This commit is contained in:
maliakal_d 2022-11-08 10:25:12 +01:00
parent 16e9b272c7
commit 4a95ee8362
6 changed files with 68 additions and 60 deletions

View File

@ -103,7 +103,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
int numMeasurements{1}; int numMeasurements{1};
int currentMeasurement{0}; int currentMeasurement{0};
mutable std::mutex mProgress; mutable std::mutex mProgress;
}; };
} // namespace sls } // namespace sls

View File

@ -1050,7 +1050,8 @@ int Feb_Control_StopAcquisition() {
// check stuck only 2000 times (1s) // check stuck only 2000 times (1s)
if (is_processing == STATUS_RUNNING) { if (is_processing == STATUS_RUNNING) {
if (check_stuck == 2000) { if (check_stuck == 2000) {
LOG(logERROR, ("Unable to get feb processing done signal\n")); LOG(logERROR,
("Unable to get feb processing done signal\n"));
// at least it is idle // at least it is idle
if (Feb_Control_AcquisitionInProgress() == STATUS_IDLE) { if (Feb_Control_AcquisitionInProgress() == STATUS_IDLE) {
return 1; return 1;
@ -1757,8 +1758,7 @@ int Feb_Control_ReadRegister(uint32_t offset, uint32_t *retval) {
} }
// Inconsistent values when reading both registers // Inconsistent values when reading both registers
if ((run[0] & run[1]) & (value[0] != value[1])) { if ((run[0] & run[1]) & (value[0] != value[1])) {
LOG(logERROR, LOG(logERROR, ("Inconsistent values read from %s 0x%x and %s 0x%x\n",
("Inconsistent values read from %s 0x%x and %s 0x%x\n",
side[0], value[0], side[1], value[1])); side[0], value[0], side[1], value[1]));
return 0; return 0;
} }

View File

@ -2185,7 +2185,8 @@ int setTrimbits(int *chanregs, char *mess) {
// if quad, set M8 and PROGRAM manually // if quad, set M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(1)) { if (!Feb_Control_SetChipSignalsToTrimQuad(1)) {
sprintf(mess, "Could not set module. Could not enable chip signals to set trimbits\n"); sprintf(mess, "Could not set module. Could not enable chip signals to "
"set trimbits\n");
LOG(logERROR, (mess)); LOG(logERROR, (mess));
sharedMemory_unlockLocalLink(); sharedMemory_unlockLocalLink();
return FAIL; return FAIL;
@ -2200,7 +2201,8 @@ int setTrimbits(int *chanregs, char *mess) {
// if quad, reset M8 and PROGRAM manually // if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) { if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sprintf(mess, "Could not set module. Could not disable chip signals to set trimbits\n"); sprintf(mess, "Could not set module. Could not disable chip "
"signals to set trimbits\n");
LOG(logERROR, (mess)); LOG(logERROR, (mess));
sharedMemory_unlockLocalLink(); sharedMemory_unlockLocalLink();
return FAIL; return FAIL;
@ -2212,7 +2214,8 @@ int setTrimbits(int *chanregs, char *mess) {
// if quad, reset M8 and PROGRAM manually // if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) { if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sprintf(mess, "Could not set module. Could not disable chip signals to set trimbits\n"); sprintf(mess, "Could not set module. Could not disable chip signals to "
"set trimbits\n");
LOG(logERROR, (mess)); LOG(logERROR, (mess));
sharedMemory_unlockLocalLink(); sharedMemory_unlockLocalLink();
return FAIL; return FAIL;
@ -2816,8 +2819,9 @@ int stopStateMachine() {
// reset feb and beb // reset feb and beb
sharedMemory_lockLocalLink(); sharedMemory_lockLocalLink();
// uncommenting this out as it randomly does not set the processing bit to high // uncommenting this out as it randomly does not set the processing bit to
//Feb_Control_Reset(); // high
// Feb_Control_Reset();
sharedMemory_unlockLocalLink(); sharedMemory_unlockLocalLink();
if (!Beb_StopAcquisition()) { if (!Beb_StopAcquisition()) {
LOG(logERROR, ("failed to stop acquisition\n")); LOG(logERROR, ("failed to stop acquisition\n"));

View File

@ -1527,7 +1527,11 @@ int write_register(int file_des) {
} else { } else {
if (readRegister(addr, &retval) == FAIL) { if (readRegister(addr, &retval) == FAIL) {
ret = FAIL; ret = FAIL;
sprintf(mess, "Could not read register 0x%x or inconsistent values. Try to read +0x100 for only left and +0x200 for only right.\n", addr); sprintf(
mess,
"Could not read register 0x%x or inconsistent values. Try "
"to read +0x100 for only left and +0x200 for only right.\n",
addr);
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} }
} }
@ -1565,7 +1569,10 @@ int read_register(int file_des) {
#elif EIGERD #elif EIGERD
if (readRegister(addr, &retval) == FAIL) { if (readRegister(addr, &retval) == FAIL) {
ret = FAIL; ret = FAIL;
sprintf(mess, "Could not read register 0x%x or inconsistent values. Try +0x100 for only left and +0x200 for only right..\n", addr); sprintf(mess,
"Could not read register 0x%x or inconsistent values. Try "
"+0x100 for only left and +0x200 for only right..\n",
addr);
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} }
#else #else
@ -1900,8 +1907,7 @@ int acquire(int blocking, int file_des) {
uint64_t sourcemac = getDetectorMAC(); uint64_t sourcemac = getDetectorMAC();
char src_mac[MAC_ADDRESS_SIZE]; char src_mac[MAC_ADDRESS_SIZE];
getMacAddressinString(src_mac, MAC_ADDRESS_SIZE, sourcemac); getMacAddressinString(src_mac, MAC_ADDRESS_SIZE, sourcemac);
sprintf( sprintf(mess,
mess,
"Invalid udp source mac address for this detector. Must be " "Invalid udp source mac address for this detector. Must be "
"same as hardware detector mac address %s\n", "same as hardware detector mac address %s\n",
src_mac); src_mac);
@ -1912,8 +1918,7 @@ int acquire(int blocking, int file_des) {
uint32_t sourceip = getDetectorIP(); uint32_t sourceip = getDetectorIP();
char src_ip[INET_ADDRSTRLEN]; char src_ip[INET_ADDRSTRLEN];
getIpAddressinString(src_ip, sourceip); getIpAddressinString(src_ip, sourceip);
sprintf( sprintf(mess,
mess,
"Invalid udp source ip address for this detector. Must be " "Invalid udp source ip address for this detector. Must be "
"same as hardware detector ip address %s in 1G readout " "same as hardware detector ip address %s in 1G readout "
"mode \n", "mode \n",

View File

@ -2562,7 +2562,8 @@ std::string CmdProxy::AdcVpp(int action) {
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[dac or mV value][(optional unit) mV] \n\t[Ctb][Moench] Vpp of " os << "[dac or mV value][(optional unit) mV] \n\t[Ctb][Moench] Vpp of "
"ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V. " "ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> "
"2V. "
"\n\tAdvanced User function!\n" "\n\tAdvanced User function!\n"
<< '\n'; << '\n';
return os.str(); return os.str();
@ -2593,8 +2594,7 @@ std::string CmdProxy::AdcVpp(int action) {
} else if (args.size() > 2 || args.size() < 1) { } else if (args.size() > 2 || args.size() < 1) {
WrongNumberOfParameters(1); WrongNumberOfParameters(1);
} }
det->setADCVpp(StringTo<int>(args[0]), mV, det->setADCVpp(StringTo<int>(args[0]), mV, std::vector<int>{det_id});
std::vector<int>{det_id});
os << args[0] << (mV ? " mV\n" : "\n"); os << args[0] << (mV ? " mV\n" : "\n");
} else { } else {
throw RuntimeError("Unknown action"); throw RuntimeError("Unknown action");