Class: Roby::GUI::ModelViews::Task
- Defined in:
- lib/roby/gui/model_views/task.rb
Overview
Handler class to display information about a task model
Constant Summary collapse
- TEMPLATE_PATH =
File.('task.rhtml', File.dirname(__FILE__))
- TEMPLATE =
ERB.new(File.read(TEMPLATE_PATH))
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #clear ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(page) ⇒ Task
constructor
A new instance of Task.
- #render(task_model, options = Hash.new) ⇒ Object
Constructor Details
#initialize(page) ⇒ Task
Returns a new instance of Task.
10 11 12 13 |
# File 'lib/roby/gui/model_views/task.rb', line 10 def initialize(page) @page = page super() end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
8 9 10 |
# File 'lib/roby/gui/model_views/task.rb', line 8 def page @page end |
Instance Method Details
#clear ⇒ Object
18 19 |
# File 'lib/roby/gui/model_views/task.rb', line 18 def clear end |
#disable ⇒ Object
16 17 |
# File 'lib/roby/gui/model_views/task.rb', line 16 def disable end |
#enable ⇒ Object
14 15 |
# File 'lib/roby/gui/model_views/task.rb', line 14 def enable end |
#render(task_model, options = Hash.new) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/roby/gui/model_views/task.rb', line 25 def render(task_model, = Hash.new) html = TEMPLATE.result(binding) svg = RelationsCanvasTask.to_svg(task_model.new(plan: DRoby::RebuiltPlan.new)) , = Kernel. , external_objects: false, doc: true if external_objects = [:external_objects] file = external_objects % 'roby_task' + ".svg" File.open(file, 'w') { |io| io.write(svg) } svg = "<object data=\"#{file}\" type=\"image/svg+xml\"></object>" end if [:doc] && task_model.doc page.push nil, page.main_doc(task_model.doc) end page.push('Roby Task Model', TEMPLATE.result(binding), ) end |