Class: Roby::GUI::SchedulerView

Inherits:
Qt::WebView
  • Object
show all
Defined in:
lib/roby/gui/scheduler_view.rb

Instance Method Summary collapse

Instance Method Details

#display(state) ⇒ Object

Displays the state of the scheduler. It clears existing information

Parameters:



40
41
42
43
# File 'lib/roby/gui/scheduler_view.rb', line 40

def display(state)
    code = erb.result(binding)
    self.html = code
end

#erbObject



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_dirObject



6
7
8
# File 'lib/roby/gui/scheduler_view.rb', line 6

def ressources_dir
    File.expand_path(File.dirname(__FILE__))
end

#scheduler_view_cssObject



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_rhtmlObject



14
15
16
# File 'lib/roby/gui/scheduler_view.rb', line 14

def scheduler_view_rhtml
    File.join(ressources_dir, "scheduler_view.rhtml")
end