Class: Syskit::GUI::ModelViews::TaskContextBase

Inherits:
Component show all
Defined in:
lib/syskit/gui/model_views/task_context_base.rb

Direct Known Subclasses

RubyTaskContext, TaskContext

Constant Summary

Constants inherited from ComponentNetworkBaseView

ComponentNetworkBaseView::Button, ComponentNetworkBaseView::DATA_SERVICE_WITHOUT_NAMES_TEMPLATE, ComponentNetworkBaseView::DATA_SERVICE_WITH_NAMES_TEMPLATE

Instance Attribute Summary collapse

Attributes inherited from Component

#interface_options

Attributes inherited from ComponentNetworkBaseView

#current_model, #page, #plan

Instance Method Summary collapse

Methods inherited from ComponentNetworkBaseView

#buttonClicked, #clear, common_graph_buttons, #compute_system_network, #disable, #enable, find_definition_place, graph_annotation_buttons, html_defined_in, #instanciate_model, #list_services, make_annotation_buttons, #push_plan, #render_data_services, #render_require_section, #save_svg, task_annotation_buttons

Constructor Details

#initialize(page) ⇒ TaskContextBase

Returns a new instance of TaskContextBase



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/syskit/gui/model_views/task_context_base.rb', line 7

def initialize(page)
    super(page)
    @task_model_view = Roby::GUI::ModelViews::Task.new(page)
    @orogen_rendering = OroGen::HTML::TaskContext.new(page)
    buttons = Array.new
    buttons.concat(self.class.common_graph_buttons('interface'))

    all_annotations = Syskit::Graphviz.available_task_annotations.sort
    buttons.concat(self.class.make_annotation_buttons('interface', all_annotations, all_annotations))
    Syskit::Graphviz.available_task_annotations.sort.each do |ann_name|
        interface_options[:annotations] << ann_name
    end
    interface_options[:buttons] = buttons
end

Instance Attribute Details

#orogen_renderingObject (readonly)

Returns the value of attribute orogen_rendering



4
5
6
# File 'lib/syskit/gui/model_views/task_context_base.rb', line 4

def orogen_rendering
  @orogen_rendering
end

#task_model_viewObject (readonly)

Returns the value of attribute task_model_view



5
6
7
# File 'lib/syskit/gui/model_views/task_context_base.rb', line 5

def task_model_view
  @task_model_view
end

Instance Method Details

#render(model, external_objects: false) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/syskit/gui/model_views/task_context_base.rb', line 29

def render(model, external_objects: false)
    super

    page.push("oroGen Model", "<p><b>oroGen name:</b> #{model.orogen_model.name}</p>")
    orogen_rendering.render(model.orogen_model, external_objects: external_objects, doc: false)

    task_model_view.render(model, external_objects: external_objects)
end

#render_doc(model) ⇒ Object



22
23
24
25
26
27
# File 'lib/syskit/gui/model_views/task_context_base.rb', line 22

def render_doc(model)
    doc = [model.doc, model.orogen_model.doc].compact.join("\n\n").strip
    if !doc.empty?
        page.push nil, page.main_doc(doc)
    end
end