Class: MINT::GestureButton

Inherits:
HWButton show all
Defined in:
lib/MINT-core/model/ir/body/gesture_button.rb

Constant Summary

Constants inherited from Interactor

Interactor::PUBLISH_ATTRIBUTES

Instance Attribute Summary collapse

Instance Method Summary collapse

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, #start_timeout, #stop_timeout

Instance Attribute Details

#statemachineObject (readonly)

Returns the value of attribute statemachine.



4
5
6
# File 'lib/MINT-core/model/ir/body/gesture_button.rb', line 4

def statemachine
  @statemachine
end

Instance Method Details

#activate(state, abstract_states, atomic_states) ⇒ Object



6
7
8
# File 'lib/MINT-core/model/ir/body/gesture_button.rb', line 6

def activate(state,abstract_states, atomic_states)
  puts "activate #{state} #{abstract_states.join "|"} #{atomic_states.join "|"}"
end

#initialize_statemachineObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/MINT-core/model/ir/body/gesture_button.rb', line 10

def initialize_statemachine
  if @statemachine.blank?
    @statemachine = Statemachine.build do

      trans :disconnected,:right_appeared, :connected
      trans :connected, :right_disappeared, :disconnected

      superstate :connected do
       trans :initialized, :select, :released
        trans :released, :confirm, :pressed
        trans :pressed, :select, :released
      end
    end
  end
end