Class: Roby::GUI::SchedulerView
- Defined in:
- lib/roby/gui/scheduler_view.rb
Instance Method Summary collapse
-
#display(state) ⇒ Object
Displays the state of the scheduler.
- #erb ⇒ Object
- #format_msg_string(msg, *args) ⇒ Object
- #ressources_dir ⇒ Object
- #scheduler_view_css ⇒ Object
- #scheduler_view_rhtml ⇒ Object
Instance Method Details
#display(state) ⇒ Object
Displays the state of the scheduler. It clears existing information
43 44 45 46 |
# File 'lib/roby/gui/scheduler_view.rb', line 43 def display(state) code = erb.result(binding) self.html = code end |
#erb ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/roby/gui/scheduler_view.rb', line 20 def erb unless @erb template = File.read(scheduler_view_rhtml) @erb = ERB.new(template) end @erb end |
#format_msg_string(msg, *args) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/roby/gui/scheduler_view.rb', line 28 def format_msg_string(msg, *args) args.each_with_index.inject(msg) do |msg, (a, i)| a = if a.respond_to?(:map) a.map(&:to_s).join(", ") else a.to_s end msg.gsub "%#{i + 1}", a end end |
#ressources_dir ⇒ Object
8 9 10 |
# File 'lib/roby/gui/scheduler_view.rb', line 8 def ressources_dir File.(__dir__) end |
#scheduler_view_css ⇒ Object
12 13 14 |
# File 'lib/roby/gui/scheduler_view.rb', line 12 def scheduler_view_css File.join(ressources_dir, "scheduler_view.css") end |
#scheduler_view_rhtml ⇒ Object
16 17 18 |
# File 'lib/roby/gui/scheduler_view.rb', line 16 def scheduler_view_rhtml File.join(ressources_dir, "scheduler_view.rhtml") end |