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

- 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:
2026-07-13 14:58:25 +02:00
committed by GitHub
parent 9cbf588217
commit c3ad3d2e73
48 changed files with 1269 additions and 142431 deletions
+58 -8
View File
@@ -53,6 +53,10 @@ void MasterAttributes::GetJungfrauBinaryAttributes(writer *w) {
WriteBinaryExposureTme(w);
WriteBinaryAcquisitionPeriod(w);
WriteBinaryNumberOfUDPInterfaces(w);
if (numUDPInterfaces == 2) {
WriteBinaryUDPPortsType(w);
WriteBinaryUDPPortsDisabled(w);
}
WriteBinaryNumberOfRows(w);
WriteBinaryReadoutSpeed(w);
}
@@ -63,6 +67,10 @@ void MasterAttributes::WriteJungfrauHDF5Attributes(H5::Group *group) {
WriteHDF5ExposureTime(group);
WriteHDF5AcquisitionPeriod(group);
WriteHDF5NumberOfUDPInterfaces(group);
if (numUDPInterfaces == 2) {
WriteHDF5UDPPortsType(group);
WriteHDF5UDPPortsDisabled(group);
}
WriteHDF5NumberOfRows(group);
WriteHDF5ReadoutSpeed(group);
}
@@ -73,6 +81,10 @@ void MasterAttributes::GetMoenchBinaryAttributes(writer *w) {
WriteBinaryExposureTme(w);
WriteBinaryAcquisitionPeriod(w);
WriteBinaryNumberOfUDPInterfaces(w);
if (numUDPInterfaces == 2) {
WriteBinaryUDPPortsType(w);
WriteBinaryUDPPortsDisabled(w);
}
WriteBinaryNumberOfRows(w);
WriteBinaryReadoutSpeed(w);
}
@@ -83,6 +95,10 @@ void MasterAttributes::WriteMoenchHDF5Attributes(H5::Group *group) {
WriteHDF5ExposureTime(group);
WriteHDF5AcquisitionPeriod(group);
WriteHDF5NumberOfUDPInterfaces(group);
if (numUDPInterfaces == 2) {
WriteHDF5UDPPortsType(group);
WriteHDF5UDPPortsDisabled(group);
}
WriteHDF5NumberOfRows(group);
WriteHDF5ReadoutSpeed(group);
}
@@ -98,6 +114,8 @@ void MasterAttributes::GetEigerBinaryAttributes(writer *w) {
WriteBinarySubExposureTime(w);
WriteBinarySubAcquisitionPeriod(w);
WriteBinaryQuad(w);
WriteBinaryUDPPortsType(w);
WriteBinaryUDPPortsDisabled(w);
WriteBinaryNumberOfRows(w);
WriteBinaryRateCorrections(w);
WriteBinaryReadoutSpeed(w);
@@ -114,6 +132,8 @@ void MasterAttributes::WriteEigerHDF5Attributes(H5::Group *group) {
WriteHDF5SubExposureTime(group);
WriteHDF5SubAcquisitionPeriod(group);
WriteHDF5Quad(group);
WriteHDF5UDPPortsType(group);
WriteHDF5UDPPortsDisabled(group);
WriteHDF5NumberOfRows(group);
WriteHDF5RateCorrections(group);
WriteHDF5ReadoutSpeed(group);
@@ -690,6 +710,26 @@ void MasterAttributes::WriteHDF5TransceiverSamples(H5::Group *group) {
}
#endif
void MasterAttributes::WriteBinaryUDPPortsType(writer *w) {
WriteBinary(w, N_UDP_PORTS_TYPE.data(), udpPortTypes);
}
#ifdef HDF5C
void MasterAttributes::WriteHDF5UDPPortsType(H5::Group *group) {
WriteHDF5StringArray(group, N_UDP_PORTS_TYPE.data(), udpPortTypes);
}
#endif
void MasterAttributes::WriteBinaryUDPPortsDisabled(writer *w) {
WriteBinary(w, N_UDP_PORTS_DISABLED.data(), udpPortsDisabled);
}
#ifdef HDF5C
void MasterAttributes::WriteHDF5UDPPortsDisabled(H5::Group *group) {
WriteHDF5Int(group, N_UDP_PORTS_DISABLED.data(), udpPortsDisabled);
}
#endif
#ifdef HDF5C
void MasterAttributes::WriteHDF5String(H5::Group *group,
const std::string &name,
@@ -704,15 +744,25 @@ void MasterAttributes::WriteHDF5String(H5::Group *group,
void MasterAttributes::WriteHDF5StringArray(
H5::Group *group, const std::string &name,
const std::vector<std::string> &value) {
std::vector<const char *> c;
for (auto &s : value) {
c.push_back(s.c_str());
try {
std::vector<const char *> c;
for (auto &s : value) {
c.push_back(s.c_str());
}
hsize_t dims[1] = {c.size()};
H5::DataSpace dataspace(1, dims);
H5::StrType strdatatype(H5::PredType::C_S1, H5T_VARIABLE);
H5::DataSet dataset =
group->createDataSet(name, strdatatype, dataspace);
dataset.write(c.data(), strdatatype);
} catch (H5::Exception &e) {
e.printErrorStack();
throw RuntimeError("Could not write attribute " + name +
" in HDf5 file");
} catch (std::exception &e) {
throw RuntimeError("Other excetion: Could not write attribute " + name +
" in HDf5 file. " + std::string(e.what()));
}
hsize_t dims[1] = {c.size()};
H5::DataSpace dataspace(1, dims);
H5::StrType strdatatype(H5::PredType::C_S1, H5T_VARIABLE);
H5::DataSet dataset = group->createDataSet(name, strdatatype, dataspace);
dataset.write(c.data(), strdatatype);
}
#endif