diff --git a/slsDetectorGui/forms/form_tab_measurement.ui b/slsDetectorGui/forms/form_tab_measurement.ui index dfc25baf8..b3a67bf20 100644 --- a/slsDetectorGui/forms/form_tab_measurement.ui +++ b/slsDetectorGui/forms/form_tab_measurement.ui @@ -255,7 +255,7 @@ 35 10 - 322 + 326 321 @@ -834,6 +834,9 @@ + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + @@ -855,7 +858,7 @@ - + @@ -879,7 +882,7 @@ - + @@ -911,6 +914,65 @@ + + + + + 0 + 0 + + + + + 60 + 0 + + + + + + + + + 0 + 0 + 127 + + + + + + + + + 0 + 0 + 127 + + + + + + + + + 193 + 193 + 193 + + + + + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 7dccad63c..5138cf023 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -40,8 +40,8 @@ public: /** Destructor */ ~qDrawPlot(); + /**is an acquisition running */ bool isRunning(){return running;}; - /** Number of x axis pixels */ int GetPixelsX(){return nPixelsX;}; /** Number of y axis pixels */ @@ -257,6 +257,7 @@ void ContourSignal(bool); void LogzSignal(bool); void SetZRangeSignal(double,double); void EnableZRangeSignal(bool); +void SetCurrentMeasurementSignal(int); }; diff --git a/slsDetectorGui/include/qTabMeasurement.h b/slsDetectorGui/include/qTabMeasurement.h index ee133c581..447c4ff02 100644 --- a/slsDetectorGui/include/qTabMeasurement.h +++ b/slsDetectorGui/include/qTabMeasurement.h @@ -85,7 +85,10 @@ public slots: */ void UpdateFinished(); - +/** updates the current measurement + * @param val the value to be updated + */ +void SetCurrentMeasurement(int val); private slots: /** Set file name diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index 5da201b2a..aa8a1bffb 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -206,29 +206,26 @@ void qDetectorMain::SetUpDetector(){ void qDetectorMain::Initialization(){ /** Dockable Plot*/ - connect(dockWidgetPlot,SIGNAL(topLevelChanged(bool)),this,SLOT(ResizeMainWindow(bool))); - + connect(dockWidgetPlot, SIGNAL(topLevelChanged(bool)), this,SLOT(ResizeMainWindow(bool))); /** tabs */ - connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(Refresh(int)));//( QWidget*))); + connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*))); /** Measurement tab*/ + connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs())); + connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs())); /** Plot tab */ - connect(tab_plot,SIGNAL(DisableZoomSignal(bool)),this, SLOT(SetZoomToolTip(bool))); - + connect(tab_plot, SIGNAL(DisableZoomSignal(bool)), this,SLOT(SetZoomToolTip(bool))); /** Plotting */ - /** When the acquisition is finished, must update the meas tab */ - connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs())); - connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs())); - connect(myPlot, SIGNAL(UpdatingPlotFinished()), this,SLOT(EnableTabs())); - connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement,SLOT(UpdateFinished())); - - + /** When the acquisition is finished, must update the meas tab */ + connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs())); + connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished())); + connect(myPlot, SIGNAL(SetCurrentMeasurementSignal(int)), tab_measurement, SLOT(SetCurrentMeasurement(int))); /** menubar */ - /** Modes Menu */ - connect(menuModes,SIGNAL(triggered(QAction*)),SLOT(EnableModes(QAction*))); - /** Utilities Menu */ - connect(menuUtilities,SIGNAL(triggered(QAction*)),SLOT(ExecuteUtilities(QAction*))); - /** Help Menu */ - connect(menuHelp,SIGNAL(triggered(QAction*)),SLOT(ExecuteHelp(QAction*))); + /** Modes Menu */ + connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*))); + /** Utilities Menu */ + connect(menuUtilities, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteUtilities(QAction*))); + /** Help Menu */ + connect(menuHelp, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteHelp(QAction*))); } diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 568829b24..71808c29a 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -158,6 +158,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){ /**Do the following only once before each n measurements */ /** Reset Current Measurement */ currentMeasurement = 0; + emit SetCurrentMeasurementSignal(currentMeasurement); /** Number of Exposures */ number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1); cout<<"\tNumber of Exposures:"<setExternalCommunicationMode(); @@ -148,8 +155,10 @@ void qTabMeasurement::SetupTimingMode(){ } } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::Initialization(int timingChange){ /** These signals are connected only at start up. The others are reinitialized when changing timing mode*/ if(!timingChange){ @@ -183,11 +192,12 @@ void qTabMeasurement::Initialization(int timingChange){ connect(spinNumGates,SIGNAL(valueChanged(int)), this, SLOT(setNumGates(int)));// /** Number of Probes**/ connect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));// - } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::DeInitialization(){ /** Number of Frames**/ disconnect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int))); @@ -208,8 +218,10 @@ void qTabMeasurement::DeInitialization(){ disconnect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int))); } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::Enable(bool enable){ frameTimeResolved->setEnabled(enable); frameNotTimeResolved->setEnabled(enable); @@ -217,8 +229,10 @@ void qTabMeasurement::Enable(bool enable){ if(!enable) btnStartStop->setEnabled(true); } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setFileName(const QString& fName){ myDet->setFileName(fName.toAscii().data()); #ifdef VERBOSE @@ -226,6 +240,7 @@ void qTabMeasurement::setFileName(const QString& fName){ #endif } + //------------------------------------------------------------------------------------------------------------------------------------------------- void qTabMeasurement::setRunIndex(int index){ @@ -238,6 +253,7 @@ void qTabMeasurement::setRunIndex(int index){ //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::startStopAcquisition(){ if(!btnStartStop->text().compare("Start")){ #ifdef VERBOSE @@ -265,8 +281,10 @@ void qTabMeasurement::startStopAcquisition(){ myPlot->StartStopDaqToggle(); } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::UpdateFinished(){ disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); btnStartStop->setText("Start"); @@ -278,15 +296,28 @@ void qTabMeasurement::UpdateFinished(){ progressTimer->stop(); } + //------------------------------------------------------------------------------------------------------------------------------------------------- + +void SetCurrentMeasurement(int val){ + lblCurrentMeasurement->setText("0u");//lblCurrentMeasurement->setText(QString::number(val)); +} + + +//------------------------------------------------------------------------------------------------------------------------------------------------- + + void qTabMeasurement::UpdateProgress(){ + progressBar->setValue(myPlot->GetProgress()); lblProgressIndex->setText(QString::number(myDet->getFileIndex())); } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setNumFrames(int val){ myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,val); #ifdef VERBOSE @@ -295,8 +326,10 @@ void qTabMeasurement::setNumFrames(int val){ } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setExposureTime(){ int64_t exptimeNS; /** Get the value of timer in ns **/ @@ -322,8 +355,10 @@ void qTabMeasurement::setExposureTime(){ } } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setAcquisitionPeriod(){ int64_t acqtimeNS; /** Get the value of timer in ns **/ @@ -347,8 +382,10 @@ void qTabMeasurement::setAcquisitionPeriod(){ } } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setNumTriggers(int val){ myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,val); #ifdef VERBOSE @@ -356,8 +393,10 @@ void qTabMeasurement::setNumTriggers(int val){ #endif } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setDelay(){ int64_t exptimeNS; /** Get the value of timer in ns **/ @@ -368,8 +407,10 @@ void qTabMeasurement::setDelay(){ myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS); } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setNumGates(int val){ myDet->setTimer(slsDetectorDefs::GATES_NUMBER,val); #ifdef VERBOSE @@ -377,8 +418,10 @@ void qTabMeasurement::setNumGates(int val){ #endif } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setNumProbes(int val){ myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,val); #ifdef VERBOSE @@ -386,8 +429,10 @@ void qTabMeasurement::setNumProbes(int val){ #endif } + //------------------------------------------------------------------------------------------------------------------------------------------------- + void qTabMeasurement::setTimingMode(int mode){ #ifdef VERBOSE cout<<"Setting Timing mode to " << comboTimingMode->currentText().toAscii().data()<setText(QString::number(myDet->getFileIndex())); /** Progress bar **/ - progressBar->setValue(myDet->getCurrentProgress()); + progressBar->setValue((int)myDet->getCurrentProgress()); /** Timing mode**/ SetupTimingMode();//comboTimingMode->setCurrentIndex((int)myDet->setExternalCommunicationMode()); } diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index f1e1d3799..1ff770e16 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -332,8 +332,8 @@ void qTabPlot::SetPlot(){ }else if(radioHistogram->isChecked()){ myPlot->EnablePlot(true); /**if enable is true, disable everything */ - box1D->setEnabled(true); - box2D->setEnabled(true); + box1D->setEnabled(isOneD); + box2D->setEnabled(!isOneD); boxSnapshot->setEnabled(true); boxSave->setEnabled(true); boxPlotAxis->setEnabled(true); @@ -341,8 +341,8 @@ void qTabPlot::SetPlot(){ }else{ myPlot->EnablePlot(true); /**if enable is true, disable everything */ - box1D->setEnabled(true); - box2D->setEnabled(true); + box1D->setEnabled(isOneD); + box2D->setEnabled(!isOneD); boxSnapshot->setEnabled(true); boxSave->setEnabled(true); boxPlotAxis->setEnabled(true);