Class: OfflineStreamListModel

Inherits:
DataStreamListModel show all
Defined in:
lib/roby/log/gui/replay.rb

Overview

This class is a data stream list model for offline replay: it holds a list of log file which can then be used for display by log/replay

Instance Attribute Summary

Attributes inherited from DataStreamListModel

#streams

Instance Method Summary collapse

Methods inherited from DataStreamListModel

#add_new, #data, #edit_at, #flags, #initialize, #insertRow, #removeRow, #rowCount

Constructor Details

This class inherits a constructor from DataStreamListModel

Instance Method Details

#edit(stream) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/roby/log/gui/replay.rb', line 12

def edit(stream)
  dir = if !stream || stream.files.empty? then ""
   else File.dirname(stream.files.first) end

  newfiles = Qt::FileDialog.get_open_file_names nil, "New data stream", dir
  return if newfiles.empty?
  if !newfiles.empty?
 if newstream = Roby.app.data_stream(newfiles)
    return newstream
 else
    Qt::MessageBox.warning nil, "Add data stream", "Cannot determine data stream type for #{newfiles.join(", ")}"
    return
 end
  end
end