|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <cinttypes>#include <cmath>#include <cstdio>#include <filesystem>#include <fstream>#include <nlohmann/json.hpp>#include <string>#include "calibration/CubicCalibrationStore.hpp"Go to the source code of this file.
Classes | |
| class | CubicCalibrationStore |
| Owns the per-channel captured points and the fitted cubic for the calibration service. More... | |
Namespaces | |
| namespace | anonymous_namespace{test_cubic_store_namespace.cpp} |
Macros | |
| #define | CHECK(cond, ...) |
Typedefs | |
| using | json = nlohmann::json |
Enumerations | |
| enum class | SensorKind |
| Which family of sensor a channel belongs to. More... | |
Variables | |
| static int | g_failures = 0 |
| #define CHECK | ( | cond, | |
| ... ) |
Definition at line 35 of file test_cubic_store_namespace.cpp.
Referenced by anonymous_namespace{test_cubic_store_namespace.cpp}::add_point_rejects_unknown_uid(), disabled_board_orphan_is_not_applied(), anonymous_namespace{test_cubic_store_namespace.cpp}::kind_round_trip(), anonymous_namespace{test_cubic_store_namespace.cpp}::legacy_file_without_kind(), anonymous_namespace{test_cubic_store_namespace.cpp}::logical_1_collision(), anonymous_namespace{test_cubic_store_namespace.cpp}::pt_lc_logical_collision(), anonymous_namespace{test_cubic_store_namespace.cpp}::recovery_regenerates_overwritten_pt_curve(), removed_board_does_not_win_the_logical_map(), role_moved_to_t7_keeps_its_unit(), t7_role_follows_within_t7(), and anonymous_namespace{test_cubic_store_namespace.cpp}::unreadable_file_is_not_overwritten().
| using json = nlohmann::json |
Definition at line 31 of file test_cubic_store_namespace.cpp.
|
strong |
Which family of sensor a channel belongs to.
logical_ch is (slot - 1) * 10 + connector with slot = board_id % 10, and check_board_slots only prevents two boards of the SAME kind sharing a slot. So PT board 22 and LC board 42 are both slot 2, and PT uid 2201 and LC uid 4201 both land on logical channel 11. The logical-channel maps below are written from a uid-ordered map, so the higher uid silently won: on 2026-09-13 a load cell's curve overwrote a 5000 psi transducer's on disk. The kind namespaces those maps so the two cannot collide.
Definition at line 49 of file CubicCalibrationStore.hpp.
| void disabled_board_orphan_is_not_applied | ( | ) |
Definition at line 333 of file test_cubic_store_namespace.cpp.
References fsw::calibration::CubicCalibrationStore::add_point(), anonymous_namespace{test_cubic_store_namespace.cpp}::add_pt_points(), fsw::calibration::cal_target(), fsw::calibration::CubicCalibrationStore::channel(), CHECK, fsw::calibration::CubicCalibrationStore::load(), fsw::calibration::None, fsw::calibration::PT, fsw::calibration::CubicCalibrationStore::register_channel(), fsw::calibration::CubicCalibrationStore::save(), and scratch.
Referenced by main().
| int main | ( | ) |
Definition at line 413 of file test_cubic_store_namespace.cpp.
References anonymous_namespace{test_cubic_store_namespace.cpp}::add_point_rejects_unknown_uid(), disabled_board_orphan_is_not_applied(), g_failures, anonymous_namespace{test_cubic_store_namespace.cpp}::kind_round_trip(), anonymous_namespace{test_cubic_store_namespace.cpp}::legacy_file_without_kind(), anonymous_namespace{test_cubic_store_namespace.cpp}::logical_1_collision(), anonymous_namespace{test_cubic_store_namespace.cpp}::pt_lc_logical_collision(), anonymous_namespace{test_cubic_store_namespace.cpp}::recovery_regenerates_overwritten_pt_curve(), removed_board_does_not_win_the_logical_map(), role_moved_to_t7_keeps_its_unit(), t7_role_follows_within_t7(), and anonymous_namespace{test_cubic_store_namespace.cpp}::unreadable_file_is_not_overwritten().
| void removed_board_does_not_win_the_logical_map | ( | ) |
Definition at line 379 of file test_cubic_store_namespace.cpp.
References fsw::calibration::CubicCalibrationStore::add_point(), anonymous_namespace{test_cubic_store_namespace.cpp}::add_pt_points(), fsw::calibration::CubicCalibrationStore::channel(), CHECK, contains(), anonymous_namespace{test_cubic_store_namespace.cpp}::eval_abcd(), fsw::calibration::CubicCalibrationStore::load(), anonymous_namespace{test_cubic_store_namespace.cpp}::read_json(), fsw::calibration::CubicCalibrationStore::register_channel(), fsw::calibration::CubicCalibrationStore::save(), and scratch.
Referenced by main().
| void role_moved_to_t7_keeps_its_unit | ( | ) |
Definition at line 260 of file test_cubic_store_namespace.cpp.
References anonymous_namespace{test_cubic_store_namespace.cpp}::add_pt_points(), fsw::calibration::CubicCalibrationStore::channel(), CHECK, contains(), fsw::calibration::CubicCalibrationStore::load(), anonymous_namespace{test_cubic_store_namespace.cpp}::read_json(), fsw::calibration::CubicCalibrationStore::register_channel(), fsw::calibration::CubicCalibrationStore::save(), scratch, and t7().
Referenced by main().
| void t7_role_follows_within_t7 | ( | ) |
Definition at line 290 of file test_cubic_store_namespace.cpp.
References fsw::calibration::CubicCalibrationStore::add_point(), fsw::calibration::CubicCalibrationStore::channel(), CHECK, contains(), fsw::calibration::CubicCalibrationStore::load(), anonymous_namespace{test_cubic_store_namespace.cpp}::read_json(), fsw::calibration::CubicCalibrationStore::register_channel(), fsw::calibration::CubicCalibrationStore::save(), and scratch.
Referenced by main().
|
static |
Definition at line 33 of file test_cubic_store_namespace.cpp.