class Vizkit::OutputPortItem

Attributes

listener[R]

Public Class Methods

new(port,options = Hash.new) click to toggle source
Calls superclass method Vizkit::PortItem.new
# File lib/vizkit/vizkit_items.rb, line 673
def initialize(port,options = Hash.new)
    super
    @listener = port.on_raw_data do |data|
        # depending on the type we receive none typelip objects
        # therefore if have to initialize it with a new sample
        begin
            update port.new_sample.zero! unless typelib_val
            update data
        rescue Orocos::NotFound
        end
    end
    @listener.stop
    @stop_propagated = false

    if @options[:item_type] != :label
        @error_listener = port.on_error do |error|
            @options[:text] = error.to_s
            emitDataChanged
        end
        @reachable_listener = port.on_reachable do
            @options.delete :text
            emitDataChanged
        end
    end
end

Public Instance Methods

collapse(propagated = false) click to toggle source
# File lib/vizkit/vizkit_items.rb, line 699
def collapse(propagated = false)
    @expanded = false
    if @listener.listening?
        @stop_propagated = propagated
        @listener.stop
    end
end
expand(propagated = false) click to toggle source
# File lib/vizkit/vizkit_items.rb, line 707
def expand(propagated = false)
    @expanded = true
    @listener.start if !propagated || @stop_propagated
end