diff --git a/graphics/VP1/VP1Base/VP1Base/IVP13DStandardChannelWidget.h b/graphics/VP1/VP1Base/VP1Base/IVP13DStandardChannelWidget.h index 8dd1301d3de2704b2824f8bf3d3a65e1fe4af897..bfba524c9471d52552f5ca32270cadfcfbe9124d 100644 --- a/graphics/VP1/VP1Base/VP1Base/IVP13DStandardChannelWidget.h +++ b/graphics/VP1/VP1Base/VP1Base/IVP13DStandardChannelWidget.h @@ -73,6 +73,7 @@ private: private slots: void toggleSystemActive(); void updateSnapshotDim(); + void setImageFromPresets(); protected slots: void showControlsForSystem(); diff --git a/graphics/VP1/VP1Base/VP1Base/IVP1ChannelWidget.h b/graphics/VP1/VP1Base/VP1Base/IVP1ChannelWidget.h index 99956faeb8d0f2c1af681955e917b492c950cb72..8a5f0e25be238375dc710bec9acc4eb010cd1dae 100644 --- a/graphics/VP1/VP1Base/VP1Base/IVP1ChannelWidget.h +++ b/graphics/VP1/VP1Base/VP1Base/IVP1ChannelWidget.h @@ -48,7 +48,7 @@ public: virtual bool isAccumulator() const; - void setRunEvtNumber(int runnumber, int eventnumber); + void setRunEvtNumber(int runnumber, unsigned long long eventnumber); protected: virtual void create();//Fixme: Abstract! @@ -65,7 +65,7 @@ protected: void turnOn(IVP1System*); void turnOff(IVP1System*,const bool& immediateErase=true); - void getRunEvtNumber(int& runnumber, int& eventnumber); + void getRunEvtNumber(int& runnumber, unsigned long long& eventnumber); void setEvtTimestamp(unsigned timestamp); void getEvtTimestamp(unsigned& timestamp); diff --git a/graphics/VP1/VP1Base/src/IVP13DStandardChannelWidget.cxx b/graphics/VP1/VP1Base/src/IVP13DStandardChannelWidget.cxx index 1e79c8ad38a80131f5fdda0bec0e6f689444fac4..4e8053a2eeb52a8a0188e0d7cfc1a180ca5a8bea 100644 --- a/graphics/VP1/VP1Base/src/IVP13DStandardChannelWidget.cxx +++ b/graphics/VP1/VP1Base/src/IVP13DStandardChannelWidget.cxx @@ -73,6 +73,11 @@ public: VP1TabWidget* tabwidget; QSplitter * extradisplaywidget_splitter; + + // restoreFromState versions + void restoreFromState_v7(QDataStream& state); + + }; //___________________________________________________________________________ @@ -184,7 +189,14 @@ void IVP13DStandardChannelWidget::create() { connect(d->uisnapshot.radioButton_width,SIGNAL(toggled(bool)),this,SLOT(updateSnapshotDim())); connect(d->uisnapshot.radioButton_height,SIGNAL(toggled(bool)),this,SLOT(updateSnapshotDim())); -// d->systemsAllowedControllers.clear(); + connect(d->uisnapshot.groupBox_imagePresets,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets())); + connect(d->uisnapshot.radioButton_720p,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets())); + connect(d->uisnapshot.radioButton_1080p,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets())); + connect(d->uisnapshot.radioButton_4K,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets())); + connect(d->uisnapshot.radioButton_8K,SIGNAL(toggled(bool)),this,SLOT(setImageFromPresets())); + + + // d->systemsAllowedControllers.clear(); d->system2switchable.clear(); QMapIterator<QCheckBox*,IVP1System*> it(d->checkbox2system); @@ -278,7 +290,7 @@ void IVP13DStandardChannelWidget::Imp::autoSnapshot() VP1Msg::messageVerbose("IVP13DStandardChannelWidget::Imp::autoSnapshot()"); int runnumber(0); - int eventnumber(0); + unsigned long long eventnumber(0); channel->getRunEvtNumber(runnumber,eventnumber); QString snapshotDirName = VP1QtUtils::environmentVariableValue("VP1_SCREENSHOTS_DIR"); @@ -478,6 +490,42 @@ QPixmap IVP13DStandardChannelWidget::getSnapshot(bool transp, int width, bool ba } +//___________________________________________________________________________ +void IVP13DStandardChannelWidget::setImageFromPresets() +{ + VP1Msg::messageDebug("IVP13DStandardChannelWidget::setImageFromPresets()"); + + disconnect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + disconnect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + + if (d->uisnapshot.radioButton_720p->isChecked()) { + d->uisnapshot.spinBox_width->setValue(1280); + d->uisnapshot.spinBox_height->setValue(720); + } + else if (d->uisnapshot.radioButton_1080p->isChecked()) { + d->uisnapshot.spinBox_width->setValue(1920); + d->uisnapshot.spinBox_height->setValue(1080); + } + else if (d->uisnapshot.radioButton_4K->isChecked()) { + d->uisnapshot.spinBox_width->setValue(4096); + d->uisnapshot.spinBox_height->setValue(2160); + } + else if (d->uisnapshot.radioButton_8K->isChecked()) { + d->uisnapshot.spinBox_width->setValue(8192); + d->uisnapshot.spinBox_height->setValue(4320); + } + else { + VP1Msg::messageDebug("ERROR! Sender unknown!!"); + } + + connect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + connect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + + // update + updateSnapshotDim(); +} + + //___________________________________________________________________________ void IVP13DStandardChannelWidget::updateSnapshotDim() { @@ -498,8 +546,14 @@ void IVP13DStandardChannelWidget::updateSnapshotDim() else if (sender()==d->uisnapshot.spinBox_height) d->uisnapshot.radioButton_height->setChecked(true); + /* + * Get widget width and height + * Note: the method "getNormalWidget" is from the "SoQtGLWidget" class + * and it returns a QWidget object + */ int onscreen_width = d->viewer->getNormalWidget()->geometry().width(); int onscreen_height = d->viewer->getNormalWidget()->geometry().height(); + if ( d->uisnapshot.checkBox_as_shown->isChecked() ) { disconnect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); disconnect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); @@ -508,14 +562,29 @@ void IVP13DStandardChannelWidget::updateSnapshotDim() connect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); connect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); } else { - if (d->uisnapshot.radioButton_width->isChecked()) { - disconnect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); - d->uisnapshot.spinBox_height->setValue(static_cast<int>(d->uisnapshot.spinBox_width->value()*static_cast<double>(onscreen_height)/onscreen_width+0.5)); - connect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); - } else { - disconnect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); - d->uisnapshot.spinBox_width->setValue(static_cast<int>(d->uisnapshot.spinBox_height->value()*static_cast<double>(onscreen_width)/onscreen_height+0.5)); - connect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + if (d->uisnapshot.checkBox_lockRatio->isChecked()) { + VP1Msg::messageDebug("checkBox_lockRatio is checked - updating only rendering size"); + if (d->uisnapshot.radioButton_width->isChecked()) { + disconnect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + d->uisnapshot.spinBox_height->setValue(static_cast<int>(d->uisnapshot.spinBox_width->value()*static_cast<double>(onscreen_height)/onscreen_width+0.5)); + connect(d->uisnapshot.spinBox_height,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + } else { + disconnect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + d->uisnapshot.spinBox_width->setValue(static_cast<int>(d->uisnapshot.spinBox_height->value()*static_cast<double>(onscreen_width)/onscreen_height+0.5)); + connect(d->uisnapshot.spinBox_width,SIGNAL(valueChanged(int)),this,SLOT(updateSnapshotDim())); + } + } + else { + VP1Msg::messageDebug("checkBox_lockRatio is NOT checked - Updating the widget size as well"); + +// if (d->uisnapshot.radioButton_width->isChecked() ) { +// int newWidth = static_cast<int>(d->uisnapshot.spinBox_width->value() * static_cast<double>(onscreen_height) / d->uisnapshot.spinBox_height->value() + 0.5); +// d->viewer->getNormalWidget()->resize(newWidth, onscreen_height); +// } else if (d->uisnapshot.radioButton_height->isChecked()) { +// int newHeight = static_cast<int>( onscreen_width * static_cast<double>(d->uisnapshot.spinBox_height->value()) / d->uisnapshot.spinBox_width->value() + 0.5); +// d->viewer->resize(onscreen_width, newHeight); +// } + } } @@ -542,6 +611,7 @@ void IVP13DStandardChannelWidget::updateSnapshotDim() //___________________________________________________________________________ void IVP13DStandardChannelWidget::dockResized() { + VP1Msg::messageVerbose("IVP13DStandardChannelWidget::dockResized()"); QTimer::singleShot(0, this, SLOT(updateSnapshotDim())); IVP1ChannelWidget::dockResized(); } @@ -551,160 +621,253 @@ QByteArray IVP13DStandardChannelWidget::saveState() { VP1Msg::messageVerbose("IVP13DStandardChannelWidget::saveState"); + + // NEW VERSION + +// +// // ===> Setup stream writing to a byteArray: +// QByteArray byteArray; +// QBuffer buffer(&byteArray); +// buffer.open(QIODevice::WriteOnly); +// QDataStream out(&buffer); +// +// /* +// * --- GET DATA TO BE SAVED --- +// */ +// +// //Systems turned on/off: +// //Fixme: Make sure that if you have two copies of the same system, +// //that the text in the checkbox gets appended some stuff like [1], +// //[2], etc., so that the strings used here will be unique. +// QMap<QString, bool> sysname2turnedon; +// QMap<QCheckBox*,IVP1System*>::const_iterator it = d->checkbox2system.constBegin(); +// while (it != d->checkbox2system.constEnd()) { +// sysname2turnedon.insert(it.key()->text(),it.key()->isChecked()); +// ++it; +// } +// +// +// // snapshot settings +// bool transp_checked = d->uisnapshot.checkBox_transp->isChecked(); +// bool widthfixed = d->uisnapshot.radioButton_width->isChecked(); +// bool as_shown = d->uisnapshot.checkBox_as_shown->isChecked(); +// +// bool locked_ratio = d->uisnapshot.checkBox_lockRatio->isChecked(); +// +// qint32 width = (qint32)(d->uisnapshot.spinBox_width->value()); +// qint32 height = (qint32)(d->uisnapshot.spinBox_height->value()); +// +// // image presets +// bool isUsingPreset = d->uisnapshot.groupBox_imagePresets->isChecked(); +// bool is720p = d->uisnapshot.radioButton_720p->isChecked(); +// bool is1080p = d->uisnapshot.radioButton_1080p->isChecked(); +// bool is4K = d->uisnapshot.radioButton_4K->isChecked(); +// bool is8K = d->uisnapshot.radioButton_8K->isChecked(); +// +// // active tab +// QString tab_index = (d->tabwidget ? d->tabwidget->tabText(d->tabwidget->currentIndex()) : QString("") ); +// +// +// /* +// * --- WRITE DATA --- +// */ +// +// // ------- SAVE ------- +// out << (qint32)7; //version +// out << IVP13DChannelWidget::saveState();//Always include state info from the base class. +// out << sysname2turnedon; +// out << ( d->extradisplaywidget_splitter ? d->extradisplaywidget_splitter->saveState() : QByteArray() ); +// out << d->viewer->saveState(); +// out << transp_checked; +// out << widthfixed; +// out << as_shown; +// out << locked_ratio; // new in v. 7 +// out << width; // new in v. 7 +// out << height; // new in v. 7 +// out << isUsingPreset; // new in v. 7 +// out << is720p; // new in v. 7 +// out << is1080p; // new in v. 7 +// out << is4K; // new in v. 7 +// out << is8K; // new in v. 7 +// out << tab_index; +// // -------------------- +// +// // ===> Finish up: +// buffer.close(); +// return byteArray; +// +// + + + + // OLD VERSION + // ===> Setup stream writing to a byteArray: - QByteArray byteArray; - QBuffer buffer(&byteArray); - buffer.open(QIODevice::WriteOnly); - QDataStream out(&buffer); - - // ===> Write Data: - - //Version & base state: - out << (qint32)6; //version - out << IVP13DChannelWidget::saveState();//Always include state info from the base class. - - //version 3 had bgd color output here; - - //Systems turned on/off: - //Fixme: Make sure that if you have two copies of the same system, - //that the text in the checkbox gets appended some stuff like [1], - //[2], etc., so that the strings used here will be unique. - QMap<QString, bool> sysname2turnedon; - QMap<QCheckBox*,IVP1System*>::const_iterator it = d->checkbox2system.constBegin(); - while (it != d->checkbox2system.constEnd()) { - sysname2turnedon.insert(it.key()->text(),it.key()->isChecked()); - ++it; - } + QByteArray byteArray; + QBuffer buffer(&byteArray); + buffer.open(QIODevice::WriteOnly); + QDataStream out(&buffer); + + // ===> Write Data: + + //Version & base state: + out << (qint32)6; //version + out << IVP13DChannelWidget::saveState();//Always include state info from the base class. - //Versions 3+ follow here. + //version 3 had bgd color output here; - out << sysname2turnedon; + //Systems turned on/off: + //Fixme: Make sure that if you have two copies of the same system, + //that the text in the checkbox gets appended some stuff like [1], + //[2], etc., so that the strings used here will be unique. + QMap<QString, bool> sysname2turnedon; + QMap<QCheckBox*,IVP1System*>::const_iterator it = d->checkbox2system.constBegin(); + while (it != d->checkbox2system.constEnd()) { + sysname2turnedon.insert(it.key()->text(),it.key()->isChecked()); + ++it; + } - out << ( d->extradisplaywidget_splitter ? d->extradisplaywidget_splitter->saveState() : QByteArray() ); + //Versions 3+ follow here. - out << d->viewer->saveState(); + out << sysname2turnedon; - //version <=3 had bool here. + out << ( d->extradisplaywidget_splitter ? d->extradisplaywidget_splitter->saveState() : QByteArray() ); - out << d->uisnapshot.checkBox_transp->isChecked(); - bool widthfixed = d->uisnapshot.radioButton_width->isChecked(); - bool as_shown = d->uisnapshot.checkBox_as_shown->isChecked(); - out << widthfixed; - out << as_shown; - if (!as_shown) - out << (qint32)(widthfixed ? d->uisnapshot.spinBox_width->value() : d->uisnapshot.spinBox_height->value()); + out << d->viewer->saveState(); - if (d->tabwidget) - out << d->tabwidget->tabText(d->tabwidget->currentIndex()); - else - out << QString(""); + //version <=3 had bool here. + + out << d->uisnapshot.checkBox_transp->isChecked(); + bool widthfixed = d->uisnapshot.radioButton_width->isChecked(); + bool as_shown = d->uisnapshot.checkBox_as_shown->isChecked(); + out << widthfixed; + out << as_shown; + if (!as_shown) + out << (qint32)(widthfixed ? d->uisnapshot.spinBox_width->value() : d->uisnapshot.spinBox_height->value()); + + if (d->tabwidget) + out << d->tabwidget->tabText(d->tabwidget->currentIndex()); + else + out << QString(""); + + //In version 5 we output a bool here. + + // ===> Finish up: + buffer.close(); + return byteArray; - //In version 5 we output a bool here. - // ===> Finish up: - buffer.close(); - return byteArray; } //___________________________________________________________________________ void IVP13DStandardChannelWidget::restoreFromState(QByteArray ba) { - VP1Msg::messageVerbose("IVP13DStandardChannelWidget::restoreFromState"); - - // ===> Setup stream for getting the contents of the byteArray: - QBuffer buffer(&ba); - buffer.open(QIODevice::ReadOnly); - QDataStream state(&buffer); - // ===> Check version and pass on state info to base class: - qint32 version; - state >> version; - if (version<0||version>6) { - message("Warning: State data in .vp1 file is in wrong format - ignoring!"); - return; - } - QByteArray basestate; - state >> basestate; - IVP13DChannelWidget::restoreFromState(basestate); - // ===> Decode the state info: - - if (version<=3) { - QColor bgdcol_dummy; - state >> bgdcol_dummy; - } + VP1Msg::messageVerbose("IVP13DStandardChannelWidget::restoreFromState"); - //Switch systems on/off: - QMap<QString, bool> sysname2turnedon; - state >> sysname2turnedon; - QMap<QCheckBox*,IVP1System*>::const_iterator it = d->checkbox2system.constBegin(); - while (it != d->checkbox2system.constEnd()) { - if (sysname2turnedon.contains(it.key()->text())) { - if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked()) - it.key()->setChecked(sysname2turnedon[it.key()->text()]); - } else { - message("Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+"'"); - } - ++it; - } + // ===> Setup stream for getting the contents of the byteArray: + QBuffer buffer(&ba); + buffer.open(QIODevice::ReadOnly); + QDataStream state(&buffer); + // ===> Check version and pass on state info to base class: + qint32 version; + state >> version; - if (version<=2) { - // We stop here to avoid too messy code. - buffer.close(); - return; - } + message("Configuration file version: " + QString::number(version) ); - //Splitter: - QByteArray splitstate; - state >> splitstate; - if (d->extradisplaywidget_splitter) - d->extradisplaywidget_splitter->restoreState(splitstate); - - //Viewer settings: - QByteArray ba_viewer; - state >> ba_viewer; - d->viewer->restoreFromState(ba_viewer);//Fixme: reset camera??? - d->need_initial_viewall = false; - - //Snapshot parameters: - bool aa_dummy, transp, widthfixed, as_shown; - if (version<=3) - state >> aa_dummy; - state >> transp; state >> widthfixed; state >> as_shown; - d->uisnapshot.checkBox_transp->setChecked(transp); - d->uisnapshot.checkBox_as_shown->setChecked(as_shown); - if (widthfixed) { - d->uisnapshot.radioButton_width->setChecked(true); - d->uisnapshot.radioButton_height->setChecked(false); - } else { - d->uisnapshot.radioButton_width->setChecked(false); - d->uisnapshot.radioButton_height->setChecked(true); - } - if (!as_shown) { - qint32 fixval; - state >> fixval; - if (widthfixed) - d->uisnapshot.spinBox_width->setValue(fixval); - else - d->uisnapshot.spinBox_height->setValue(fixval); - } + if (version<0||version>7) { + message("Warning: State data in .vp1 file is in wrong format - ignoring!"); + return; + } - QString tabname; - state >> tabname; - if (d->tabwidget) { - for (int i = 0; i < d->tabwidget->count(); ++i) { - if (d->tabwidget->tabText(i) == tabname) { - d->tabwidget->setCurrentIndex(i); - break; - } - } - } + QByteArray basestate; + state >> basestate; + IVP13DChannelWidget::restoreFromState(basestate); - if (version==5) { - bool b; - state >> b; - } - // ===> Finish up: - buffer.close(); + // ===> Decode the state info: + + if (version == 7) + d->restoreFromState_v7(state); + + if (version<=3) { + QColor bgdcol_dummy; + state >> bgdcol_dummy; + } + + //Switch systems on/off: + QMap<QString, bool> sysname2turnedon; + state >> sysname2turnedon; + QMap<QCheckBox*,IVP1System*>::const_iterator it = d->checkbox2system.constBegin(); + while (it != d->checkbox2system.constEnd()) { + if (sysname2turnedon.contains(it.key()->text())) { + if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked()) + it.key()->setChecked(sysname2turnedon[it.key()->text()]); + } else { + message("Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+"'"); + } + ++it; + } + + if (version<=2) { + // We stop here to avoid too messy code. + buffer.close(); + return; + } + + //Splitter: + QByteArray splitstate; + state >> splitstate; + if (d->extradisplaywidget_splitter) + d->extradisplaywidget_splitter->restoreState(splitstate); + + //Viewer settings: + QByteArray ba_viewer; + state >> ba_viewer; + d->viewer->restoreFromState(ba_viewer);//Fixme: reset camera??? + d->need_initial_viewall = false; + + //Snapshot parameters: + bool aa_dummy, transp, widthfixed, as_shown; + if (version<=3) + state >> aa_dummy; + state >> transp; state >> widthfixed; state >> as_shown; + d->uisnapshot.checkBox_transp->setChecked(transp); + d->uisnapshot.checkBox_as_shown->setChecked(as_shown); + if (widthfixed) { + d->uisnapshot.radioButton_width->setChecked(true); + d->uisnapshot.radioButton_height->setChecked(false); + } else { + d->uisnapshot.radioButton_width->setChecked(false); + d->uisnapshot.radioButton_height->setChecked(true); + } + if (!as_shown) { + qint32 fixval; + state >> fixval; + if (widthfixed) + d->uisnapshot.spinBox_width->setValue(fixval); + else + d->uisnapshot.spinBox_height->setValue(fixval); + } + + QString tabname; + state >> tabname; + if (d->tabwidget) { + for (int i = 0; i < d->tabwidget->count(); ++i) { + if (d->tabwidget->tabText(i) == tabname) { + d->tabwidget->setCurrentIndex(i); + break; + } + } + } + + if (version==5) { + bool b; + state >> b; + } + + + // ===> Finish up: + buffer.close(); } //___________________________________________________________________________ @@ -729,3 +892,124 @@ void IVP13DStandardChannelWidget::showControlsForSystem( ) } d->tabwidget->setCurrentIndex(index); } + + +//___________________________________________________________________________ +void IVP13DStandardChannelWidget::Imp::restoreFromState_v7(QDataStream& state) { + + VP1Msg::messageVerbose("IVP13DStandardChannelWidget::Imp::restoreFromState_v7"); + + /* + * --- VARIABLES TO BE RESTORED --- + */ + //Switch systems on/off: + QMap<QString, bool> sysname2turnedon; + //Splitter: + QByteArray splitstate; + //Viewer settings: + QByteArray ba_viewer; + // Snapshot parameters: + bool transp, widthfixed, as_shown; + bool locked_ratio; + qint32 width, height; + // image format presets + bool isUsingPresets; + bool is720p; + bool is1080p; + bool is4K; + bool is8K; + // Active tab + QString tabname; + + + /* + * ------- GET STATE ------- + */ + // 'version' restored already + // 'basestate' restored already + state >> sysname2turnedon; + state >> splitstate; + state >> ba_viewer; + state >> transp; + state >> widthfixed; + state >> as_shown; + state >> locked_ratio; + state >> width; + state >> height; + state >> isUsingPresets; + state >> is720p; + state >> is1080p; + state >> is4K; + state >> is8K; + state >> tabname; + // ------------------------- + + + + + /* + * --- RESTORE VARIABLES --- + */ + + //Switch systems on/off: + QMap<QCheckBox*,IVP1System*>::const_iterator it = checkbox2system.constBegin(); + while (it != checkbox2system.constEnd()) { + if (sysname2turnedon.contains(it.key()->text())) { + if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked()) + it.key()->setChecked(sysname2turnedon[it.key()->text()]); + } else { + channel->message("Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+"'"); + } + ++it; + } + + + //Splitter: + if (extradisplaywidget_splitter) + extradisplaywidget_splitter->restoreState(splitstate); + + //Viewer settings: + viewer->restoreFromState(ba_viewer);//Fixme: reset camera??? + need_initial_viewall = false; + + + // Snapshot parameters - Set Width and Height + uisnapshot.checkBox_transp->setChecked(transp); + uisnapshot.checkBox_as_shown->setChecked(as_shown); + if (widthfixed) { + uisnapshot.radioButton_width->setChecked(true); + uisnapshot.radioButton_height->setChecked(false); + } else { + uisnapshot.radioButton_width->setChecked(false); + uisnapshot.radioButton_height->setChecked(true); + } + if (!as_shown) { + uisnapshot.spinBox_width->setValue(width); + uisnapshot.spinBox_height->setValue(height); + } + + // image format presets + if (isUsingPresets) + uisnapshot.groupBox_imagePresets->setChecked(true); + if (is720p) + uisnapshot.radioButton_720p->setChecked(true); + else if (is1080p) + uisnapshot.radioButton_1080p->setChecked(true); + else if (is4K) + uisnapshot.radioButton_4K->setChecked(true); + else if (is8K) + uisnapshot.radioButton_8K->setChecked(true); + + + // Set active tab + if (tabwidget) { + for (int i = 0; i < tabwidget->count(); ++i) { + if (tabwidget->tabText(i) == tabname) { + tabwidget->setCurrentIndex(i); + break; + } + } + } +} + + diff --git a/graphics/VP1/VP1Base/src/IVP1ChannelWidget.cxx b/graphics/VP1/VP1Base/src/IVP1ChannelWidget.cxx index 220e99e355343b28974984c41e9b318de7acb6a3..4ad277b237072d71fbfc3325db3ca88cce6f24ff 100644 --- a/graphics/VP1/VP1Base/src/IVP1ChannelWidget.cxx +++ b/graphics/VP1/VP1Base/src/IVP1ChannelWidget.cxx @@ -38,7 +38,7 @@ public: bool canregistercontroller; bool canregistersystem; int runnumber; - int eventnumber; + unsigned long long eventnumber; unsigned timestamp; }; @@ -86,7 +86,7 @@ bool IVP1ChannelWidget::isAccumulator() const } //_______________________________________________________ -void IVP1ChannelWidget::setRunEvtNumber(int runnumber, int eventnumber) +void IVP1ChannelWidget::setRunEvtNumber(int runnumber, unsigned long long eventnumber) { d->runnumber = runnumber; d->eventnumber = eventnumber; @@ -252,7 +252,7 @@ void IVP1ChannelWidget::turnOff(IVP1System*s,const bool& immediateErase) } //_______________________________________________________ -void IVP1ChannelWidget::getRunEvtNumber(int& runnumber, int& eventnumber) +void IVP1ChannelWidget::getRunEvtNumber(int& runnumber, unsigned long long& eventnumber) { runnumber = d->runnumber; eventnumber = d->eventnumber; diff --git a/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui b/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui index f25db795002d16368efddd5c08355699f95a3b5d..08a0d27d6e053805a99566c88565eb75dcdd7812 100644 --- a/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui +++ b/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>242</width> - <height>113</height> + <width>412</width> + <height>257</height> </rect> </property> <property name="windowTitle"> @@ -18,12 +18,12 @@ <number>0</number> </property> <item> - <layout class="QVBoxLayout"> + <layout class="QVBoxLayout" name="layout_main"> <property name="spacing"> <number>0</number> </property> <item> - <layout class="QHBoxLayout"> + <layout class="QHBoxLayout" name="layout_top_label"> <item> <widget class="QLabel" name="label"> <property name="text"> @@ -47,7 +47,7 @@ </layout> </item> <item> - <layout class="QHBoxLayout"> + <layout class="QHBoxLayout" name="layout_snapshot_options"> <property name="spacing"> <number>0</number> </property> @@ -153,7 +153,7 @@ <number>10</number> </property> <property name="maximum"> - <number>30000</number> + <number>16000</number> </property> <property name="singleStep"> <number>50</number> @@ -188,13 +188,27 @@ <number>10</number> </property> <property name="maximum"> - <number>30000</number> + <number>16000</number> </property> <property name="singleStep"> <number>50</number> </property> <property name="value"> - <number>800</number> + <number>4320</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_lockOption"> + <item> + <widget class="QCheckBox" name="checkBox_lockRatio"> + <property name="text"> + <string>Lock ratio</string> + </property> + <property name="checked"> + <bool>true</bool> </property> </widget> </item> @@ -219,6 +233,93 @@ </item> </layout> </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox_imagePresets"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Image Presets:</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="1"> + <widget class="QRadioButton" name="radioButton_1080p"> + <property name="toolTip"> + <string>1920 x 1080 pixels (16:9 aspect ratio) - 2.1 Mpixels</string> + </property> + <property name="text"> + <string>1080p Full HD</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_imagePresets</string> + </attribute> + </widget> + </item> + <item row="1" column="0"> + <widget class="QRadioButton" name="radioButton_4K"> + <property name="toolTip"> + <string>4096 x 2160 pixels (1.9:1 aspect ratio) - 8.85 Mpixels</string> + </property> + <property name="text"> + <string>4K DCI</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_imagePresets</string> + </attribute> + </widget> + </item> + <item row="0" column="0"> + <widget class="QRadioButton" name="radioButton_720p"> + <property name="toolTip"> + <string>1280 x 720 pixels - 16:9 aspect ratio - 0.9 Mpixels</string> + </property> + <property name="text"> + <string>720p HD</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_imagePresets</string> + </attribute> + </widget> + </item> + <item row="1" column="1"> + <widget class="QRadioButton" name="radioButton_8K"> + <property name="toolTip"> + <string>8192 × 4320 pixels (17:9 aspect ratio) - 35.4 Mpixels</string> + </property> + <property name="text"> + <string>8K</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_imagePresets</string> + </attribute> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </item> </layout> </item> </layout> @@ -306,4 +407,7 @@ </hints> </connection> </connections> + <buttongroups> + <buttongroup name="buttonGroup_imagePresets"/> + </buttongroups> </ui>