Merge pull request #106 from slsdetectorgroup/settingsfile

removed settings file option for gotthard and jungfrau, also removed …
This commit is contained in:
Dhanya Thattil 2020-06-18 16:05:00 +02:00 committed by GitHub
commit 7c23f1e42c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 2732 additions and 4494 deletions

View File

@ -732,13 +732,6 @@ class Detector(CppDetectorApi):
res = self.getMeasuredSubFramePeriod() res = self.getMeasuredSubFramePeriod()
return element_if_equal([it.total_seconds() for it in res]) return element_if_equal([it.total_seconds() for it in res])
@property
def storeinram(self):
return element_if_equal(self.getStoreInRamMode())
@storeinram.setter
def storeinram(self, value):
self.setStoreInRamMode(value)
""" """
Jungfrau specific Jungfrau specific

View File

@ -318,6 +318,16 @@ void init_det(py::module &m) {
(void (Detector::*)(defs::dacIndex, int, int, sls::Positions)) & (void (Detector::*)(defs::dacIndex, int, int, sls::Positions)) &
Detector::setOnChipDAC, Detector::setOnChipDAC,
py::arg(), py::arg(), py::arg(), py::arg() = Positions{}) py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
.def("getExternalSignalFlags",
(Result<defs::externalSignalFlag>(Detector::*)(int, sls::Positions)
const) &
Detector::getExternalSignalFlags,
py::arg(), py::arg() = Positions{})
.def("setExternalSignalFlags",
(void (Detector::*)(int, defs::externalSignalFlag,
sls::Positions)) &
Detector::setExternalSignalFlags,
py::arg(), py::arg(), py::arg() = Positions{})
.def("acquire", (void (Detector::*)()) & Detector::acquire) .def("acquire", (void (Detector::*)()) & Detector::acquire)
.def("clearAcquiringFlag", .def("clearAcquiringFlag",
(void (Detector::*)()) & Detector::clearAcquiringFlag) (void (Detector::*)()) & Detector::clearAcquiringFlag)
@ -745,14 +755,6 @@ void init_det(py::module &m) {
(void (Detector::*)(bool, sls::Positions)) & (void (Detector::*)(bool, sls::Positions)) &
Detector::setOverFlowMode, Detector::setOverFlowMode,
py::arg(), py::arg() = Positions{}) py::arg(), py::arg() = Positions{})
.def("getStoreInRamMode",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getStoreInRamMode,
py::arg() = Positions{})
.def("setStoreInRamMode",
(void (Detector::*)(bool, sls::Positions)) &
Detector::setStoreInRamMode,
py::arg(), py::arg() = Positions{})
.def("getBottom", .def("getBottom",
(Result<bool>(Detector::*)(sls::Positions) const) & (Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getBottom, Detector::getBottom,
@ -914,16 +916,6 @@ void init_det(py::module &m) {
(Result<sls::ns>(Detector::*)(sls::Positions) const) & (Result<sls::ns>(Detector::*)(sls::Positions) const) &
Detector::getExptimeLeft, Detector::getExptimeLeft,
py::arg() = Positions{}) py::arg() = Positions{})
.def("getExternalSignalFlags",
(Result<defs::externalSignalFlag>(Detector::*)(int, sls::Positions)
const) &
Detector::getExternalSignalFlags,
py::arg(), py::arg() = Positions{})
.def("setExternalSignalFlags",
(void (Detector::*)(int, defs::externalSignalFlag,
sls::Positions)) &
Detector::setExternalSignalFlags,
py::arg(), py::arg(), py::arg() = Positions{})
.def("getNumberOfBursts", .def("getNumberOfBursts",
(Result<int64_t>(Detector::*)(sls::Positions) const) & (Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getNumberOfBursts, Detector::getNumberOfBursts,
@ -1396,7 +1388,8 @@ void init_det(py::module &m) {
Detector::getLastClientIP, Detector::getLastClientIP,
py::arg() = Positions{}) py::arg() = Positions{})
.def("executeCommand", .def("executeCommand",
(void (Detector::*)(const std::string &, sls::Positions)) & (Result<std::string>(Detector::*)(const std::string &,
sls::Positions)) &
Detector::executeCommand, Detector::executeCommand,
py::arg(), py::arg() = Positions{}) py::arg(), py::arg() = Positions{})
.def("getNumberOfFramesFromStart", .def("getNumberOfFramesFromStart",

View File

@ -60,7 +60,6 @@ int eiger_iodelay = 0;
int eiger_photonenergy = 0; int eiger_photonenergy = 0;
int eiger_dynamicrange = 0; int eiger_dynamicrange = 0;
int eiger_parallelmode = 0; int eiger_parallelmode = 0;
int eiger_storeinmem = 0;
int eiger_overflow32 = 0; int eiger_overflow32 = 0;
int eiger_readoutspeed = 0; int eiger_readoutspeed = 0;
int eiger_triggermode = 0; int eiger_triggermode = 0;
@ -687,8 +686,7 @@ void setupDetector() {
setDynamicRange(DEFAULT_DYNAMIC_RANGE); setDynamicRange(DEFAULT_DYNAMIC_RANGE);
eiger_photonenergy = DEFAULT_PHOTON_ENERGY; eiger_photonenergy = DEFAULT_PHOTON_ENERGY;
setParallelMode(DEFAULT_PARALLEL_MODE); setParallelMode(DEFAULT_PARALLEL_MODE);
setOverFlowMode(DEFAULT_READOUT_STOREINRAM_MODE); setOverFlowMode(DEFAULT_READOUT_OVERFLOW32_MODE);
setStoreInRamMode(DEFAULT_READOUT_OVERFLOW32_MODE);
setClockDivider(RUN_CLK, DEFAULT_CLK_SPEED); // clk_devider,half speed setClockDivider(RUN_CLK, DEFAULT_CLK_SPEED); // clk_devider,half speed
setIODelay(DEFAULT_IO_DELAY); setIODelay(DEFAULT_IO_DELAY);
setTiming(DEFAULT_TIMING_MODE); setTiming(DEFAULT_TIMING_MODE);
@ -805,14 +803,6 @@ int setOverFlowMode(int mode) {
int getOverFlowMode() { return eiger_overflow32; } int getOverFlowMode() { return eiger_overflow32; }
void setStoreInRamMode(int mode) {
mode = (mode == 0 ? 0 : 1);
LOG(logINFO, ("Setting Store in Ram mode to %d\n", mode));
eiger_storeinmem = mode;
}
int getStoreInRamMode() { return eiger_storeinmem; }
/* parameters - timer */ /* parameters - timer */
int setStartingFrameNumber(uint64_t value) { int setStartingFrameNumber(uint64_t value) {
@ -1118,37 +1108,6 @@ int setModule(sls_detector_module myMod, char *mess) {
return OK; return OK;
} }
int getModule(sls_detector_module *myMod) {
#ifndef VIRTUAL
// trimbits
unsigned int *tt;
tt = Feb_Control_GetTrimbits();
// exclude gap pixels
int ip = 0, ich = 0;
for (int iy = 0; iy < 256; ++iy) {
for (int ichip = 0; ichip < 4; ++ichip) {
for (int ix = 0; ix < 256; ++iy) {
myMod->chanregs[ich++] = tt[ip++];
}
if (ichip < 3) {
ip++;
ip++;
}
}
}
#endif
// copy local module to myMod
if (detectorModules) {
if (copyModule(myMod, detectorModules) == FAIL)
return FAIL;
} else
return FAIL;
return OK;
}
enum detectorSettings setSettings(enum detectorSettings sett) { enum detectorSettings setSettings(enum detectorSettings sett) {
if (sett == UNINITIALIZED) { if (sett == UNINITIALIZED) {
return thisSettings; return thisSettings;
@ -2057,10 +2016,8 @@ int startStateMachine() {
LOG(logINFO, ("Going to start acquisition\n")); LOG(logINFO, ("Going to start acquisition\n"));
Feb_Control_StartAcquisition(); Feb_Control_StartAcquisition();
if (!eiger_storeinmem) {
LOG(logINFO, ("requesting images right after start\n")); LOG(logINFO, ("requesting images right after start\n"));
ret = startReadOut(); ret = startReadOut();
}
// wait for acquisition start // wait for acquisition start
if (ret == OK) { if (ret == OK) {
@ -2382,16 +2339,6 @@ void readFrame(int *ret, char *mess) {
} }
LOG(logINFOGREEN, ("Acquisition finished\n")); LOG(logINFOGREEN, ("Acquisition finished\n"));
if (eiger_storeinmem) {
LOG(logINFO, ("requesting images after storing in memory\n"));
if (startReadOut() == FAIL) {
strcpy(mess, "Could not execute read image requests\n");
LOG(logERROR, (mess));
*ret = (int)FAIL;
return;
}
}
// wait for detector to send // wait for detector to send
int isTransmitting = 1; int isTransmitting = 1;
while (isTransmitting) { while (isTransmitting) {

View File

@ -103,7 +103,6 @@ enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE };
#define DEFAULT_DYNAMIC_RANGE (16) #define DEFAULT_DYNAMIC_RANGE (16)
#define DEFAULT_PARALLEL_MODE (1) #define DEFAULT_PARALLEL_MODE (1)
#define DEFAULT_READOUT_STOREINRAM_MODE (0)
#define DEFAULT_READOUT_OVERFLOW32_MODE (0) #define DEFAULT_READOUT_OVERFLOW32_MODE (0)
#define DEFAULT_CLK_SPEED (FULL_SPEED) #define DEFAULT_CLK_SPEED (FULL_SPEED)
#define DEFAULT_IO_DELAY (650) #define DEFAULT_IO_DELAY (650)

View File

@ -945,23 +945,6 @@ int setModule(sls_detector_module myMod, char *mess) {
return OK; return OK;
} }
int getModule(sls_detector_module *myMod) {
for (int idac = 0; idac < NDAC; ++idac) {
if (dacValues[idac] >= 0)
*((myMod->dacs) + idac) = dacValues[idac];
}
// check if all of them are not initialized
int initialized = 0;
for (int idac = 0; idac < NDAC; ++idac) {
if (dacValues[idac] >= 0)
initialized = 1;
}
if (initialized) {
return OK;
}
return FAIL;
}
enum detectorSettings setSettings(enum detectorSettings sett) { enum detectorSettings setSettings(enum detectorSettings sett) {
if (sett == UNINITIALIZED) if (sett == UNINITIALIZED)
return thisSettings; return thisSettings;

View File

@ -367,6 +367,9 @@ void initStopServer() {
if (!isControlServer) { if (!isControlServer) {
ComVirtual_setStop(virtual_stop); ComVirtual_setStop(virtual_stop);
} }
// temp threshold and reset event (read by stop server)
setThresholdTemperature(DEFAULT_TMP_THRSHLD);
setTemperatureEvent(0);
#endif #endif
} }
@ -745,23 +748,6 @@ int setModule(sls_detector_module myMod, char *mess) {
return OK; return OK;
} }
int getModule(sls_detector_module *myMod) {
for (int idac = 0; idac < NDAC; ++idac) {
if (dacValues[idac] >= 0)
*((myMod->dacs) + idac) = dacValues[idac];
}
// check if all of them are not initialized
int initialized = 0;
for (int idac = 0; idac < NDAC; ++idac) {
if (dacValues[idac] >= 0)
initialized = 1;
}
if (initialized) {
return OK;
}
return FAIL;
}
enum detectorSettings setSettings(enum detectorSettings sett) { enum detectorSettings setSettings(enum detectorSettings sett) {
if (sett == UNINITIALIZED) if (sett == UNINITIALIZED)
return thisSettings; return thisSettings;

View File

@ -600,16 +600,6 @@ int setModule(sls_detector_module myMod, char *mess) {
return OK; return OK;
} }
int getModule(sls_detector_module *myMod) {
// copy local module to myMod
if (detectorModules) {
if (copyModule(myMod, detectorModules) == FAIL)
return FAIL;
} else
return FAIL;
return OK;
}
int setBit(int ibit, int patword) { return patword |= (1 << ibit); } int setBit(int ibit, int patword) { return patword |= (1 << ibit); }
int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); } int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }

View File

@ -24,7 +24,6 @@ int receiveData(int file_des, void *buf, int length, intType itype);
int sendDataOnly(int file_des, void *buf, int length); int sendDataOnly(int file_des, void *buf, int length);
int receiveDataOnly(int file_des, void *buf, int length); int receiveDataOnly(int file_des, void *buf, int length);
int sendModule(int file_des, sls_detector_module *myMod);
int receiveModule(int file_des, sls_detector_module *myMod); int receiveModule(int file_des, sls_detector_module *myMod);
/** /**

View File

@ -184,8 +184,6 @@ int setParallelMode(int mode);
int getParallelMode(); int getParallelMode();
int setOverFlowMode(int mode); int setOverFlowMode(int mode);
int getOverFlowMode(); int getOverFlowMode();
void setStoreInRamMode(int mode);
int getStoreInRamMode();
#endif #endif
#ifdef CHIPTESTBOARDD #ifdef CHIPTESTBOARDD
int setReadoutMode(enum readoutMode mode); int setReadoutMode(enum readoutMode mode);
@ -276,7 +274,6 @@ int64_t getMeasurementTime();
// parameters - module, settings // parameters - module, settings
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(GOTTHARD2D)) #if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(GOTTHARD2D))
int setModule(sls_detector_module myMod, char *mess); int setModule(sls_detector_module myMod, char *mess);
int getModule(sls_detector_module *myMod);
#endif #endif
#ifdef MYTHEN3D #ifdef MYTHEN3D
int setTrimbits(int *trimbits); int setTrimbits(int *trimbits);

View File

@ -41,12 +41,10 @@ int get_adc(int);
int write_register(int); int write_register(int);
int read_register(int); int read_register(int);
int set_module(int); int set_module(int);
int get_module(int);
int set_settings(int); int set_settings(int);
int get_threshold_energy(int); int get_threshold_energy(int);
int start_acquisition(int); int start_acquisition(int);
int stop_acquisition(int); int stop_acquisition(int);
int start_readout(int);
int get_run_status(int); int get_run_status(int);
int start_and_read_all(int); int start_and_read_all(int);
int read_all(int); int read_all(int);
@ -85,7 +83,6 @@ int get_measurement_time(int);
int set_dynamic_range(int); int set_dynamic_range(int);
int set_roi(int); int set_roi(int);
int get_roi(int); int get_roi(int);
int exit_server(int);
int lock_server(int); int lock_server(int);
int get_last_client_ip(int); int get_last_client_ip(int);
int set_port(int); int set_port(int);
@ -181,8 +178,6 @@ int set_parallel_mode(int);
int get_parallel_mode(int); int get_parallel_mode(int);
int set_overflow_mode(int); int set_overflow_mode(int);
int get_overflow_mode(int); int get_overflow_mode(int);
int set_storeinram(int);
int get_storeinram(int);
int set_readout_mode(int); int set_readout_mode(int);
int get_readout_mode(int); int get_readout_mode(int);
int set_clock_frequency(int); int set_clock_frequency(int);

View File

@ -404,68 +404,6 @@ int receiveDataOnly(int file_des, void *buf, int length) {
return total_received; return total_received;
} }
int sendModule(int file_des, sls_detector_module *myMod) {
int ts = 0, n = 0;
n = sendData(file_des, &(myMod->serialnumber), sizeof(myMod->serialnumber),
INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->nchan), sizeof(myMod->nchan), INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->nchip), sizeof(myMod->nchip), INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->ndac), sizeof(myMod->ndac), INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->reg), sizeof(myMod->reg), INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->iodelay), sizeof(myMod->iodelay), INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->tau), sizeof(myMod->tau), INT32);
if (!n) {
return -1;
}
ts += n;
n = sendData(file_des, &(myMod->eV), sizeof(myMod->eV), INT32);
if (!n) {
return -1;
}
ts += n;
// dacs
n = sendData(file_des, myMod->dacs, sizeof(int) * (myMod->ndac), INT32);
if (!n) {
return -1;
}
ts += n;
// channels
#if defined(EIGERD) || defined(MYTHEN3D)
n = sendData(file_des, myMod->chanregs, sizeof(int) * (myMod->nchan),
INT32);
if (!n) {
return -1;
}
ts += n;
#endif
LOG(logDEBUG1, ("module of size %d sent register %x\n", ts, myMod->reg));
return ts;
}
int receiveModule(int file_des, sls_detector_module *myMod) { int receiveModule(int file_des, sls_detector_module *myMod) {
enum TLogLevel level = logDEBUG1; enum TLogLevel level = logDEBUG1;
LOG(level, ("Receiving Module\n")); LOG(level, ("Receiving Module\n"));

View File

@ -155,15 +155,12 @@ void function_table() {
flist[F_WRITE_REGISTER] = &write_register; flist[F_WRITE_REGISTER] = &write_register;
flist[F_READ_REGISTER] = &read_register; flist[F_READ_REGISTER] = &read_register;
flist[F_SET_MODULE] = &set_module; flist[F_SET_MODULE] = &set_module;
flist[F_GET_MODULE] = &get_module;
flist[F_SET_SETTINGS] = &set_settings; flist[F_SET_SETTINGS] = &set_settings;
flist[F_GET_THRESHOLD_ENERGY] = &get_threshold_energy; flist[F_GET_THRESHOLD_ENERGY] = &get_threshold_energy;
flist[F_START_ACQUISITION] = &start_acquisition; flist[F_START_ACQUISITION] = &start_acquisition;
flist[F_STOP_ACQUISITION] = &stop_acquisition; flist[F_STOP_ACQUISITION] = &stop_acquisition;
flist[F_START_READOUT] = &start_readout;
flist[F_GET_RUN_STATUS] = &get_run_status; flist[F_GET_RUN_STATUS] = &get_run_status;
flist[F_START_AND_READ_ALL] = &start_and_read_all; flist[F_START_AND_READ_ALL] = &start_and_read_all;
flist[F_READ_ALL] = &read_all;
flist[F_GET_NUM_FRAMES] = &get_num_frames; flist[F_GET_NUM_FRAMES] = &get_num_frames;
flist[F_SET_NUM_FRAMES] = &set_num_frames; flist[F_SET_NUM_FRAMES] = &set_num_frames;
flist[F_GET_NUM_TRIGGERS] = &get_num_triggers; flist[F_GET_NUM_TRIGGERS] = &get_num_triggers;
@ -201,7 +198,6 @@ void function_table() {
flist[F_SET_DYNAMIC_RANGE] = &set_dynamic_range; flist[F_SET_DYNAMIC_RANGE] = &set_dynamic_range;
flist[F_SET_ROI] = &set_roi; flist[F_SET_ROI] = &set_roi;
flist[F_GET_ROI] = &get_roi; flist[F_GET_ROI] = &get_roi;
flist[F_EXIT_SERVER] = &exit_server;
flist[F_LOCK_SERVER] = &lock_server; flist[F_LOCK_SERVER] = &lock_server;
flist[F_GET_LAST_CLIENT_IP] = &get_last_client_ip; flist[F_GET_LAST_CLIENT_IP] = &get_last_client_ip;
flist[F_SET_PORT] = &set_port; flist[F_SET_PORT] = &set_port;
@ -292,8 +288,6 @@ void function_table() {
flist[F_GET_PARALLEL_MODE] = &get_parallel_mode; flist[F_GET_PARALLEL_MODE] = &get_parallel_mode;
flist[F_SET_OVERFLOW_MODE] = &set_overflow_mode; flist[F_SET_OVERFLOW_MODE] = &set_overflow_mode;
flist[F_GET_OVERFLOW_MODE] = &get_overflow_mode; flist[F_GET_OVERFLOW_MODE] = &get_overflow_mode;
flist[F_SET_STOREINRAM_MODE] = &set_storeinram;
flist[F_GET_STOREINRAM_MODE] = &get_storeinram;
flist[F_SET_READOUT_MODE] = &set_readout_mode; flist[F_SET_READOUT_MODE] = &set_readout_mode;
flist[F_GET_READOUT_MODE] = &get_readout_mode; flist[F_GET_READOUT_MODE] = &get_readout_mode;
flist[F_SET_CLOCK_FREQUENCY] = &set_clock_frequency; flist[F_SET_CLOCK_FREQUENCY] = &set_clock_frequency;
@ -1544,68 +1538,6 @@ int set_module(int file_des) {
return Server_SendResult(file_des, INT32, NULL, 0); return Server_SendResult(file_des, INT32, NULL, 0);
} }
int get_module(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
sls_detector_module module;
int *myDac = NULL;
int *myChan = NULL;
module.dacs = NULL;
module.chanregs = NULL;
// allocate to send arguments
// allocate dacs
myDac = malloc(getNumberOfDACs() * sizeof(int));
// error
if (getNumberOfDACs() > 0 && myDac == NULL) {
ret = FAIL;
sprintf(mess, "Could not allocate dacs\n");
LOG(logERROR, (mess));
} else
module.dacs = myDac;
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(GOTTHARD2D)
functionNotImplemented();
#endif
#if defined(EIGERD) || defined(MYTHEN3D)
// allocate chans
if (ret == OK) {
myChan = malloc(getTotalNumberOfChannels() * sizeof(int));
if (getTotalNumberOfChannels() > 0 && myChan == NULL) {
ret = FAIL;
sprintf(mess, "Could not allocate chans\n");
LOG(logERROR, (mess));
} else
module.chanregs = myChan;
}
#endif
// get module
if (ret == OK) {
module.nchip = getNumberOfChips();
module.nchan = getTotalNumberOfChannels();
module.ndac = getNumberOfDACs();
// only get
LOG(logDEBUG1, ("Getting module\n"));
#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(GOTTHARD2D)
getModule(&module);
#endif
LOG(logDEBUG1, ("Getting module. Settings:%d\n", module.reg));
}
Server_SendResult(file_des, INT32, NULL, 0);
// send module, 0 is to receive partially (without trimbits etc)
if (ret != FAIL) {
ret = sendModule(file_des, &module);
}
free(myChan);
free(myDac);
return ret;
}
int set_settings(int file_des) { int set_settings(int file_des) {
ret = OK; ret = OK;
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
@ -1808,27 +1740,6 @@ int stop_acquisition(int file_des) {
return Server_SendResult(file_des, INT32, NULL, 0); return Server_SendResult(file_des, INT32, NULL, 0);
} }
int start_readout(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
LOG(logDEBUG1, ("Starting readout\n"));
#ifndef EIGERD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
ret = startReadOut();
if (ret == FAIL) {
sprintf(mess, "Could not start readout\n");
LOG(logERROR, (mess));
}
LOG(logDEBUG1, ("Starting readout ret: %d\n", ret));
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
int get_run_status(int file_des) { int get_run_status(int file_des) {
ret = OK; ret = OK;
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
@ -2793,14 +2704,6 @@ int get_roi(int file_des) {
return ret; return ret;
} }
int exit_server(int file_des) {
LOG(logINFORED, ("Closing Server\n"));
ret = OK;
memset(mess, 0, sizeof(mess));
Server_SendResult(file_des, INT32, NULL, 0);
return GOODBYE;
}
int lock_server(int file_des) { int lock_server(int file_des) {
ret = OK; ret = OK;
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
@ -5327,11 +5230,11 @@ int get_dest_udp_port(int file_des) {
ret = OK; ret = OK;
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
int retval = -1; int retval = -1;
LOG(logDEBUG1, ("Getting destination porstore in ram moden")); LOG(logDEBUG1, ("Getting destination port"));
// get only // get only
retval = udpDetails.dstport; retval = udpDetails.dstport;
LOG(logDEBUG, ("udp destination port retstore in ram model: %u\n", retval)); LOG(logDEBUG, ("udp destination port retval: %u\n", retval));
return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
} }
@ -5570,43 +5473,6 @@ int get_overflow_mode(int file_des) {
return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
} }
int set_storeinram(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
int arg = 0;
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
return printSocketReadError();
LOG(logINFO, ("Setting store in ram mode: %u\n", arg));
#ifndef EIGERD
functionNotImplemented();
#else
// only set
if (Server_VerifyLock() == OK) {
setStoreInRamMode(arg);
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}
int get_storeinram(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
int retval = -1;
LOG(logDEBUG1, ("Getting store in ram mode\n"));
#ifndef EIGERD
functionNotImplemented();
#else
// get only
retval = getStoreInRamMode();
LOG(logDEBUG1, ("store in ram mode retval: %u\n", retval));
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
int set_readout_mode(int file_des) { int set_readout_mode(int file_des) {
ret = OK; ret = OK;
memset(mess, 0, sizeof(mess)); memset(mess, 0, sizeof(mess));
@ -6916,7 +6782,7 @@ int get_receiver_parameters(int file_des) {
n += sendData(file_des, &i32, sizeof(i32), INT32); n += sendData(file_des, &i32, sizeof(i32), INT32);
if (n < 0) if (n < 0)
return printSocketReadError(); return printSocketReadError();
// multisize // numberOfDetector
i32 = 0; i32 = 0;
n += sendData(file_des, &i32, sizeof(i32), INT32); n += sendData(file_des, &i32, sizeof(i32), INT32);
if (n < 0) if (n < 0)

View File

@ -43,7 +43,7 @@ class Detector {
* ************************************************/ * ************************************************/
/* Free the shared memory of this detector and all modules /* Free the shared memory of this detector and all modules
* belonging to it.*/ * belonging to it */
void freeSharedMemory(); void freeSharedMemory();
void loadConfig(const std::string &fname); void loadConfig(const std::string &fname);
@ -327,6 +327,21 @@ class Detector {
void setOnChipDAC(defs::dacIndex index, int chipIndex, int value, void setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
Positions pos = {}); Positions pos = {});
/** [Gotthard] signal index is 0
* [Mythen3] signal index 0-3 for master input, 4-7 master output signals */
Result<defs::externalSignalFlag>
getExternalSignalFlags(int signalIndex, Positions pos = {}) const;
/** [Gotthard] signal index is 0
* Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE
* [Mythen3] signal index 0 is master input trigger signal, 1-3 for master
* input gate signals, 4 is busy out signal, 5-7 is master output gate
* signals.
* Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE (for
* master input trigger only), INVERSION_ON, INVERSION_OFF */
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
Positions pos = {});
/************************************************** /**************************************************
* * * *
* Acquisition * * Acquisition *
@ -750,12 +765,6 @@ class Detector {
/** [Eiger] */ /** [Eiger] */
void setOverFlowMode(bool value, Positions pos = {}); void setOverFlowMode(bool value, Positions pos = {});
/** [Eiger] */
Result<bool> getStoreInRamMode(Positions pos = {}) const;
/** [Eiger] */
void setStoreInRamMode(bool value, Positions pos = {});
/** [Eiger] */ /** [Eiger] */
Result<bool> getBottom(Positions pos = {}) const; Result<bool> getBottom(Positions pos = {}) const;
@ -925,21 +934,6 @@ class Detector {
/** [Gotthard] */ /** [Gotthard] */
Result<ns> getExptimeLeft(Positions pos = {}) const; Result<ns> getExptimeLeft(Positions pos = {}) const;
/** [Gotthard] signal index is 0
* [Mythen3] signal index 0-3 for master input, 4-7 master output signals */
Result<defs::externalSignalFlag>
getExternalSignalFlags(int signalIndex, Positions pos = {}) const;
/** [Gotthard] signal index is 0
* Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE
* [Mythen3] signal index 0 is master input trigger signal, 1-3 for master
* input gate signals, 4 is busy out signal, 5-7 is master output gate
* signals.
* Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE (for
* master input trigger only), INVERSION_ON, INVERSION_OFF */
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
Positions pos = {});
/************************************************** /**************************************************
* * * *
* Gotthard2 Specific * * Gotthard2 Specific *
@ -1412,7 +1406,8 @@ class Detector {
Result<sls::IpAddr> getLastClientIP(Positions pos = {}) const; Result<sls::IpAddr> getLastClientIP(Positions pos = {}) const;
/** Execute a command on the detector server console */ /** Execute a command on the detector server console */
void executeCommand(const std::string &value, Positions pos = {}); Result<std::string> executeCommand(const std::string &value,
Positions pos = {});
/** [Jungfrau][Mythen3][CTB][Moench] /** [Jungfrau][Mythen3][CTB][Moench]
* [Gotthard2] only in continuous mode */ * [Gotthard2] only in continuous mode */

View File

@ -2545,8 +2545,8 @@ std::string CmdProxy::ExecuteCommand(int action) {
if (args.size() != 1) { if (args.size() != 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
det->executeCommand(args[0], {det_id}); auto t = det->executeCommand(args[0], {det_id});
os << "successful" << '\n'; os << OutString(t) << '\n';
} else { } else {
throw sls::RuntimeError("Unknown action"); throw sls::RuntimeError("Unknown action");
} }

View File

@ -766,7 +766,6 @@ class CmdProxy {
{"settingspath", &CmdProxy::settingspath}, {"settingspath", &CmdProxy::settingspath},
{"parallel", &CmdProxy::parallel}, {"parallel", &CmdProxy::parallel},
{"overflow", &CmdProxy::overflow}, {"overflow", &CmdProxy::overflow},
{"storeinram", &CmdProxy::storeinram},
{"flippeddatax", &CmdProxy::flippeddatax}, {"flippeddatax", &CmdProxy::flippeddatax},
{"trimen", &CmdProxy::TrimEnergies}, {"trimen", &CmdProxy::TrimEnergies},
{"ratecorr", &CmdProxy::RateCorrection}, {"ratecorr", &CmdProxy::RateCorrection},
@ -1776,10 +1775,6 @@ class CmdProxy {
"[0, 1]\n\t[Eiger] Enable or disable show overflow flag in " "[0, 1]\n\t[Eiger] Enable or disable show overflow flag in "
"32 bit mode."); "32 bit mode.");
INTEGER_COMMAND(storeinram, getStoreInRamMode, setStoreInRamMode,
StringTo<int>,
"[0, 1]\n\t[Eiger] Enable or disable store in ram mode.");
INTEGER_COMMAND( INTEGER_COMMAND(
flippeddatax, getBottom, setBottom, StringTo<int>, flippeddatax, getBottom, setBottom, StringTo<int>,
"[0, 1]\n\t[Eiger] Top or Bottom Half of Eiger module. 1 is bottom, 0 " "[0, 1]\n\t[Eiger] Top or Bottom Half of Eiger module. 1 is bottom, 0 "

View File

@ -376,25 +376,25 @@ void Detector::setClockDivider(int clkIndex, int value, Positions pos) {
} }
Result<int> Detector::getHighVoltage(Positions pos) const { Result<int> Detector::getHighVoltage(Positions pos) const {
return pimpl->Parallel(&Module::setDAC, pos, -1, defs::HIGH_VOLTAGE, 0); return pimpl->Parallel(&Module::getDAC, pos, defs::HIGH_VOLTAGE, false);
} }
void Detector::setHighVoltage(int value, Positions pos) { void Detector::setHighVoltage(int value, Positions pos) {
pimpl->Parallel(&Module::setDAC, pos, value, defs::HIGH_VOLTAGE, 0); pimpl->Parallel(&Module::setDAC, pos, value, defs::HIGH_VOLTAGE, false);
} }
Result<bool> Detector::getPowerChip(Positions pos) const { Result<bool> Detector::getPowerChip(Positions pos) const {
return pimpl->Parallel(&Module::powerChip, pos, -1); return pimpl->Parallel(&Module::getPowerChip, pos);
} }
void Detector::setPowerChip(bool on, Positions pos) { void Detector::setPowerChip(bool on, Positions pos) {
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) { if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
for (int i = 0; i != pimpl->size(); ++i) { for (int i = 0; i != pimpl->size(); ++i) {
pimpl->Parallel(&Module::powerChip, {i}, static_cast<int>(on)); pimpl->Parallel(&Module::setPowerChip, {i}, on);
usleep(1000 * 1000); usleep(1000 * 1000);
} }
} else { } else {
pimpl->Parallel(&Module::powerChip, pos, static_cast<int>(on)); pimpl->Parallel(&Module::setPowerChip, pos, on);
} }
} }
@ -486,7 +486,7 @@ std::vector<defs::dacIndex> Detector::getDacList() const {
Result<int> Detector::getDAC(defs::dacIndex index, bool mV, Result<int> Detector::getDAC(defs::dacIndex index, bool mV,
Positions pos) const { Positions pos) const {
return pimpl->Parallel(&Module::setDAC, pos, -1, index, mV); return pimpl->Parallel(&Module::getDAC, pos, index, mV);
} }
void Detector::setDAC(defs::dacIndex index, int value, bool mV, Positions pos) { void Detector::setDAC(defs::dacIndex index, int value, bool mV, Positions pos) {
@ -503,6 +503,17 @@ void Detector::setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
pimpl->Parallel(&Module::setOnChipDAC, pos, index, chipIndex, value); pimpl->Parallel(&Module::setOnChipDAC, pos, index, chipIndex, value);
} }
Result<defs::externalSignalFlag>
Detector::getExternalSignalFlags(int signalIndex, Positions pos) const {
return pimpl->Parallel(&Module::getExternalSignalFlags, pos, signalIndex);
}
void Detector::setExternalSignalFlags(int signalIndex,
defs::externalSignalFlag value,
Positions pos) {
pimpl->Parallel(&Module::setExternalSignalFlags, pos, signalIndex, value);
}
// Acquisition // Acquisition
void Detector::acquire() { pimpl->acquire(); } void Detector::acquire() { pimpl->acquire(); }
@ -690,12 +701,11 @@ Result<std::string> Detector::printRxConfiguration(Positions pos) const {
} }
Result<bool> Detector::getTenGiga(Positions pos) const { Result<bool> Detector::getTenGiga(Positions pos) const {
return pimpl->Parallel(&Module::enableTenGigabitEthernet, pos, -1); return pimpl->Parallel(&Module::getTenGiga, pos);
} }
void Detector::setTenGiga(bool value, Positions pos) { void Detector::setTenGiga(bool value, Positions pos) {
pimpl->Parallel(&Module::enableTenGigabitEthernet, pos, pimpl->Parallel(&Module::setTenGiga, pos, value);
static_cast<int>(value));
} }
Result<bool> Detector::getTenGigaFlowControl(Positions pos) const { Result<bool> Detector::getTenGigaFlowControl(Positions pos) const {
@ -780,7 +790,7 @@ void Detector::setRxPort(int port, int module_id) {
} }
Result<int> Detector::getRxFifoDepth(Positions pos) const { Result<int> Detector::getRxFifoDepth(Positions pos) const {
return pimpl->Parallel(&Module::setReceiverFifoDepth, pos, -1); return pimpl->Parallel(&Module::getReceiverFifoDepth, pos);
} }
void Detector::setRxFifoDepth(int nframes, Positions pos) { void Detector::setRxFifoDepth(int nframes, Positions pos) {
@ -827,11 +837,11 @@ Result<int64_t> Detector::getRxRealUDPSocketBufferSize(Positions pos) const {
} }
Result<bool> Detector::getRxLock(Positions pos) { Result<bool> Detector::getRxLock(Positions pos) {
return pimpl->Parallel(&Module::lockReceiver, pos, -1); return pimpl->Parallel(&Module::getReceiverLock, pos);
} }
void Detector::setRxLock(bool value, Positions pos) { void Detector::setRxLock(bool value, Positions pos) {
pimpl->Parallel(&Module::lockReceiver, pos, static_cast<int>(value)); pimpl->Parallel(&Module::setReceiverLock, pos, value);
} }
Result<sls::IpAddr> Detector::getRxLastClientIP(Positions pos) const { Result<sls::IpAddr> Detector::getRxLastClientIP(Positions pos) const {
@ -928,7 +938,7 @@ void Detector::setRxZmqFrequency(int freq, Positions pos) {
} }
Result<int> Detector::getRxZmqTimer(Positions pos) const { Result<int> Detector::getRxZmqTimer(Positions pos) const {
return pimpl->Parallel(&Module::setReceiverStreamingTimer, pos, -1); return pimpl->Parallel(&Module::getReceiverStreamingTimer, pos);
} }
void Detector::setRxZmqTimer(int time_in_ms, Positions pos) { void Detector::setRxZmqTimer(int time_in_ms, Positions pos) {
@ -1054,14 +1064,6 @@ void Detector::setOverFlowMode(bool value, Positions pos) {
pimpl->Parallel(&Module::setOverFlowMode, pos, value); pimpl->Parallel(&Module::setOverFlowMode, pos, value);
} }
Result<bool> Detector::getStoreInRamMode(Positions pos) const {
return pimpl->Parallel(&Module::getStoreInRamMode, pos);
}
void Detector::setStoreInRamMode(bool value, Positions pos) {
pimpl->Parallel(&Module::setStoreInRamMode, pos, value);
}
Result<bool> Detector::getBottom(Positions pos) const { Result<bool> Detector::getBottom(Positions pos) const {
return pimpl->Parallel(&Module::getFlippedDataX, pos); return pimpl->Parallel(&Module::getFlippedDataX, pos);
} }
@ -1131,16 +1133,11 @@ void Detector::setRxPadDeactivatedMode(bool pad, Positions pos) {
} }
Result<bool> Detector::getPartialReset(Positions pos) const { Result<bool> Detector::getPartialReset(Positions pos) const {
auto res = pimpl->Parallel(&Module::setCounterBit, pos, -1); return pimpl->Parallel(&Module::getCounterBit, pos);
Result<bool> t(res.size());
for (unsigned int i = 0; i < res.size(); ++i) {
t[i] = !res[i];
}
return t;
} }
void Detector::setPartialReset(bool value, Positions pos) { void Detector::setPartialReset(bool value, Positions pos) {
pimpl->Parallel(&Module::setCounterBit, pos, !value); pimpl->Parallel(&Module::setCounterBit, pos, value);
} }
void Detector::pulsePixel(int n, defs::xy pixel, Positions pos) { void Detector::pulsePixel(int n, defs::xy pixel, Positions pos) {
@ -1170,41 +1167,35 @@ void Detector::setQuad(const bool enable) {
// Jungfrau Specific // Jungfrau Specific
Result<int> Detector::getThresholdTemperature(Positions pos) const { Result<int> Detector::getThresholdTemperature(Positions pos) const {
auto res = pimpl->Parallel(&Module::setThresholdTemperature, pos, -1); return pimpl->Parallel(&Module::getThresholdTemperature, pos);
for (auto &it : res) {
it /= 1000;
}
return res;
} }
void Detector::setThresholdTemperature(int temp, Positions pos) { void Detector::setThresholdTemperature(int temp, Positions pos) {
pimpl->Parallel(&Module::setThresholdTemperature, pos, temp * 1000); pimpl->Parallel(&Module::setThresholdTemperature, pos, temp);
} }
Result<bool> Detector::getTemperatureControl(Positions pos) const { Result<bool> Detector::getTemperatureControl(Positions pos) const {
return pimpl->Parallel(&Module::setTemperatureControl, pos, -1); return pimpl->Parallel(&Module::getTemperatureControl, pos);
} }
void Detector::setTemperatureControl(bool enable, Positions pos) { void Detector::setTemperatureControl(bool enable, Positions pos) {
pimpl->Parallel(&Module::setTemperatureControl, pos, pimpl->Parallel(&Module::setTemperatureControl, pos, enable);
static_cast<int>(enable));
} }
Result<int> Detector::getTemperatureEvent(Positions pos) const { Result<int> Detector::getTemperatureEvent(Positions pos) const {
return pimpl->Parallel(&Module::setTemperatureEvent, pos, -1); return pimpl->Parallel(&Module::getTemperatureEvent, pos);
} }
void Detector::resetTemperatureEvent(Positions pos) { void Detector::resetTemperatureEvent(Positions pos) {
pimpl->Parallel(&Module::setTemperatureEvent, pos, 0); pimpl->Parallel(&Module::resetTemperatureEvent, pos);
} }
Result<bool> Detector::getAutoCompDisable(Positions pos) const { Result<bool> Detector::getAutoCompDisable(Positions pos) const {
return pimpl->Parallel(&Module::setAutoComparatorDisableMode, pos, -1); return pimpl->Parallel(&Module::getAutoComparatorDisableMode, pos);
} }
void Detector::setAutoCompDisable(bool value, Positions pos) { void Detector::setAutoCompDisable(bool value, Positions pos) {
pimpl->Parallel(&Module::setAutoComparatorDisableMode, pos, pimpl->Parallel(&Module::setAutoComparatorDisableMode, pos, value);
static_cast<int>(value));
} }
Result<int> Detector::getNumberOfAdditionalStorageCells(Positions pos) const { Result<int> Detector::getNumberOfAdditionalStorageCells(Positions pos) const {
@ -1216,7 +1207,7 @@ void Detector::setNumberOfAdditionalStorageCells(int value) {
} }
Result<int> Detector::getStorageCellStart(Positions pos) const { Result<int> Detector::getStorageCellStart(Positions pos) const {
return pimpl->Parallel(&Module::setStorageCellStart, pos, -1); return pimpl->Parallel(&Module::getStorageCellStart, pos);
} }
void Detector::setStorageCellStart(int cell, Positions pos) { void Detector::setStorageCellStart(int cell, Positions pos) {
@ -1252,17 +1243,6 @@ Result<ns> Detector::getExptimeLeft(Positions pos) const {
return pimpl->Parallel(&Module::getExptimeLeft, pos); return pimpl->Parallel(&Module::getExptimeLeft, pos);
} }
Result<defs::externalSignalFlag>
Detector::getExternalSignalFlags(int signalIndex, Positions pos) const {
return pimpl->Parallel(&Module::getExternalSignalFlags, pos, signalIndex);
}
void Detector::setExternalSignalFlags(int signalIndex,
defs::externalSignalFlag value,
Positions pos) {
pimpl->Parallel(&Module::setExternalSignalFlags, pos, signalIndex, value);
}
// Gotthard2 Specific // Gotthard2 Specific
Result<int64_t> Detector::getNumberOfBursts(Positions pos) const { Result<int64_t> Detector::getNumberOfBursts(Positions pos) const {
@ -1440,7 +1420,7 @@ Result<int> Detector::getVoltage(defs::dacIndex index, Positions pos) const {
default: default:
throw RuntimeError("Unknown Voltage Index"); throw RuntimeError("Unknown Voltage Index");
} }
return pimpl->Parallel(&Module::setDAC, pos, -1, index, 1); return pimpl->Parallel(&Module::getDAC, pos, index, true);
} }
void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) { void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) {
@ -1456,7 +1436,7 @@ void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) {
default: default:
throw RuntimeError("Unknown Voltage Index"); throw RuntimeError("Unknown Voltage Index");
} }
pimpl->Parallel(&Module::setDAC, pos, value, index, 1); pimpl->Parallel(&Module::setDAC, pos, value, index, true);
} }
Result<uint32_t> Detector::getADCEnableMask(Positions pos) const { Result<uint32_t> Detector::getADCEnableMask(Positions pos) const {
@ -1581,11 +1561,11 @@ void Detector::setDigitalIODelay(uint64_t pinMask, int delay, Positions pos) {
} }
Result<bool> Detector::getLEDEnable(Positions pos) const { Result<bool> Detector::getLEDEnable(Positions pos) const {
return pimpl->Parallel(&Module::setLEDEnable, pos, -1); return pimpl->Parallel(&Module::getLEDEnable, pos);
} }
void Detector::setLEDEnable(bool enable, Positions pos) { void Detector::setLEDEnable(bool enable, Positions pos) {
pimpl->Parallel(&Module::setLEDEnable, pos, static_cast<int>(enable)); pimpl->Parallel(&Module::setLEDEnable, pos, enable);
} }
// Pattern // Pattern
@ -1597,7 +1577,7 @@ void Detector::savePattern(const std::string &fname) {
throw RuntimeError("Could not create file to save pattern"); throw RuntimeError("Could not create file to save pattern");
} }
// get pattern limits // get pattern limits
auto r = pimpl->Parallel(&Module::setPatternLoopAddresses, {}, -1, -1, -1) auto r = pimpl->Parallel(&Module::getPatternLoopAddresses, {}, -1)
.tsquash("Inconsistent pattern limits"); .tsquash("Inconsistent pattern limits");
CmdProxy proxy(this); CmdProxy proxy(this);
@ -1629,7 +1609,7 @@ void Detector::setPattern(const std::string &fname, Positions pos) {
} }
Result<uint64_t> Detector::getPatternIOControl(Positions pos) const { Result<uint64_t> Detector::getPatternIOControl(Positions pos) const {
return pimpl->Parallel(&Module::setPatternIOControl, pos, -1); return pimpl->Parallel(&Module::getPatternIOControl, pos);
} }
void Detector::setPatternIOControl(uint64_t word, Positions pos) { void Detector::setPatternIOControl(uint64_t word, Positions pos) {
@ -1637,7 +1617,7 @@ void Detector::setPatternIOControl(uint64_t word, Positions pos) {
} }
Result<uint64_t> Detector::getPatternClockControl(Positions pos) const { Result<uint64_t> Detector::getPatternClockControl(Positions pos) const {
return pimpl->Parallel(&Module::setPatternClockControl, pos, -1); return pimpl->Parallel(&Module::getPatternClockControl, pos);
} }
void Detector::setPatternClockControl(uint64_t word, Positions pos) { void Detector::setPatternClockControl(uint64_t word, Positions pos) {
@ -1645,7 +1625,7 @@ void Detector::setPatternClockControl(uint64_t word, Positions pos) {
} }
Result<uint64_t> Detector::getPatternWord(int addr, Positions pos) { Result<uint64_t> Detector::getPatternWord(int addr, Positions pos) {
return pimpl->Parallel(&Module::setPatternWord, pos, addr, -1); return pimpl->Parallel(&Module::getPatternWord, pos, addr);
} }
void Detector::setPatternWord(int addr, uint64_t word, Positions pos) { void Detector::setPatternWord(int addr, uint64_t word, Positions pos) {
@ -1654,8 +1634,7 @@ void Detector::setPatternWord(int addr, uint64_t word, Positions pos) {
Result<std::array<int, 2>> Result<std::array<int, 2>>
Detector::getPatternLoopAddresses(int level, Positions pos) const { Detector::getPatternLoopAddresses(int level, Positions pos) const {
return pimpl->Parallel(&Module::setPatternLoopAddresses, pos, level, -1, return pimpl->Parallel(&Module::getPatternLoopAddresses, pos, level);
-1);
} }
void Detector::setPatternLoopAddresses(int level, int start, int stop, void Detector::setPatternLoopAddresses(int level, int start, int stop,
@ -1664,7 +1643,7 @@ void Detector::setPatternLoopAddresses(int level, int start, int stop,
} }
Result<int> Detector::getPatternLoopCycles(int level, Positions pos) const { Result<int> Detector::getPatternLoopCycles(int level, Positions pos) const {
return pimpl->Parallel(&Module::setPatternLoopCycles, pos, level, -1); return pimpl->Parallel(&Module::getPatternLoopCycles, pos, level);
} }
void Detector::setPatternLoopCycles(int level, int n, Positions pos) { void Detector::setPatternLoopCycles(int level, int n, Positions pos) {
@ -1672,7 +1651,7 @@ void Detector::setPatternLoopCycles(int level, int n, Positions pos) {
} }
Result<int> Detector::getPatternWaitAddr(int level, Positions pos) const { Result<int> Detector::getPatternWaitAddr(int level, Positions pos) const {
return pimpl->Parallel(&Module::setPatternWaitAddr, pos, level, -1); return pimpl->Parallel(&Module::getPatternWaitAddr, pos, level);
} }
void Detector::setPatternWaitAddr(int level, int addr, Positions pos) { void Detector::setPatternWaitAddr(int level, int addr, Positions pos) {
@ -1680,7 +1659,7 @@ void Detector::setPatternWaitAddr(int level, int addr, Positions pos) {
} }
Result<uint64_t> Detector::getPatternWaitTime(int level, Positions pos) const { Result<uint64_t> Detector::getPatternWaitTime(int level, Positions pos) const {
return pimpl->Parallel(&Module::setPatternWaitTime, pos, level, -1); return pimpl->Parallel(&Module::getPatternWaitTime, pos, level);
} }
void Detector::setPatternWaitTime(int level, uint64_t t, Positions pos) { void Detector::setPatternWaitTime(int level, uint64_t t, Positions pos) {
@ -1886,19 +1865,20 @@ void Detector::setStopPort(int value, Positions pos) {
} }
Result<bool> Detector::getDetectorLock(Positions pos) const { Result<bool> Detector::getDetectorLock(Positions pos) const {
return pimpl->Parallel(&Module::lockServer, pos, -1); return pimpl->Parallel(&Module::getLockDetector, pos);
} }
void Detector::setDetectorLock(bool lock, Positions pos) { void Detector::setDetectorLock(bool lock, Positions pos) {
pimpl->Parallel(&Module::lockServer, pos, static_cast<int>(lock)); pimpl->Parallel(&Module::setLockDetector, pos, lock);
} }
Result<sls::IpAddr> Detector::getLastClientIP(Positions pos) const { Result<sls::IpAddr> Detector::getLastClientIP(Positions pos) const {
return pimpl->Parallel(&Module::getLastClientIP, pos); return pimpl->Parallel(&Module::getLastClientIP, pos);
} }
void Detector::executeCommand(const std::string &value, Positions pos) { Result<std::string> Detector::executeCommand(const std::string &value,
pimpl->Parallel(&Module::execCommand, pos, value); Positions pos) {
return pimpl->Parallel(&Module::execCommand, pos, value);
} }
Result<int64_t> Detector::getNumberOfFramesFromStart(Positions pos) const { Result<int64_t> Detector::getNumberOfFramesFromStart(Positions pos) const {

View File

@ -315,7 +315,7 @@ void DetectorImpl::updateDetectorSize() {
<< multi_shm()->numberOfChannels.y; << multi_shm()->numberOfChannels.y;
for (auto &d : detectors) { for (auto &d : detectors) {
d->updateMultiSize(multi_shm()->numberOfDetector); d->updateNumberOfDetector(multi_shm()->numberOfDetector);
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -523,27 +523,6 @@ TEST_CASE("overflow", "[.cmd][.new]") {
} }
} }
TEST_CASE("storeinram", "[.cmd][.new]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER) {
auto previous = det.getStoreInRamMode();
std::ostringstream oss1, oss2, oss3;
proxy.Call("storeinram", {"1"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "storeinram 1\n");
proxy.Call("storeinram", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "storeinram 1\n");
proxy.Call("storeinram", {"0"}, -1, PUT, oss3);
REQUIRE(oss3.str() == "storeinram 0\n");
for (int i = 0; i != det.size(); ++i) {
det.setStoreInRamMode(previous[i], {i});
}
} else {
REQUIRE_THROWS(proxy.Call("storeinram", {}, -1, GET));
}
}
TEST_CASE("flippeddatax", "[.cmd][.new]") { TEST_CASE("flippeddatax", "[.cmd][.new]") {
Detector det; Detector det;
CmdProxy proxy(&det); CmdProxy proxy(&det);

View File

@ -109,7 +109,6 @@ void ClientInterface::startTCPServer() {
// clang-format off // clang-format off
int ClientInterface::functionTable(){ int ClientInterface::functionTable(){
flist[F_EXEC_RECEIVER_COMMAND] = &ClientInterface::exec_command; flist[F_EXEC_RECEIVER_COMMAND] = &ClientInterface::exec_command;
flist[F_EXIT_RECEIVER] = &ClientInterface::exit_server;
flist[F_LOCK_RECEIVER] = &ClientInterface::lock_receiver; flist[F_LOCK_RECEIVER] = &ClientInterface::lock_receiver;
flist[F_GET_LAST_RECEIVER_CLIENT_IP] = &ClientInterface::get_last_client_ip; flist[F_GET_LAST_RECEIVER_CLIENT_IP] = &ClientInterface::get_last_client_ip;
flist[F_SET_RECEIVER_PORT] = &ClientInterface::set_port; flist[F_SET_RECEIVER_PORT] = &ClientInterface::set_port;
@ -291,12 +290,6 @@ int ClientInterface::exec_command(Interface &socket) {
return socket.sendResult(retval); return socket.sendResult(retval);
} }
int ClientInterface::exit_server(Interface &socket) {
LOG(logINFO) << "Closing server";
socket.Send(OK);
return GOODBYE;
}
int ClientInterface::lock_receiver(Interface &socket) { int ClientInterface::lock_receiver(Interface &socket) {
auto lock = socket.Receive<int>(); auto lock = socket.Receive<int>();
LOG(logDEBUG1) << "Locking Server to " << lock; LOG(logDEBUG1) << "Locking Server to " << lock;
@ -338,47 +331,7 @@ int ClientInterface::get_version(Interface &socket) {
int ClientInterface::setup_receiver(Interface &socket) { int ClientInterface::setup_receiver(Interface &socket) {
auto arg = socket.Receive<rxParameters>(); auto arg = socket.Receive<rxParameters>();
LOG(logDEBUG) << "detType:" << arg.detType << std::endl LOG(logDEBUG) << sls::ToString(arg);
<< "multiSize.x:" << arg.multiSize.x << std::endl
<< "multiSize.y:" << arg.multiSize.y << std::endl
<< "detId:" << arg.detId << std::endl
<< "hostname:" << arg.hostname << std::endl
<< "udpInterfaces:" << arg.udpInterfaces << std::endl
<< "udp_dstport:" << arg.udp_dstport << std::endl
<< "udp_dstip:" << sls::IpAddr(arg.udp_dstip) << std::endl
<< "udp_dstmac:" << sls::MacAddr(arg.udp_dstmac) << std::endl
<< "udp_dstport2:" << arg.udp_dstport2 << std::endl
<< "udp_dstip2:" << sls::IpAddr(arg.udp_dstip2) << std::endl
<< "udp_dstmac2:" << sls::MacAddr(arg.udp_dstmac2)
<< std::endl
<< "frames:" << arg.frames << std::endl
<< "triggers:" << arg.triggers << std::endl
<< "bursts:" << arg.bursts << std::endl
<< "analogSamples:" << arg.analogSamples << std::endl
<< "digitalSamples:" << arg.digitalSamples << std::endl
<< "expTimeNs:" << arg.expTimeNs << std::endl
<< "periodNs:" << arg.periodNs << std::endl
<< "subExpTimeNs:" << arg.subExpTimeNs << std::endl
<< "subDeadTimeNs:" << arg.subDeadTimeNs << std::endl
<< "activate:" << arg.activate << std::endl
<< "quad:" << arg.quad << std::endl
<< "dynamicRange:" << arg.dynamicRange << std::endl
<< "timMode:" << arg.timMode << std::endl
<< "tenGiga:" << arg.tenGiga << std::endl
<< "roMode:" << arg.roMode << std::endl
<< "adcMask:" << arg.adcMask << std::endl
<< "adc10gMask:" << arg.adc10gMask << std::endl
<< "roi.xmin:" << arg.roi.xmin << std::endl
<< "roi.xmax:" << arg.roi.xmax << std::endl
<< "countermask:" << arg.countermask << std::endl
<< "burstType:" << arg.burstType << std::endl
<< "exptime1:" << arg.expTime1Ns << std::endl
<< "exptime2:" << arg.expTime2Ns << std::endl
<< "exptime3:" << arg.expTime3Ns << std::endl
<< "gateDelay1:" << arg.gateDelay1Ns << std::endl
<< "gateDelay2:" << arg.gateDelay2Ns << std::endl
<< "gateDelay3:" << arg.gateDelay3Ns << std::endl
<< "gates:" << arg.gates << std::endl;
// if object exists, verify unlocked and idle, else only verify lock // if object exists, verify unlocked and idle, else only verify lock
// (connecting first time) // (connecting first time)
@ -389,10 +342,10 @@ int ClientInterface::setup_receiver(Interface &socket) {
// basic setup // basic setup
setDetectorType(arg.detType); setDetectorType(arg.detType);
{ {
int msize[2] = {arg.multiSize.x, arg.multiSize.y}; int msize[2] = {arg.numberOfDetector.x, arg.numberOfDetector.y};
impl()->setMultiDetectorSize(msize); impl()->setDetectorSize(msize);
} }
impl()->setDetectorPositionId(arg.detId); impl()->setModulePositionId(arg.moduleId);
impl()->setDetectorHostname(arg.hostname); impl()->setDetectorHostname(arg.hostname);
// udp setup // udp setup

View File

@ -61,7 +61,6 @@ class ClientInterface : private virtual slsDetectorDefs {
void verifyIdle(sls::ServerInterface &socket); void verifyIdle(sls::ServerInterface &socket);
int exec_command(sls::ServerInterface &socket); int exec_command(sls::ServerInterface &socket);
int exit_server(sls::ServerInterface &socket);
int lock_receiver(sls::ServerInterface &socket); int lock_receiver(sls::ServerInterface &socket);
int get_last_client_ip(sls::ServerInterface &socket); int get_last_client_ip(sls::ServerInterface &socket);
int set_port(sls::ServerInterface &socket); int set_port(sls::ServerInterface &socket);

View File

@ -55,7 +55,7 @@ void Implementation::InitializeMembers() {
myDetectorType = GENERIC; myDetectorType = GENERIC;
for (int i = 0; i < MAX_DIMENSIONS; ++i) for (int i = 0; i < MAX_DIMENSIONS; ++i)
numDet[i] = 0; numDet[i] = 0;
detID = 0; modulePos = 0;
detHostname = ""; detHostname = "";
silentMode = false; silentMode = false;
fifoDepth = 0; fifoDepth = 0;
@ -315,12 +315,12 @@ void Implementation::setDetectorType(const detectorType d) {
LOG(logDEBUG) << " Detector type set to " << sls::ToString(d); LOG(logDEBUG) << " Detector type set to " << sls::ToString(d);
} }
int *Implementation::getMultiDetectorSize() const { int *Implementation::getDetectorSize() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called"; LOG(logDEBUG3) << __SHORT_AT__ << " called";
return (int *)numDet; return (int *)numDet;
} }
void Implementation::setMultiDetectorSize(const int *size) { void Implementation::setDetectorSize(const int *size) {
LOG(logDEBUG3) << __SHORT_AT__ << " called"; LOG(logDEBUG3) << __SHORT_AT__ << " called";
std::string log_message = "Detector Size (ports): ("; std::string log_message = "Detector Size (ports): (";
for (int i = 0; i < MAX_DIMENSIONS; ++i) { for (int i = 0; i < MAX_DIMENSIONS; ++i) {
@ -350,31 +350,32 @@ void Implementation::setMultiDetectorSize(const int *size) {
LOG(logINFO) << log_message; LOG(logINFO) << log_message;
} }
int Implementation::getDetectorPositionId() const { int Implementation::getModulePositionId() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called"; LOG(logDEBUG3) << __SHORT_AT__ << " called";
return detID; return modulePos;
} }
void Implementation::setDetectorPositionId(const int id) { void Implementation::setModulePositionId(const int id) {
LOG(logDEBUG3) << __SHORT_AT__ << " called"; LOG(logDEBUG3) << __SHORT_AT__ << " called";
detID = id; modulePos = id;
LOG(logINFO) << "Detector Position Id:" << detID; LOG(logINFO) << "Module Position Id:" << modulePos;
// update zmq port // update zmq port
streamingPort = streamingPort =
DEFAULT_ZMQ_RX_PORTNO + (detID * (myDetectorType == EIGER ? 2 : 1)); DEFAULT_ZMQ_RX_PORTNO + (modulePos * (myDetectorType == EIGER ? 2 : 1));
for (unsigned int i = 0; i < dataProcessor.size(); ++i) { for (unsigned int i = 0; i < dataProcessor.size(); ++i) {
dataProcessor[i]->SetupFileWriter( dataProcessor[i]->SetupFileWriter(
fileWriteEnable, (int *)numDet, &framesPerFile, &fileName, fileWriteEnable, (int *)numDet, &framesPerFile, &fileName,
&filePath, &fileIndex, &overwriteEnable, &detID, &numThreads, &filePath, &fileIndex, &overwriteEnable, &modulePos, &numThreads,
&numberOfTotalFrames, &dynamicRange, &udpPortNum[i], generalData); &numberOfTotalFrames, &dynamicRange, &udpPortNum[i], generalData);
} }
assert(numDet[1] != 0); assert(numDet[1] != 0);
for (unsigned int i = 0; i < listener.size(); ++i) { for (unsigned int i = 0; i < listener.size(); ++i) {
uint16_t row = 0, col = 0; uint16_t row = 0, col = 0;
row = (detID % numDet[1]) * ((numUDPInterfaces == 2) ? 2 : 1); // row row =
col = (detID / numDet[1]) * ((myDetectorType == EIGER) ? 2 : 1) + (modulePos % numDet[1]) * ((numUDPInterfaces == 2) ? 2 : 1); // row
col = (modulePos / numDet[1]) * ((myDetectorType == EIGER) ? 2 : 1) +
i; // col for horiz. udp ports i; // col for horiz. udp ports
listener[i]->SetHardCodedPosition(row, col); listener[i]->SetHardCodedPosition(row, col);
} }
@ -555,9 +556,9 @@ void Implementation::setFileWriteEnable(const bool b) {
for (unsigned int i = 0; i < dataProcessor.size(); ++i) { for (unsigned int i = 0; i < dataProcessor.size(); ++i) {
dataProcessor[i]->SetupFileWriter( dataProcessor[i]->SetupFileWriter(
fileWriteEnable, (int *)numDet, &framesPerFile, &fileName, fileWriteEnable, (int *)numDet, &framesPerFile, &fileName,
&filePath, &fileIndex, &overwriteEnable, &detID, &numThreads, &filePath, &fileIndex, &overwriteEnable, &modulePos,
&numberOfTotalFrames, &dynamicRange, &udpPortNum[i], &numThreads, &numberOfTotalFrames, &dynamicRange,
generalData); &udpPortNum[i], generalData);
} }
} }
@ -1062,9 +1063,9 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
SetThreadPriorities(); SetThreadPriorities();
// update (from 1 to 2 interface) & also for printout // update (from 1 to 2 interface) & also for printout
setMultiDetectorSize(numDet); setDetectorSize(numDet);
// update row and column in dataprocessor // update row and column in dataprocessor
setDetectorPositionId(detID); setModulePositionId(modulePos);
// update call backs // update call backs
if (rawDataReadyCallBack) { if (rawDataReadyCallBack) {

View File

@ -28,10 +28,10 @@ class Implementation : private virtual slsDetectorDefs {
* ************************************************/ * ************************************************/
void setDetectorType(const detectorType d); void setDetectorType(const detectorType d);
int *getMultiDetectorSize() const; int *getDetectorSize() const;
void setMultiDetectorSize(const int *size); void setDetectorSize(const int *size);
int getDetectorPositionId() const; int getModulePositionId() const;
void setDetectorPositionId(const int id); void setModulePositionId(const int id);
std::string getDetectorHostname() const; std::string getDetectorHostname() const;
void setDetectorHostname(const std::string &c); void setDetectorHostname(const std::string &c);
bool getSilentMode() const; bool getSilentMode() const;
@ -265,7 +265,7 @@ class Implementation : private virtual slsDetectorDefs {
int numThreads; int numThreads;
detectorType myDetectorType; detectorType myDetectorType;
int numDet[MAX_DIMENSIONS]; int numDet[MAX_DIMENSIONS];
int detID; int modulePos;
std::string detHostname; std::string detHostname;
bool silentMode; bool silentMode;
uint32_t fifoDepth; uint32_t fifoDepth;

View File

@ -41,6 +41,9 @@ std::string ToString(const defs::timingSourceType s);
std::string ToString(const slsDetectorDefs::ROI &roi); std::string ToString(const slsDetectorDefs::ROI &roi);
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi); std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
std::string ToString(const slsDetectorDefs::rxParameters &r);
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::rxParameters &r);
const std::string &ToString(const std::string &s); const std::string &ToString(const std::string &s);
/** Convert std::chrono::duration with specified output unit */ /** Convert std::chrono::duration with specified output unit */

View File

@ -445,8 +445,8 @@ typedef struct {
*/ */
struct rxParameters { struct rxParameters {
detectorType detType{GENERIC}; detectorType detType{GENERIC};
xy multiSize; xy numberOfDetector;
int detId{0}; int moduleId{0};
char hostname[MAX_STR_LENGTH]; char hostname[MAX_STR_LENGTH];
int udpInterfaces{1}; int udpInterfaces{1};
int udp_dstport{0}; int udp_dstport{0};

View File

@ -26,15 +26,12 @@ enum detFuncs {
F_WRITE_REGISTER, F_WRITE_REGISTER,
F_READ_REGISTER, F_READ_REGISTER,
F_SET_MODULE, F_SET_MODULE,
F_GET_MODULE,
F_SET_SETTINGS, F_SET_SETTINGS,
F_GET_THRESHOLD_ENERGY, F_GET_THRESHOLD_ENERGY,
F_START_ACQUISITION, F_START_ACQUISITION,
F_STOP_ACQUISITION, F_STOP_ACQUISITION,
F_START_READOUT,
F_GET_RUN_STATUS, F_GET_RUN_STATUS,
F_START_AND_READ_ALL, F_START_AND_READ_ALL,
F_READ_ALL,
F_GET_NUM_FRAMES, F_GET_NUM_FRAMES,
F_SET_NUM_FRAMES, F_SET_NUM_FRAMES,
F_GET_NUM_TRIGGERS, F_GET_NUM_TRIGGERS,
@ -70,7 +67,6 @@ enum detFuncs {
F_SET_DYNAMIC_RANGE, F_SET_DYNAMIC_RANGE,
F_SET_ROI, F_SET_ROI,
F_GET_ROI, F_GET_ROI,
F_EXIT_SERVER,
F_LOCK_SERVER, F_LOCK_SERVER,
F_GET_LAST_CLIENT_IP, F_GET_LAST_CLIENT_IP,
F_SET_PORT, F_SET_PORT,
@ -161,8 +157,6 @@ enum detFuncs {
F_GET_PARALLEL_MODE, F_GET_PARALLEL_MODE,
F_SET_OVERFLOW_MODE, F_SET_OVERFLOW_MODE,
F_GET_OVERFLOW_MODE, F_GET_OVERFLOW_MODE,
F_SET_STOREINRAM_MODE,
F_GET_STOREINRAM_MODE,
F_SET_READOUT_MODE, F_SET_READOUT_MODE,
F_GET_READOUT_MODE, F_GET_READOUT_MODE,
F_SET_CLOCK_FREQUENCY, F_SET_CLOCK_FREQUENCY,
@ -213,7 +207,6 @@ enum detFuncs {
(detector server should not compile anyway) */ (detector server should not compile anyway) */
F_EXEC_RECEIVER_COMMAND, F_EXEC_RECEIVER_COMMAND,
F_EXIT_RECEIVER,
F_LOCK_RECEIVER, F_LOCK_RECEIVER,
F_GET_LAST_RECEIVER_CLIENT_IP, F_GET_LAST_RECEIVER_CLIENT_IP,
F_SET_RECEIVER_PORT, F_SET_RECEIVER_PORT,
@ -332,15 +325,12 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_WRITE_REGISTER: return "F_WRITE_REGISTER"; case F_WRITE_REGISTER: return "F_WRITE_REGISTER";
case F_READ_REGISTER: return "F_READ_REGISTER"; case F_READ_REGISTER: return "F_READ_REGISTER";
case F_SET_MODULE: return "F_SET_MODULE"; case F_SET_MODULE: return "F_SET_MODULE";
case F_GET_MODULE: return "F_GET_MODULE";
case F_SET_SETTINGS: return "F_SET_SETTINGS"; case F_SET_SETTINGS: return "F_SET_SETTINGS";
case F_GET_THRESHOLD_ENERGY: return "F_GET_THRESHOLD_ENERGY"; case F_GET_THRESHOLD_ENERGY: return "F_GET_THRESHOLD_ENERGY";
case F_START_ACQUISITION: return "F_START_ACQUISITION"; case F_START_ACQUISITION: return "F_START_ACQUISITION";
case F_STOP_ACQUISITION: return "F_STOP_ACQUISITION"; case F_STOP_ACQUISITION: return "F_STOP_ACQUISITION";
case F_START_READOUT: return "F_START_READOUT";
case F_GET_RUN_STATUS: return "F_GET_RUN_STATUS"; case F_GET_RUN_STATUS: return "F_GET_RUN_STATUS";
case F_START_AND_READ_ALL: return "F_START_AND_READ_ALL"; case F_START_AND_READ_ALL: return "F_START_AND_READ_ALL";
case F_READ_ALL: return "F_READ_ALL";
case F_GET_NUM_FRAMES: return "F_GET_NUM_FRAMES"; case F_GET_NUM_FRAMES: return "F_GET_NUM_FRAMES";
case F_SET_NUM_FRAMES: return "F_SET_NUM_FRAMES"; case F_SET_NUM_FRAMES: return "F_SET_NUM_FRAMES";
case F_GET_NUM_TRIGGERS: return "F_GET_NUM_TRIGGERS"; case F_GET_NUM_TRIGGERS: return "F_GET_NUM_TRIGGERS";
@ -376,7 +366,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_SET_DYNAMIC_RANGE: return "F_SET_DYNAMIC_RANGE"; case F_SET_DYNAMIC_RANGE: return "F_SET_DYNAMIC_RANGE";
case F_SET_ROI: return "F_SET_ROI"; case F_SET_ROI: return "F_SET_ROI";
case F_GET_ROI: return "F_GET_ROI"; case F_GET_ROI: return "F_GET_ROI";
case F_EXIT_SERVER: return "F_EXIT_SERVER";
case F_LOCK_SERVER: return "F_LOCK_SERVER"; case F_LOCK_SERVER: return "F_LOCK_SERVER";
case F_GET_LAST_CLIENT_IP: return "F_GET_LAST_CLIENT_IP"; case F_GET_LAST_CLIENT_IP: return "F_GET_LAST_CLIENT_IP";
case F_SET_PORT: return "F_SET_PORT"; case F_SET_PORT: return "F_SET_PORT";
@ -467,8 +456,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_GET_PARALLEL_MODE: return "F_GET_PARALLEL_MODE"; case F_GET_PARALLEL_MODE: return "F_GET_PARALLEL_MODE";
case F_SET_OVERFLOW_MODE: return "F_SET_OVERFLOW_MODE"; case F_SET_OVERFLOW_MODE: return "F_SET_OVERFLOW_MODE";
case F_GET_OVERFLOW_MODE: return "F_GET_OVERFLOW_MODE"; case F_GET_OVERFLOW_MODE: return "F_GET_OVERFLOW_MODE";
case F_SET_STOREINRAM_MODE: return "F_SET_STOREINRAM_MODE";
case F_GET_STOREINRAM_MODE: return "F_GET_STOREINRAM_MODE";
case F_SET_READOUT_MODE: return "F_SET_READOUT_MODE"; case F_SET_READOUT_MODE: return "F_SET_READOUT_MODE";
case F_GET_READOUT_MODE: return "F_GET_READOUT_MODE"; case F_GET_READOUT_MODE: return "F_GET_READOUT_MODE";
case F_SET_CLOCK_FREQUENCY: return "F_SET_CLOCK_FREQUENCY"; case F_SET_CLOCK_FREQUENCY: return "F_SET_CLOCK_FREQUENCY";
@ -518,7 +505,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START"; case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
case F_EXEC_RECEIVER_COMMAND: return "F_EXEC_RECEIVER_COMMAND"; case F_EXEC_RECEIVER_COMMAND: return "F_EXEC_RECEIVER_COMMAND";
case F_EXIT_RECEIVER: return "F_EXIT_RECEIVER";
case F_LOCK_RECEIVER: return "F_LOCK_RECEIVER"; case F_LOCK_RECEIVER: return "F_LOCK_RECEIVER";
case F_GET_LAST_RECEIVER_CLIENT_IP: return "F_GET_LAST_RECEIVER_CLIENT_IP"; case F_GET_LAST_RECEIVER_CLIENT_IP: return "F_GET_LAST_RECEIVER_CLIENT_IP";
case F_SET_RECEIVER_PORT: return "F_SET_RECEIVER_PORT"; case F_SET_RECEIVER_PORT: return "F_SET_RECEIVER_PORT";

View File

@ -3,10 +3,10 @@
#define APILIB 0x200409 #define APILIB 0x200409
#define APIRECEIVER 0x200409 #define APIRECEIVER 0x200409
#define APIGUI 0x200409 #define APIGUI 0x200409
#define APICTB 0x200610 #define APIEIGER 0x200618
#define APIGOTTHARD 0x200610 #define APICTB 0x200618
#define APIJUNGFRAU 0x200610 #define APIGOTTHARD 0x200618
#define APIMOENCH 0x200610 #define APIGOTTHARD2 0x200618
#define APIGOTTHARD2 0x200610 #define APIJUNGFRAU 0x200618
#define APIMYTHEN3 0x200616 #define APIMYTHEN3 0x200618
#define APIEIGER 0x200617 #define APIMOENCH 0x200615

View File

@ -1,4 +1,5 @@
#include "ToString.h" #include "ToString.h"
#include "network_utils.h"
namespace sls { namespace sls {
@ -12,6 +13,57 @@ std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi) {
return os << ToString(roi); return os << ToString(roi);
} }
std::string ToString(const slsDetectorDefs::rxParameters &r) {
std::ostringstream oss;
oss << '[' << "detType:" << r.detType << std::endl
<< "numberOfDetector.x:" << r.numberOfDetector.x << std::endl
<< "numberOfDetector.y:" << r.numberOfDetector.y << std::endl
<< "moduleId:" << r.moduleId << std::endl
<< "hostname:" << r.hostname << std::endl
<< "udpInterfaces:" << r.udpInterfaces << std::endl
<< "udp_dstport:" << r.udp_dstport << std::endl
<< "udp_dstip:" << sls::IpAddr(r.udp_dstip) << std::endl
<< "udp_dstmac:" << sls::MacAddr(r.udp_dstmac) << std::endl
<< "udp_dstport2:" << r.udp_dstport2 << std::endl
<< "udp_dstip2:" << sls::IpAddr(r.udp_dstip2) << std::endl
<< "udp_dstmac2:" << sls::MacAddr(r.udp_dstmac2) << std::endl
<< "frames:" << r.frames << std::endl
<< "triggers:" << r.triggers << std::endl
<< "bursts:" << r.bursts << std::endl
<< "analogSamples:" << r.analogSamples << std::endl
<< "digitalSamples:" << r.digitalSamples << std::endl
<< "expTimeNs:" << r.expTimeNs << std::endl
<< "periodNs:" << r.periodNs << std::endl
<< "subExpTimeNs:" << r.subExpTimeNs << std::endl
<< "subDeadTimeNs:" << r.subDeadTimeNs << std::endl
<< "activate:" << r.activate << std::endl
<< "quad:" << r.quad << std::endl
<< "dynamicRange:" << r.dynamicRange << std::endl
<< "timMode:" << r.timMode << std::endl
<< "tenGiga:" << r.tenGiga << std::endl
<< "roMode:" << r.roMode << std::endl
<< "adcMask:" << r.adcMask << std::endl
<< "adc10gMask:" << r.adc10gMask << std::endl
<< "roi.xmin:" << r.roi.xmin << std::endl
<< "roi.xmax:" << r.roi.xmax << std::endl
<< "countermask:" << r.countermask << std::endl
<< "burstType:" << r.burstType << std::endl
<< "exptime1:" << r.expTime1Ns << std::endl
<< "exptime2:" << r.expTime2Ns << std::endl
<< "exptime3:" << r.expTime3Ns << std::endl
<< "gateDelay1:" << r.gateDelay1Ns << std::endl
<< "gateDelay2:" << r.gateDelay2Ns << std::endl
<< "gateDelay3:" << r.gateDelay3Ns << std::endl
<< "gates:" << r.gates << std::endl
<< ']';
return oss.str();
}
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::rxParameters &r) {
return os << ToString(r);
}
std::string ToString(const defs::runStatus s) { std::string ToString(const defs::runStatus s) {
switch (s) { switch (s) {
case defs::ERROR: case defs::ERROR: