Class: FilteredDataStreamListModel

Inherits:
Qt::SortFilterProxyModel
  • Object
show all
Defined in:
lib/roby/log/gui/data_displays.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream_combo, display, type, streams) ⇒ FilteredDataStreamListModel

Returns a new instance of FilteredDataStreamListModel.



70
71
72
73
74
75
76
# File 'lib/roby/log/gui/data_displays.rb', line 70

def initialize(stream_combo, display, type, streams)
  super()
  @display = display
  @type    = type
  @streams = streams
  @stream_combo = stream_combo
end

Instance Attribute Details

#displayObject (readonly)

Returns the value of attribute display.



69
70
71
# File 'lib/roby/log/gui/data_displays.rb', line 69

def display
  @display
end

#stream_comboObject (readonly)

Returns the value of attribute stream_combo.



68
69
70
# File 'lib/roby/log/gui/data_displays.rb', line 68

def stream_combo
  @stream_combo
end

#streamsObject (readonly)

Returns the value of attribute streams.



67
68
69
# File 'lib/roby/log/gui/data_displays.rb', line 67

def streams
  @streams
end

#typeObject (readonly)

Returns the value of attribute type.



67
68
69
# File 'lib/roby/log/gui/data_displays.rb', line 67

def type
  @type
end

Instance Method Details

#filterAcceptsRow(stream_row, stream_parent) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/roby/log/gui/data_displays.rb', line 77

def filterAcceptsRow(stream_row, stream_parent)
  if s = streams[stream_row]
 s.type == type
  else
 false
  end
end

#selectedStreamObject



84
85
86
87
88
# File 'lib/roby/log/gui/data_displays.rb', line 84

def selectedStream()
  index = stream_combo.current_index
  index = self.index(index, 0, Qt::ModelIndex.new)
  display.stream = streams[mapToSource(index).row]
end