mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 04:47:14 +02:00
wip to change to enum for portposition
This commit is contained in:
@ -1703,14 +1703,21 @@ int ClientInterface::set_all_threshold(Interface &socket) {
|
||||
int ClientInterface::set_detector_datastream(Interface &socket) {
|
||||
int args[2]{-1, -1};
|
||||
socket.Receive(args);
|
||||
bool left = static_cast<int>(args[0]);
|
||||
portPosition port = static_cast<portPosition>(args[0]);
|
||||
switch (port) {
|
||||
case LEFT:
|
||||
case RIGHT:
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Invalid port type");
|
||||
}
|
||||
bool enable = static_cast<int>(args[1]);
|
||||
LOG(logDEBUG1) << "Setting datstream " << (left ? "left" : "right")
|
||||
<< ") to " << sls::ToString(enable);
|
||||
LOG(logDEBUG1) << "Setting datastream (" << sls::ToString(port) << ") to "
|
||||
<< sls::ToString(enable);
|
||||
if (myDetectorType != EIGER)
|
||||
functionNotImplemented();
|
||||
verifyIdle(socket);
|
||||
impl()->setDetectorDataStream(left, enable);
|
||||
impl()->setDetectorDataStream(port, enable);
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
|
@ -1508,15 +1508,17 @@ void Implementation::setActivate(bool enable) {
|
||||
LOG(logINFO) << "Activation: " << (activated ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
bool Implementation::getDetectorDataStream(const bool leftPort) const {
|
||||
int index = (leftPort ? 0 : 1);
|
||||
return detectorDataStream[index];
|
||||
bool Implementation::getDetectorDataStream(const portPosition port) const {
|
||||
int index = (port == LEFT ? 0 : 1);
|
||||
return detectorDataStream[index];
|
||||
}
|
||||
|
||||
void Implementation::setDetectorDataStream(const bool leftPort, const bool enable) {
|
||||
int index = (leftPort ? 0 : 1);
|
||||
void Implementation::setDetectorDataStream(const portPosition port,
|
||||
const bool enable) {
|
||||
int index = (port == LEFT ? 0 : 1);
|
||||
detectorDataStream[index] = enable;
|
||||
LOG(logINFO) << "Detector datastream (" << (leftPort ? "Left" : "Right") << " Port): " << sls::ToString(detectorDataStream[index]);
|
||||
LOG(logINFO) << "Detector datastream (" << sls::ToString(port)
|
||||
<< " Port): " << sls::ToString(detectorDataStream[index]);
|
||||
}
|
||||
|
||||
bool Implementation::getDeactivatedPadding() const {
|
||||
|
@ -211,10 +211,10 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
/** [Eiger] If deactivated, receiver will create dummy data if deactivated
|
||||
* padding is enabled (as it will receive nothing from detector) */
|
||||
void setActivate(const bool enable);
|
||||
bool getDetectorDataStream(const bool leftPort) const;
|
||||
bool getDetectorDataStream(const portPosition port) const;
|
||||
/** [Eiger] If datastream is disabled, receiver will create dummy data if deactivated
|
||||
* padding for that port is enabled (as it will receive nothing from detector) */
|
||||
void setDetectorDataStream(const bool leftPort, const bool enable);
|
||||
void setDetectorDataStream(const portPosition port, const bool enable);
|
||||
bool getDeactivatedPadding() const;
|
||||
/* [Eiger] */
|
||||
void setDeactivatedPadding(const bool enable);
|
||||
|
Reference in New Issue
Block a user