diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index c9b95bcc9..b6b8a2b5d 100755 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -160,4 +160,5 @@ class qDrawPlot : public QWidget, private Ui::PlotObject { unsigned int nPixelsY{0}; const static int npixelsx_jctb = 400; int npixelsy_jctb{0}; + uint32_t pixelMask{0}; }; diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index 01621fca9..47fda49ec 100755 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -229,6 +229,7 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) { case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::MOENCH: case slsDetectorDefs::MYTHEN3: + case slsDetectorDefs::GOTTHARD2: break; default: std::ostringstream os; @@ -446,7 +447,7 @@ void qDetectorMain::ExecuteHelp(QAction *action) { clientVersion + "

" "Common GUI to control the SLS Detectors: " - "Eiger, Gotthard, Jungfrau and Moench.

" + "Eiger, Jungfrau, Mythen3, Gotthard, Gotthard2 and Moench.

" "It can be operated in parallel with the command " "line interface:
" "sls_detector_put,
sls_detector_get,
sls_" diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 88a56cd64..e101a042f 100755 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -52,6 +52,19 @@ qDrawPlot::~qDrawPlot() { void qDrawPlot::SetupWidgetWindow() { detType = det->getDetectorType().squash(); + switch (detType) { + case slsDetectorDefs::JUNGFRAU: + case slsDetectorDefs::MOENCH: + pixelMask = ((1 << 15) - 1); + FILE_LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask << std::dec; + break; + case slsDetectorDefs::GOTTHARD2: + pixelMask = ((1 << 13) - 1); + FILE_LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask << std::dec; + break; + default: + break; + } // save try { std::string temp = det->getFilePath().squash("/tmp/"); @@ -879,7 +892,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data int halfbyte = 0; char cbyte = '\0'; - // mythen 3 debugging + // mythen3 / gotthard2 debugging int discardBits = numDiscardBits; switch (dr) { @@ -903,14 +916,15 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data case 16: if (detType == slsDetectorDefs::JUNGFRAU || - detType == slsDetectorDefs::MOENCH) { + detType == slsDetectorDefs::MOENCH || + detType == slsDetectorDefs::GOTTHARD2) { // show gain plot if (gaindest != NULL) { for (ichan = 0; ichan < size; ++ichan) { uint16_t temp = (*((u_int16_t *)source)); gaindest[ichan] = ((temp & 0xC000) >> 14); - dest[ichan] = (temp & 0x3FFF); + dest[ichan] = (temp & pixelMask); source += 2; } } @@ -918,7 +932,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data // only data plot else { for (ichan = 0; ichan < size; ++ichan) { - dest[ichan] = ((*((u_int16_t *)source)) & 0x3FFF); + dest[ichan] = ((*((u_int16_t *)source)) & pixelMask); source += 2; } } diff --git a/slsDetectorGui/src/qTabAdvanced.cpp b/slsDetectorGui/src/qTabAdvanced.cpp index 31a683cfe..e19678940 100755 --- a/slsDetectorGui/src/qTabAdvanced.cpp +++ b/slsDetectorGui/src/qTabAdvanced.cpp @@ -30,6 +30,7 @@ void qTabAdvanced::SetupWidgetWindow() { tab_roi->setEnabled(true); break; case slsDetectorDefs::MYTHEN3: + case slsDetectorDefs::GOTTHARD2: lblDiscardBits->setEnabled(true); spinDiscardBits->setEnabled(true); default: diff --git a/slsDetectorGui/src/qTabDeveloper.cpp b/slsDetectorGui/src/qTabDeveloper.cpp index 6291fb026..1fe5c5332 100755 --- a/slsDetectorGui/src/qTabDeveloper.cpp +++ b/slsDetectorGui/src/qTabDeveloper.cpp @@ -112,7 +112,27 @@ void qTabDeveloper::SetupWidgetWindow() { dacWidgets.push_back(new qDacWidget(this, det, true, "vpl: ", getSLSIndex(detType, tempid++))); dacWidgets.push_back(new qDacWidget(this, det, true, "vtrim: ", getSLSIndex(detType, tempid++))); dacWidgets.push_back(new qDacWidget(this, det, true, "vdcsh: ", getSLSIndex(detType, tempid++))); - break; + break; + + case slsDetectorDefs::GOTTHARD2: + lblSpinHV->show(); + spinHV->show(); + hvmin = 0; + dacWidgets.push_back(new qDacWidget(this, det, true, "vref_h_adc: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vb_comp_fe: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vb_comp_adc: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vcom_cds: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vref_rstore: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vb_opa_1st: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vref_comp_fe: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vcom_adc1: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vref_prech: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vref_l_adc: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vref_cds: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vb_cs: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vb_opa_fd: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vcom_adc2: ", getSLSIndex(detType, tempid++))); + break; default: break; } @@ -367,6 +387,41 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorTy } break; + case slsDetectorDefs::GOTTHARD2: + switch (index) { + case 0: + return slsDetectorDefs::VREF_H_ADC; + case 1: + return slsDetectorDefs::VB_COMP_FE; + case 2: + return slsDetectorDefs::VB_COMP_ADC; + case 3: + return slsDetectorDefs::VCOM_CDS; + case 4: + return slsDetectorDefs::VREF_RSTORE; + case 5: + return slsDetectorDefs::VB_OPA_1ST; + case 6: + return slsDetectorDefs::VREF_COMP_FE; + case 7: + return slsDetectorDefs::VCOM_ADC1; + case 8: + return slsDetectorDefs::VREF_PRECH; + case 9: + return slsDetectorDefs::VREF_L_ADC; + case 10: + return slsDetectorDefs::VREF_CDS; + case 11: + return slsDetectorDefs::VB_CS; + case 12: + return slsDetectorDefs::VB_OPA_FD; + case 13: + return slsDetectorDefs::VCOM_ADC2; + default: + throw sls::RuntimeError(std::string("Unknown dac/adc index") + std::to_string(index)); + } + break; + default: throw sls::RuntimeError(std::string("Unknown detector type")); } diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index a43d3f5c8..e9322eafa 100755 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -60,6 +60,7 @@ void qTabPlot::SetupWidgetWindow() { switch(det->getDetectorType().squash()) { case slsDetectorDefs::GOTTHARD: case slsDetectorDefs::MYTHEN3: + case slsDetectorDefs::GOTTHARD2: is1d = true; break; case slsDetectorDefs::EIGER: diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index ceb0e3fff..10489db8e 100755 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -83,6 +83,11 @@ void qTabSettings::SetupDetectorSettings() { item[(int)FORCESWITCHG1]->setEnabled(true); item[(int)FORCESWITCHG2]->setEnabled(true); break; + case slsDetectorDefs::GOTTHARD2: + item[(int)DYNAMICGAIN]->setEnabled(true); + item[(int)FIXGAIN1]->setEnabled(true); + item[(int)FIXGAIN2]->setEnabled(true); + break; default: FILE_LOG(logDEBUG) << "Unknown detector type. Exiting GUI."; qDefs::Message(qDefs::CRITICAL,