From a27908addab3e58565912dc236ec45e8e924f1c7 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Wed, 10 Jun 2020 11:00:30 +0200 Subject: [PATCH] [recorder] add check bo for no saving --- pylonrecorder.cpp | 14 +++++++++++--- pylonrecorder.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pylonrecorder.cpp b/pylonrecorder.cpp index 5dfccf5..b0e49f9 100644 --- a/pylonrecorder.cpp +++ b/pylonrecorder.cpp @@ -385,6 +385,11 @@ void PylonRecorder::createActions() { buffersizeSpinner->setFixedSize(120, 25); 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"); toolbar->addAction(exitAct); toolbar->addSeparator(); @@ -400,6 +405,8 @@ void PylonRecorder::createActions() { toolbar->addSeparator(); toolbar->addWidget(new QLabel("buffer size:")); toolbar->addWidget(buffersizeSpinner); + toolbar->addSeparator(); + toolbar->addWidget(dryRunCheckBox); } void PylonRecorder::updateActions() { @@ -493,16 +500,17 @@ void PylonRecorder::startRecording() { writer->setVideoSpecs(specs); buffer->clear(); grabber->start(); - writer->start(); + if (!dryRunCheckBox->isChecked()) { + writer->start(); + writing = true; + } grabbing = true; - writing = true; stopRequest = false; preassureTimer->start(50); frameTimer->start(50); labelTimer->start(650); updateActions(); - } void PylonRecorder::stopRecording() { diff --git a/pylonrecorder.h b/pylonrecorder.h index d8109e6..ee1dddd 100644 --- a/pylonrecorder.h +++ b/pylonrecorder.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "pylonwrapper.h" #include "imagebuffer.h" @@ -79,6 +80,7 @@ private: QImage image; QTimer *frameTimer, *preassureTimer, *labelTimer; QLabel *imageLabel, *writingLabel, *grabbingLabel, *cameraConnectedLabel, *fileLabel; + QCheckBox *dryRunCheckBox; QProgressBar *preassureBar; QProgressBar *loadBar; QScrollArea *scrollArea;