added ReadingMode member to RawMasterFile adapted error in Matterhorntransformer

This commit is contained in:
2026-02-03 16:49:04 +01:00
parent 4edebf4671
commit 8c8d635b0c
9 changed files with 146 additions and 75 deletions

View File

@@ -2,11 +2,11 @@
#pragma once
#include "aare/defs.hpp"
#include <algorithm>
#include <chrono>
#include <filesystem>
#include <fmt/format.h>
#include <fstream>
#include <optional>
#include <chrono>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
@@ -97,9 +97,9 @@ class RawMasterFile {
size_t m_frame_padding{};
// TODO! should these be bool?
uint8_t m_analog_flag{};
uint8_t m_digital_flag{};
uint8_t m_transceiver_flag{};
bool m_analog_flag{};
bool m_digital_flag{};
bool m_transceiver_flag{};
ScanParameters m_scan_parameters;
@@ -135,6 +135,8 @@ class RawMasterFile {
size_t n_modules() const;
uint8_t quad() const;
ReadingMode get_reading_mode() const;
std::optional<size_t> analog_samples() const;
std::optional<size_t> digital_samples() const;
std::optional<size_t> transceiver_samples() const;
@@ -145,7 +147,9 @@ class RawMasterFile {
ScanParameters scan_parameters() const;
std::optional<std::chrono::nanoseconds> exptime() const { return m_exptime; }
std::optional<std::chrono::nanoseconds> exptime() const {
return m_exptime;
}
std::chrono::nanoseconds period() const { return m_period; }
private:

View File

@@ -188,6 +188,15 @@ struct ROI {
}
};
enum ReadingMode : uint8_t {
Analog = 0,
Digital = 1,
AnalogAndDigital = 2,
Transceiver = 3,
DigitalAndTransceiver = 4,
Unknown = 5
};
using dynamic_shape = std::vector<ssize_t>;
// TODO! Can we uniform enums between the libraries?
@@ -353,16 +362,15 @@ using DataTypeVariants = std::variant<uint16_t, uint32_t>;
constexpr uint16_t ADC_MASK =
0x3FFF; // used to mask out the gain bits in Jungfrau
class BitOffset{
class BitOffset {
uint8_t m_offset{};
public:
public:
BitOffset() = default;
explicit BitOffset(uint32_t offset);
uint8_t value() const {return m_offset;}
bool operator==(const BitOffset& other) const;
bool operator<(const BitOffset& other) const;
uint8_t value() const { return m_offset; }
bool operator==(const BitOffset &other) const;
bool operator<(const BitOffset &other) const;
};
} // namespace aare