module Roby::GUI::RelationsCanvasEventGenerator

Public Class Methods

priorities() click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 43
def self.priorities
    @@priorities ||= Hash.new
end
style(object, flags) click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 22
def self.style(object, flags)
    flags |= (object.controlable? ? EVENT_CONTROLABLE : EVENT_CONTINGENT)

    if (flags & EVENT_CALLED) == EVENT_CALLED
        if (flags & EVENT_CONTROLABLE) != EVENT_CONTROLABLE
            STDERR.puts "WARN: inconsistency in replayed logs. Found event call on #{object} #{object.object_id} which is marked as contingent (#{object.controlable?}"
        end
        flags |= EVENT_CONTROLABLE
    end

    if !styles.has_key?(flags)
        raise ArgumentError, "event #{object} has flags #{flags}, which has no defined style (controlable=#{object.controlable?})"
    end

    styles[flags]
end
styles() click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 39
def self.styles
    return EVENT_STYLES
end

Public Instance Methods

display(display, graphics_item) click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 81
def display(display, graphics_item)
    graphics_item.text.plain_text = display_name(display).to_s
end
display_create(display) click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 47
def display_create(display)
    scene = display.scene
    circle = scene.add_ellipse(-EVENT_CIRCLE_RADIUS, -EVENT_CIRCLE_RADIUS, EVENT_CIRCLE_RADIUS * 2, EVENT_CIRCLE_RADIUS * 2)
    text   = scene.add_text(display_name(display))
    circle.singleton_class.class_eval { attr_accessor :text }
    circle.z_value = EVENT_LAYER

    text.parent_item = circle
    text_width   = text.bounding_rect.width
    text.set_pos(-text_width / 2, 0)
    circle.text = text
    circle
end
display_name(display) click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 64
def display_name(display)
    name = if model.ancestors[0].name != 'Roby::EventGenerator'
               [display.filter_prefixes(model.ancestors[0].name.dup)]
           else
               []
           end

    if display.show_ownership
        owners = self.owners.dup
        owners.delete_if { |o| o.remote_name == "log_replay" }
        if !owners.empty?
            name << "[#{owners.map(&:name).join(", ")}]"
        end
    end
    name.join("\n")
end
display_time_end(circle, pos) click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 62
def display_time_end(circle, pos); end
display_time_start(circle, pos) click to toggle source
# File lib/roby/gui/relations_view/relations_canvas.rb, line 61
def display_time_start(circle, pos); circle.translate(pos) end