Class: Roby::GUI::RelationsView

Inherits:
Qt::Widget
  • Object
show all
Defined in:
lib/roby/gui/relations_view.rb

Overview

Plan display that shows a snapshot of the event/task structure, as well as the events emitted within the last cycle

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(history_widget, parent = nil) ⇒ RelationsView

In remote connections, this is he period between checking if there is data on the socket, in seconds

See #connect



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/roby/gui/relations_view.rb', line 22

def initialize(history_widget, parent = nil)
    super(parent)
    @ui = Ui::RelationsView.new
    ui.setupUi(self)
    @scheduler_view = SchedulerView.new(ui.scheduler_view_holder)
    @scheduler_view_layout = Qt::VBoxLayout.new(ui.scheduler_view_holder)
    @scheduler_view_layout.add_widget scheduler_view
    scheduler_view.show

    @history_widget = history_widget
    @view = RelationsCanvas.new([history_widget.current_plan])
    ui.setupActions(self)
    ui.graphics.scene = view.scene

    resize 500, 500
end

Instance Attribute Details

#history_widgetObject (readonly)

Returns the value of attribute history_widget.



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

def history_widget
  @history_widget
end

#scheduler_viewObject (readonly)

Returns the value of attribute scheduler_view.



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

def scheduler_view
  @scheduler_view
end

#uiObject (readonly)

Returns the value of attribute ui.



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

def ui
  @ui
end

#viewObject (readonly)

Returns the value of attribute view.



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

def view
  @view
end

Instance Method Details

#apply_options(options) ⇒ Object



67
68
69
# File 'lib/roby/gui/relations_view.rb', line 67

def apply_options(options)
    view.apply_options(options)
end

#save_optionsObject



63
64
65
# File 'lib/roby/gui/relations_view.rb', line 63

def save_options
    view.save_options
end

#setDisplayTime(time) ⇒ Object



50
51
52
53
# File 'lib/roby/gui/relations_view.rb', line 50

def setDisplayTime(time)
    scheduler_view.display(history_widget.current_plan.consolidated_scheduler_state)
    view.update(time)
end

#update_display_time(time) ⇒ Object



58
59
60
61
# File 'lib/roby/gui/relations_view.rb', line 58

def update_display_time(time)
    scheduler_view.display(history_widget.current_plan.consolidated_scheduler_state)
    view.update(time)
end

#update_time_range(start_time, current_time) ⇒ Object



56
# File 'lib/roby/gui/relations_view.rb', line 56

def update_time_range(start_time, current_time); end

#updateWindowTitleObject

Slot used to make the widget update its title when e.g. the underlying history widget changed its source



41
42
43
44
45
46
47
# File 'lib/roby/gui/relations_view.rb', line 41

def updateWindowTitle
    if (parent_title = history_widget.window_title)
        self.window_title = "#{history_widget.window_title}: Relations"
    else
        self.window_title = "roby-display: Relations"
    end
end