diff --git a/snapshotview.cpp b/snapshotview.cpp new file mode 100644 --- /dev/null +++ b/snapshotview.cpp @@ -0,0 +1,30 @@ +#include "snapshotview.h" +#include "ui_snapshotview.h" + +SnapShotView::SnapShotView(QWidget *parent, SnapShot* snapShot) : + QMainWindow(parent), + ui(new Ui::SnapShotView) +{ + ui->setupUi(this); + + unsigned numOfChannels = snapShot->data.size(); + + for (unsigned ci = 0; ci < numOfChannels; ci++) + { + QwtPlotCurve* curve = new QwtPlotCurve(); + curves.append(curve); + curve->setSamples(snapShot->data[ci]); + curve->attach(ui->plot); + } + + _snapShot = snapShot; +} + +SnapShotView::~SnapShotView() +{ + for (auto curve : curves) + { + delete curve; + } + delete ui; +}