[recorder] add check bo for no saving

This commit is contained in:
Jan Grewe 2020-06-10 11:00:30 +02:00
parent f31d6d4119
commit a27908adda
2 changed files with 13 additions and 3 deletions

View File

@ -385,6 +385,11 @@ void PylonRecorder::createActions() {
buffersizeSpinner->setFixedSize(120, 25); buffersizeSpinner->setFixedSize(120, 25);
buffersizeSpinner->setStyleSheet("QSpinBox{font-size: 10px;font-family: Arial;color: rgb(0, 0, 0);background-color: rgb(255,255,255);}"); buffersizeSpinner->setStyleSheet("QSpinBox{font-size: 10px;font-family: Arial;color: rgb(0, 0, 0);background-color: rgb(255,255,255);}");
dryRunCheckBox = new QCheckBox("Dry run, no writing");
dryRunCheckBox->setChecked(false);
dryRunCheckBox->setFixedSize(150, 25);
dryRunCheckBox->setStyleSheet("QCheckBox{font-size: 12px;font-family: Arial;color: rgb(0, 0, 0);}");
QToolBar *toolbar = addToolBar("main toolbar"); QToolBar *toolbar = addToolBar("main toolbar");
toolbar->addAction(exitAct); toolbar->addAction(exitAct);
toolbar->addSeparator(); toolbar->addSeparator();
@ -400,6 +405,8 @@ void PylonRecorder::createActions() {
toolbar->addSeparator(); toolbar->addSeparator();
toolbar->addWidget(new QLabel("buffer size:")); toolbar->addWidget(new QLabel("buffer size:"));
toolbar->addWidget(buffersizeSpinner); toolbar->addWidget(buffersizeSpinner);
toolbar->addSeparator();
toolbar->addWidget(dryRunCheckBox);
} }
void PylonRecorder::updateActions() { void PylonRecorder::updateActions() {
@ -493,16 +500,17 @@ void PylonRecorder::startRecording() {
writer->setVideoSpecs(specs); writer->setVideoSpecs(specs);
buffer->clear(); buffer->clear();
grabber->start(); grabber->start();
if (!dryRunCheckBox->isChecked()) {
writer->start(); writer->start();
grabbing = true;
writing = true; writing = true;
}
grabbing = true;
stopRequest = false; stopRequest = false;
preassureTimer->start(50); preassureTimer->start(50);
frameTimer->start(50); frameTimer->start(50);
labelTimer->start(650); labelTimer->start(650);
updateActions(); updateActions();
} }
void PylonRecorder::stopRecording() { void PylonRecorder::stopRecording() {

View File

@ -4,6 +4,7 @@
#include <QMainWindow> #include <QMainWindow>
#include <QTimer> #include <QTimer>
#include <QSpinBox> #include <QSpinBox>
#include <QCheckBox>
#include "pylonwrapper.h" #include "pylonwrapper.h"
#include "imagebuffer.h" #include "imagebuffer.h"
@ -79,6 +80,7 @@ private:
QImage image; QImage image;
QTimer *frameTimer, *preassureTimer, *labelTimer; QTimer *frameTimer, *preassureTimer, *labelTimer;
QLabel *imageLabel, *writingLabel, *grabbingLabel, *cameraConnectedLabel, *fileLabel; QLabel *imageLabel, *writingLabel, *grabbingLabel, *cameraConnectedLabel, *fileLabel;
QCheckBox *dryRunCheckBox;
QProgressBar *preassureBar; QProgressBar *preassureBar;
QProgressBar *loadBar; QProgressBar *loadBar;
QScrollArea *scrollArea; QScrollArea *scrollArea;