mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-16 20:56:04 +02:00
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
101 lines
3.8 KiB
C++
101 lines
3.8 KiB
C++
// SPDX-License-Identifier: LGPL-3.0-or-other
|
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
#include "sls/Detector.h"
|
|
#include "sls/ToString.h"
|
|
#include "test-Caller-global.h"
|
|
|
|
#include "catch.hpp"
|
|
#include <string>
|
|
|
|
namespace sls {
|
|
|
|
namespace acq = sls::test::acquire;
|
|
|
|
TEST_CASE("check_master_file_attributes",
|
|
"[.detectorintegration][.disable_check_data_file]") {
|
|
|
|
Detector det;
|
|
auto detType = det.getDetectorType().squash(defs::GENERIC);
|
|
INFO("Testing master file attributes with " << ToString(detType));
|
|
|
|
// if ctb, set to default and restore after test
|
|
std::optional<acq::CTBState> ctb_state = std::nullopt;
|
|
if (detType == defs::CHIPTESTBOARD ||
|
|
detType == defs::XILINX_CHIPTESTBOARD) {
|
|
ctb_state = std::make_optional(acq::default_ctb_state(detType));
|
|
}
|
|
acq::CTBStateGuard ctb_guard(det, ctb_state);
|
|
|
|
test_run_with_master_file_checker(
|
|
det, [&](auto &det, auto &acq_state, auto &file_state, auto &checker) {
|
|
// get expected state of parameters and check against master file
|
|
auto expected_state = acq::build_expected_state(
|
|
det, acq_state, file_state, ctb_state);
|
|
checks::check_metadata(checker, expected_state);
|
|
});
|
|
}
|
|
|
|
TEST_CASE("udp_datastream with master file",
|
|
"[.detectorintegration][.disable_check_data_file]") {
|
|
Detector det;
|
|
auto det_type = det.getDetectorType().squash();
|
|
if (det_type == defs::EIGER) {
|
|
auto prev_val_left = det.getUDPDataStream(defs::LEFT);
|
|
auto prev_val_right = det.getUDPDataStream(defs::RIGHT);
|
|
|
|
det.setUDPDataStream(defs::LEFT, false);
|
|
// check master file
|
|
{
|
|
// expected
|
|
std::vector<defs::portPosition> expected_ports =
|
|
det.getPortPositionList();
|
|
std::vector<int> expected_disabled_ports =
|
|
det.getRxDisabledUDPPortIndices();
|
|
REQUIRE(expected_disabled_ports.size() > 0);
|
|
|
|
test_run_with_master_file_checker(
|
|
det, [&](auto &det, auto &acq_state, auto &file_state,
|
|
auto &checker) {
|
|
checks::check_udp_ports_type(checker, expected_ports);
|
|
checks::check_udp_ports_disabled(checker,
|
|
expected_disabled_ports);
|
|
});
|
|
}
|
|
|
|
for (int i = 0; i != det.size(); ++i) {
|
|
det.setUDPDataStream(defs::LEFT, prev_val_left[i], {i});
|
|
det.setUDPDataStream(defs::RIGHT, prev_val_right[i], {i});
|
|
}
|
|
} else if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
|
|
(det.getNumberofUDPInterfaces().squash(0) == 2)) {
|
|
auto prev_val_top = det.getUDPDataStream(defs::TOP);
|
|
auto prev_val_bottom = det.getUDPDataStream(defs::BOTTOM);
|
|
|
|
det.setUDPDataStream(defs::TOP, false);
|
|
// check master file
|
|
{
|
|
// expected
|
|
std::vector<defs::portPosition> expected_ports =
|
|
det.getPortPositionList();
|
|
std::vector<int> expected_disabled_ports =
|
|
det.getRxDisabledUDPPortIndices();
|
|
REQUIRE(expected_disabled_ports.size() > 0);
|
|
|
|
test_run_with_master_file_checker(
|
|
det, [&](auto &det, auto &acq_state, auto &file_state,
|
|
auto &checker) {
|
|
checks::check_udp_ports_type(checker, expected_ports);
|
|
checks::check_udp_ports_disabled(checker,
|
|
expected_disabled_ports);
|
|
});
|
|
}
|
|
|
|
for (int i = 0; i != det.size(); ++i) {
|
|
det.setUDPDataStream(defs::TOP, prev_val_top[i], {i});
|
|
det.setUDPDataStream(defs::BOTTOM, prev_val_bottom[i], {i});
|
|
}
|
|
}
|
|
}
|
|
|
|
} // namespace sls
|