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
40 41 42 43 |
# File 'lib/roby/gui/scheduler_view.rb', line 40 def display(state) code = erb.result(binding) self.html = code end |
#erb ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/roby/gui/scheduler_view.rb', line 18 def erb if !@erb template = File.read(scheduler_view_rhtml) @erb = ERB.new(template) end return @erb end |
#format_msg_string(msg, *args) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/roby/gui/scheduler_view.rb', line 26 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
6 7 8 |
# File 'lib/roby/gui/scheduler_view.rb', line 6 def ressources_dir File.(File.dirname(__FILE__)) end |
#scheduler_view_css ⇒ Object
10 11 12 |
# File 'lib/roby/gui/scheduler_view.rb', line 10 def scheduler_view_css File.join(ressources_dir, "scheduler_view.css") end |
#scheduler_view_rhtml ⇒ Object
14 15 16 |
# File 'lib/roby/gui/scheduler_view.rb', line 14 def scheduler_view_rhtml File.join(ressources_dir, "scheduler_view.rhtml") end |