mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-08-10 20:30:29 +02:00
Dev/rx disable datastream port (#1448)
Build and Deploy on local RHEL9 / build (push) Successful in 2m13s
Build on RHEL9 docker image / build (push) Successful in 3m53s
Build and Deploy on local RHEL8 / build (push) Successful in 4m58s
Build on RHEL8 docker image / build (push) Successful in 5m47s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m55s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m26s
Build and Deploy on local RHEL9 / build (push) Successful in 2m13s
Build on RHEL9 docker image / build (push) Successful in 3m53s
Build and Deploy on local RHEL8 / build (push) Successful in 4m58s
Build on RHEL8 docker image / build (push) Successful in 5m47s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m55s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m26s
- changed
- command from `datastream` to `udp_datastream` to be more specific
- Detector API:
- setNumberofUDPInterfaces(pos) =>setNumberofUDPInterfaces() # no position anymore
- getDataStream(portPosition, pos) =>getUDPDataStream(portPosition, pos)
- setDataStream(portPosition, pos) => setUDPDataStream(portPosition) # no position anymore
- modified the dataprocessing thread:
- if gui or call back, start zmq processing (connecting sockets) before starting receiver (disabled ports sends dummy that the client zmq sockets are not ready for)
- if only progress, starting progress processing thread after startReceiver
-
- added
- Detector API:
- getRxDisabledUDPPortIndices()
- getPortPositionList()
- allow disabling/enabling udp interface in receiver for Jungfrua/Moench when both udp interfaces is enabled (This is to go fast, where only one half of the module matters)
- write ports type and disabled ports to master file (tests for it as well)
- tests for python commands as well
- datastream command to deprecated commands
- refactored tests to make the new parameters fit
* first draft of disabling data port at the receiver side. Todo: master file and stream for gui to use
* updated help in command
* formatting
* md5 unchanged
* fix test, check port position for detector type
* wip, udp port enable metadata in client, to:receiver, zmq streaming
* wip, master attributes
* wip, imple=> save only disabled ports with port index, 1 interface, is empty
* works in file. still needs refactoring
* updated writer versions
* udp ports type pass, disabled with api yet
* fixed disabled ports meta data as well
* fixed in developer via other PR
* renamed.more intuitive
* fix in gui that wont wait for disabled ports
* added tests for master file
* extra tests
* move the master fiel tests into its own tests with the disable marker for github tests
* refactoring
* python test
* more intuitive and doc
* release notes
* example for python
* back to before
* minor documentation fix and sending nports unnecessarily for getRxUDPPortDisableMetadata
* doc
* review fixes, 1. using std::array instead of vector, 2. moving udp_datastream command testing with different values into master attributes testing file because we test the master file
* minor
* review: update help
* progress printed before assigned
* try catch inside hdf5
* auto generated code for CLI and formatting
* missing packets should not be checked at github workflow level
* formatting
* improved python doc for udp_datastream help
* indent doc python done
This commit is contained in:
@@ -1082,17 +1082,17 @@ Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getNumberofUDPInterfacesFromShm, pos);
|
||||
}
|
||||
|
||||
void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
|
||||
void Detector::setNumberofUDPInterfaces(int n) {
|
||||
auto detType = getDetectorType().squash();
|
||||
if (detType != defs::JUNGFRAU && detType != defs::MOENCH) {
|
||||
throw RuntimeError(
|
||||
"Cannot set number of udp interfaces for this detector.");
|
||||
}
|
||||
// also called by vetostream (for gotthard2)
|
||||
setNumberofUDPInterfaces_(n, pos);
|
||||
setNumberofUDPInterfaces_(n);
|
||||
}
|
||||
|
||||
void Detector::setNumberofUDPInterfaces_(int n, Positions pos) {
|
||||
void Detector::setNumberofUDPInterfaces_(int n) {
|
||||
if (!size()) {
|
||||
throw RuntimeError("No modules added.");
|
||||
}
|
||||
@@ -1102,10 +1102,10 @@ void Detector::setNumberofUDPInterfaces_(int n, Positions pos) {
|
||||
bool previouslyReceiverStreaming = false;
|
||||
uint16_t rxStartingPort = 0;
|
||||
if (useReceiver) {
|
||||
previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(true);
|
||||
previouslyReceiverStreaming = getRxZmqDataStream().squash(true);
|
||||
rxStartingPort = getRxZmqPort({0}).squash(0);
|
||||
}
|
||||
pimpl->Parallel(&Module::setNumberofUDPInterfaces, pos, n);
|
||||
pimpl->Parallel(&Module::setNumberofUDPInterfaces, {}, n);
|
||||
// ensure receiver zmq socket ports are multiplied by 2 (2 interfaces)
|
||||
setClientZmqPort(clientStartingPort, -1);
|
||||
if (getUseReceiverFlag().squash(false)) {
|
||||
@@ -1117,8 +1117,8 @@ void Detector::setNumberofUDPInterfaces_(int n, Positions pos) {
|
||||
pimpl->setDataStreamingToClient(true);
|
||||
}
|
||||
if (previouslyReceiverStreaming) {
|
||||
setRxZmqDataStream(false, pos);
|
||||
setRxZmqDataStream(true, pos);
|
||||
setRxZmqDataStream(false);
|
||||
setRxZmqDataStream(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1317,6 +1317,24 @@ void Detector::setTransmissionDelay(int step) {
|
||||
pimpl->setTransmissionDelay(step);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getUDPDataStream(const defs::portPosition port,
|
||||
Positions pos) const {
|
||||
return pimpl->getUDPDataStream(port, pos);
|
||||
}
|
||||
|
||||
void Detector::setUDPDataStream(const defs::portPosition port,
|
||||
const bool enable, Positions pos) {
|
||||
pimpl->setUDPDataStream(port, enable, pos);
|
||||
}
|
||||
|
||||
std::vector<int> Detector::getRxDisabledUDPPortIndices() const {
|
||||
return pimpl->getRxDisabledUDPPortIndices();
|
||||
}
|
||||
|
||||
std::vector<defs::portPosition> Detector::getPortPositionList() const {
|
||||
return pimpl->getPortPositionList();
|
||||
}
|
||||
|
||||
// Receiver
|
||||
|
||||
Result<bool> Detector::getUseReceiverFlag(Positions pos) const {
|
||||
@@ -1750,16 +1768,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);
|
||||
}
|
||||
@@ -2012,7 +2020,7 @@ void Detector::setVetoStream(defs::streamingInterface interface,
|
||||
? 2
|
||||
: 1);
|
||||
if (numinterfaces != old_numinterfaces) {
|
||||
setNumberofUDPInterfaces_(numinterfaces, pos);
|
||||
setNumberofUDPInterfaces_(numinterfaces);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user