mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
WIP
This commit is contained in:
parent
3156e6f50e
commit
a656668d73
@ -2,7 +2,6 @@
|
||||
|
||||
#include <semaphore.h>
|
||||
|
||||
char *sharedMemory_getError();
|
||||
void sharedMemory_print();
|
||||
int sharedMemory_create(int port);
|
||||
void sharedMemory_initialize();
|
||||
|
@ -224,6 +224,5 @@ int get_veto(int);
|
||||
int set_veto(int);
|
||||
int set_pattern(int);
|
||||
int get_scan(int);
|
||||
int get_num_scan_steps(int);
|
||||
int disable_scan(int);
|
||||
int enable_scan(int);
|
||||
|
@ -24,13 +24,10 @@ typedef struct Memory {
|
||||
} sharedMem;
|
||||
|
||||
sharedMem *shm = NULL;
|
||||
char shmMess[MAX_STR_LENGTH];
|
||||
int shmFd = -1;
|
||||
|
||||
extern int isControlServer;
|
||||
|
||||
char *sharedMemory_getError() { return shmMess; }
|
||||
|
||||
void sharedMemory_print() {
|
||||
LOG(logINFO, ("%s Shared Memory:\n", isControlServer ? "c" : "s"));
|
||||
LOG(logINFO,
|
||||
@ -42,8 +39,6 @@ void sharedMemory_print() {
|
||||
}
|
||||
|
||||
int sharedMemory_create(int port) {
|
||||
memset(shmMess, 0, MAX_STR_LENGTH);
|
||||
|
||||
// if sham existed, delete old shm and create again
|
||||
shmFd =
|
||||
shmget(SHM_KEY + port, sizeof(sharedMem), IPC_CREAT | IPC_EXCL | 0666);
|
||||
@ -58,8 +53,7 @@ int sharedMemory_create(int port) {
|
||||
IPC_CREAT | IPC_EXCL | 0666);
|
||||
}
|
||||
if (shmFd == -1) {
|
||||
sprintf(shmMess, "Create shared memory failed: %s\n", strerror(errno));
|
||||
LOG(logERROR, (shmMess));
|
||||
LOG(logERROR, ("Create shared memory failed: %s\n", strerror(errno)));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Shared memory created\n"));
|
||||
@ -81,21 +75,18 @@ void sharedMemory_initialize() {
|
||||
}
|
||||
|
||||
int sharedMemory_open(int port) {
|
||||
memset(shmMess, 0, MAX_STR_LENGTH);
|
||||
shmFd = shmget(SHM_KEY + port, sizeof(sharedMem), 0666);
|
||||
if (shmFd == -1) {
|
||||
sprintf(shmMess, "Open shared memory failed: %s\n", strerror(errno));
|
||||
LOG(logERROR, (shmMess));
|
||||
LOG(logERROR, ("Open shared memory failed: %s\n", strerror(errno)));
|
||||
return FAIL;
|
||||
}
|
||||
if (sharedMemory_attach() == FAIL) {
|
||||
return FAIL;
|
||||
}
|
||||
if (shm->version != SHM_VERSION) {
|
||||
sprintf(shmMess,
|
||||
"Shared memory version 0x%x does not match! (expected: 0x%x)\n",
|
||||
shm->version, SHM_VERSION);
|
||||
LOG(logERROR, (shmMess));
|
||||
LOG(logERROR,
|
||||
("Shared memory version 0x%x does not match! (expected: 0x%x)\n",
|
||||
shm->version, SHM_VERSION));
|
||||
}
|
||||
LOG(logINFO, ("Shared memory opened\n"));
|
||||
return OK;
|
||||
@ -104,8 +95,7 @@ int sharedMemory_open(int port) {
|
||||
int sharedMemory_attach() {
|
||||
shm = (sharedMem *)shmat(shmFd, NULL, 0);
|
||||
if (shm == (void *)-1) {
|
||||
sprintf(shmMess, "could not attach: %s\n", strerror(errno));
|
||||
LOG(logERROR, (shmMess));
|
||||
LOG(logERROR, ("could not attach: %s\n", strerror(errno)));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Shared memory attached\n"));
|
||||
@ -113,10 +103,8 @@ int sharedMemory_attach() {
|
||||
}
|
||||
|
||||
int sharedMemory_detach() {
|
||||
memset(shmMess, 0, MAX_STR_LENGTH);
|
||||
if (shmdt(shm) == -1) {
|
||||
sprintf(shmMess, "could not detach: %s\n", strerror(errno));
|
||||
LOG(logERROR, (shmMess));
|
||||
LOG(logERROR, ("could not detach: %s\n", strerror(errno)));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Shared memory detached\n"));
|
||||
@ -124,10 +112,8 @@ int sharedMemory_detach() {
|
||||
}
|
||||
|
||||
int sharedMemory_remove() {
|
||||
memset(shmMess, 0, MAX_STR_LENGTH);
|
||||
if (shmctl(shmFd, IPC_RMID, NULL) == -1) {
|
||||
sprintf(shmMess, "could not remove: %s\n", strerror(errno));
|
||||
LOG(logERROR, (shmMess));
|
||||
LOG(logERROR, ("could not remove: %s\n", strerror(errno)));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Shared memory removed\n"));
|
||||
|
@ -55,6 +55,7 @@ int (*flist[NUM_DET_FUNCTIONS])(int);
|
||||
int scan = 0;
|
||||
int numScanSteps = 0;
|
||||
int *scanSteps = NULL;
|
||||
int64_t scanDacSettleTime_us = 0;
|
||||
enum DACINDEX scanDac = 0;
|
||||
int scanTrimbits = 0;
|
||||
|
||||
@ -340,7 +341,6 @@ void function_table() {
|
||||
flist[F_SET_VETO] = &set_veto;
|
||||
flist[F_SET_PATTERN] = &set_pattern;
|
||||
flist[F_GET_SCAN] = get_scan;
|
||||
flist[F_GET_NUM_SCAN_STEPS] = get_num_scan_steps;
|
||||
flist[F_DISABLE_SCAN] = disable_scan;
|
||||
flist[F_ENABLE_SCAN] = enable_scan;
|
||||
// check
|
||||
@ -1772,6 +1772,7 @@ int start_state_machine(int blocking, int file_des) {
|
||||
sharedMemory_setScanStatus(0);
|
||||
break;
|
||||
}
|
||||
usleep(scanDacSettleTime_us);
|
||||
#ifdef EIGERD
|
||||
prepareAcquisition();
|
||||
#endif
|
||||
@ -2968,7 +2969,8 @@ int set_pattern_loop_addresses(int file_des) {
|
||||
startAddr, stopAddr));
|
||||
retvals[0] = startAddr;
|
||||
retvals[1] = stopAddr;
|
||||
validate(args[1], startAddr, "set Pattern loops' start address", HEX);
|
||||
validate(args[1], startAddr, "set Pattern loops' start address",
|
||||
HEX);
|
||||
validate(args[2], stopAddr, "set Pattern loops' stop address", HEX);
|
||||
}
|
||||
}
|
||||
@ -3007,7 +3009,8 @@ int set_pattern_loop_cycles(int file_des) {
|
||||
retval = numLoops;
|
||||
LOG(logDEBUG1,
|
||||
("Pattern loop cycles retval: (ncycles:%d)\n", retval));
|
||||
validate(args[1], retval, "set Pattern loops' number of cycles", DEC);
|
||||
validate(args[1], retval, "set Pattern loops' number of cycles",
|
||||
DEC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -7384,39 +7387,51 @@ int set_pattern(int file_des) {
|
||||
retval1 = patloop[1];
|
||||
numLoops = patnloop[0];
|
||||
setPatternLoop(0, &patloop[0], &patloop[1], &numLoops);
|
||||
validate(patloop[0], retval0, "set pattern Loop 0 start address", HEX);
|
||||
validate(patloop[1], retval1, "set pattern Loop 0 stop address", HEX);
|
||||
validate(patnloop[0], numLoops, "set pattern Loop 0 num loops", HEX);
|
||||
validate(patloop[0], retval0, "set pattern Loop 0 start address",
|
||||
HEX);
|
||||
validate(patloop[1], retval1, "set pattern Loop 0 stop address",
|
||||
HEX);
|
||||
validate(patnloop[0], numLoops, "set pattern Loop 0 num loops",
|
||||
HEX);
|
||||
}
|
||||
if (ret == OK) {
|
||||
retval0 = patloop[2];
|
||||
retval1 = patloop[3];
|
||||
numLoops = patnloop[1];
|
||||
setPatternLoop(1, &patloop[2], &patloop[3], &numLoops);
|
||||
validate(patloop[2], retval0, "set pattern Loop 1 start address", HEX);
|
||||
validate(patloop[3], retval1, "set pattern Loop 1 stop address", HEX);
|
||||
validate(patnloop[1], numLoops, "set pattern Loop 1 num loops", HEX);
|
||||
validate(patloop[2], retval0, "set pattern Loop 1 start address",
|
||||
HEX);
|
||||
validate(patloop[3], retval1, "set pattern Loop 1 stop address",
|
||||
HEX);
|
||||
validate(patnloop[1], numLoops, "set pattern Loop 1 num loops",
|
||||
HEX);
|
||||
}
|
||||
if (ret == OK) {
|
||||
retval0 = patloop[4];
|
||||
retval1 = patloop[5];
|
||||
numLoops = patnloop[2];
|
||||
setPatternLoop(2, &patloop[4], &patloop[5], &numLoops);
|
||||
validate(patloop[4], retval0, "set pattern Loop 2 start address", HEX);
|
||||
validate(patloop[5], retval1, "set pattern Loop 2 stop address", HEX);
|
||||
validate(patnloop[2], numLoops, "set pattern Loop 2 num loops", HEX);
|
||||
validate(patloop[4], retval0, "set pattern Loop 2 start address",
|
||||
HEX);
|
||||
validate(patloop[5], retval1, "set pattern Loop 2 stop address",
|
||||
HEX);
|
||||
validate(patnloop[2], numLoops, "set pattern Loop 2 num loops",
|
||||
HEX);
|
||||
}
|
||||
if (ret == OK) {
|
||||
retval0 = setPatternWaitAddress(0, patwait[0]);
|
||||
validate(patwait[0], retval0, "set pattern Loop 0 wait address", HEX);
|
||||
validate(patwait[0], retval0, "set pattern Loop 0 wait address",
|
||||
HEX);
|
||||
}
|
||||
if (ret == OK) {
|
||||
retval0 = setPatternWaitAddress(1, patwait[1]);
|
||||
validate(patwait[1], retval0, "set pattern Loop 1 wait address", HEX);
|
||||
validate(patwait[1], retval0, "set pattern Loop 1 wait address",
|
||||
HEX);
|
||||
}
|
||||
if (ret == OK) {
|
||||
retval0 = setPatternWaitAddress(2, patwait[2]);
|
||||
validate(patwait[2], retval0, "set pattern Loop 2 wait address", HEX);
|
||||
validate(patwait[2], retval0, "set pattern Loop 2 wait address",
|
||||
HEX);
|
||||
}
|
||||
if (ret == OK) {
|
||||
uint64_t retval64 = setPatternWaitTime(0, patwaittime[0]);
|
||||
@ -7441,31 +7456,18 @@ int set_pattern(int file_des) {
|
||||
int get_scan(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int retval = -1;
|
||||
int retval[4] = {-1, -1, -1, -1};
|
||||
int64_t retval_time = -1;
|
||||
|
||||
LOG(logDEBUG1, ("Getting scan\n"));
|
||||
|
||||
// get only
|
||||
retval = scan;
|
||||
retval[0] = scan;
|
||||
LOG(logDEBUG1, ("scan mode retval: %u\n", retval));
|
||||
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int get_num_scan_steps(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int retval = -1;
|
||||
|
||||
LOG(logDEBUG1, ("Getting num scan steps\n"));
|
||||
|
||||
// get only
|
||||
retval = numScanSteps;
|
||||
LOG(logDEBUG1, ("num scan steps retval: %u\n", retval));
|
||||
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int disable_scan(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
@ -7493,15 +7495,19 @@ int enable_scan(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int args[4] = {-1, -1, -1, -1};
|
||||
int64_t args_time = -1;
|
||||
|
||||
if (receiveData(file_des, args, sizeof(args), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
if (receiveData(file_des, args_time, sizeof(args_time), INT64) < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
int startOffset = args[1];
|
||||
int endOffset = args[2];
|
||||
int stepSize = args[3];
|
||||
scanDacSettleTime_us = args[4] / 1000;
|
||||
scanTrimbits = 0;
|
||||
|
||||
if ((startOffset < endOffset && stepSize <= 0) ||
|
||||
|
@ -394,19 +394,14 @@ class Detector {
|
||||
/** [Eiger] Sends an internal software trigger to the detector */
|
||||
void sendSoftwareTrigger(Positions pos = {});
|
||||
|
||||
Result<bool> getScan(Positions pos = {}) const;
|
||||
|
||||
Result<int> getNumberOfScanSteps(Positions pos = {}) const;
|
||||
Result<defs::scanParameters> getScan(Positions pos = {}) const;
|
||||
|
||||
/** also sets number of frames to 1 */
|
||||
void disableScan();
|
||||
|
||||
/** scan dac, [Eiger] use TRIMBIT_SCAN for scanning trimbits, also sets
|
||||
* number of frames to number of steps in receiver */
|
||||
void enableScan(const defs::dacIndex dac, const int start_offset,
|
||||
const int end_offset, const int step_size);
|
||||
|
||||
// TODO: remove resetframescaught in receiver
|
||||
/** scan dac, trimbits scan only for [Eiger/ Mythen3] TRIMBIT_SCAN, also
|
||||
* sets number of frames to number of steps in receiver */
|
||||
void enableScan(const defs::scanParameters t);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
@ -996,9 +996,9 @@ std::string CmdProxy::Scan(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[dac_name|0|trimbit_scan] [start_val] [stop_val] "
|
||||
"[step_size]\n\tConfigures to scan "
|
||||
"dac and sets number of frames to number of steps. Must acquire "
|
||||
"after this. To cancel the scan configuration "
|
||||
"[step_size] [dac settling time ns|us|ms|s]\n\tConfigures to "
|
||||
"scan dac and sets number of frames to number of steps. Must "
|
||||
"acquire after this. To cancel the scan configuration "
|
||||
"set dac to '0' without further arguments. This also sets number "
|
||||
"of frames back to 1."
|
||||
"\n\t[Eiger]Use trimbit_scan as dac name for a trimbit scan."
|
||||
@ -1008,7 +1008,7 @@ std::string CmdProxy::Scan(int action) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getScan();
|
||||
os << OutString(t) << '\n';
|
||||
os << ToString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() == 1) {
|
||||
if (StringTo<int>(args[0]) != 0) {
|
||||
@ -1016,21 +1016,26 @@ std::string CmdProxy::Scan(int action) {
|
||||
}
|
||||
det->disableScan();
|
||||
os << "scan disabled" << '\n';
|
||||
} else if (args.size() != 4) {
|
||||
WrongNumberOfParameters(4);
|
||||
} else if (args.size() == 4) {
|
||||
det->enableScan(defs::scanParameters(
|
||||
StringTo<defs::dacIndex>(args[0]), StringTo<int>(args[1]),
|
||||
StringTo<int>(args[2]), StringTo<int>(args[3])));
|
||||
} else if (args.size() == 5) {
|
||||
std::string time_str(args[4]);
|
||||
std::string unit = RemoveUnit(time_str);
|
||||
auto t = StringTo<time::ns>(time_str, unit);
|
||||
det->enableScan(defs::scanParameters(
|
||||
StringTo<defs::dacIndex>(args[0]), StringTo<int>(args[1]),
|
||||
StringTo<int>(args[2]), StringTo<int>(args[3]), t));
|
||||
} else {
|
||||
det->enableScan(StringTo<defs::dacIndex>(args[0]),
|
||||
StringTo<int>(args[1]), StringTo<int>(args[2]),
|
||||
StringTo<int>(args[3]));
|
||||
auto nsteps = det->getNumberOfScanSteps().tsquash(
|
||||
"inconsistent number of scan steps");
|
||||
os << "scan enabled for " << nsteps << " steps" << '\n';
|
||||
WrongNumberOfParameters(4);
|
||||
}
|
||||
os << ToString(args) << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
} // namespace sls
|
||||
/* Network Configuration (Detector<->Receiver) */
|
||||
|
||||
std::string CmdProxy::UDPDestinationIP(int action) {
|
||||
|
@ -559,26 +559,14 @@ void Detector::sendSoftwareTrigger(Positions pos) {
|
||||
pimpl->Parallel(&Module::sendSoftwareTrigger, pos);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getScan(Positions pos) const {
|
||||
Result<defs::scanParameters> Detector::getScan(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getScan, pos);
|
||||
}
|
||||
|
||||
Result<int> Detector::getNumberOfScanSteps(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getNumberOfScanSteps, pos);
|
||||
}
|
||||
void Detector::disableScan() { pimpl->Parallel(&Module::disableScan, {}); }
|
||||
|
||||
void Detector::disableScan() {
|
||||
pimpl->Parallel(&Module::disableScan, {});
|
||||
setNumberOfFrames(1);
|
||||
}
|
||||
|
||||
void Detector::enableScan(const defs::dacIndex dac, const int start_offset,
|
||||
const int end_offset, const int step_size) {
|
||||
pimpl->Parallel(&Module::enableScan, {}, dac, start_offset, end_offset,
|
||||
step_size);
|
||||
auto t =
|
||||
getNumberOfScanSteps().tsquash("inconsistent number of scan steps");
|
||||
setNumberOfFrames(t);
|
||||
void Detector::enableScan(const defs::scanParameters t) {
|
||||
pimpl->Parallel(&Module::enableScan, {}, t);
|
||||
}
|
||||
|
||||
// Network Configuration (Detector<->Receiver)
|
||||
|
@ -449,20 +449,18 @@ void Module::setStartingFrameNumber(uint64_t value) {
|
||||
|
||||
void Module::sendSoftwareTrigger() { sendToDetectorStop(F_SOFTWARE_TRIGGER); }
|
||||
|
||||
bool Module::getScan() {
|
||||
return static_cast<bool>(sendToDetector<int>(F_GET_SCAN));
|
||||
defs::scanParameters Module::getScan() {
|
||||
return sendToDetector<defs::scanParameters>(F_GET_SCAN);
|
||||
}
|
||||
|
||||
int Module::getNumberOfScanSteps() {
|
||||
return sendToDetector<int>(F_GET_NUM_SCAN_STEPS);
|
||||
void Module::disableScan() {
|
||||
sendToDetector(F_DISABLE_SCAN);
|
||||
setNumberOfFrames(1);
|
||||
}
|
||||
|
||||
void Module::disableScan() { sendToDetector(F_DISABLE_SCAN); }
|
||||
|
||||
void Module::enableScan(const defs::dacIndex dac, const int start_offset,
|
||||
const int end_offset, const int step_size) {
|
||||
int args[]{static_cast<int>(dac), start_offset, end_offset, step_size};
|
||||
sendToDetector(F_ENABLE_SCAN, args, nullptr);
|
||||
void Module::enableScan(const defs::scanParameters t) {
|
||||
auto retval = sendToDetector<int64_t>(F_ENABLE_SCAN, t);
|
||||
setNumberOfFrames(retval);
|
||||
}
|
||||
|
||||
// Network Configuration (Detector<->Receiver)
|
||||
|
@ -166,11 +166,9 @@ class Module : public virtual slsDetectorDefs {
|
||||
uint64_t getStartingFrameNumber();
|
||||
void setStartingFrameNumber(uint64_t value);
|
||||
void sendSoftwareTrigger();
|
||||
bool getScan();
|
||||
int getNumberOfScanSteps();
|
||||
defs::scanParameters getScan();
|
||||
void disableScan();
|
||||
void enableScan(const defs::dacIndex dac, const int start_offset,
|
||||
const int end_offset, const int step_size);
|
||||
void enableScan(const defs::scanParameters t);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
@ -47,8 +47,10 @@ std::ostream &operator<<(std::ostream &os,
|
||||
std::string ToString(const slsDetectorDefs::patternParameters &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::patternParameters &r);
|
||||
std::string ToString(const slsDetectorDefs::scanParameters &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::scanParameters &r);
|
||||
const std::string &ToString(const std::string &s);
|
||||
|
||||
/** Convert std::chrono::duration with specified output unit */
|
||||
template <typename T, typename Rep = double>
|
||||
typename std::enable_if<is_duration<T>::value, std::string>::type
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include <algorithm>
|
||||
#include <bitset>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#else
|
||||
@ -451,6 +452,24 @@ typedef struct {
|
||||
uint32_t patwait[3]{};
|
||||
uint64_t patwaittime[3]{};
|
||||
} __attribute__((packed));
|
||||
|
||||
/** scan structure */
|
||||
struct scanParameters {
|
||||
dacIndex dacInd{DAC_0};
|
||||
int startOffset{0};
|
||||
int stopOffset{0};
|
||||
int stepSize{0};
|
||||
int64_t dacSettleTime_ns{100 * 1000};
|
||||
|
||||
scanParameters() = default;
|
||||
scanParameters(
|
||||
dacIndex dac, int start, int stop, int step,
|
||||
std::chrono::nanoseconds t = std::chrono::nanoseconds{10000})
|
||||
: dacInd(dac), startOffset(start), stopOffset(stop),
|
||||
stepSize(step) {
|
||||
dacSettleTime_ns = t.count();
|
||||
}
|
||||
} __attribute__((packed));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -201,7 +201,6 @@ enum detFuncs {
|
||||
F_SET_VETO,
|
||||
F_SET_PATTERN,
|
||||
F_GET_SCAN,
|
||||
F_GET_NUM_SCAN_STEPS,
|
||||
F_DISABLE_SCAN,
|
||||
F_ENABLE_SCAN,
|
||||
|
||||
@ -503,7 +502,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_SET_VETO: return "F_SET_VETO";
|
||||
case F_SET_PATTERN: return "F_SET_PATTERN";
|
||||
case F_GET_SCAN: return "F_GET_SCAN";
|
||||
case F_GET_NUM_SCAN_STEPS: return "F_GET_NUM_SCAN_STEPS";
|
||||
case F_DISABLE_SCAN: return "F_DISABLE_SCAN";
|
||||
case F_ENABLE_SCAN: return "F_ENABLE_SCAN";
|
||||
|
||||
|
@ -102,6 +102,23 @@ std::ostream &operator<<(std::ostream &os,
|
||||
return os << ToString(r);
|
||||
}
|
||||
|
||||
std::string ToString(const slsDetectorDefs::scanParameters &r) {
|
||||
std::ostringstream oss;
|
||||
oss << '[' << "dac " << r.dacInd << std::endl
|
||||
<< "start " << r.startOffset << std::endl
|
||||
<< "stop " << r.stopOffset << std::endl
|
||||
<< "step " << r.stepSize << std::endl
|
||||
<< "settleTime "
|
||||
<< ToString(std::chrono::nanoseconds{r.dacSettleTime_ns}) << std::endl
|
||||
<< ']';
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::scanParameters &r) {
|
||||
return os << ToString(r);
|
||||
}
|
||||
|
||||
std::string ToString(const defs::runStatus s) {
|
||||
switch (s) {
|
||||
case defs::ERROR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user