mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +02:00
WIP
This commit is contained in:
@ -1010,21 +1010,25 @@ std::string CmdProxy::Scan(int action) {
|
||||
auto t = det->getScan();
|
||||
os << ToString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
// disable
|
||||
if (args.size() == 1) {
|
||||
if (StringTo<int>(args[0]) != 0) {
|
||||
throw sls::RuntimeError("Did you mean '0' to disable?");
|
||||
}
|
||||
det->disableScan();
|
||||
os << "scan disabled" << '\n';
|
||||
} else if (args.size() == 4) {
|
||||
det->enableScan(defs::scanParameters(
|
||||
det->setScan(defs::scanParameters());
|
||||
}
|
||||
// enable without settling time
|
||||
else if (args.size() == 4) {
|
||||
det->setScan(defs::scanParameters(
|
||||
StringTo<defs::dacIndex>(args[0]), StringTo<int>(args[1]),
|
||||
StringTo<int>(args[2]), StringTo<int>(args[3])));
|
||||
} else if (args.size() == 5) {
|
||||
}
|
||||
// enable with all parameters
|
||||
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(
|
||||
det->setScan(defs::scanParameters(
|
||||
StringTo<defs::dacIndex>(args[0]), StringTo<int>(args[1]),
|
||||
StringTo<int>(args[2]), StringTo<int>(args[3]), t));
|
||||
} else {
|
||||
|
@ -563,10 +563,8 @@ Result<defs::scanParameters> Detector::getScan(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getScan, pos);
|
||||
}
|
||||
|
||||
void Detector::disableScan() { pimpl->Parallel(&Module::disableScan, {}); }
|
||||
|
||||
void Detector::enableScan(const defs::scanParameters t) {
|
||||
pimpl->Parallel(&Module::enableScan, {}, t);
|
||||
void Detector::setScan(const defs::scanParameters t) {
|
||||
pimpl->Parallel(&Module::setScan, {}, t);
|
||||
}
|
||||
|
||||
// Network Configuration (Detector<->Receiver)
|
||||
|
@ -453,13 +453,9 @@ defs::scanParameters Module::getScan() {
|
||||
return sendToDetector<defs::scanParameters>(F_GET_SCAN);
|
||||
}
|
||||
|
||||
void Module::disableScan() {
|
||||
sendToDetector(F_DISABLE_SCAN);
|
||||
setNumberOfFrames(1);
|
||||
}
|
||||
|
||||
void Module::enableScan(const defs::scanParameters t) {
|
||||
auto retval = sendToDetector<int64_t>(F_ENABLE_SCAN, t);
|
||||
void Module::setScan(const defs::scanParameters t) {
|
||||
auto retval = sendToDetector<int64_t>(F_SET_SCAN, t);
|
||||
// if disabled, retval is 1, else its number of steps
|
||||
setNumberOfFrames(retval);
|
||||
}
|
||||
|
||||
|
@ -167,8 +167,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setStartingFrameNumber(uint64_t value);
|
||||
void sendSoftwareTrigger();
|
||||
defs::scanParameters getScan();
|
||||
void disableScan();
|
||||
void enableScan(const defs::scanParameters t);
|
||||
void setScan(const defs::scanParameters t);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
Reference in New Issue
Block a user