diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer
new file mode 100755
index 000000000..fd0648a48
Binary files /dev/null and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ
diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c
index 37c50026c..c71f6bf7e 100755
--- a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c
+++ b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c
@@ -485,31 +485,26 @@ int get_detector_type(int file_des) {
int set_external_signal_flag(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
- int args[2] = {-1,-1};
+ int arg = -1;
enum externalSignalFlag retval= GET_EXTERNAL_SIGNAL_FLAG;
- if (receiveData(file_des, args, sizeof(args), INT32) < 0)
+ if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
return printSocketReadError();
- int signalindex = args[0];
- enum externalSignalFlag flag = args[1];
- FILE_LOG(logDEBUG1, ("Setting external signal %d to flag %d\n", signalindex, flag));
+ enum externalSignalFlag flag = arg;
+ FILE_LOG(logDEBUG1, ("Setting external signal flag to %d\n", flag));
#ifndef GOTTHARDD
functionNotImplemented();
#else
- if (signalindex > 0)
- modeNotImplemented("Signal index", signalindex);
- else {
- // set
- if ((flag != GET_EXTERNAL_SIGNAL_FLAG) && (Server_VerifyLock() == OK)) {
- setExtSignal(flag);
- }
- // get
- retval = getExtSignal();
- validate((int)flag, (int)retval, "set external signal flag", DEC);
- FILE_LOG(logDEBUG1, ("External Signal Flag: %d\n", retval));
+ // set
+ if ((flag != GET_EXTERNAL_SIGNAL_FLAG) && (Server_VerifyLock() == OK)) {
+ setExtSignal(flag);
}
+ // get
+ retval = getExtSignal();
+ validate((int)flag, (int)retval, "set external signal flag", DEC);
+ FILE_LOG(logDEBUG1, ("External Signal Flag: %d\n", retval));
#endif
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
}
diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h
index 28a56a08b..a4617cd38 100755
--- a/slsDetectorSoftware/include/multiSlsDetector.h
+++ b/slsDetectorSoftware/include/multiSlsDetector.h
@@ -821,13 +821,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* Set/get external signal flags (to specify triggerinrising edge etc)
* (Gotthard, Mythen)
* @param pol external signal flag (-1 gets)
- * @param signalindex singal index (0 - 3)
* @param detPos -1 for all detectors in list or specific detector position
* @returns current timing mode
*/
externalSignalFlag
setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG,
- int signalindex = 0, int detPos = -1);
+ int detPos = -1);
/**
* Set/get readout flags (Eiger, Mythen)
diff --git a/slsDetectorSoftware/include/slsDetector.h b/slsDetectorSoftware/include/slsDetector.h
index 99da58602..913d03f14 100755
--- a/slsDetectorSoftware/include/slsDetector.h
+++ b/slsDetectorSoftware/include/slsDetector.h
@@ -814,10 +814,9 @@ class slsDetector : public virtual slsDetectorDefs{
/**
* Set/get external signal flags (to specify triggerinrising edge etc) (Gotthard, Mythen)
* @param pol external signal flag (-1 gets)
- * @param signalindex singal index (0 - 3)
* @returns current timing mode
*/
- externalSignalFlag setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG, int signalindex = 0);
+ externalSignalFlag setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG);
/**
* Set/get readout flags (Eiger, Mythen)
diff --git a/slsDetectorSoftware/src/multiSlsDetector.cpp b/slsDetectorSoftware/src/multiSlsDetector.cpp
index ddbb0ab26..1acf99192 100755
--- a/slsDetectorSoftware/src/multiSlsDetector.cpp
+++ b/slsDetectorSoftware/src/multiSlsDetector.cpp
@@ -1352,14 +1352,14 @@ multiSlsDetector::setExternalCommunicationMode(externalCommunicationMode pol, in
}
slsDetectorDefs::externalSignalFlag
-multiSlsDetector::setExternalSignalFlags(externalSignalFlag pol, int signalindex, int detPos) {
+multiSlsDetector::setExternalSignalFlags(externalSignalFlag pol, int detPos) {
// single
if (detPos >= 0) {
- return detectors[detPos]->setExternalSignalFlags(pol, signalindex);
+ return detectors[detPos]->setExternalSignalFlags(pol);
}
// multi
- auto r = parallelCall(&slsDetector::setExternalSignalFlags, pol, signalindex);
+ auto r = parallelCall(&slsDetector::setExternalSignalFlags, pol);
return sls::minusOneIfDifferent(r);
}
diff --git a/slsDetectorSoftware/src/slsDetector.cpp b/slsDetectorSoftware/src/slsDetector.cpp
index 5e5757c03..0e4924e84 100755
--- a/slsDetectorSoftware/src/slsDetector.cpp
+++ b/slsDetectorSoftware/src/slsDetector.cpp
@@ -1707,15 +1707,13 @@ slsDetector::setExternalCommunicationMode(externalCommunicationMode pol) {
}
slsDetectorDefs::externalSignalFlag
-slsDetector::setExternalSignalFlags(externalSignalFlag pol, int signalindex) {
+slsDetector::setExternalSignalFlags(externalSignalFlag pol) {
int fnum = F_SET_EXTERNAL_SIGNAL_FLAG;
- int args[]{signalindex, pol};
auto retval = GET_EXTERNAL_SIGNAL_FLAG;
- FILE_LOG(logDEBUG1) << "Setting signal " << signalindex << " to flag "
- << pol;
+ FILE_LOG(logDEBUG1) << "Setting signal flag to " << pol;
if (shm()->onlineFlag == ONLINE_FLAG) {
- sendToDetector(fnum, args, retval);
- FILE_LOG(logDEBUG1) << "Ext Signal (" << signalindex << "): " << retval;
+ sendToDetector(fnum, pol, retval);
+ FILE_LOG(logDEBUG1) << "Ext Signal: " << retval;
}
return retval;
}
diff --git a/slsDetectorSoftware/src/slsDetectorCommand.cpp b/slsDetectorSoftware/src/slsDetectorCommand.cpp
index 78193c807..e9ad54992 100755
--- a/slsDetectorSoftware/src/slsDetectorCommand.cpp
+++ b/slsDetectorSoftware/src/slsDetectorCommand.cpp
@@ -383,7 +383,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page config
- - extsig:[i] [flag] sets/gets the mode of the external signal i. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
+ - extsig [flag] sets/gets the mode of the external signal. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
\c ro_trigger_in_rising_edge, \c ro_trigger_in_falling_edge, \c gate_out_active_high, \c gate_out_active_low, \c trigger_out_rising_edge, \c trigger_out_falling_edge, \c ro_trigger_out_rising_edge,
\c ro_trigger_out_falling_edge. \n Used in GOTTHARDonly. \c Returns \c (string)
*/
@@ -3879,11 +3879,14 @@ std::string slsDetectorCommand::cmdDAC(int narg, const char * const args[], int
char answer[1000];
int mode = 0;
- int idac = -1;
- if (sscanf(args[0], "dac:%d", &idac) == 1) {
- //printf("chiptestboard!\n");
+ if (cmd == "dac") {
+ int idac = -1;
+ if (sscanf(args[1], "%d", &idac) != 1) {
+ return std::string("Could not scan dac index") + std::string(args[1]);
+ }
dac = (dacIndex)idac;
- } else if (cmd == "adcvpp")
+ }
+ else if (cmd == "adcvpp")
dac = ADC_VPP;
else if (cmd == "vthreshold")
dac = THRESHOLD;
@@ -4218,8 +4221,6 @@ std::string slsDetectorCommand::helpDAC(int action) {
std::string slsDetectorCommand::cmdADC(int narg, const char * const args[], int action, int detPos) {
dacIndex adc;
- int idac;
- // double val=-1;
char answer[1000];
if (action == HELP_ACTION)
@@ -4227,13 +4228,18 @@ std::string slsDetectorCommand::cmdADC(int narg, const char * const args[], int
else if (action == PUT_ACTION)
return std::string("cannot set ") + cmd;
- if (sscanf(args[0],"adc:%d",&idac)==1) {
- // printf("chiptestboard!\n");
- adc=(dacIndex)(idac+SLOW_ADC0);
- if (idac < 0 || idac > SLOW_ADC_TEMP - SLOW_ADC0)
+ if (cmd == "adc") {
+ int idac = -1;
+ if (sscanf(args[1], "%d", &idac) != 1) {
+ return std::string("Could not scan adc index") + std::string(args[1]);
+ }
+ if (idac < 0 || idac > SLOW_ADC_TEMP - SLOW_ADC0) {
return (std::string ("cannot set adc, must be between ") + std::to_string(0) +
std::string (" and ") + std::to_string(SLOW_ADC_TEMP - SLOW_ADC0));
- } else if (cmd=="temp_adc")
+ }
+ adc = (dacIndex)(idac + SLOW_ADC0);
+ }
+ else if (cmd=="temp_adc")
adc=TEMPERATURE_ADC;
else if (cmd=="temp_fpga")
adc=TEMPERATURE_FPGA;
@@ -4817,11 +4823,6 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
} else if (cmd == "extsig") {
externalSignalFlag flag = GET_EXTERNAL_SIGNAL_FLAG;
- int is = -1;
- if (sscanf(args[0], "extsig:%d", &is))
- ;
- else
- return std::string("could not scan signal number ") + std::string(args[0]);
if (action == PUT_ACTION) {
flag = myDet->externalSignalType(args[1]);
@@ -4830,7 +4831,7 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
}
myDet->setOnline(ONLINE_FLAG, detPos);
- return myDet->externalSignalType(myDet->setExternalSignalFlags(flag, is, detPos));
+ return myDet->externalSignalType(myDet->setExternalSignalFlags(flag, detPos));
} else if (cmd == "programfpga") {
if (action == GET_ACTION)
@@ -4955,7 +4956,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
std::ostringstream os;
if (action == PUT_ACTION || action == HELP_ACTION) {
- os << "extsig:i mode \t sets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
+ os << "extsig mode \t sets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
@@ -4970,7 +4971,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
}
if (action == GET_ACTION || action == HELP_ACTION) {
- os << "extsig:i \t gets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
+ os << "extsig \t gets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
os << "led \t returns led status (0 off, 1 on)" << std::endl;
diff --git a/slsSupportLib/include/versionAPI.h b/slsSupportLib/include/versionAPI.h
index 8c2a64ecc..0afe8e75b 100644
--- a/slsSupportLib/include/versionAPI.h
+++ b/slsSupportLib/include/versionAPI.h
@@ -1,6 +1,5 @@
/** API versions */
#define GITBRANCH "refgui"
-#define APIGOTTHARD 0x190108
#define APIMOENCH 0x181108
#define APILIB 0x190405
#define APIRECEIVER 0x190405
@@ -8,3 +7,4 @@
#define APIEIGER 0x190531
#define APIJUNGFRAU 0x190531
#define APICTB 0x190603
+#define APIGOTTHARD 0x190604