removed masterflags enum, especially in gotthard server

This commit is contained in:
maliakal_d 2021-06-10 12:10:17 +02:00
parent bdc3a5f3d9
commit 0b2a4a879e
6 changed files with 20 additions and 38 deletions

View File

@ -67,9 +67,6 @@ exposed to Python through pybind11.
.. autoclass:: readoutMode
:undoc-members:
.. autoclass:: masterFlags
:undoc-members:
.. autoclass:: burstMode
:undoc-members:

View File

@ -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']

View File

@ -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

View File

@ -255,12 +255,6 @@ void init_enums(py::module &m) {
.value("QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED)
.export_values();
py::enum_<slsDetectorDefs::masterFlags>(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_<slsDetectorDefs::burstMode>(Defs, "burstMode")
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)

View File

@ -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

View File

@ -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 <vector> //hmm... but currently no way around
namespace sls {