class Roby::DRoby::V5::PlanDumper::DRoby

Attributes

droby_id[R]
event_relation_graphs[R]
free_events[R]
groups[R]
mission_tasks[R]
permanent_events[R]
permanent_tasks[R]
plan_class[R]
task_events[R]
task_relation_graphs[R]
tasks[R]

Public Class Methods

new(plan_class, droby_id, tasks, task_events, free_events, mission_tasks, permanent_tasks, permanent_events, task_relation_graphs, event_relation_graphs) click to toggle source
# File lib/roby/droby/v5/droby_dump.rb, line 605
def initialize(plan_class, droby_id,
               tasks, task_events, free_events,
               mission_tasks, permanent_tasks, permanent_events,
               task_relation_graphs, event_relation_graphs)
    @plan_class            = plan_class
    @droby_id              = droby_id
    @tasks           = tasks
    @task_events           = task_events
    @free_events           = free_events
    @mission_tasks         = mission_tasks
    @permanent_tasks       = permanent_tasks
    @permanent_events      = permanent_events
    @task_relation_graphs  = task_relation_graphs
    @event_relation_graphs = event_relation_graphs
end

Public Instance Methods

proxy(peer) click to toggle source
# File lib/roby/droby/v5/droby_dump.rb, line 621
def proxy(peer)
    plan = Plan.new
    peer.with_object(droby_id => plan) do
        peer.load_groups(tasks, task_events, free_events) do |tasks, task_events, free_events|
            plan.tasks.merge(tasks)
            plan.task_events.merge(task_events)
            plan.free_events.merge(free_events)

            plan.mission_tasks.replace(peer.local_object(mission_tasks))
            plan.permanent_tasks.replace(peer.local_object(permanent_tasks))
            plan.permanent_events.replace(peer.local_object(permanent_events))

            task_relation_graphs.each do |rel_id, edges|
                rel = peer.local_object(rel_id)
                g   = plan.task_relation_graph_for(rel)
                peer.local_object(edges).each_slice(3) do |from, to, info|
                    g.add_edge(from, to, info)
                end
            end
            event_relation_graphs.each do |rel_id, edges|
                rel = peer.local_object(rel_id)
                g   = plan.event_relation_graph_for(rel)
                peer.local_object(edges).each_slice(3) do |from, to, info|
                    g.add_edge(from, to, info)
                end
            end
        end
    end
    plan
end