mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-15 18:07:25 +02:00
first draft of disabling data port at the receiver side. Todo: master file and stream for gui to use
This commit is contained in:
@@ -1317,6 +1317,16 @@ void Detector::setTransmissionDelay(int step) {
|
||||
pimpl->setTransmissionDelay(step);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getDataStream(const defs::portPosition port,
|
||||
Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDataStream, pos, port);
|
||||
}
|
||||
|
||||
void Detector::setDataStream(const defs::portPosition port, const bool enable,
|
||||
Positions pos) {
|
||||
pimpl->Parallel(&Module::setDataStream, pos, port, enable);
|
||||
}
|
||||
|
||||
// Receiver
|
||||
|
||||
Result<bool> Detector::getUseReceiverFlag(Positions pos) const {
|
||||
@@ -1746,16 +1756,6 @@ void Detector::setQuad(const bool enable) {
|
||||
pimpl->Parallel(&Module::setQuad, {}, enable);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getDataStream(const defs::portPosition port,
|
||||
Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDataStream, pos, port);
|
||||
}
|
||||
|
||||
void Detector::setDataStream(const defs::portPosition port, const bool enable,
|
||||
Positions pos) {
|
||||
pimpl->Parallel(&Module::setDataStream, pos, port, enable);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getTop(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getTop, pos);
|
||||
}
|
||||
|
||||
@@ -1407,6 +1407,33 @@ void Module::setTransmissionDelayRight(int value) {
|
||||
sendToDetector(F_SET_TRANSMISSION_DELAY_RIGHT, value, nullptr);
|
||||
}
|
||||
|
||||
bool Module::getDataStream(const portPosition port) const {
|
||||
// receiver only
|
||||
if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH) {
|
||||
if (!shm()->useReceiverFlag) {
|
||||
throw RuntimeError("No receiver to get datastream.");
|
||||
}
|
||||
return sendToReceiver<int>(F_RECEIVER_GET_UDP_DATASTREAM,
|
||||
static_cast<int>(port));
|
||||
} else
|
||||
return sendToDetector<int>(F_GET_DATASTREAM, static_cast<int>(port));
|
||||
}
|
||||
|
||||
void Module::setDataStream(const portPosition port, const bool enable) {
|
||||
int args[]{static_cast<int>(port), static_cast<int>(enable)};
|
||||
if (shm()->detType == JUNGFRAU || shm()->detType == MOENCH) {
|
||||
if (!shm()->useReceiverFlag) {
|
||||
throw RuntimeError("No receiver to set datastream.");
|
||||
}
|
||||
sendToReceiver(F_RECEIVER_SET_UDP_DATASTREAM, args, nullptr);
|
||||
} else {
|
||||
sendToDetector(F_SET_DATASTREAM, args, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_RECEIVER_SET_UDP_DATASTREAM, args, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Receiver Config
|
||||
|
||||
bool Module::getUseReceiverFlag() const { return shm()->useReceiverFlag; }
|
||||
@@ -1948,18 +1975,6 @@ void Module::setQuad(const bool enable) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Module::getDataStream(const portPosition port) const {
|
||||
return sendToDetector<int>(F_GET_DATASTREAM, static_cast<int>(port));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
bool Module::getTop() const {
|
||||
return (static_cast<bool>(sendToDetector<int>(F_GET_TOP)));
|
||||
}
|
||||
|
||||
@@ -279,6 +279,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setTransmissionDelayLeft(int value);
|
||||
int getTransmissionDelayRight() const;
|
||||
void setTransmissionDelayRight(int value);
|
||||
bool getDataStream(const portPosition port) const;
|
||||
void setDataStream(const portPosition port, const bool enable);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
@@ -388,8 +390,6 @@ class Module : public virtual slsDetectorDefs {
|
||||
void pulseChip(int n_pulses = 0);
|
||||
bool getQuad() const;
|
||||
void setQuad(const bool enable);
|
||||
bool getDataStream(const portPosition port) const;
|
||||
void setDataStream(const portPosition port, const bool enable);
|
||||
bool getTop() const;
|
||||
void setTop(bool value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user