jungfrau: cannot set partial readout while acquiring

This commit is contained in:
maliakal_d 2021-08-17 09:53:34 +02:00
parent 3d90c1527a
commit 24f012e6c7
4 changed files with 23 additions and 23 deletions

View File

@ -2340,7 +2340,7 @@ void *start_timer(void *arg) {
if (dr == 4) { if (dr == 4) {
npixels /= 2; npixels /= 2;
} }
LOG(logDBUG1, LOG(logDEBUG1,
("pixels:%d pixelsperpacket:%d\n", npixels, pixelsPerPacket)); ("pixels:%d pixelsperpacket:%d\n", npixels, pixelsPerPacket));
for (int i = 0; i < npixels; ++i) { for (int i = 0; i < npixels; ++i) {
if (i > 0 && i % pixelsPerPacket == 0) { if (i > 0 && i % pixelsPerPacket == 0) {

View File

@ -148,7 +148,7 @@ int set_partial_readout(int);
int get_partial_readout(int); int get_partial_readout(int);
void calculate_and_set_position(); void calculate_and_set_position();
int set_detector_position(int); int set_detector_position(int);
int check_detector_idle(); int check_detector_idle(const char *s);
int is_udp_configured(); int is_udp_configured();
void configure_mac(); void configure_mac();
int set_source_udp_ip(int); int set_source_udp_ip(int);

View File

@ -4756,7 +4756,7 @@ int set_partial_readout(int file_des) {
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} else } else
#elif JUNGFRAUD #elif JUNGFRAUD
if (arg % PARTIAL_READOUT_MULTIPLE != 0) { if ((check_detector_idle("set partial readout") == OK) && (arg % PARTIAL_READOUT_MULTIPLE != 0)) {
ret = FAIL; ret = FAIL;
sprintf(mess, sprintf(mess,
"Could not set partial readout. %d must be a multiple " "Could not set partial readout. %d must be a multiple "
@ -4889,7 +4889,7 @@ int set_detector_position(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
maxydet = args[0]; maxydet = args[0];
detectorId = args[1]; detectorId = args[1];
calculate_and_set_position(); calculate_and_set_position();
@ -4898,15 +4898,15 @@ int set_detector_position(int file_des) {
return Server_SendResult(file_des, INT32, NULL, 0); return Server_SendResult(file_des, INT32, NULL, 0);
} }
int check_detector_idle() { int check_detector_idle(const char *s) {
enum runStatus status = getRunStatus(); enum runStatus status = getRunStatus();
if (status != IDLE && status != RUN_FINISHED && status != STOPPED && if (status != IDLE && status != RUN_FINISHED && status != STOPPED &&
status != ERROR) { status != ERROR) {
ret = FAIL; ret = FAIL;
sprintf(mess, sprintf(mess,
"Cannot configure mac when detector is not idle. Detector at " "Cannot %s when detector is not idle. Detector at "
"%s state\n", "%s state\n",
getRunStateName(status)); s, getRunStateName(status));
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} }
return ret; return ret;
@ -4998,7 +4998,7 @@ int set_source_udp_ip(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.srcip != arg) { if (udpDetails.srcip != arg) {
udpDetails.srcip = arg; udpDetails.srcip = arg;
configure_mac(); configure_mac();
@ -5037,7 +5037,7 @@ int set_source_udp_ip2(int file_des) {
#else #else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.srcip2 != arg) { if (udpDetails.srcip2 != arg) {
udpDetails.srcip2 = arg; udpDetails.srcip2 = arg;
configure_mac(); configure_mac();
@ -5077,7 +5077,7 @@ int set_dest_udp_ip(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.dstip != arg) { if (udpDetails.dstip != arg) {
udpDetails.dstip = arg; udpDetails.dstip = arg;
configure_mac(); configure_mac();
@ -5116,7 +5116,7 @@ int set_dest_udp_ip2(int file_des) {
#else #else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.dstip2 != arg) { if (udpDetails.dstip2 != arg) {
udpDetails.dstip2 = arg; udpDetails.dstip2 = arg;
configure_mac(); configure_mac();
@ -5155,7 +5155,7 @@ int set_source_udp_mac(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.srcmac != arg) { if (udpDetails.srcmac != arg) {
udpDetails.srcmac = arg; udpDetails.srcmac = arg;
configure_mac(); configure_mac();
@ -5192,7 +5192,7 @@ int set_source_udp_mac2(int file_des) {
#else #else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.srcmac2 != arg) { if (udpDetails.srcmac2 != arg) {
udpDetails.srcmac2 = arg; udpDetails.srcmac2 = arg;
configure_mac(); configure_mac();
@ -5230,7 +5230,7 @@ int set_dest_udp_mac(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.dstmac != arg) { if (udpDetails.dstmac != arg) {
udpDetails.dstmac = arg; udpDetails.dstmac = arg;
configure_mac(); configure_mac();
@ -5267,7 +5267,7 @@ int set_dest_udp_mac2(int file_des) {
#else #else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.dstmac2 != arg) { if (udpDetails.dstmac2 != arg) {
udpDetails.dstmac2 = arg; udpDetails.dstmac2 = arg;
configure_mac(); configure_mac();
@ -5305,7 +5305,7 @@ int set_dest_udp_port(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.dstport != arg) { if (udpDetails.dstport != arg) {
udpDetails.dstport = arg; udpDetails.dstport = arg;
configure_mac(); configure_mac();
@ -5342,7 +5342,7 @@ int set_dest_udp_port2(int file_des) {
#else #else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
if (udpDetails.dstport2 != arg) { if (udpDetails.dstport2 != arg) {
udpDetails.dstport2 = arg; udpDetails.dstport2 = arg;
configure_mac(); configure_mac();
@ -5389,7 +5389,7 @@ int set_num_interfaces(int file_des) {
"Could not number of interfaces to %d. Options[1, 2]\n", "Could not number of interfaces to %d. Options[1, 2]\n",
arg); arg);
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} else if (check_detector_idle() == OK) { } else if (check_detector_idle("configure mac") == OK) {
if (getNumberofUDPInterfaces() != arg) { if (getNumberofUDPInterfaces() != arg) {
setNumberofUDPInterfaces(arg); setNumberofUDPInterfaces(arg);
calculate_and_set_position(); // aleady configures mac calculate_and_set_position(); // aleady configures mac
@ -5435,7 +5435,7 @@ int set_interface_sel(int file_des) {
sprintf(mess, "Could not set primary interface %d. Options[0, 1]\n", sprintf(mess, "Could not set primary interface %d. Options[0, 1]\n",
arg); arg);
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} else if (check_detector_idle() == OK) { } else if (check_detector_idle("configure mac") == OK) {
if (getPrimaryInterface() != arg) { if (getPrimaryInterface() != arg) {
selectPrimaryInterface(arg); selectPrimaryInterface(arg);
configure_mac(); configure_mac();
@ -8086,7 +8086,7 @@ int reconfigure_udp(int file_des) {
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
LOG(logINFO, ("Reconfiguring UDP\n")); LOG(logINFO, ("Reconfiguring UDP\n"));
if (check_detector_idle() == OK) { if (check_detector_idle("configure mac") == OK) {
configure_mac(); configure_mac();
if (configured == FAIL) { if (configured == FAIL) {
ret = FAIL; ret = FAIL;

View File

@ -477,7 +477,7 @@ std::vector<uint64_t> Implementation::getNumMissingPackets() const {
int np = generalData->packetsPerFrame; int np = generalData->packetsPerFrame;
uint64_t totnp = np; uint64_t totnp = np;
// partial readout // partial readout
if (partialReadout != generalData->maxRowsPerReadout) { if (partialReadout != (int)generalData->maxRowsPerReadout) {
totnp = ((partialReadout * np) / generalData->maxRowsPerReadout); totnp = ((partialReadout * np) / generalData->maxRowsPerReadout);
} }
totnp *= numberOfTotalFrames; totnp *= numberOfTotalFrames;