diff --git a/slsDetectorGui/include/qTabDeveloper.h b/slsDetectorGui/include/qTabDeveloper.h index 211469978..08795c96e 100755 --- a/slsDetectorGui/include/qTabDeveloper.h +++ b/slsDetectorGui/include/qTabDeveloper.h @@ -42,7 +42,7 @@ private: HV_180, HV_200 }; - + int hvmin; static const int HV_MIN = 60; static const int HV_MAX = 200; }; diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index 44fdf0a7d..bd1ccd7f2 100755 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -228,6 +228,7 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) { case slsDetectorDefs::GOTTHARD: case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::MOENCH: + case slsDetectorDefs::MYTHEN3: break; default: std::ostringstream os; diff --git a/slsDetectorGui/src/qTabDeveloper.cpp b/slsDetectorGui/src/qTabDeveloper.cpp index ea8b4904a..6291fb026 100755 --- a/slsDetectorGui/src/qTabDeveloper.cpp +++ b/slsDetectorGui/src/qTabDeveloper.cpp @@ -19,6 +19,7 @@ void qTabDeveloper::SetupWidgetWindow() { lblComboHV->hide(); lblSpinHV->hide(); spinHV->hide(); + hvmin = HV_MIN; try{ slsDetectorDefs::detectorType detType = det->getDetectorType().squash(); @@ -91,6 +92,27 @@ void qTabDeveloper::SetupWidgetWindow() { dacWidgets.push_back(new qDacWidget(this, det, true, "i Dac 7: ", getSLSIndex(detType, tempid++))); break; + case slsDetectorDefs::MYTHEN3: + lblSpinHV->show(); + spinHV->show(); + hvmin = 0; + dacWidgets.push_back(new qDacWidget(this, det, true, "vcassh: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vth2: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vshaper: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vshaperneg: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vipre_out: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vth3: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vth1: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vicin: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vcas: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vpreamp: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vph: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "vipre: ", getSLSIndex(detType, tempid++))); + dacWidgets.push_back(new qDacWidget(this, det, true, "viinsh: ", getSLSIndex(detType, tempid++))); + 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; default: break; } @@ -145,7 +167,7 @@ void qTabDeveloper::GetHighVoltage() { auto retval = det->getHighVoltage({comboDetector->currentIndex() - 1}).tsquash("Inconsistent values for high voltage."); //spinHV if (spinHV->isVisible()) { - if (retval != 0 && retval < HV_MIN && retval > HV_MAX) { + if (retval != 0 && retval < hvmin && retval > HV_MAX) { throw sls::RuntimeError(std::string("Unknown High Voltage: ") + std::to_string(retval)); } spinHV->setValue(retval); @@ -306,6 +328,45 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorTy } throw sls::RuntimeError(std::string("Unknown dac/adc index") + std::to_string(index)); + case slsDetectorDefs::MYTHEN3: + switch (index) { + case 0: + return slsDetectorDefs::CASSH; + case 1: + return slsDetectorDefs::VTH2; + case 2: + return slsDetectorDefs::SHAPER1; + case 3: + return slsDetectorDefs::SHAPER2; + case 4: + return slsDetectorDefs::VIPRE_OUT; + case 5: + return slsDetectorDefs::VTH3; + case 6: + return slsDetectorDefs::THRESHOLD; + case 7: + return slsDetectorDefs::VICIN; + case 8: + return slsDetectorDefs::CAS; + case 9: + return slsDetectorDefs::PREAMP; + case 10: + return slsDetectorDefs::CALIBRATION_PULSE; + case 11: + return slsDetectorDefs::VIPRE; + case 12: + return slsDetectorDefs::VIINSH; + case 13: + return slsDetectorDefs::VPL; + case 14: + return slsDetectorDefs::TRIMBIT_SIZE; + case 15: + return slsDetectorDefs::VDCSH; + 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 85a0b150e..a43d3f5c8 100755 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -59,6 +59,7 @@ void qTabPlot::SetupWidgetWindow() { is1d = false; switch(det->getDetectorType().squash()) { case slsDetectorDefs::GOTTHARD: + case slsDetectorDefs::MYTHEN3: is1d = true; break; case slsDetectorDefs::EIGER: diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index ab289b97b..ceb0e3fff 100755 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -21,6 +21,7 @@ void qTabSettings::SetupWidgetWindow() { // enabling according to det type switch(det->getDetectorType().squash()) { case slsDetectorDefs::MOENCH: + case slsDetectorDefs::MYTHEN3: lblSettings->setEnabled(false); comboSettings->setEnabled(false); break; diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 6f841763b..fa68c2033 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index 6e49204e2..11e64b153 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -375,6 +375,7 @@ void setupDetector() { setExpTime(DEFAULT_EXPTIME); setPeriod(DEFAULT_PERIOD); setDelayAfterTrigger(DEFAULT_DELAY_AFTER_TRIGGER); + setTiming(DEFAULT_TIMING_MODE); } int setDefaultDacs() { @@ -644,6 +645,16 @@ int setHighVoltage(int val){ } +/* parameters - timing */ +void setTiming( enum timingMode arg){ + // to be implemented +} + +enum timingMode getTiming() { + return AUTO_TIMING; +} + + int configureMAC() { uint32_t srcip = udpDetails.srcip; diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h index 4ced84856..19269bbc6 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h @@ -7,7 +7,7 @@ #define CTRL_SRVR_INIT_TIME_US (300 * 1000) /* Hardware Definitions */ -#define NCHAN (128) +#define NCHAN (128 * 3) #define NCHIP (10) #define NDAC (16) #define HV_SOFT_MAX_VOLTAGE (200) @@ -24,6 +24,7 @@ #define DEFAULT_PERIOD (2*1000*1000) //ns #define DEFAULT_DELAY_AFTER_TRIGGER (0) #define DEFAULT_HIGH_VOLTAGE (0) +#define DEFAULT_TIMING_MODE (AUTO_TIMING) #define DEFAULT_READOUT_C0 (125000000) // rdo_clk, 125 MHz #define DEFAULT_READOUT_C1 (250000000) // rdo_x2_clk, 250 MHz #define DEFAULT_SYSTEM_C0 (250000000) // run_clk, 250 MHz diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 01cc84f0b..6a00e5ddb 100755 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -286,7 +286,7 @@ int setHighVoltage(int val); // parameters - timing, extsig -#if !defined(MYTHEN3D) && !defined(GOTTHARD2D) +#if !defined(GOTTHARD2D) void setTiming( enum timingMode arg); enum timingMode getTiming(); #endif diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 01db16f8d..4a44cc69e 100755 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -677,7 +677,7 @@ int set_timing_mode(int file_des) { return printSocketReadError(); FILE_LOG(logDEBUG1, ("Setting external communication mode to %d\n", arg)); -#if defined(MYTHEN3D) || defined(GOTTHARD2D) +#ifdef GOTTHARD2D functionNotImplemented(); #else diff --git a/slsDetectorSoftware/src/multiSlsDetector.cpp b/slsDetectorSoftware/src/multiSlsDetector.cpp index 071785501..67d25a92a 100755 --- a/slsDetectorSoftware/src/multiSlsDetector.cpp +++ b/slsDetectorSoftware/src/multiSlsDetector.cpp @@ -700,7 +700,7 @@ void multiSlsDetector::readFrameFromReceiver() { currentFileIndex); } dataReady(thisData, currentFrameIndex, - ((dynamicRange == 32) ? currentSubFrameIndex : -1), + ((dynamicRange == 32 && eiger) ? currentSubFrameIndex : -1), pCallbackArg); delete thisData; } diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 5be97e005..aaec89199 100755 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -992,16 +992,19 @@ int Implementation::setNumberofDigitalSamples(const uint32_t i) { } int Implementation::setDynamicRange(const uint32_t i) { - // only eiger + if (dynamicRange != i) { dynamicRange = i; - generalData->SetDynamicRange(i, tengigaEnable); - generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, quadEnable); - // to update npixelsx, npixelsy in file writer - for (const auto &it : dataProcessor) - it->SetPixelDimension(); - if (SetupFifoStructure() == FAIL) - return FAIL; + + if (myDetectorType == EIGER) { + generalData->SetDynamicRange(i, tengigaEnable); + generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, quadEnable); + // to update npixelsx, npixelsy in file writer + for (const auto &it : dataProcessor) + it->SetPixelDimension(); + if (SetupFifoStructure() == FAIL) + return FAIL; + } } FILE_LOG(logINFO) << "Dynamic Range: " << dynamicRange; return OK; diff --git a/slsSupportLib/include/sls_detector_defs.h b/slsSupportLib/include/sls_detector_defs.h index b1704852b..12e2ae757 100755 --- a/slsSupportLib/include/sls_detector_defs.h +++ b/slsSupportLib/include/sls_detector_defs.h @@ -520,7 +520,7 @@ struct detParameters { nGappixelsY = 1; break; case slsDetectorDefs::detectorType::MYTHEN3: - nChanX = 128; + nChanX = 128 * 3; nChanY = 1; nChipX = 10; nChipY = 1; diff --git a/slsSupportLib/include/versionAPI.h b/slsSupportLib/include/versionAPI.h index 3c93e68e8..441bbc71b 100644 --- a/slsSupportLib/include/versionAPI.h +++ b/slsSupportLib/include/versionAPI.h @@ -8,5 +8,5 @@ #define APIGOTTHARD 0x191111 #define APIJUNGFRAU 0x191111 #define APIEIGER 0x191111 -#define APIMYTHEN3 0x191111 #define APIGOTTHARD2 0x191115 +#define APIMYTHEN3 0x191118