Class: Syskit::GUI::ExpandedJobStatus

Inherits:
WidgetList show all
Defined in:
lib/syskit/gui/expanded_job_status.rb

Overview

Detailed view on a job

This is the widget displayed in Syskit IDE when a job is selected. It displays the task chronicle narrowed-down to the tasks involved in the job, as well as exceptions related to this task

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from WidgetList

#add_after, #add_before, #add_separator, #add_widget, #auto_resize?, #children_size_updated, #clear_widgets, #each_widget, #resizeEvent

Constructor Details

#initialize(parent = nil) ⇒ ExpandedJobStatus

Returns a new instance of ExpandedJobStatus



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

def initialize(parent = nil)
    super(parent, auto_resize: false)

    @ui_exception_view = Roby::GUI::ExceptionView.new
    connect(ui_exception_view, SIGNAL('fileOpenClicked(const QUrl&)'),
            self, SIGNAL('fileOpenClicked(const QUrl&)'))
    @ui_chronicle = Roby::GUI::ChronicleWidget.new
    ui_chronicle.show_mode = :in_range
    ui_chronicle.reverse_sort = true
    add_widget ui_exception_view
    ui_exception_view.hide
    add_widget ui_chronicle
    @job_status = nil
end

Instance Attribute Details

#job_statusJobStatusDisplay (readonly)

Returns the summary widget for the currently selected job, or nil if no job is selected

Returns:

  • (JobStatusDisplay)

    the summary widget for the currently selected job, or nil if no job is selected



21
22
23
# File 'lib/syskit/gui/expanded_job_status.rb', line 21

def job_status
  @job_status
end

#ui_chronicleRoby::GUI::ChronicleWidget (readonly)

Returns the chronicle displaying the task states for the currently selected job, or for all tasks if there is no currently selected job

Returns:

  • (Roby::GUI::ChronicleWidget)

    the chronicle displaying the task states for the currently selected job, or for all tasks if there is no currently selected job



17
18
19
# File 'lib/syskit/gui/expanded_job_status.rb', line 17

def ui_chronicle
  @ui_chronicle
end

#ui_exception_viewRoby::GUI::ExceptionView (readonly)

Returns display of the exceptions that are related to this task

Returns:

  • (Roby::GUI::ExceptionView)

    display of the exceptions that are related to this task



13
14
15
# File 'lib/syskit/gui/expanded_job_status.rb', line 13

def ui_exception_view
  @ui_exception_view
end

Instance Method Details

#add_tasks_info(tasks_info, job_info) ⇒ Object

Add task and job info



66
67
68
# File 'lib/syskit/gui/expanded_job_status.rb', line 66

def add_tasks_info(tasks_info, job_info)
    ui_chronicle.add_tasks_info(tasks_info, job_info)
end

#deselectObject

Deselect the current job

This updates the chronicle to show all tasks



43
44
45
46
47
48
# File 'lib/syskit/gui/expanded_job_status.rb', line 43

def deselect
    disconnect(self, SLOT('exceptionEvent()'))
    @job_status = nil
    ui_chronicle.clear_tasks_info
    update_exceptions([])
end

#exceptionEventObject

Slot used to announce that the exceptions registerd on #job_status have changed



92
93
94
# File 'lib/syskit/gui/expanded_job_status.rb', line 92

def exceptionEvent
    update_exceptions(job_status.exceptions)
end

#scheduler_state=(state) ⇒ Object

Set the current scheduler state



71
72
73
# File 'lib/syskit/gui/expanded_job_status.rb', line 71

def scheduler_state=(state)
    ui_chronicle.scheduler_state = state
end

#select(job_status) ⇒ Object

Select a given job

It reduces the displayed information to only the information that involved the selected job

Parameters:

  • job_status (JobStatusDisplay)

    the job status widget that represents the job to be selected



57
58
59
60
61
62
63
# File 'lib/syskit/gui/expanded_job_status.rb', line 57

def select(job_status)
    disconnect(self, SLOT('exceptionEvent()'))
    @job_status = job_status
    ui_chronicle.clear_tasks_info
    update_exceptions(job_status.exceptions)
    connect(job_status, SIGNAL('exceptionEvent()'), self, SLOT('exceptionEvent()'))
end

#update_chronicleObject

Update the chronicle display



76
77
78
79
80
# File 'lib/syskit/gui/expanded_job_status.rb', line 76

def update_chronicle
    ui_chronicle.update_current_tasks
    ui_chronicle.update
    children_size_updated
end

#update_exceptions(exceptions) ⇒ Object

Update the exception display to display the given exceptions



98
99
100
101
102
103
104
105
106
# File 'lib/syskit/gui/expanded_job_status.rb', line 98

def update_exceptions(exceptions)
    ui_exception_view.exceptions = exceptions.dup
    if exceptions.empty?
        ui_exception_view.hide
    else
        ui_exception_view.show
    end
    children_size_updated
end

#update_time(cycle_index, cycle_time) ⇒ Object

Update the current time

Parameters:

  • cycle_index (Integer)

    the index of the current Roby cycle

  • cycle_time (Time)

    the time of the current Roby cycle



86
87
88
# File 'lib/syskit/gui/expanded_job_status.rb', line 86

def update_time(cycle_index, cycle_time)
    ui_chronicle.update_current_time(cycle_time)
end