Class: MINT::Pointer3D

Inherits:
Pointer show all
Defined in:
lib/MINT-core/model/ir/pointer.rb

Constant Summary

Constants inherited from Interactor

Interactor::PUBLISH_ATTRIBUTES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Pointer

#consume, #getSCXML, #restart_timeout, #stop_timeout

Methods inherited from Interactor

class_from_channel_name, #create_attribute_channel_name, create_channel_name, #create_channel_w_name, get, getModel, #getSCXML, get_dm, #init_statemachine, #is_in?, #new_states, notify, #process_event, #process_event!, #process_event_vars, #publish_update, #states, #states=, #sync_event, #sync_states, #to_dot, wait

Methods included from InteractorHelpers

#restart_timeout, #stop_timeout

Instance Attribute Details

#cached_xObject

Returns the value of attribute cached_x.



57
58
59
# File 'lib/MINT-core/model/ir/pointer.rb', line 57

def cached_x
  @cached_x
end

#cached_yObject

Returns the value of attribute cached_y.



57
58
59
# File 'lib/MINT-core/model/ir/pointer.rb', line 57

def cached_y
  @cached_y
end

#cached_zObject

Returns the value of attribute cached_z.



57
58
59
# File 'lib/MINT-core/model/ir/pointer.rb', line 57

def cached_z
  @cached_z
end

Instance Method Details

#cache_coordinates(x, y, z = nil) ⇒ Object



59
60
61
62
63
# File 'lib/MINT-core/model/ir/pointer.rb', line 59

def cache_coordinates(x,y,z=nil)
  @cached_x = x if (x)
  @cached_y = y if (y)
  @cached_z = z if (z)
end

#start_timeoutObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/MINT-core/model/ir/pointer.rb', line 67

def start_timeout
  if not @timer
    @timer = EventMachine::Timer.new(0.1) do
      attribute_set(:x, @cached_x)
      attribute_set(:y, @cached_y)
      attribute_set(:z, @cached_z)

      process_event("stop")

    end
  else
    puts "timer already started!!!"
  end
end