1#ifndef DAQ_SENSOR_ASSIGNMENT_HPP
2#define DAQ_SENSOR_ASSIGNMENT_HPP
112 SystemState system_state,
const std::string& source_ip =
"");
122 uint8_t start_channel = 0);
std::string sensor_type_to_string(SensorType type) const
const std::map< std::string, PressureSensorSpec > & get_pressure_sensor_specs() const
Get all pressure sensor specs.
bool load_assignments_from_config(const std::string &config_path)
Load assignments from config file.
uint8_t flight_ip_range_start_
std::string assign_board_ip(uint8_t board_id, const std::string &mac_address, SystemState system_state, const std::string &source_ip="")
Assign IP address to board (called by FSW) If a static IP was set for this board_id,...
bool update_board_config_from_packet(uint8_t board_id, const uint8_t *data, size_t size)
Update board configuration from received packet.
std::vector< uint8_t > generate_board_config_packet(uint8_t board_id) const
Get board configuration for sending to board.
bool load_sensor_definitions(const std::string &config_path)
Load sensor definitions from config.
SensorType sensor_type_from_string(const std::string &type_str) const
void register_config_update_callback(std::function< void(uint8_t, const BoardConfiguration &)> callback)
Register callback for board configuration updates.
void set_static_board_ip(uint8_t board_id, const std::string &ip)
Set a static IP for a board from loaded configuration.
SensorAssignmentManager()
std::optional< BoardConfiguration > get_board_config(uint8_t board_id) const
Get board configuration.
std::vector< std::function< void(uint8_t, const BoardConfiguration &)> > config_callbacks_
uint8_t flight_ip_range_end_
std::map< uint8_t, std::string > static_board_ips_
uint8_t gse_ip_range_start_
std::string flight_base_ip_
std::map< std::string, PressureSensorSpec > pressure_sensor_specs_
std::map< std::string, SensorAssignment > sensor_assignments_
std::string calculate_ip_from_mac(const std::string &mac_address, SystemState state) const
std::map< uint8_t, BoardConfiguration > board_configs_
std::vector< SensorAssignment > get_board_sensors(uint8_t board_id) const
Get all sensors for a board.
~SensorAssignmentManager()=default
bool assign_sensors_to_board(uint8_t board_id, const std::vector< std::string > &sensor_ids, uint8_t start_channel=0)
Assign sensors to board (called by FSW).
std::optional< SensorAssignment > get_sensor_assignment(const std::string &sensor_id) const
Get sensor assignment for a sensor ID.
uint8_t gse_ip_range_end_
std::vector< SensorAssignment > get_system_sensors(SystemState state) const
Get all sensors for a system state.
static ActuatorControllerState state
SystemState
System state (GSE or Flight).
Motorized ball valve position: raw ADC counts -> % open.
Board configuration (assigned by FSW).
std::vector< SensorAssignment > sensors
std::string firmware_version
SensorType primary_sensor_type
Pressure sensor specifications.
uint16_t max_pressure_psi
Sensor assignment to board.