|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <cmath>#include <cstdio>#include <filesystem>#include <fstream>#include <nlohmann/json.hpp>#include <string>#include <vector>#include "calibration/CubicCalibrationStore.hpp"#include "calibration/LcTareStore.hpp"Go to the source code of this file.
Classes | |
| struct | CubicChannel |
| Per-sensor calibration record: identity, captured points, and the current fit. More... | |
| struct | CubicFit |
| Result of a least-squares polynomial fit over a channel's captured points. More... | |
| struct | CubicPoint |
| One operator-captured calibration point: raw ADC code paired with a known reference PSI. More... | |
| class | LcTareStore |
| Owns the per-channel tares for the calibration service. More... | |
Namespaces | |
| namespace | anonymous_namespace{test_lc_linear_fit.cpp} |
Macros | |
| #define | CHECK(cond, ...) |
Enumerations | |
| enum class | SensorKind |
| Which family of sensor a channel belongs to. More... | |
Variables | |
| static int | g_failures = 0 |
| constexpr uint16_t | anonymous_namespace{test_lc_linear_fit.cpp}::kUid = 4201 |
| #define CHECK | ( | cond, | |
| ... ) |
Definition at line 42 of file test_lc_linear_fit.cpp.
Referenced by anonymous_namespace{test_lc_linear_fit.cpp}::a_model_change_refits_without_a_capture(), anonymous_namespace{test_lc_linear_fit.cpp}::both_fits_are_serialized(), anonymous_namespace{test_lc_linear_fit.cpp}::cubic_model_is_unchanged(), anonymous_namespace{test_lc_linear_fit.cpp}::linear_model_fits_a_line(), anonymous_namespace{test_lc_linear_fit.cpp}::linear_needs_two_points(), anonymous_namespace{test_lc_linear_fit.cpp}::raw_coefficients_match_the_normalized_form(), and anonymous_namespace{test_lc_linear_fit.cpp}::tare_cancels_zero_drift_on_linear_not_cubic().
|
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.
| std::string fsw::calibration::lc_tare_entity | ( | uint8_t | board_id, |
| uint8_t | connector ) |
The publish-path entity name for an LC channel: "LC<slot>_Cal.CH<connector>", where slot is board_id % 10 with 0 -> 10 — the same rule DatabaseConfig uses to name the calibrated LC VTables, and the same board_number the LC publish path already holds.
It exists as one shared function because the failure mode of a second copy is specific and has already happened: slot is NOT board_id, so PT board 22 and LC board 42 are both slot 2, and deriving a uid back out of an entity string collides them. Node must key on this string rather than re-derive it.
Definition at line 29 of file LcTareStore.cpp.
Referenced by anonymous_namespace{test_lc_tare.cpp}::fingerprint_tracks_what_the_curve_does(), anonymous_namespace{test_lc_tare.cpp}::non_finite_offset_is_never_recorded(), anonymous_namespace{test_lc_tare.cpp}::recompute_carries_tare_across_a_better_fit(), anonymous_namespace{test_lc_tare.cpp}::save_load_round_trip(), anonymous_namespace{test_lc_tare.cpp}::stale_audit_finds_a_missed_recompute(), anonymous_namespace{test_lc_linear_fit.cpp}::tared_reading(), and anonymous_namespace{test_lc_tare.cpp}::untrusted_curves_keep_the_last_good_offset().
| int main | ( | ) |
Definition at line 257 of file test_lc_linear_fit.cpp.
References anonymous_namespace{test_lc_linear_fit.cpp}::a_model_change_refits_without_a_capture(), anonymous_namespace{test_lc_linear_fit.cpp}::both_fits_are_serialized(), anonymous_namespace{test_lc_linear_fit.cpp}::cubic_model_is_unchanged(), g_failures, anonymous_namespace{test_lc_linear_fit.cpp}::linear_model_fits_a_line(), anonymous_namespace{test_lc_linear_fit.cpp}::linear_needs_two_points(), anonymous_namespace{test_lc_linear_fit.cpp}::raw_coefficients_match_the_normalized_form(), and anonymous_namespace{test_lc_linear_fit.cpp}::tare_cancels_zero_drift_on_linear_not_cubic().
|
static |
Definition at line 40 of file test_lc_linear_fit.cpp.