1#ifndef DAQ_SENSOR_ROUTER_HPP
2#define DAQ_SENSOR_ROUTER_HPP
6#include <unordered_map>
59 std::array<uint8_t, 2>
get_table_id(
const std::string& sensor_type, uint8_t channel_id)
const;
64 std::string
get_table_name(
const std::string& sensor_type, uint8_t channel_id)
const;
73 uint64_t receive_timestamp_ns)
const;
82 uint64_t receive_timestamp_ns, uint8_t pt_board_slot = 1)
const;
105 uint64_t receive_timestamp_ns)
const;
109 uint64_t receive_timestamp_ns)
const;
113 uint64_t receive_timestamp_ns)
const;
118 uint64_t receive_timestamp_ns)
const;
122 uint64_t receive_timestamp_ns)
const;
126 uint64_t receive_timestamp_ns)
const;
140 uint64_t receive_timestamp_ns)
const;
143 std::unordered_map<std::string, SensorChannelConfig>
151 std::string
make_key(
const std::string& sensor_type, uint8_t channel_id)
const;
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::RawLCMessage > > route_lc_samples(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::RawRTDMessage > > route_rtd_samples(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
void set_pt_calibration(const calibration::PTCalibrationManager *cal_manager)
Set PT calibration manager (legacy).
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::RawTCMessage > > route_tc_samples(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
std::array< uint8_t, 2 > get_table_id(const std::string &sensor_type, uint8_t channel_id) const
Get table ID for a sensor channel.
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::RawPTMessage > > route_pt_samples(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
Convert a sensor batch into Elodin messages.
void set_tc_calibration(const calibration::SensorCalibrationManager *m)
Set calibration managers for each sensor type.
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::CalibratedPTMessage > > route_pt_samples_calibrated(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns, uint8_t pt_board_slot=1) const
Convert PT samples to calibrated messages.
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::CalibratedRTDMessage > > route_rtd_samples_calibrated(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
const calibration::PTCalibrationManager * pt_calibration_
const calibration::SensorCalibrationManager * tc_calibration_
const calibration::SensorCalibrationManager * rtd_calibration_
std::unordered_map< std::string, SensorChannelConfig > channel_map_
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::CalibratedTCMessage > > route_tc_samples_calibrated(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
std::string get_table_name(const std::string &sensor_type, uint8_t channel_id) const
Get table name for a sensor channel (for debugging).
bool load_config(const std::string &config_path)
Load routing configuration from TOML file.
std::string make_key(const std::string &sensor_type, uint8_t channel_id) const
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::CalibratedRTDMessage > > route_rtd_samples_pt100(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
RTD Pt100 temperature conversion — no calibration manager required.
void set_rtd_calibration(const calibration::SensorCalibrationManager *m)
void add_channel(const SensorChannelConfig &config)
Add a sensor channel configuration manually.
std::vector< std::pair< std::array< uint8_t, 2 >, comms::messages::sensor::CalibratedLCMessage > > route_lc_samples_calibrated(const daq_comms::protocol::SensorBatch &batch, uint64_t receive_timestamp_ns) const
const calibration::SensorCalibrationManager * lc_calibration_
void set_lc_calibration(const calibration::SensorCalibrationManager *m)
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawTCMessage
Raw Thermocouple sample message for Elodin CRITICAL: Includes padding bytes to ensure uint32_t fields...
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, float, uint32_t, uint8_t > CalibratedRTDMessage
Calibrated RTD message for Elodin.
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, float, uint32_t, uint8_t > CalibratedLCMessage
Calibrated Load Cell message for Elodin.
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, float, uint32_t, uint8_t > CalibratedTCMessage
Calibrated Thermocouple message for Elodin.
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawRTDMessage
Raw RTD sample message for Elodin CRITICAL: Includes padding bytes to ensure uint32_t fields are 4-by...
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, float, uint32_t, uint8_t > CalibratedPTMessage
Calibrated Pressure Transducer message for Elodin.
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawLCMessage
Raw Load Cell sample message for Elodin CRITICAL: Includes padding bytes to ensure uint32_t fields ar...
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawPTMessage
Raw Pressure Transducer sample message for Elodin.
Motorized ball valve position: raw ADC counts -> % open.
Configuration for sensor channel routing.
std::array< uint8_t, 2 > table_id