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



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

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.



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

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.



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

def ui
  @ui
end

#viewObject (readonly)

Returns the value of attribute view.



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

def view
  @view
end

Instance Method Details

#apply_options(options) ⇒ Object



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

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

#save_optionsObject



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

def save_options
    view.save_options
end

#setDisplayTime(time) ⇒ Object



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

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

#update_display_time(time) ⇒ Object



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

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



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

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



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

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