diff --git a/docs/src/pyenums.rst b/docs/src/pyenums.rst index 4143ac4b1..90013e301 100644 --- a/docs/src/pyenums.rst +++ b/docs/src/pyenums.rst @@ -67,9 +67,6 @@ exposed to Python through pybind11. .. autoclass:: readoutMode :undoc-members: -.. autoclass:: masterFlags - :undoc-members: - .. autoclass:: burstMode :undoc-members: diff --git a/docs/src/pygettingstarted.rst b/docs/src/pygettingstarted.rst index 6592d4276..f84f25a53 100644 --- a/docs/src/pygettingstarted.rst +++ b/docs/src/pygettingstarted.rst @@ -219,7 +219,7 @@ The enums can be found in slsdet.enums >>> [e for e in dir(slsdet.enums) if not e.startswith('_')] ['burstMode', 'clockIndex', 'dacIndex', 'detectorSettings', 'detectorType', 'dimension', 'externalSignalFlag', - 'fileFormat', 'frameDiscardPolicy', 'masterFlags', + 'fileFormat', 'frameDiscardPolicy', 'readoutMode', 'runStatus', 'speedLevel', 'timingMode', 'timingSourceType'] diff --git a/python/slsdet/enums.py b/python/slsdet/enums.py index 6c42c454b..48c2d51b3 100644 --- a/python/slsdet/enums.py +++ b/python/slsdet/enums.py @@ -12,7 +12,6 @@ dacIndex = _slsdet.slsDetectorDefs.dacIndex detectorSettings = _slsdet.slsDetectorDefs.detectorSettings clockIndex = _slsdet.slsDetectorDefs.clockIndex readoutMode = _slsdet.slsDetectorDefs.readoutMode -masterFlags = _slsdet.slsDetectorDefs.masterFlags burstMode = _slsdet.slsDetectorDefs.burstMode timingSourceType = _slsdet.slsDetectorDefs.timingSourceType M3_GainCaps = _slsdet.slsDetectorDefs.M3_GainCaps \ No newline at end of file diff --git a/python/src/enums.cpp b/python/src/enums.cpp index 7adc2ee5b..961f615be 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -255,12 +255,6 @@ void init_enums(py::module &m) { .value("QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED) .export_values(); - py::enum_(Defs, "masterFlags") - .value("NO_MASTER", slsDetectorDefs::masterFlags::NO_MASTER) - .value("IS_MASTER", slsDetectorDefs::masterFlags::IS_MASTER) - .value("IS_SLAVE", slsDetectorDefs::masterFlags::IS_SLAVE) - .export_values(); - py::enum_(Defs, "burstMode") .value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL) .value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL) diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index 94be9a283..fe3d7cf8e 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -55,7 +55,7 @@ int ipPacketSize = 0; int udpPacketSize = 0; // master slave configuration (for 25um) -int masterflags = NO_MASTER; +int master = 0; int masterdefaultdelay = 62; int patternphase = 0; int adcphase = 0; @@ -621,14 +621,12 @@ int readConfigFile() { // key is master/ slave flag if (!strcasecmp(key, "masterflags")) { if (!strcasecmp(value, "is_master")) { - masterflags = IS_MASTER; + master = 1; LOG(logINFOBLUE, ("\tMaster\n")); - } else if (!strcasecmp(value, "is_slave")) { - masterflags = IS_SLAVE; - LOG(logINFOBLUE, ("\tSlave\n")); - } else if (!strcasecmp(value, "no_master")) { - masterflags = NO_MASTER; - LOG(logINFOBLUE, ("\tNo Master\n")); + } else if ((!strcasecmp(value, "is_slave")) || + (!strcasecmp(value, "no_master"))) { + master = 0; + LOG(logINFOBLUE, ("\tSlave or No Master\n")); } else { LOG(logERROR, ("\tCould not scan masterflags %s value from config file\n", @@ -705,7 +703,7 @@ void setMasterSlaveConfiguration() { return; // master configuration - if (masterflags == IS_MASTER) { + if (master) { // master default delay set, so reset delay setDelayAfterTrigger(0); @@ -876,7 +874,7 @@ int setDelayAfterTrigger(int64_t val) { return FAIL; } LOG(logINFO, ("Setting delay after trigger %lld ns\n", (long long int)val)); - if (masterflags == IS_MASTER) { + if (master) { val += masterdefaultdelay; LOG(logINFO, ("\tActual Delay (master): %lld\n", (long long int)val)); } @@ -900,7 +898,7 @@ int setDelayAfterTrigger(int64_t val) { int64_t getDelayAfterTrigger() { int64_t retval = get64BitReg(SET_DELAY_LSB_REG, SET_DELAY_MSB_REG) / (1E-9 * CLK_FREQ); - if (masterflags == IS_MASTER) { + if (master) { LOG(logDEBUG1, ("\tActual Delay read (master): %lld\n", (long long int)retval)); retval -= masterdefaultdelay; @@ -924,7 +922,7 @@ int64_t getPeriodLeft() { int64_t getDelayAfterTriggerLeft() { int64_t retval = get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) / (1E-9 * CLK_FREQ); - if (masterflags == IS_MASTER) { + if (master) { LOG(logDEBUG1, ("\tGetting Actual delay (master): %lld\n", (long long int)retval)); retval -= masterdefaultdelay; @@ -1201,7 +1199,7 @@ int setHighVoltage(int val) { /* parameters - timing, extsig */ -int isMaster() { return (masterflags == IS_MASTER ? 1 : 0); } +int isMaster() { return master; } void setTiming(enum timingMode arg) { u_int32_t addr = EXT_SIGNAL_REG; @@ -1453,7 +1451,7 @@ int configureMAC() { setExpTime(900 * 1000); // take an image - if (masterflags == IS_MASTER) + if (master) usleep(1 * 1000 * 1000); // required to ensure master starts // acquisition only after slave has changed // to basic parameters and is waiting diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 0848459e4..28a6403a9 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -375,9 +375,6 @@ typedef struct { /** chip speed */ enum speedLevel { FULL_SPEED, HALF_SPEED, QUARTER_SPEED }; - /** hierarchy in multi-detector structure, if any */ - enum masterFlags { NO_MASTER, IS_MASTER, IS_SLAVE }; - /** * burst mode for gotthard2 */ @@ -394,14 +391,14 @@ typedef struct { */ enum timingSourceType { TIMING_INTERNAL, TIMING_EXTERNAL }; - //gain caps Mythen3 + // gain caps Mythen3 enum M3_GainCaps { - M3_C10pre= 1<<7, - M3_C15sh = 1<<10, - M3_C30sh = 1<<11, - M3_C50sh = 1<<12, - M3_C225ACsh = 1<<13, - M3_C15pre = 1<<14, + M3_C10pre = 1 << 7, + M3_C15sh = 1 << 10, + M3_C30sh = 1 << 11, + M3_C50sh = 1 << 12, + M3_C225ACsh = 1 << 13, + M3_C15pre = 1 << 14, }; #ifdef __cplusplus @@ -636,9 +633,6 @@ typedef struct { #ifdef __cplusplus - - - // TODO! discuss this #include //hmm... but currently no way around namespace sls {