class Vizkit::LogOutputPortItem

Attributes

port[R]

Public Class Methods

new(port,options = Hash.new) click to toggle source
Calls superclass method Vizkit::VizkitItem.new
# File lib/vizkit/vizkit_items.rb, line 1063
def initialize(port,options = Hash.new)
    super()
    @options = Kernel.validate_options options,:item_type => :label
    @port = port
    setEnabled(port.number_of_samples > 0)
    if @options[:item_type] == :label
        setText port.name
        appendRow([VizkitItem.new("Samples"),VizkitItem.new(port.number_of_samples.to_s)])
        appendRow([VizkitItem.new("First Sample"),VizkitItem.new(port.first_sample_pos.to_s)])
        appendRow([VizkitItem.new("Last Sample"),VizkitItem.new(port.last_sample_pos.to_s)])
        @meta = PortMetaDataItem.new port
        @meta2 = PortMetaDataItem.new port,:item_type => :value
        appendRow([@meta,@meta2])
    else
        setText port.type.name
        @error_listener = port.on_error do |error|
            @options[:text] = error.to_s
            emitDataChanged
        end
    end
end

Public Instance Methods

port_from_items(items = []) click to toggle source
# File lib/vizkit/vizkit_items.rb, line 1085
def port_from_items(items = [])
    port.to_proxy()
end