diff --git a/slsDetectorGui/forms/form_tab_measurement.ui b/slsDetectorGui/forms/form_tab_measurement.ui index ea826ebb5..b9ea4b54d 100644 --- a/slsDetectorGui/forms/form_tab_measurement.ui +++ b/slsDetectorGui/forms/form_tab_measurement.ui @@ -188,6 +188,10 @@ false + + Number of Triggers to be expected. + #cycles# + Number of Triggers: @@ -205,8 +209,8 @@ - Run index (automatically incremented) - #index# + Number of Triggers to be expected. + #cycles# @@ -221,7 +225,7 @@ - 1 + 0 2000000000 @@ -236,6 +240,10 @@ false + + The Delay between Trigger Edge and Start of Exposure ( or Readout). +#delay# + Delay After Trigger: @@ -253,8 +261,8 @@ - Frame period between exposures. - #period# + The Delay between Trigger Edge and Start of Exposure ( or Readout). +#delay# Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -281,6 +289,10 @@ 0 + + The Delay between Trigger Edge and Start of Exposure ( or Readout). +#delay# + Qt::LeftToRight @@ -330,6 +342,10 @@ 0 + + Number of Gate Signals per Frame. + #gates# + Number of Gates: @@ -347,8 +363,8 @@ - Run index (automatically incremented) - #index# + Number of Gate Signals per Frame. + #gates# @@ -363,7 +379,7 @@ - 1 + 0 2000000000 @@ -384,6 +400,10 @@ 0 + + The data are accumulated over several (frames) pump-cycles. Set cycles to 1. +#probes# + Number of Probes: @@ -401,8 +421,8 @@ - Run index (automatically incremented) - #index# + The data are accumulated over several (frames) pump-cycles. Set cycles to 1. +#probes# @@ -417,7 +437,7 @@ - 1 + 0 2000000000 @@ -626,8 +646,15 @@ false - Frame period between exposures. - #period# + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> +<tr> +<td style="border: none;"> +<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Frame period between exposures. </p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> #period#</p></td></tr></table></body></html> Acquisition Period: @@ -646,8 +673,15 @@ - Frame period between exposures. - #period# + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> +<tr> +<td style="border: none;"> +<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Frame period between exposures. </p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> #period#</p></td></tr></table></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -674,6 +708,17 @@ 0 + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> +<tr> +<td style="border: none;"> +<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Frame period between exposures. </p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> #period#</p></td></tr></table></body></html> + Qt::LeftToRight diff --git a/slsDetectorGui/include/qDetectorMain.h b/slsDetectorGui/include/qDetectorMain.h index 1e80ccd3f..d8494a4c0 100644 --- a/slsDetectorGui/include/qDetectorMain.h +++ b/slsDetectorGui/include/qDetectorMain.h @@ -111,7 +111,6 @@ private: /**if the developer tab should be enabled,known from command line */ int isDeveloper; - /**Sets up the layout of the widget * */ void SetUpWidgetWindow(); diff --git a/slsDetectorGui/slsDetectorGui.pro b/slsDetectorGui/slsDetectorGui.pro index a57c8e744..4a8021f79 100644 --- a/slsDetectorGui/slsDetectorGui.pro +++ b/slsDetectorGui/slsDetectorGui.pro @@ -6,7 +6,7 @@ UI_HEADERS_DIR = forms/include RESOURCES += icons.qrc -DEFINES += VERBOSE DACS_INT #VERYVERBOSE +DEFINES += VERBOSE #VERYVERBOSE #DACS_INT target.path += $(DESTDIR) diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index d9e369cd1..cc5255196 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -97,15 +97,15 @@ void qDetectorMain::SetUpWidgetWindow(){ tabs = new MyTabWidget(this); layoutTabs->addWidget(tabs); // creating all the tab widgets - tab_messages = new qTabMessages (this, myDet); - tab_measurement = new qTabMeasurement (this, myDet,myPlot); - tab_dataoutput = new qTabDataOutput (this, myDet, detID); - tab_plot = new qTabPlot (this, myDet,myPlot); - tab_actions = new qTabActions (this, myDet); - tab_settings = new qTabSettings (this, myDet, detID); - tab_advanced = new qTabAdvanced (this, myDet); - tab_debugging = new qTabDebugging (this, myDet); - tab_developer = new qTabDeveloper (this, myDet); + tab_messages = new qTabMessages (this, myDet); cout<<"Messages ready"<setFloating(false); dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures); tabs->setTabEnabled(Developer,isDeveloper); + if(!digitalDetector) actionExpert->setEnabled(false); + // Other setup //Height of plot and central widget @@ -323,8 +325,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){ tr("Detector Setup files (*.det)")); // Gets called when cancelled as well if (!fName.isEmpty()){ - myDet->retrieveDetectorSetup(string(fName.toAscii().constData())); - qDefs::InfoMessage("The parameters have been successfully setup.","Main"); + if(myDet->retrieveDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL) + qDefs::InfoMessage("The Setup Parameters have been loaded successfully.","Main"); + else qDefs::WarningMessage("The Loading of Setup Parameters has failed.","Main"); } } else if(action==actionSaveSetup){ @@ -337,8 +340,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){ tr("Detector Setup files (*.det) ")); // Gets called when cancelled as well if (!fName.isEmpty()){ - myDet->dumpDetectorSetup(string(fName.toAscii().constData())); - qDefs::InfoMessage("The setup parameters have been successfully saved.","Main"); + if(myDet->dumpDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL) + qDefs::InfoMessage("The Setup Parameters have been saved successfully.","Main"); + else qDefs::WarningMessage("The Saving of Setup Parameters has failed.","Main"); } } else if(action==actionMeasurementWizard){ @@ -356,8 +360,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){ tr("Configuration files (*.config)")); // Gets called when cancelled as well if (!fName.isEmpty()){ - myDet->readConfigurationFile(string(fName.toAscii().constData())); - qDefs::InfoMessage("The parameters have been successfully configured.","Main"); + if(myDet->readConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL) + qDefs::InfoMessage("The Configuration Parameters have been configured successfully.","Main"); + else qDefs::WarningMessage("The Loading of Configuration Parameters has failed.","Main"); } } else if(action==actionSaveConfiguration){ @@ -370,8 +375,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){ tr("Configuration files (*.config) ")); // Gets called when cancelled as well if (!fName.isEmpty()){ - myDet->writeConfigurationFile(string(fName.toAscii().constData())); - qDefs::InfoMessage("The configuration parameters have been successfully saved.","Main"); + if(myDet->writeConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL) + qDefs::InfoMessage("The Configuration Parameters have been saved successfully.","Main"); + else qDefs::WarningMessage("The Saving of Configuration Parameters has failed.","Main"); } } else if(action==actionLoadTrimbits){ @@ -384,8 +390,104 @@ void qDetectorMain::ExecuteUtilities(QAction *action){ tr("Trimbit files (*.trim *.sn*)")); // Gets called when cancelled as well if (!fName.isEmpty()){ - //myDet->readConfigurationFile(string(fName.toAscii().constData())); - qDefs::InfoMessage("The parameters have been successfully configured.","Main"); + if(myDet->loadSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL) + qDefs::InfoMessage("The Trimbits have been loaded successfully.","Main"); + else qDefs::WarningMessage("The Loading of Trimbits has failed.","Main"); + } + } + else if(action==actionSaveTrimbits){ +#ifdef VERBOSE + cout << "Saving Trimbits" << endl; +#endif + QString fName = QString(myDet->getFilePath().c_str()); + fName = QFileDialog::getSaveFileName(this, + tr("Save Current Detector Trimbits"),fName, + tr("Trimbit files (*.trim *.sn*) ")); + // Gets called when cancelled as well + if (!fName.isEmpty()){ + if(myDet->saveSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL) + qDefs::InfoMessage("The Trimbits have been saved successfully.","Main"); + else qDefs::WarningMessage("The Saving of Trimbits has failed.","Main"); + } + } + else if(action==actionLoadCalibration){ +#ifdef VERBOSE + cout << "Loading Calibration Data" << endl; +#endif + QString fName = QString(myDet->getFilePath().c_str()); + fName = QFileDialog::getOpenFileName(this, + tr("Load Detector Calibration Data"),fName, + tr("Calibration files (*.cal *.sn*)")); + // Gets called when cancelled as well + if (!fName.isEmpty()){ + int nMod = myDet->setNumberOfModules(); + slsDetector *detector; + slsDetectorDefs::sls_detector_module *myMod=NULL; + string sFname= fName.toAscii().constData(); + double gain,offset; + for(int i=0;igetSlsDetector(i); + if(detector){ + if (sFname.find(".cal")==string::npos) { + if (sFname.find(".sn")==string::npos && sFname.find(".cal")) { + ostringstream ostfn; + ostfn << sFname << ".sn" << setfill('0') << setw(3) << hex << myDet->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER, i); + fn=ostfn.str(); + }} + if(detector->readCalibrationFile(fn,gain,offset)==-1) + qDefs::WarningMessage(string("Could not open Calibration File.\n")+ fn,"Main"); + else{ + if(myMod = detector->getModule(i)){ + myMod->gain = gain; + myMod->offset = offset; + detector->setModule(*myMod); + detector->deleteModule(myMod); + } + } + } + detector = NULL; + } + + //if(energyConversion::readCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL) + // qDefs::InfoMessage("The Calibration Data have been loaded successfully.","Main"); + //else qDefs::WarningMessage("The Loading of Calibration Data has failed.","Main"); + } + } + else if(action==actionSaveCalibration){ +#ifdef VERBOSE + cout << "Saving Calibration Data" << endl; +#endif + QString fName = QString(myDet->getFilePath().c_str()); + fName = QFileDialog::getSaveFileName(this, + tr("Save Current Detector Calibration Data"),fName, + tr("Calibration files (*.cal *.sn*) ")); + // Gets called when cancelled as well + if (!fName.isEmpty()){ + int nMod = myDet->setNumberOfModules(); + cout<<"nmode:"<getSlsDetector(i); + if(detector){ + ostringstream ostfn; + ostfn << sFname << ".sn" << setfill('0') << setw(3) << hex << myDet->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER, i); + fn=ostfn.str(); + if(myMod = detector->getModule(i)){ + if(detector->writeCalibrationFile(fn,myMod->gain,myMod->offset)==-1) + qDefs::WarningMessage(string("Could not open Calibration File.\n")+ fn,"Main"); + detector->deleteModule(myMod); + } + } + detector = NULL; + } + //if(energyConversion::writeCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL) + // qDefs::InfoMessage("The Calibration Data have been saved successfully.","Main"); + //else qDefs::WarningMessage("The Saving of Calibration Data has failed.","Main"); } } diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 900cd86c6..9e67308c5 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -211,9 +211,14 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){ //get #scansets for level 0 and level 1 int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0); int numScan1 = myDet->getScanSteps(1); numScan1 = ((numScan1==0)?1:numScan1); - int numPos = myDet->getPositions(); numPos = ((numPos==0) ?1:numPos); - number_of_exposures = number_of_frames * numScan0 * numScan1 * numPos; + + number_of_exposures = number_of_frames * numScan0 * numScan1; + if(anglePlot) { + int numPos = myDet->getPositions(); //numPos = ((numPos==0) ?1:numPos); + number_of_exposures = numScan0 * numScan1;/*number_of_exposures * numPos;*/ + + } cout << "\tNumber of Exposures:" << number_of_exposures << endl; // ExposureTime @@ -616,7 +621,7 @@ void qDrawPlot::Clear1DPlot(){ void qDrawPlot::UpdatePlot(){ #ifdef VERYVERBOSE - cout << "Entering UpdatePlot function" << endl; + /*cout << "Entering UpdatePlot function" << endl;*/ #endif plot_update_timer->stop(); @@ -628,7 +633,7 @@ void qDrawPlot::UpdatePlot(){ if(lastImageNumber){ if(histNBins){ #ifdef VERYVERBOSE - cout << "Last Image Number: " << lastImageNumber << endl; + /*cout << "Last Image Number: " << lastImageNumber << endl;*/ #endif Clear1DPlot(); plot1D->SetXTitle(histXAxisTitle.toAscii().constData()); diff --git a/slsDetectorGui/src/qTabDebugging.cpp b/slsDetectorGui/src/qTabDebugging.cpp index 7e77113ec..3dc131bb6 100644 --- a/slsDetectorGui/src/qTabDebugging.cpp +++ b/slsDetectorGui/src/qTabDebugging.cpp @@ -44,13 +44,14 @@ void qTabDebugging::SetupWidgetWindow(){ else lblModule->setText("Module Number:"); // loading combo box module numbers - int max = myDet->setNumberOfModules(GET_FLAG,slsDetectorDefs::X)*myDet->setNumberOfModules(GET_FLAG,slsDetectorDefs::Y); - for(int i=0;isetNumberOfModules(); + +/* for(int i=0;igetSlsDetector(i); if(s->setTCPSocket()!=slsDetectorDefs::FAIL){ comboModule->addItem(QString::number(i)); } - } + }*/ } //------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/slsDetectorGui/src/qTabDeveloper.cpp b/slsDetectorGui/src/qTabDeveloper.cpp index 9abd46c6d..7324d94de 100644 --- a/slsDetectorGui/src/qTabDeveloper.cpp +++ b/slsDetectorGui/src/qTabDeveloper.cpp @@ -154,7 +154,7 @@ void qTabDeveloper::SetupWidgetWindow(){ void qTabDeveloper::Initialization(){ - connect(adcTimer, SIGNAL(timeout()), this, SLOT(RefreshAdcs())); + if(NUM_ADC_WIDGETS) connect(adcTimer, SIGNAL(timeout()), this, SLOT(RefreshAdcs())); for(int i=0;islsDetectorBase::getDetectorType(detType),"Developer"); exit(-1); break; } + return slsDetectorDefs::HUMIDITY; } @@ -316,7 +319,7 @@ void qTabDeveloper::Refresh(){ for(int i=0;isetValue((double)myDet->setDAC(-1,getSLSIndex(i))); //adcs - RefreshAdcs(); + if(NUM_ADC_WIDGETS) RefreshAdcs(); //gotthard -high voltage if(detType == slsDetectorDefs::GOTTHARD){ diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index 318746799..939484f45 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -493,7 +493,7 @@ void qTabPlot::SetFrequency(){ void qTabPlot::EnableScanBox(){ #ifdef VERYVERBOSE - cout << "Entering Enable Scan Box() \t mode:" << mode << " \t id:" << id << endl; + cout << "Entering Enable Scan Box()" << endl; #endif int mode0 = myDet->getScanMode(0); diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index 430046fde..f76a5bad9 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -41,6 +41,9 @@ void qTabSettings::SetupWidgetWindow(){ SetupDetectorSettings(); comboSettings->setCurrentIndex(myDet->getSettings(detID)); + //threshold + spinThreshold->setValue(myDet->getThresholdEnergy()); + //expert mode is not enabled initially lblThreshold->setEnabled(false); spinThreshold->setEnabled(false);