diff --git a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h index 2e6612990..6b5b275f6 100644 --- a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h @@ -49,6 +49,10 @@ #define BASE_ASIC_RDO (0x00500) // 0x1806_0500 - 0x1806_050F // https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/asic_rdo/asic_rdo.vhd +/** Dead time Free Controller */ +#define BASE_DEADTIME_FREE_CTRL (0x00580) // 0x1806_0580 - 0x1806_0587 +// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/DeadTimeFreeController/DeadTimeFreeCtrl.vhd + /* UDP datagram generator */ #define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF @@ -467,4 +471,15 @@ #define ASICRDO_CNFG_RESSTRG_LNGTH_OFST (0) #define ASICRDO_CNFG_RESSTRG_LNGTH_MSK (0x000000FF << ASICRDO_CNFG_RESSTRG_LNGTH_OFST) + +/** Dead time Free Controller + * --------------------------------------------------*/ + +#define DEADTIME_CONFIG_REG (0x00 * REG_OFFSET + BASE_DEADTIME_FREE_CTRL) + +#define DEADTIME_FREE_MODE_ENBL_OFST (0) +#define DEADTIME_FREE_MODE_ENBL_MSK (0x00000001 << DEADTIME_FREE_MODE_ENBL_OFST) +#define DEADTIME_EARLY_EXP_FIN_ERR_OFST (4) +#define DEADTIME_EARLY_EXP_FIN_ERR_MSK (0x00000001 << DEADTIME_EARLY_EXP_FIN_ERR_OFST) + // clang-format on \ No newline at end of file diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index 8db552853..f7bc75cc0 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -573,240 +573,28 @@ int setDynamicRange(int dr) { } } -/* parameters - module, speed, readout */ +/* set parameters - readout */ -int setModule(sls_detector_module myMod, char *mess) { - - LOG(logINFO, ("Setting module\n")); - - /* future implementation - // settings (not yet implemented) - setSettings((enum detectorSettings)myMod.reg); - if (myMod.reg >= 0) { - detectorModules->reg = myMod.reg; - } - - // threshold - if (myMod.eV >= 0) - setThresholdEnergy(myMod.eV); - else { - // (loading a random trim file) (dont return fail) - setSettings(UNDEFINED); - LOG(logERROR, - ("Settings has been changed to undefined (random trim - file)\n")); - } - */ - - // dacs - for (int i = 0; i < NDAC; ++i) { - // ignore dacs with -1 - if (myMod.dacs[i] != -1) { - setDAC((enum DACINDEX)i, myMod.dacs[i], 0); - if (myMod.dacs[i] != detectorDacs[i]) { - sprintf(mess, "Could not set module. Could not set dac %d\n", - i); - LOG(logERROR, (mess)); - // setSettings(UNDEFINED); - // LOG(logERROR, ("Settings has been changed to undefined\n")); - return FAIL; - } - } - } - - // trimbits - if (myMod.nchan == 0) { - LOG(logINFO, ("Setting module without trimbits\n")); - } else { - // set trimbits - if (setTrimbits(myMod.chanregs) == FAIL) { - sprintf(mess, "Could not set module. Could not set trimbits\n"); - LOG(logERROR, (mess)); - // setSettings(UNDEFINED); - // LOG(logERROR, ("Settings has been changed to undefined (random " - // "trim file)\n")); - return FAIL; - } - } - - return OK; -} - -int setBit(int ibit, int patword) { return patword |= (1 << ibit); } - -int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); } - -int setTrimbits(int *trimbits) { - LOG(logINFOBLUE, ("Setting trimbits\n")); - - // validate - for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { - if (trimbits[ichan] < 0 || trimbits[ichan] > 63) { - LOG(logERROR, ("Trimbit value (%d) for channel %d is invalid\n", - trimbits[ichan], ichan)); - return FAIL; - } - } - LOG(logINFO, ("Trimbits validated\n")); - trimmingPrint = logDEBUG5; - - uint64_t patword = 0; - int iaddr = 0; - for (int ichip = 0; ichip < NCHIP; ichip++) { - LOG(logDEBUG1, (" Chip %d\n", ichip)); - iaddr = 0; - patword = 0; - writePatternWord(iaddr++, patword); - - // chip select - patword = setBit(SIGNAL_TBLoad_1 + ichip, patword); - writePatternWord(iaddr++, patword); - - // reset trimbits - patword = setBit(SIGNAL_resStorage, patword); - patword = setBit(SIGNAL_resCounter, patword); - writePatternWord(iaddr++, patword); - writePatternWord(iaddr++, patword); - patword = clearBit(SIGNAL_resStorage, patword); - patword = clearBit(SIGNAL_resCounter, patword); - writePatternWord(iaddr++, patword); - writePatternWord(iaddr++, patword); - - // select first channel - patword = setBit(SIGNAL_CHSserialIN, patword); - writePatternWord(iaddr++, patword); - // 1 clk pulse - patword = setBit(SIGNAL_CHSclk, patword); - writePatternWord(iaddr++, patword); - patword = clearBit(SIGNAL_CHSclk, patword); - // clear 1st channel - writePatternWord(iaddr++, patword); - patword = clearBit(SIGNAL_CHSserialIN, patword); - // 2 clk pulses - for (int i = 0; i < 2; i++) { - patword = setBit(SIGNAL_CHSclk, patword); - writePatternWord(iaddr++, patword); - patword = clearBit(SIGNAL_CHSclk, patword); - writePatternWord(iaddr++, patword); - } - - // for each channel (all chips) - for (int ich = 0; ich < NCHAN_1_COUNTER; ich++) { - LOG(logDEBUG1, (" Chip %d, Channel %d\n", ichip, ich)); - int val = trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS + - NCOUNTERS * ich] + - trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS + - NCOUNTERS * ich + 1] * - 64 + - trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS + - NCOUNTERS * ich + 2] * - 64 * 64; - - // push 6 0 bits - for (int i = 0; i < 6; i++) { - patword = clearBit(SIGNAL_serialIN, patword); - patword = clearBit(SIGNAL_clk, patword); - writePatternWord(iaddr++, patword); - patword = setBit(SIGNAL_clk, patword); - writePatternWord(iaddr++, patword); - } - - // deserialize - for (int i = 0; i < 18; i++) { - if (val & (1 << i)) { - patword = setBit(SIGNAL_serialIN, patword); - } else { - patword = clearBit(SIGNAL_serialIN, patword); - } - patword = clearBit(SIGNAL_clk, patword); - writePatternWord(iaddr++, patword); - - patword = setBit(SIGNAL_clk, patword); - writePatternWord(iaddr++, patword); - } - writePatternWord(iaddr++, patword); - writePatternWord(iaddr++, patword); - - // move to next channel - for (int i = 0; i < 3; i++) { - patword = setBit(SIGNAL_CHSclk, patword); - writePatternWord(iaddr++, patword); - patword = clearBit(SIGNAL_CHSclk, patword); - writePatternWord(iaddr++, patword); - } - } - // chip unselect - patword = clearBit(SIGNAL_TBLoad_1 + ichip, patword); - writePatternWord(iaddr++, patword); - - // last iaddr check - if (iaddr >= MAX_PATTERN_LENGTH) { - LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n", - iaddr, MAX_PATTERN_LENGTH)); - trimmingPrint = logINFO; - return FAIL; - } - - // set pattern wait address - for (int i = 0; i <= 2; i++) - setPatternWaitAddress(i, MAX_PATTERN_LENGTH - 1); - - // pattern loop - for (int i = 0; i <= 2; i++) { - int stop = MAX_PATTERN_LENGTH - 1, nloop = 0; - setPatternLoop(i, &stop, &stop, &nloop); - } - - // pattern limits - { - int start = 0, nloop = 0; - setPatternLoop(-1, &start, &iaddr, &nloop); - } - // send pattern to the chips - startPattern(); - } - - // copy trimbits locally - for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { - detectorChans[ichan] = trimbits[ichan]; - } - trimmingPrint = logINFO; - LOG(logINFO, ("All trimbits have been loaded\n")); - return OK; -} - -int setAllTrimbits(int val) { - int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan)); - for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { - trimbits[ichan] = val; - } - if (setTrimbits(trimbits) == FAIL) { - LOG(logERROR, ("Could not set all trimbits to %d\n", val)); - free(trimbits); +int setParallelMode(int mode) { + if (mode < 0) return FAIL; + LOG(logINFO, ("Setting %s mode\n", (mode ? "Parallel" : "Non Parallel"))); + uint32_t addr = DEADTIME_CONFIG_REG; + if (mode) { + bus_w(addr, bus_r(addr) | DEADTIME_FREE_MODE_ENBL_MSK); + } else { + bus_w(addr, bus_r(addr) & ~DEADTIME_FREE_MODE_ENBL_MSK); } - // setSettings(UNDEFINED); - // LOG(logERROR, ("Settings has been changed to undefined (random " - // "trim file)\n")); - LOG(logINFO, ("All trimbits have been set to %d\n", val)); - free(trimbits); return OK; } -int getAllTrimbits() { - int value = detectorChans[0]; - if (detectorModules) { - for (int ichan = 0; ichan < ((detectorModules)->nchan); ichan++) { - if (detectorChans[ichan] != value) { - value = -1; - break; - } - } - } - LOG(logINFO, ("Value of all Trimbits: %d\n", value)); - return value; +int getParallelMode() { + return ((bus_r(DEADTIME_CONFIG_REG) & DEADTIME_FREE_MODE_ENBL_MSK) >> + DEADTIME_FREE_MODE_ENBL_OFST); } +/* parameters - timer */ + void setNumFrames(int64_t val) { if (val > 0) { LOG(logINFO, ("Setting number of frames %lld\n", (long long int)val)); @@ -1148,6 +936,240 @@ int64_t getMeasurementTime() { (1E-9 * FIXED_PLL_FREQUENCY); } +/* parameters - module, speed, readout */ + +int setModule(sls_detector_module myMod, char *mess) { + + LOG(logINFO, ("Setting module\n")); + + /* future implementation + // settings (not yet implemented) + setSettings((enum detectorSettings)myMod.reg); + if (myMod.reg >= 0) { + detectorModules->reg = myMod.reg; + } + + // threshold + if (myMod.eV >= 0) + setThresholdEnergy(myMod.eV); + else { + // (loading a random trim file) (dont return fail) + setSettings(UNDEFINED); + LOG(logERROR, + ("Settings has been changed to undefined (random trim + file)\n")); + } + */ + + // dacs + for (int i = 0; i < NDAC; ++i) { + // ignore dacs with -1 + if (myMod.dacs[i] != -1) { + setDAC((enum DACINDEX)i, myMod.dacs[i], 0); + if (myMod.dacs[i] != detectorDacs[i]) { + sprintf(mess, "Could not set module. Could not set dac %d\n", + i); + LOG(logERROR, (mess)); + // setSettings(UNDEFINED); + // LOG(logERROR, ("Settings has been changed to undefined\n")); + return FAIL; + } + } + } + + // trimbits + if (myMod.nchan == 0) { + LOG(logINFO, ("Setting module without trimbits\n")); + } else { + // set trimbits + if (setTrimbits(myMod.chanregs) == FAIL) { + sprintf(mess, "Could not set module. Could not set trimbits\n"); + LOG(logERROR, (mess)); + // setSettings(UNDEFINED); + // LOG(logERROR, ("Settings has been changed to undefined (random " + // "trim file)\n")); + return FAIL; + } + } + + return OK; +} + +int setBit(int ibit, int patword) { return patword |= (1 << ibit); } + +int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); } + +int setTrimbits(int *trimbits) { + LOG(logINFOBLUE, ("Setting trimbits\n")); + + // validate + for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { + if (trimbits[ichan] < 0 || trimbits[ichan] > 63) { + LOG(logERROR, ("Trimbit value (%d) for channel %d is invalid\n", + trimbits[ichan], ichan)); + return FAIL; + } + } + LOG(logINFO, ("Trimbits validated\n")); + trimmingPrint = logDEBUG5; + + uint64_t patword = 0; + int iaddr = 0; + for (int ichip = 0; ichip < NCHIP; ichip++) { + LOG(logDEBUG1, (" Chip %d\n", ichip)); + iaddr = 0; + patword = 0; + writePatternWord(iaddr++, patword); + + // chip select + patword = setBit(SIGNAL_TBLoad_1 + ichip, patword); + writePatternWord(iaddr++, patword); + + // reset trimbits + patword = setBit(SIGNAL_resStorage, patword); + patword = setBit(SIGNAL_resCounter, patword); + writePatternWord(iaddr++, patword); + writePatternWord(iaddr++, patword); + patword = clearBit(SIGNAL_resStorage, patword); + patword = clearBit(SIGNAL_resCounter, patword); + writePatternWord(iaddr++, patword); + writePatternWord(iaddr++, patword); + + // select first channel + patword = setBit(SIGNAL_CHSserialIN, patword); + writePatternWord(iaddr++, patword); + // 1 clk pulse + patword = setBit(SIGNAL_CHSclk, patword); + writePatternWord(iaddr++, patword); + patword = clearBit(SIGNAL_CHSclk, patword); + // clear 1st channel + writePatternWord(iaddr++, patword); + patword = clearBit(SIGNAL_CHSserialIN, patword); + // 2 clk pulses + for (int i = 0; i < 2; i++) { + patword = setBit(SIGNAL_CHSclk, patword); + writePatternWord(iaddr++, patword); + patword = clearBit(SIGNAL_CHSclk, patword); + writePatternWord(iaddr++, patword); + } + + // for each channel (all chips) + for (int ich = 0; ich < NCHAN_1_COUNTER; ich++) { + LOG(logDEBUG1, (" Chip %d, Channel %d\n", ichip, ich)); + int val = trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS + + NCOUNTERS * ich] + + trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS + + NCOUNTERS * ich + 1] * + 64 + + trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS + + NCOUNTERS * ich + 2] * + 64 * 64; + + // push 6 0 bits + for (int i = 0; i < 6; i++) { + patword = clearBit(SIGNAL_serialIN, patword); + patword = clearBit(SIGNAL_clk, patword); + writePatternWord(iaddr++, patword); + patword = setBit(SIGNAL_clk, patword); + writePatternWord(iaddr++, patword); + } + + // deserialize + for (int i = 0; i < 18; i++) { + if (val & (1 << i)) { + patword = setBit(SIGNAL_serialIN, patword); + } else { + patword = clearBit(SIGNAL_serialIN, patword); + } + patword = clearBit(SIGNAL_clk, patword); + writePatternWord(iaddr++, patword); + + patword = setBit(SIGNAL_clk, patword); + writePatternWord(iaddr++, patword); + } + writePatternWord(iaddr++, patword); + writePatternWord(iaddr++, patword); + + // move to next channel + for (int i = 0; i < 3; i++) { + patword = setBit(SIGNAL_CHSclk, patword); + writePatternWord(iaddr++, patword); + patword = clearBit(SIGNAL_CHSclk, patword); + writePatternWord(iaddr++, patword); + } + } + // chip unselect + patword = clearBit(SIGNAL_TBLoad_1 + ichip, patword); + writePatternWord(iaddr++, patword); + + // last iaddr check + if (iaddr >= MAX_PATTERN_LENGTH) { + LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n", + iaddr, MAX_PATTERN_LENGTH)); + trimmingPrint = logINFO; + return FAIL; + } + + // set pattern wait address + for (int i = 0; i <= 2; i++) + setPatternWaitAddress(i, MAX_PATTERN_LENGTH - 1); + + // pattern loop + for (int i = 0; i <= 2; i++) { + int stop = MAX_PATTERN_LENGTH - 1, nloop = 0; + setPatternLoop(i, &stop, &stop, &nloop); + } + + // pattern limits + { + int start = 0, nloop = 0; + setPatternLoop(-1, &start, &iaddr, &nloop); + } + // send pattern to the chips + startPattern(); + } + + // copy trimbits locally + for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { + detectorChans[ichan] = trimbits[ichan]; + } + trimmingPrint = logINFO; + LOG(logINFO, ("All trimbits have been loaded\n")); + return OK; +} + +int setAllTrimbits(int val) { + int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan)); + for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { + trimbits[ichan] = val; + } + if (setTrimbits(trimbits) == FAIL) { + LOG(logERROR, ("Could not set all trimbits to %d\n", val)); + free(trimbits); + return FAIL; + } + // setSettings(UNDEFINED); + // LOG(logERROR, ("Settings has been changed to undefined (random " + // "trim file)\n")); + LOG(logINFO, ("All trimbits have been set to %d\n", val)); + free(trimbits); + return OK; +} + +int getAllTrimbits() { + int value = detectorChans[0]; + if (detectorModules) { + for (int ichan = 0; ichan < ((detectorModules)->nchan); ichan++) { + if (detectorChans[ichan] != value) { + value = -1; + break; + } + } + } + LOG(logINFO, ("Value of all Trimbits: %d\n", value)); + return value; +} + /* parameters - dac, hv */ void setDAC(enum DACINDEX ind, int val, int mV) { if (val < 0) { @@ -2318,8 +2340,17 @@ enum runStatus getRunStatus() { // not running else { + // error from too short exptime in parallel mode + uint32_t deadtimeReg = bus_r(DEADTIME_CONFIG_REG); + if ((deadtimeReg & DEADTIME_EARLY_EXP_FIN_ERR_MSK) >> + DEADTIME_EARLY_EXP_FIN_ERR_OFST) { + LOG(logERROR, + ("Status: ERROR in Dead Time Reg (too short exptime) %08x\n", + deadtimeReg)); + s = ERROR; + } // stopped or error - if (retval & FLOW_STATUS_FIFO_FULL_MSK) { + else if (retval & FLOW_STATUS_FIFO_FULL_MSK) { LOG(logINFOBLUE, ("Status: STOPPED\n")); // FIFO FULL?? s = STOPPED; } else if (retval & FLOW_STATUS_CSM_BUSY_MSK) { diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 613f40554..6f513744a 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -179,9 +179,11 @@ int setExternalSampling(int val); #endif // parameters - readout -#ifdef EIGERD +#if defined(EIGERD) || defined(MYTHEN3D) int setParallelMode(int mode); int getParallelMode(); +#endif +#ifdef EIGERD int setOverFlowMode(int mode); int getOverFlowMode(); #endif @@ -277,9 +279,9 @@ int64_t getMeasurementTime(); int setModule(sls_detector_module myMod, char *mess); #endif #ifdef MYTHEN3D -int setTrimbits(int *trimbits); int setBit(int ibit, int patword); int clearBit(int ibit, int patword); +int setTrimbits(int *trimbits); int setAllTrimbits(int val); int getAllTrimbits(); #endif diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index adc94c79c..b04b4db30 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -5427,7 +5427,7 @@ int set_parallel_mode(int file_des) { return printSocketReadError(); LOG(logINFO, ("Setting parallel mode: %u\n", arg)); -#ifndef EIGERD +#if !defined(EIGERD) && !defined(MYTHEN3D) functionNotImplemented(); #else // only set @@ -5458,7 +5458,7 @@ int get_parallel_mode(int file_des) { LOG(logDEBUG1, ("Getting parallel mode\n")); -#ifndef EIGERD +#if !defined(EIGERD) && !defined(MYTHEN3D) functionNotImplemented(); #else // get only diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 07781ad13..74701b48c 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -393,6 +393,14 @@ class Detector { void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value, Positions pos = {}); + /** [Eiger][Mythen3] */ + Result getParallelMode(Positions pos = {}) const; + + /** [Eiger][Mythen3] + * [Mythen3] If exposure time is too short, acquisition will return with an + * ERROR and take fewer frames than expected */ + void setParallelMode(bool value, Positions pos = {}); + /************************************************** * * * Acquisition * @@ -853,12 +861,6 @@ class Detector { /** [Eiger] Directory where settings files are loaded from/to */ void setSettingsPath(const std::string &value, Positions pos = {}); - /** [Eiger] */ - Result getParallelMode(Positions pos = {}) const; - - /** [Eiger] */ - void setParallelMode(bool value, Positions pos = {}); - /** [Eiger] */ Result getOverFlowMode(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index de335edd6..20874fcc0 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -682,6 +682,7 @@ class CmdProxy { {"powerchip", &CmdProxy::powerchip}, {"imagetest", &CmdProxy::imagetest}, {"extsig", &CmdProxy::ExternalSignal}, + {"parallel", &CmdProxy::parallel}, /** temperature */ {"templist", &CmdProxy::templist}, @@ -849,7 +850,6 @@ class CmdProxy { {"threshold", &CmdProxy::Threshold}, {"thresholdnotb", &CmdProxy::ThresholdNoTb}, {"settingspath", &CmdProxy::settingspath}, - {"parallel", &CmdProxy::parallel}, {"overflow", &CmdProxy::overflow}, {"flippeddatax", &CmdProxy::flippeddatax}, {"trimen", &CmdProxy::TrimEnergies}, @@ -1247,6 +1247,12 @@ class CmdProxy { "\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel " "intensity incremented by 1. If 1, all pixels almost saturated."); + INTEGER_COMMAND(parallel, getParallelMode, setParallelMode, StringTo, + "[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel " + "mode.\n\t[Mythen3] If exptime is too short, the " + "acquisition will return ERROR status and take fewer " + "frames than expected."); + /** temperature */ GET_COMMAND_NOID( templist, getTemperatureList, @@ -1913,9 +1919,6 @@ class CmdProxy { settingspath, getSettingsPath, setSettingsPath, "[path]\n\t[Eiger] Directory where settings files are loaded from/to."); - INTEGER_COMMAND(parallel, getParallelMode, setParallelMode, StringTo, - "[0, 1]\n\t[Eiger] Enable or disable parallel mode."); - INTEGER_COMMAND(overflow, getOverFlowMode, setOverFlowMode, StringTo, "[0, 1]\n\t[Eiger] Enable or disable show overflow flag in " "32 bit mode. Default is disabled."); diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 08300c353..2e17f2ff7 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -575,6 +575,14 @@ void Detector::setExternalSignalFlags(int signalIndex, pimpl->Parallel(&Module::setExternalSignalFlags, pos, signalIndex, value); } +Result Detector::getParallelMode(Positions pos) const { + return pimpl->Parallel(&Module::getParallelMode, pos); +} + +void Detector::setParallelMode(bool value, Positions pos) { + pimpl->Parallel(&Module::setParallelMode, pos, value); +} + // Acquisition void Detector::acquire() { pimpl->acquire(); } @@ -1129,14 +1137,6 @@ void Detector::setSettingsPath(const std::string &value, Positions pos) { pimpl->Parallel(&Module::setSettingsDir, pos, value); } -Result Detector::getParallelMode(Positions pos) const { - return pimpl->Parallel(&Module::getParallelMode, pos); -} - -void Detector::setParallelMode(bool value, Positions pos) { - pimpl->Parallel(&Module::setParallelMode, pos, value); -} - Result Detector::getOverFlowMode(Positions pos) const { return pimpl->Parallel(&Module::getOverFlowMode, pos); } diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 2f0c344d2..92fc0dce3 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -382,6 +382,14 @@ void Module::setExternalSignalFlags(int signalIndex, externalSignalFlag type) { sendToDetector(F_SET_EXTERNAL_SIGNAL_FLAG, args, nullptr); } +bool Module::getParallelMode() const { + return sendToDetector(F_GET_PARALLEL_MODE); +} + +void Module::setParallelMode(const bool enable) { + sendToDetector(F_SET_PARALLEL_MODE, static_cast(enable), nullptr); +} + // Acquisition void Module::startReceiver() { @@ -1108,14 +1116,6 @@ std::string Module::setSettingsDir(const std::string &dir) { return shm()->settingsDir; } -bool Module::getParallelMode() const { - return sendToDetector(F_GET_PARALLEL_MODE); -} - -void Module::setParallelMode(const bool enable) { - sendToDetector(F_SET_PARALLEL_MODE, static_cast(enable), nullptr); -} - bool Module::getOverFlowMode() const { return sendToDetector(F_GET_OVERFLOW_MODE); } diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index db392fac1..9d1dd28bd 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -149,6 +149,8 @@ class Module : public virtual slsDetectorDefs { int value); externalSignalFlag getExternalSignalFlags(int signalIndex) const; void setExternalSignalFlags(int signalIndex, externalSignalFlag type); + bool getParallelMode() const; + void setParallelMode(const bool enable); /************************************************** * * @@ -303,8 +305,6 @@ class Module : public virtual slsDetectorDefs { bool trimbits); std::string getSettingsDir() const; std::string setSettingsDir(const std::string &dir); - bool getParallelMode() const; - void setParallelMode(const bool enable); bool getOverFlowMode() const; void setOverFlowMode(const bool enable); bool getFlippedDataX() const;