diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright © 2015-2016 Hasan Yavuz Özderya +# Copyright © 2017 Hasan Yavuz Özderya # # This file is part of serialplot. # @@ -69,6 +69,7 @@ qt5_wrap_ui(UI_FILES src/commandwidget.ui src/dataformatpanel.ui src/plotcontrolpanel.ui + src/recordpanel.ui src/numberformatbox.ui src/endiannessbox.ui src/binarystreamreadersettings.ui @@ -104,6 +105,7 @@ add_executable(${PROGRAM_NAME} WIN32 src/commandedit.cpp src/dataformatpanel.cpp src/plotcontrolpanel.cpp + src/recordpanel.cpp src/tooltipfilter.cpp src/sneakylineedit.cpp src/channelmanager.cpp diff --git a/serialplot.pro b/serialplot.pro --- a/serialplot.pro +++ b/serialplot.pro @@ -67,7 +67,8 @@ SOURCES += \ src/demoreader.cpp \ src/framedreader.cpp \ src/plotmanager.cpp \ - src/numberformat.cpp + src/numberformat.cpp \ + src/recordpanel.cpp HEADERS += \ src/mainwindow.h \ @@ -106,7 +107,8 @@ HEADERS += \ src/framedreader.h \ src/plotmanager.h \ src/setting_defines.h \ - src/numberformat.h + src/numberformat.h \ + src/recordpanel.h FORMS += \ src/mainwindow.ui \ @@ -121,7 +123,8 @@ FORMS += \ src/endiannessbox.ui \ src/framedreadersettings.ui \ src/binarystreamreadersettings.ui \ - src/asciireadersettings.ui + src/asciireadersettings.ui \ + src/recordpanel.ui INCLUDEPATH += qmake/ src/ diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -62,7 +62,8 @@ MainWindow::MainWindow(QWidget *parent) channelMan(1, 1, this), snapshotMan(this, &channelMan), commandPanel(&serialPort), - dataFormatPanel(&serialPort, &channelMan) + dataFormatPanel(&serialPort, &channelMan), + recordPanel(this) { ui->setupUi(this); @@ -72,6 +73,7 @@ MainWindow::MainWindow(QWidget *parent) ui->tabWidget->insertTab(1, &dataFormatPanel, "Data Format"); ui->tabWidget->insertTab(2, &plotControlPanel, "Plot"); ui->tabWidget->insertTab(3, &commandPanel, "Commands"); + ui->tabWidget->insertTab(4, &recordPanel, "Record"); ui->tabWidget->setCurrentIndex(0); auto tbPortControl = portControl.toolBar(); addToolBar(tbPortControl); diff --git a/src/mainwindow.h b/src/mainwindow.h --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -1,5 +1,5 @@ /* - Copyright © 2016 Hasan Yavuz Özderya + Copyright © 2017 Hasan Yavuz Özderya This file is part of serialplot. @@ -38,6 +38,7 @@ #include "commandpanel.h" #include "dataformatpanel.h" #include "plotcontrolpanel.h" +#include "recordpanel.h" #include "ui_about_dialog.h" #include "framebuffer.h" #include "channelmanager.h" @@ -79,6 +80,7 @@ private: CommandPanel commandPanel; DataFormatPanel dataFormatPanel; PlotControlPanel plotControlPanel; + RecordPanel recordPanel; bool isDemoRunning(); /// Stores settings for all modules diff --git a/src/recordpanel.cpp b/src/recordpanel.cpp new file mode 100644 --- /dev/null +++ b/src/recordpanel.cpp @@ -0,0 +1,33 @@ +/* + Copyright © 2017 Hasan Yavuz Özderya + + This file is part of serialplot. + + serialplot is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + serialplot is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with serialplot. If not, see . +*/ + +#include "recordpanel.h" +#include "ui_recordpanel.h" + +RecordPanel::RecordPanel(QWidget *parent) : + QWidget(parent), + ui(new Ui::RecordPanel) +{ + ui->setupUi(this); +} + +RecordPanel::~RecordPanel() +{ + delete ui; +} diff --git a/src/recordpanel.h b/src/recordpanel.h new file mode 100644 --- /dev/null +++ b/src/recordpanel.h @@ -0,0 +1,41 @@ +/* + Copyright © 2017 Hasan Yavuz Özderya + + This file is part of serialplot. + + serialplot is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + serialplot is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with serialplot. If not, see . +*/ + +#ifndef RECORDPANEL_H +#define RECORDPANEL_H + +#include + +namespace Ui { +class RecordPanel; +} + +class RecordPanel : public QWidget +{ + Q_OBJECT + +public: + explicit RecordPanel(QWidget *parent = 0); + ~RecordPanel(); + +private: + Ui::RecordPanel *ui; +}; + +#endif // RECORDPANEL_H diff --git a/src/recordpanel.ui b/src/recordpanel.ui new file mode 100644 --- /dev/null +++ b/src/recordpanel.ui @@ -0,0 +1,130 @@ + + + RecordPanel + + + + 0 + 0 + 532 + 152 + + + + Form + + + + + + + + + + Select record file + + + Browse + + + + + + + + 0 + 0 + + + + Select file... + + + + + + + + + Continue recording to file even when plotting is paused + + + Record while paused + + + true + + + + + + + Increments file name automatically everytime you start a new recording + + + Auto increment file name + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 85 + 50 + + + + Start/Stop Recording + + + Record + + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + +