ef52dac2ee
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m34s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 12m52s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 12m54s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 9m48s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 12m50s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 13m54s
Build Packages / build:rpm (rocky8) (push) Successful in 12m46s
Build Packages / build:rpm (rocky9) (push) Successful in 11m56s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 10m34s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m54s
Build Packages / DIALS test (push) Successful in 13m1s
Build Packages / XDS test (durin plugin) (push) Successful in 8m32s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 8m44s
Build Packages / XDS test (neggia plugin) (push) Successful in 8m3s
Build Packages / Generate python client (push) Successful in 13s
Build Packages / Build documentation (push) Successful in 47s
Build Packages / Create release (push) Skipped
Build Packages / Unit tests (push) Successful in 43m38s
* jfjoch_broker: For PSI EIGER detector allow to disable individual half-modules by putting empty hostname Reviewed-on: #61 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
60 lines
2.6 KiB
C++
60 lines
2.6 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <sls/Detector.h>
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "../common/Logger.h"
|
|
#include "DetectorWrapper.h"
|
|
|
|
#define BASE_DETECTOR_MAC 0xAABBCCDDEE10 // little-endian!
|
|
|
|
class SLSDetectorWrapper : public DetectorWrapper {
|
|
Logger logger{"SLSDetectorWrapper"};
|
|
DetectorType det_type = DetectorType::JUNGFRAU;
|
|
sls::Detector det;
|
|
|
|
// Mapping between the slsDetectorPackage module index space and the
|
|
// Jungfraujoch (logical) module index space.
|
|
//
|
|
// Inactive half-modules (empty hostname string) are excluded from the
|
|
// slsDetectorPackage entirely - they are never added with setHostname() and
|
|
// never configured. They DO keep their slot in the logical numbering, so the
|
|
// geometry, module count and UDP destination ports of the surviving modules
|
|
// are unaffected.
|
|
//
|
|
// sls_to_logical[s] -> logical index of the s-th module known to SLS
|
|
// n_logical_units -> total logical units (2 * modules for EIGER,
|
|
// modules for JUNGFRAU), i.e. including placeholders
|
|
std::vector<int> sls_to_logical;
|
|
int n_logical_units = 0;
|
|
|
|
// Scatter an SLS-ordered (active-only) per-module vector back into a
|
|
// logical-ordered vector of size n_logical_units, filling inactive slots
|
|
// with the given placeholder. Used so that temperature / HV are reported at
|
|
// the correct Jungfraujoch module position.
|
|
[[nodiscard]] std::vector<int64_t> MapToLogical(const std::vector<int64_t>& sls_values,
|
|
int64_t placeholder) const;
|
|
|
|
void InternalStop();
|
|
[[nodiscard]] int64_t GetNumberOfTriggersLeft() const;
|
|
[[nodiscard]] DetectorPowerState GetPowerState() const;
|
|
int64_t GetFirmwareVersion() const;
|
|
std::string GetDetectorServerVersion() const;
|
|
std::vector<int64_t> GetFPGATemperatures() const;
|
|
std::vector<int64_t> GetHighVoltage() const;
|
|
public:
|
|
SLSDetectorWrapper();
|
|
[[nodiscard]] DetectorState GetState() const override;
|
|
void Initialize(DiffractionExperiment& experiment,
|
|
const std::vector<AcquisitionDeviceNetConfig>& net_config) override;
|
|
void Configure(const DiffractionExperiment& experiment) override;
|
|
void Start(const DiffractionExperiment& experiment) override;
|
|
void Stop() override;
|
|
void Trigger() override;
|
|
void Deactivate() override;
|
|
void LoadPixelMask(PixelMask &mask) override;
|
|
DetectorStatus GetStatus() const override;
|
|
};
|