Class: MINT::HWButton

Inherits:
Interactor show all
Defined in:
lib/MINT-core/model/ir/button.rb

Direct Known Subclasses

GestureButton

Constant Summary

Constants inherited from Interactor

Interactor::PUBLISH_ATTRIBUTES

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 Method Details

#initialize_statemachineObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/MINT-core/model/ir/button.rb', line 5

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

      trans :disconnected,:connect, :connected
      trans :connected, :disconnect, :disconnected

      superstate :connected do
        trans :released, :press, :pressed
        trans :pressed, :release, :released
      end
    end
  end
end