module StructViewer::Functions

Public Instance Methods

child?(text) click to toggle source
# File lib/vizkit/widgets/struct_viewer/struct_viewer.rb, line 29
def child?(text)
    0.upto @model.rowCount-1 do |row|
        item = @model.item(row,0)
        return true if item.text == text
    end
    false
end
config(port,options=Hash.new) click to toggle source
# File lib/vizkit/widgets/struct_viewer/struct_viewer.rb, line 37
def config(port,options=Hash.new)
    return if child? port.full_name
    port1,port2 = if port.output?
                      [Vizkit::OutputPortItem.new(port,:full_name => true), Vizkit::OutputPortItem.new(port,:item_type => :value)]
                  elsif port.input?
                      [Vizkit::InputPortItem.new(port,:full_name => true), Vizkit::IntputPortItem.new(port,:item_type => :value)]
                  end
    @model.appendRow [port1,port2]
    port1.expand
    port2.expand
    treeView.resizeColumnToContents 0
    treeView.resizeColumnToContents 1
    # data handling is done by the data model
    :do_not_connect
end
init(parent=nil) click to toggle source
# File lib/vizkit/widgets/struct_viewer/struct_viewer.rb, line 6
def init(parent=nil)
    Vizkit.setup_tree_view treeView
    @model = Vizkit::VizkitItemModel.new
    treeView.setModel @model
    @filter = ::Vizkit::PluginConnections::ShowHideEventFilter.new
    installEventFilter(@filter)
    @filter.on_show do
        0.upto(@model.rowCount-1) do |i|
            @model.item(i,0).listener.start
            @model.item(i,1).listener.start
        end
    end
    @filter.on_hide do
        0.upto(@model.rowCount-1) do |i|
            @model.item(i,0).listener.stop
            @model.item(i,1).listener.stop
        end
    end
end
multi_value?() click to toggle source
# File lib/vizkit/widgets/struct_viewer/struct_viewer.rb, line 53
def multi_value?
    true
end
update(data, port_name) click to toggle source
# File lib/vizkit/widgets/struct_viewer/struct_viewer.rb, line 26
def update(data, port_name)
end