mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +02:00
Merge branch 'developer' into gui
This commit is contained in:
@ -1366,14 +1366,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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
||||
++i;
|
||||
|
||||
/*! \page config
|
||||
- <b>extsig:[i] [flag]</b> 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,
|
||||
- <b>extsig [flag]</b> 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;
|
||||
|
Reference in New Issue
Block a user