Class: Roby::Coordination::Script::TimeoutStart
- Inherits:
-
Roby::Coordination::ScriptInstruction
- Object
- Roby::Coordination::ScriptInstruction
- Roby::Coordination::Script::TimeoutStart
- Defined in:
- lib/roby/coordination/script.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#timeout_stop ⇒ Object
Returns the value of attribute timeout_stop.
Instance Method Summary collapse
- #execute(script) ⇒ Object
-
#initialize(model, event) ⇒ TimeoutStart
constructor
A new instance of TimeoutStart.
Methods inherited from Roby::Coordination::ScriptInstruction
Constructor Details
#initialize(model, event) ⇒ TimeoutStart
Returns a new instance of TimeoutStart.
95 96 97 98 |
# File 'lib/roby/coordination/script.rb', line 95 def initialize(model, event) @model = model @event = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
92 93 94 |
# File 'lib/roby/coordination/script.rb', line 92 def event @event end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
91 92 93 |
# File 'lib/roby/coordination/script.rb', line 91 def model @model end |
#timeout_stop ⇒ Object
Returns the value of attribute timeout_stop.
93 94 95 |
# File 'lib/roby/coordination/script.rb', line 93 def timeout_stop @timeout_stop end |
Instance Method Details
#execute(script) ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/roby/coordination/script.rb', line 100 def execute(script) script.root_task.execution_engine.delayed(model.seconds) do if !self.disabled? # Remove all instructions that are within the # timeout's scope if event event.resolve.emit script.jump_to(timeout_stop) else raise TimedOut.new(script.root_task, script.current_instruction), "#{script.current_instruction} timed out" end end end true end |