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 = {}) ⇒ Object
Constructor Details
#initialize(page) ⇒ Task
12 13 14 15 |
# File 'lib/roby/gui/model_views/task.rb', line 12 def initialize(page) @page = page super() end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
10 11 12 |
# File 'lib/roby/gui/model_views/task.rb', line 10 def page @page end |
Instance Method Details
#clear ⇒ Object
21 |
# File 'lib/roby/gui/model_views/task.rb', line 21 def clear; end |
#disable ⇒ Object
19 |
# File 'lib/roby/gui/model_views/task.rb', line 19 def disable; end |
#enable ⇒ Object
17 |
# File 'lib/roby/gui/model_views/task.rb', line 17 def enable; end |
#render(task_model, options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/roby/gui/model_views/task.rb', line 27 def render(task_model, = {}) 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 |