mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
@ -132,7 +132,7 @@
|
||||
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
||||
#define CONTROL_STRT_PATTERN_OFST (2)
|
||||
#define CONTROL_STRT_PATTERN_MSK (0x00000001 << CONTROL_STRT_PATTERN_OFST)
|
||||
#define CONTROL_STRT_READOUT_OFST (3) // not connected in software yet
|
||||
#define CONTROL_STRT_READOUT_OFST (3)
|
||||
#define CONTROL_STRT_READOUT_MSK (0x00000001 << CONTROL_STRT_READOUT_OFST)
|
||||
#define CONTROL_STRT_SW_TRIGGER_OFST (4)
|
||||
#define CONTROL_STRT_SW_TRIGGER_MSK (0x00000001 << CONTROL_STRT_SW_TRIGGER_OFST)
|
||||
|
Binary file not shown.
@ -2407,6 +2407,22 @@ int softwareTrigger() {
|
||||
return OK;
|
||||
}
|
||||
|
||||
int startReadOut() {
|
||||
LOG(logINFOBLUE, ("Starting Readout\n"));
|
||||
#ifdef VIRTUAL
|
||||
// cannot set #frames and exptiem temporarily to 1 and 0,
|
||||
// because have to set it back after readout (but this is non blocking)
|
||||
return startStateMachine();
|
||||
#endif
|
||||
cleanFifos();
|
||||
|
||||
// start readout
|
||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_READOUT_MSK);
|
||||
|
||||
LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG)));
|
||||
return OK;
|
||||
}
|
||||
|
||||
enum runStatus getRunStatus() {
|
||||
LOG(logDEBUG1, ("Getting status\n"));
|
||||
// scan error or running
|
||||
|
@ -567,8 +567,7 @@ int stopStateMachine();
|
||||
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||
int softwareTrigger();
|
||||
#endif
|
||||
|
||||
#ifdef EIGERD
|
||||
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||
int startReadOut();
|
||||
#endif
|
||||
enum runStatus getRunStatus();
|
||||
|
@ -239,4 +239,5 @@ int get_bad_channels(int);
|
||||
int set_bad_channels(int);
|
||||
int reconfigure_udp(int);
|
||||
int validate_udp_configuration(int);
|
||||
int get_bursts_left(int);
|
||||
int get_bursts_left(int);
|
||||
int start_readout(int);
|
@ -358,6 +358,7 @@ void function_table() {
|
||||
flist[F_RECONFIGURE_UDP] = &reconfigure_udp;
|
||||
flist[F_VALIDATE_UDP_CONFIG] = &validate_udp_configuration;
|
||||
flist[F_GET_BURSTS_LEFT] = &get_bursts_left;
|
||||
flist[F_START_READOUT] = &start_readout;
|
||||
|
||||
// check
|
||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||
@ -8103,4 +8104,44 @@ int get_bursts_left(int file_des) {
|
||||
LOG(logDEBUG1, ("retval num bursts left %lld\n", (long long int)retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
|
||||
}
|
||||
}
|
||||
|
||||
int start_readout(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
#ifndef MYTHEN3D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
if (Server_VerifyLock() == OK) {
|
||||
enum runStatus s = getRunStatus();
|
||||
if (s == RUNNING || s == WAITING) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not start readout because the detector is "
|
||||
"already running!\n");
|
||||
LOG(logERROR, (mess));
|
||||
} else if (configured == FAIL) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not start readout because ");
|
||||
strcat(mess, configureMessage);
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
memset(scanErrMessage, 0, MAX_STR_LENGTH);
|
||||
sharedMemory_setScanStop(0);
|
||||
sharedMemory_setScanStatus(IDLE); // if it was error
|
||||
// start readout
|
||||
ret = startReadOut();
|
||||
if (ret == FAIL) {
|
||||
#ifdef VIRTUAL
|
||||
sprintf(mess,
|
||||
"Could not start readout. Could not create udp "
|
||||
"socket in server. Check udp_dstip & udp_dstport.\n");
|
||||
#else
|
||||
sprintf(mess, "Could not start readout\n");
|
||||
#endif
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user