mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +02:00
wip to change to enum for portposition
This commit is contained in:
@ -1603,29 +1603,15 @@ std::string CmdProxy::DataStream(int action) {
|
||||
if (args.size() != 1) {
|
||||
WrongNumberOfParameters(1);
|
||||
}
|
||||
// TODO, enum for "left and right?"
|
||||
if (args[0] == "left") {
|
||||
left = true;
|
||||
} else if (args[0] == "right") {
|
||||
left = false;
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown data argument " + args[0]);
|
||||
}
|
||||
auto t = det->getDataStream(left, std::vector<int>{det_id});
|
||||
auto t = det->getDataStream(StringTo<defs::portPosition>(args[0]),
|
||||
std::vector<int>{det_id});
|
||||
os << OutString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
if (args[0] == "left") {
|
||||
left = true;
|
||||
} else if (args[0] == "right") {
|
||||
left = false;
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown data argument " + args[0]);
|
||||
}
|
||||
det->setDataStream(left, StringTo<bool>(args[1]),
|
||||
std::vector<int>{det_id});
|
||||
det->setDataStream(StringTo<defs::portPosition>(args[0]),
|
||||
StringTo<bool>(args[1]), std::vector<int>{det_id});
|
||||
os << args << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
|
@ -1369,13 +1369,14 @@ void Detector::setQuad(const bool enable) {
|
||||
pimpl->Parallel(&Module::setQuad, {}, enable);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getDataStream(const bool left, Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDataStream, pos, left);
|
||||
Result<bool> Detector::getDataStream(const portPosition port,
|
||||
Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDataStream, pos, port);
|
||||
}
|
||||
|
||||
void Detector::setDataStream(const bool left, const bool enable,
|
||||
void Detector::setDataStream(const portPosition port, const bool enable,
|
||||
Positions pos) {
|
||||
pimpl->Parallel(&Module::setDataStream, pos, left, enable);
|
||||
pimpl->Parallel(&Module::setDataStream, pos, port, enable);
|
||||
}
|
||||
|
||||
// Jungfrau Specific
|
||||
|
@ -1509,12 +1509,12 @@ void Module::setQuad(const bool enable) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Module::getDataStream(const bool left) const {
|
||||
return sendToDetector<int>(F_GET_DATASTREAM, static_cast<int>(left));
|
||||
bool Module::getDataStream(const portPosition port) const {
|
||||
return sendToDetector<int>(F_GET_DATASTREAM, static_cast<int>(port));
|
||||
}
|
||||
|
||||
void Module::setDataStream(const bool left, const bool enable) {
|
||||
int args[]{static_cast<int>(left), static_cast<int>(enable)};
|
||||
void Module::setDataStream(const portPosition port, const bool enable) {
|
||||
int args[]{static_cast<int>(port), static_cast<int>(enable)};
|
||||
sendToDetector(F_SET_DATASTREAM, args, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_RECEIVER_SET_DATASTREAM, args, nullptr);
|
||||
|
@ -343,8 +343,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
void pulseChip(int n_pulses = 0);
|
||||
bool getQuad() const;
|
||||
void setQuad(const bool enable);
|
||||
bool getDataStream(const bool left) const;
|
||||
void setDataStream(const bool left, const bool enable);
|
||||
bool getDataStream(const portPosition port) const;
|
||||
void setDataStream(const portPosition port, const bool enable);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
Reference in New Issue
Block a user