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:



43
44
45
46
# File 'lib/roby/gui/scheduler_view.rb', line 43

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

#erbObject



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_dirObject



8
9
10
# File 'lib/roby/gui/scheduler_view.rb', line 8

def ressources_dir
    File.expand_path(__dir__)
end

#scheduler_view_cssObject



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_rhtmlObject



16
17
18
# File 'lib/roby/gui/scheduler_view.rb', line 16

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