mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 22:40:02 +02:00
WIP
This commit is contained in:
parent
d3e60eba80
commit
a0bdfcdae3
@ -201,9 +201,9 @@ void qTabMeasurement::GetTimingMode() {
|
||||
|
||||
try {
|
||||
auto oldMode = comboTimingMode->currentIndex();
|
||||
auto retval = myDet->setExternalCommunicationMode();
|
||||
auto retval = myDet->setTimingMode();
|
||||
switch(retval) {
|
||||
case slsDetectorDefs::GET_EXTERNAL_COMMUNICATION_MODE:
|
||||
case slsDetectorDefs::GET_TIMING_MODE:
|
||||
qDefs::Message(qDefs::WARNING, "Timing Mode is inconsistent for all detectors.", "qTabMeasurement::GetTimingMode");
|
||||
break;
|
||||
case slsDetectorDefs::AUTO_TIMING:
|
||||
@ -229,7 +229,7 @@ void qTabMeasurement::SetTimingMode(int val) {
|
||||
FILE_LOG(logINFO) << "Setting timing mode:" << comboTimingMode->currentText().toAscii().data();
|
||||
|
||||
try {
|
||||
myDet->setExternalCommunicationMode(static_cast<slsDetectorDefs::externalCommunicationMode>(val));
|
||||
myDet->setTimingMode(static_cast<slsDetectorDefs::timingMode>(val));
|
||||
EnableWidgetsforTimingMode();
|
||||
} CATCH_HANDLE("Could not set timing mode.", "qTabMeasurement::SetTimingMode", this, &qTabMeasurement::GetTimingMode)
|
||||
}
|
||||
|
Binary file not shown.
@ -1444,9 +1444,9 @@ int setHighVoltage(int val){
|
||||
/* parameters - timing, extsig */
|
||||
|
||||
|
||||
void setTiming( enum externalCommunicationMode arg){
|
||||
void setTiming( enum timingMode arg){
|
||||
|
||||
if(arg != GET_EXTERNAL_COMMUNICATION_MODE){
|
||||
if(arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
@ -1464,7 +1464,7 @@ void setTiming( enum externalCommunicationMode arg){
|
||||
}
|
||||
|
||||
|
||||
enum externalCommunicationMode getTiming() {
|
||||
enum timingMode getTiming() {
|
||||
if (bus_r(EXT_SIGNAL_REG) == EXT_SIGNAL_MSK)
|
||||
return TRIGGER_EXPOSURE;
|
||||
return AUTO_TIMING;
|
||||
|
@ -1193,9 +1193,9 @@ int setHighVoltage(int val) {
|
||||
|
||||
/* parameters - timing, extsig */
|
||||
|
||||
void setTiming( enum externalCommunicationMode arg) {
|
||||
enum externalCommunicationMode ret=GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
if (arg != GET_EXTERNAL_COMMUNICATION_MODE) {
|
||||
void setTiming( enum timingMode arg) {
|
||||
enum timingMode ret=GET_TIMING_MODE;
|
||||
if (arg != GET_TIMING_MODE) {
|
||||
switch((int)arg) {
|
||||
case AUTO_TIMING: ret = 0; break;
|
||||
case TRIGGER_EXPOSURE: ret = 2; break;
|
||||
@ -1211,8 +1211,8 @@ void setTiming( enum externalCommunicationMode arg) {
|
||||
}
|
||||
|
||||
|
||||
enum externalCommunicationMode getTiming() {
|
||||
enum externalCommunicationMode ret = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
enum timingMode getTiming() {
|
||||
enum timingMode ret = GET_TIMING_MODE;
|
||||
ret = eiger_triggermode;
|
||||
switch((int)ret) {
|
||||
case 0: ret = AUTO_TIMING; break;
|
||||
|
Binary file not shown.
@ -1226,10 +1226,10 @@ int setHighVoltage(int val){
|
||||
/* parameters - timing, extsig */
|
||||
|
||||
|
||||
void setTiming( enum externalCommunicationMode arg){
|
||||
void setTiming( enum timingMode arg){
|
||||
u_int32_t addr = EXT_SIGNAL_REG;
|
||||
|
||||
if (arg != GET_EXTERNAL_COMMUNICATION_MODE){
|
||||
if (arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
@ -1251,7 +1251,7 @@ void setTiming( enum externalCommunicationMode arg){
|
||||
}
|
||||
}
|
||||
|
||||
enum externalCommunicationMode getTiming() {
|
||||
enum timingMode getTiming() {
|
||||
u_int32_t regval = bus_r(EXT_SIGNAL_REG);
|
||||
switch (regval) {
|
||||
case EXT_SIGNAL_TRGGR_IN_RSNG_VAL:
|
||||
@ -1456,7 +1456,7 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
|
||||
*/
|
||||
FILE_LOG(logINFOBLUE, ("Sending an image to counter the packet numbers\n"));
|
||||
// remember old parameters
|
||||
enum externalCommunicationMode oldtiming = getTiming();
|
||||
enum timingMode oldtiming = getTiming();
|
||||
uint64_t oldframes = setTimer(FRAME_NUMBER, -1);
|
||||
uint64_t oldcycles = setTimer(CYCLES_NUMBER, -1);
|
||||
uint64_t oldPeriod = setTimer(FRAME_PERIOD, -1);
|
||||
|
Binary file not shown.
@ -976,9 +976,9 @@ int setHighVoltage(int val){
|
||||
/* parameters - timing, extsig */
|
||||
|
||||
|
||||
void setTiming( enum externalCommunicationMode arg){
|
||||
void setTiming( enum timingMode arg){
|
||||
|
||||
if(arg != GET_EXTERNAL_COMMUNICATION_MODE){
|
||||
if(arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
@ -996,7 +996,7 @@ void setTiming( enum externalCommunicationMode arg){
|
||||
}
|
||||
|
||||
|
||||
enum externalCommunicationMode getTiming() {
|
||||
enum timingMode getTiming() {
|
||||
if (bus_r(EXT_SIGNAL_REG) == EXT_SIGNAL_MSK)
|
||||
return TRIGGER_EXPOSURE;
|
||||
return AUTO_TIMING;
|
||||
|
@ -1061,9 +1061,9 @@ int setHighVoltage(int val){
|
||||
/* parameters - timing, extsig */
|
||||
|
||||
|
||||
void setTiming( enum externalCommunicationMode arg){
|
||||
void setTiming( enum timingMode arg){
|
||||
|
||||
if(arg != GET_EXTERNAL_COMMUNICATION_MODE){
|
||||
if(arg != GET_TIMING_MODE){
|
||||
switch((int)arg){
|
||||
case AUTO_TIMING:
|
||||
FILE_LOG(logINFO, ("Set Timing: Auto\n"));
|
||||
@ -1081,7 +1081,7 @@ void setTiming( enum externalCommunicationMode arg){
|
||||
}
|
||||
|
||||
|
||||
enum externalCommunicationMode getTiming() {
|
||||
enum timingMode getTiming() {
|
||||
if (bus_r(EXT_SIGNAL_REG) == EXT_SIGNAL_MSK)
|
||||
return TRIGGER_EXPOSURE;
|
||||
return AUTO_TIMING;
|
||||
|
@ -212,8 +212,8 @@ int setHighVoltage(int val);
|
||||
|
||||
|
||||
// parameters - timing, extsig
|
||||
void setTiming( enum externalCommunicationMode arg);
|
||||
enum externalCommunicationMode getTiming();
|
||||
void setTiming( enum timingMode arg);
|
||||
enum timingMode getTiming();
|
||||
#ifdef GOTTHARDD
|
||||
void setExtSignal(enum externalSignalFlag mode);
|
||||
int getExtSignal();
|
||||
|
@ -167,7 +167,7 @@ const char* getFunctionName(enum detFuncs func) {
|
||||
case F_EXEC_COMMAND: return "F_EXEC_COMMAND";
|
||||
case F_GET_DETECTOR_TYPE: return "F_GET_DETECTOR_TYPE";
|
||||
case F_SET_EXTERNAL_SIGNAL_FLAG: return "F_SET_EXTERNAL_SIGNAL_FLAG";
|
||||
case F_SET_EXTERNAL_COMMUNICATION_MODE: return "F_SET_EXTERNAL_COMMUNICATION_MODE";
|
||||
case F_SET_TIMING_MODE: return "F_SET_TIMING_MODE";
|
||||
case F_GET_ID: return "F_GET_ID";
|
||||
case F_DIGITAL_TEST: return "F_DIGITAL_TEST";
|
||||
case F_SET_DAC: return "F_SET_DAC";
|
||||
@ -258,7 +258,7 @@ void function_table() {
|
||||
flist[F_EXEC_COMMAND] = &exec_command;
|
||||
flist[F_GET_DETECTOR_TYPE] = &get_detector_type;
|
||||
flist[F_SET_EXTERNAL_SIGNAL_FLAG] = &set_external_signal_flag;
|
||||
flist[F_SET_EXTERNAL_COMMUNICATION_MODE] = &set_external_communication_mode;
|
||||
flist[F_SET_TIMING_MODE] = &set_timing_mode;
|
||||
flist[F_GET_ID] = &get_id;
|
||||
flist[F_DIGITAL_TEST] = &digital_test;
|
||||
flist[F_SET_DAC] = &set_dac;
|
||||
@ -525,18 +525,18 @@ int set_external_signal_flag(int file_des) {
|
||||
|
||||
|
||||
|
||||
int set_external_communication_mode(int file_des) {
|
||||
int set_timing_mode(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
enum externalCommunicationMode arg = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
enum externalCommunicationMode retval = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
enum timingMode arg = GET_TIMING_MODE;
|
||||
enum timingMode retval = GET_TIMING_MODE;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
FILE_LOG(logDEBUG1, ("Setting external communication mode to %d\n", arg));
|
||||
|
||||
// set
|
||||
if ((arg != GET_EXTERNAL_COMMUNICATION_MODE) && (Server_VerifyLock() == OK)) {
|
||||
if ((arg != GET_TIMING_MODE) && (Server_VerifyLock() == OK)) {
|
||||
switch (arg) {
|
||||
case AUTO_TIMING:
|
||||
case TRIGGER_EXPOSURE:
|
||||
|
@ -27,7 +27,7 @@ int M_nofuncMode(int);
|
||||
int exec_command(int);
|
||||
int get_detector_type(int);
|
||||
int set_external_signal_flag(int);
|
||||
int set_external_communication_mode(int);
|
||||
int set_timing_mode(int);
|
||||
int get_id(int);
|
||||
int digital_test(int);
|
||||
int set_dac(int);
|
||||
|
@ -162,15 +162,13 @@ class Detector {
|
||||
|
||||
void setDAC(int value, defs::dacIndex index, bool mV, Positions pos = {});
|
||||
|
||||
//TODO: rename externalCommunicationMode: timingMode
|
||||
Result<defs::externalCommunicationMode>
|
||||
getTimingMode(Positions pos = {}) const;
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE]
|
||||
* [Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER]
|
||||
*/
|
||||
void setTimingMode(defs::externalCommunicationMode value,
|
||||
void setTimingMode(defs::timingMode value,
|
||||
Positions pos = {});
|
||||
|
||||
|
||||
|
@ -763,9 +763,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns current timing mode
|
||||
*/
|
||||
externalCommunicationMode setExternalCommunicationMode(
|
||||
externalCommunicationMode pol = GET_EXTERNAL_COMMUNICATION_MODE,
|
||||
int detPos = -1);//
|
||||
timingMode setTimingMode(timingMode pol = GET_TIMING_MODE, int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
|
@ -618,8 +618,7 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
* @param pol timing mode (-1 gets)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
externalCommunicationMode setExternalCommunicationMode(
|
||||
externalCommunicationMode pol = GET_EXTERNAL_COMMUNICATION_MODE);
|
||||
timingMode setTimingMode(timingMode pol = GET_TIMING_MODE);
|
||||
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
|
@ -385,7 +385,7 @@ public:
|
||||
/**
|
||||
* Set/get timing mode
|
||||
* @param pol timing mode (-1 gets)
|
||||
* Options (slsDetectorDefs::externalCommunicationMode)
|
||||
* Options (slsDetectorDefs::timingMode)
|
||||
* (Eiger: AUTO_TIMING, TRIGGER_EXPOSURE, BURST_TRIGGER, GATED)
|
||||
* (Jungfrau: AUTO_TIMING, TRIGGER_EXPOSURE)
|
||||
* (Gotthard: AUTO_TIMING, TRIGGER_EXPOSURE)
|
||||
|
@ -548,15 +548,13 @@ void Detector::setDAC(int value, defs::dacIndex index, bool mV, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDAC, pos, value, index, mV);
|
||||
}
|
||||
|
||||
Result<defs::externalCommunicationMode>
|
||||
Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setExternalCommunicationMode, pos,
|
||||
defs::GET_EXTERNAL_COMMUNICATION_MODE);
|
||||
Result<defs::timingMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setTimingMode, pos,
|
||||
defs::GET_TIMING_MODE);
|
||||
}
|
||||
|
||||
void Detector::setTimingMode(defs::externalCommunicationMode value,
|
||||
Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setExternalCommunicationMode, pos, value);
|
||||
void Detector::setTimingMode(defs::timingMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTimingMode, pos, value);
|
||||
}
|
||||
|
||||
Result<defs::externalSignalFlag>
|
||||
|
@ -1110,16 +1110,14 @@ int multiSlsDetector::getADC(dacIndex index, int detPos) {
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalCommunicationMode
|
||||
multiSlsDetector::setExternalCommunicationMode(externalCommunicationMode pol,
|
||||
int detPos) {
|
||||
slsDetectorDefs::timingMode multiSlsDetector::setTimingMode(timingMode pol, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setExternalCommunicationMode(pol);
|
||||
return detectors[detPos]->setTimingMode(pol);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::setExternalCommunicationMode, pol);
|
||||
auto r = parallelCall(&slsDetector::setTimingMode, pol);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
|
@ -1457,11 +1457,10 @@ int slsDetector::getADC(dacIndex index) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalCommunicationMode
|
||||
slsDetector::setExternalCommunicationMode(externalCommunicationMode pol) {
|
||||
int fnum = F_SET_EXTERNAL_COMMUNICATION_MODE;
|
||||
slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode pol) {
|
||||
int fnum = F_SET_TIMING_MODE;
|
||||
auto arg = static_cast<int>(pol);
|
||||
externalCommunicationMode retval = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
FILE_LOG(logDEBUG1) << "Setting communication to mode " << pol;
|
||||
sendToDetector(fnum, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
|
@ -4285,11 +4285,11 @@ std::string slsDetectorCommand::cmdTiming(int narg, const char * const args[], i
|
||||
return helpTiming(HELP_ACTION);
|
||||
}
|
||||
if (action == PUT_ACTION) {
|
||||
if (myDet->externalCommunicationType(std::string(args[1])) == GET_EXTERNAL_COMMUNICATION_MODE)
|
||||
if (myDet->timingModeType(std::string(args[1])) == GET_TIMING_MODE)
|
||||
return helpTiming(action);
|
||||
myDet->setExternalCommunicationMode(myDet->externalCommunicationType(std::string(args[1])), detPos);
|
||||
myDet->setTimingMode(myDet->timingModeType(std::string(args[1])), detPos);
|
||||
}
|
||||
return myDet->externalCommunicationType(myDet->setExternalCommunicationMode(GET_EXTERNAL_COMMUNICATION_MODE, detPos));
|
||||
return myDet->timingModeType(myDet->setTimingMode(GET_TIMING_MODE, detPos));
|
||||
}
|
||||
std::string slsDetectorCommand::helpTiming(int action) {
|
||||
|
||||
|
@ -167,7 +167,7 @@ double slsDetectorUsers::getMeasuredSubFramePeriod(bool inseconds, int detPos) {
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setTimingMode(int pol, int detPos){
|
||||
return detector.setExternalCommunicationMode(slsDetectorDefs::externalCommunicationMode(pol), detPos);
|
||||
return detector.setTimingMode(slsDetectorDefs::timingMode(pol), detPos);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setClockDivider(int value, int detPos) {
|
||||
|
@ -337,9 +337,8 @@ format
|
||||
/**
|
||||
communication mode using external signals
|
||||
*/
|
||||
enum externalCommunicationMode {
|
||||
GET_EXTERNAL_COMMUNICATION_MODE =
|
||||
-1, /**<return flag for communication mode */
|
||||
enum timingMode {
|
||||
GET_TIMING_MODE = -1, /**<return flag for communication mode */
|
||||
AUTO_TIMING, /**< internal timing */
|
||||
TRIGGER_EXPOSURE, /**< trigger mode i.e. exposure is triggered */
|
||||
GATED, /**< gated */
|
||||
@ -792,11 +791,11 @@ format
|
||||
/**
|
||||
returns external communication mode std::string from index
|
||||
\param f can be AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER,
|
||||
GET_EXTERNAL_COMMUNICATION_MODE \returns auto, trigger, gating,
|
||||
GET_TIMING_MODE \returns auto, trigger, gating,
|
||||
burst_trigger, unknown
|
||||
*/
|
||||
|
||||
static std::string externalCommunicationType(externalCommunicationMode f) {
|
||||
static std::string timingModeType(timingMode f) {
|
||||
switch (f) {
|
||||
case AUTO_TIMING:
|
||||
return std::string("auto");
|
||||
@ -815,11 +814,10 @@ format
|
||||
returns external communication mode index from std::string
|
||||
\param sval can be auto, trigger, gating, burst_trigger
|
||||
\returns AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER,
|
||||
GET_EXTERNAL_COMMUNICATION_MODE
|
||||
GET_TIMING_MODE
|
||||
*/
|
||||
|
||||
static externalCommunicationMode
|
||||
externalCommunicationType(std::string sval) {
|
||||
static timingMode timingModeType(std::string sval) {
|
||||
if (sval == "auto")
|
||||
return AUTO_TIMING;
|
||||
if (sval == "trigger")
|
||||
@ -828,7 +826,7 @@ format
|
||||
return GATED;
|
||||
if (sval == "burst_trigger")
|
||||
return BURST_TRIGGER;
|
||||
return GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
return GET_TIMING_MODE;
|
||||
};
|
||||
|
||||
/** returns std::string from file format index
|
||||
|
@ -13,7 +13,7 @@ enum detFuncs{
|
||||
F_EXEC_COMMAND=0, /**< command is executed */
|
||||
F_GET_DETECTOR_TYPE, /**< return detector type */
|
||||
F_SET_EXTERNAL_SIGNAL_FLAG, /**< set/get flag for external signal */
|
||||
F_SET_EXTERNAL_COMMUNICATION_MODE, /**< set/get external communication mode (obsolete) */
|
||||
F_SET_TIMING_MODE, /**< set/get external communication mode (obsolete) */
|
||||
F_GET_ID, /**< get detector id of version */
|
||||
F_DIGITAL_TEST, /**< digital test of the detector */
|
||||
F_SET_DAC, /**< set DAC value */
|
||||
@ -164,7 +164,7 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_EXEC_COMMAND: return "F_EXEC_COMMAND";
|
||||
case F_GET_DETECTOR_TYPE: return "F_GET_DETECTOR_TYPE";
|
||||
case F_SET_EXTERNAL_SIGNAL_FLAG: return "F_SET_EXTERNAL_SIGNAL_FLAG";
|
||||
case F_SET_EXTERNAL_COMMUNICATION_MODE: return "F_SET_EXTERNAL_COMMUNICATION_MODE";
|
||||
case F_SET_TIMING_MODE: return "F_SET_TIMING_MODE";
|
||||
case F_GET_ID: return "F_GET_ID";
|
||||
case F_DIGITAL_TEST: return "F_DIGITAL_TEST";
|
||||
case F_SET_DAC: return "F_SET_DAC";
|
||||
|
@ -1,10 +1,10 @@
|
||||
/** API versions */
|
||||
#define GITBRANCH "developer"
|
||||
#define APIMOENCH 0x181108
|
||||
#define APICTB 0x190604
|
||||
#define APILIB 0x190723
|
||||
#define APIRECEIVER 0x190722
|
||||
#define APIGUI 0x190723
|
||||
#define APIJUNGFRAU 0x190730
|
||||
#define APIGOTTHARD 0x190813
|
||||
#define APIEIGER 0x190816
|
||||
#define APIGOTTHARD 0x190816
|
||||
#define APIJUNGFRAU 0x190816
|
||||
#define APIMOENCH 0x190816
|
||||
|
Loading…
x
Reference in New Issue
Block a user