Files
maliakal_dandGitHub c3ad3d2e73
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
Dev/rx disable datastream port (#1448)
- 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
2026-07-13 14:58:25 +02:00

125 lines
3.3 KiB
C++

// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include "Acquire.h"
#include "CTBState.h"
#include "FileState.h"
#include <variant>
namespace sls::test::acquire {
struct CommonExpectedState {
defs::detectorType det_type{};
defs::timingMode timing_mode{};
defs::xy geometry{};
int image_size{};
defs::xy port_shape{};
int max_frames_per_file{};
defs::frameDiscardPolicy frame_discard_policy{};
bool partial_frames_padding{};
defs::scanParameters scan_parameters{};
uint64_t total_frames{};
uint64_t frames_in_file{};
std::map<std::string, std::string> additional_json_header{};
};
struct JungfrauExpectedState {
std::vector<defs::ROI> rois{};
ns exptime{};
ns period{};
int num_udp_interfaces{};
std::vector<defs::portPosition> udp_port_types;
std::vector<int> udp_ports_disabled;
int read_n_rows{};
defs::speedLevel readout_speed{};
};
struct MoenchExpectedState {
std::vector<defs::ROI> rois{};
ns exptime{};
ns period{};
int num_udp_interfaces{};
std::vector<defs::portPosition> udp_port_types;
std::vector<int> udp_ports_disabled;
int read_n_rows{};
defs::speedLevel readout_speed{};
};
struct EigerExpectedState {
std::vector<defs::ROI> rois{};
int dynamic_range{};
bool ten_giga{};
ns exptime{};
ns period{};
int threshold_energy{};
ns sub_exptime{};
ns sub_period{};
bool quad{};
std::vector<defs::portPosition> udp_port_types;
std::vector<int> udp_ports_disabled;
int read_n_rows{};
std::vector<int64_t> rate_corrections{};
defs::speedLevel readout_speed{};
};
struct Mythen3ExpectedState {
std::vector<defs::ROI> rois{};
int dynamic_range{};
bool ten_giga{};
ns period{};
int counter_mask{};
std::array<ns, 3> exp_times{};
std::array<ns, 3> gate_delays{};
int num_gates{};
std::array<int, 3> threshold_energies{};
defs::speedLevel readout_speed{};
};
struct Gotthard2ExpectedState {
std::vector<defs::ROI> rois{};
ns exptime{};
ns period{};
defs::burstMode burst_mode{};
defs::speedLevel readout_speed{};
};
struct CTBExpectedState {
ns exptime{};
ns period{};
CTBState ctb_acq_state{};
};
using DetectorSpecificState =
std::variant<JungfrauExpectedState, MoenchExpectedState, EigerExpectedState,
Mythen3ExpectedState, Gotthard2ExpectedState,
CTBExpectedState>;
struct ExpectedState {
FileState file_state{};
AcquisitionState acquisition_state{};
CommonExpectedState common_state{};
DetectorSpecificState detector_specific_state{};
};
template <typename T>
const T &get_detector_specific_state(const ExpectedState &expected_state) {
return std::get<T>(expected_state.detector_specific_state);
}
template <typename T> bool is_type(const ExpectedState &e) {
return std::holds_alternative<T>(e.detector_specific_state);
}
ExpectedState build_expected_state(
const Detector &det,
const AcquisitionState &acq_state = default_acquisition_state(),
const FileState &file_state = default_file_state(),
std::optional<CTBState> ctb_state = std::nullopt);
int get_expected_image_size(const Detector &det,
std::optional<CTBState> ctb_state = std::nullopt);
} // namespace sls::test::acquire