Class: FB::ArduinoCommandSet
- Inherits:
-
Object
- Object
- FB::ArduinoCommandSet
- Defined in:
- lib/arduino/command_set.rb
Overview
Composes all logic related to controlling a bot into a single object. Responsible for writing to the serial line.
Instance Attribute Summary collapse
-
#bot ⇒ Object
readonly
Returns the value of attribute bot.
Instance Method Summary collapse
- #done(gcode) ⇒ Object
- #emergency_stop ⇒ Object
- #execute(gcode) ⇒ Object
-
#initialize(bot) ⇒ ArduinoCommandSet
constructor
A new instance of ArduinoCommandSet.
- #move_relative(gcode) ⇒ Object
- #received(gcode) ⇒ Object
- #report_current_position(gcode) ⇒ Object
- #report_status_value(gcode) ⇒ Object
- #reporting_end_stops(gcode) ⇒ Object
Constructor Details
#initialize(bot) ⇒ ArduinoCommandSet
Returns a new instance of ArduinoCommandSet.
7 8 9 |
# File 'lib/arduino/command_set.rb', line 7 def initialize(bot) @bot = bot end |
Instance Attribute Details
#bot ⇒ Object (readonly)
Returns the value of attribute bot.
5 6 7 |
# File 'lib/arduino/command_set.rb', line 5 def bot @bot end |
Instance Method Details
#done(gcode) ⇒ Object
32 33 |
# File 'lib/arduino/command_set.rb', line 32 def done(gcode) end |
#emergency_stop ⇒ Object
16 17 18 |
# File 'lib/arduino/command_set.rb', line 16 def emergency_stop(*) bot.write("E") end |
#execute(gcode) ⇒ Object
11 12 13 14 |
# File 'lib/arduino/command_set.rb', line 11 def execute(gcode) puts "SERIAL OUT: #{gcode.name}" self.send(gcode.name, gcode) end |
#move_relative(gcode) ⇒ Object
20 21 |
# File 'lib/arduino/command_set.rb', line 20 def move_relative(gcode) end |
#received(gcode) ⇒ Object
23 24 |
# File 'lib/arduino/command_set.rb', line 23 def received(gcode) end |
#report_current_position(gcode) ⇒ Object
29 30 |
# File 'lib/arduino/command_set.rb', line 29 def report_current_position(gcode) end |
#report_status_value(gcode) ⇒ Object
35 36 |
# File 'lib/arduino/command_set.rb', line 35 def report_status_value(gcode) end |
#reporting_end_stops(gcode) ⇒ Object
26 27 |
# File 'lib/arduino/command_set.rb', line 26 def reporting_end_stops(gcode) end |