diff --git a/src/snapshotmanager.cpp b/src/snapshotmanager.cpp --- a/src/snapshotmanager.cpp +++ b/src/snapshotmanager.cpp @@ -28,14 +28,14 @@ #include "snapshotmanager.h" SnapshotManager::SnapshotManager(QMainWindow* mainWindow, - QList* channelBuffers) : + ChannelManager* channelMan) : _menu("Snapshots"), _takeSnapshotAction("Take Snapshot", this), loadSnapshotAction("Load Snapshots", this), clearAction("Clear Snapshots", this) { _mainWindow = mainWindow; - _channelBuffers = channelBuffers; + _channelMan = channelMan; _takeSnapshotAction.setToolTip("Take a snapshot of current plot"); _takeSnapshotAction.setShortcut(QKeySequence("F5")); @@ -64,15 +64,15 @@ void SnapshotManager::takeSnapshot() QString name = QTime::currentTime().toString("'Snapshot ['HH:mm:ss']'"); auto snapshot = new Snapshot(_mainWindow, name); - unsigned numOfChannels = _channelBuffers->size(); - unsigned numOfSamples = _channelBuffers->at(0)->size(); + unsigned numOfChannels = _channelMan->numOfChannels(); + unsigned numOfSamples = _channelMan->numOfSamples(); for (unsigned ci = 0; ci < numOfChannels; ci++) { snapshot->data.append(QVector(numOfSamples)); for (unsigned i = 0; i < numOfSamples; i++) { - snapshot->data[ci][i] = _channelBuffers->at(ci)->sample(i); + snapshot->data[ci][i] = _channelMan->channelBuffer(ci)->sample(i); } }