|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <cmath>#include <cstdio>#include <filesystem>#include <fstream>#include <limits>#include <nlohmann/json.hpp>#include <string>#include "calibration/LcTareStore.hpp"Go to the source code of this file.
Classes | |
| struct | LcTare |
| One load cell's tare: the scale reads zero at the load it was holding when the operator pressed Tare. More... | |
Namespaces | |
| namespace | anonymous_namespace{test_lc_tare.cpp} |
Macros | |
| #define | CHECK(cond, ...) |
Variables | |
| static int | g_failures = 0 |
| #define CHECK | ( | cond, | |
| ... ) |
Definition at line 37 of file test_lc_tare.cpp.
Referenced by anonymous_namespace{test_lc_tare.cpp}::entity_matches_the_publish_path(), anonymous_namespace{test_lc_tare.cpp}::fingerprint_tracks_what_the_curve_does(), anonymous_namespace{test_lc_tare.cpp}::loaded_tare_is_corrected_by_recompute(), 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_tare.cpp}::unreadable_file_is_not_overwritten(), and anonymous_namespace{test_lc_tare.cpp}::untrusted_curves_keep_the_last_good_offset().
| std::string fsw::calibration::lc_tare_entity | ( | uint8_t | board_id, |
| uint8_t | connector ) |
LcTareStore — the guards that keep a load-cell tare from becoming a confident wrong number.
The bug this whole store exists to prevent, in the operator's words: a 20 kg tank sits on a scale whose calibration is a bad two-point fit reading it as 18. The operator tares and the display reads 0. Later they add points, the fit improves, and the same tank evaluates to 20. A tare persisted as "18 kg" then displays 2 kg for a tank that never moved — plausible enough that nobody questions it. Persisting the ADC CODE instead and re-deriving through the current curve gives 20 - 20 = 0. Case 1 pins exactly that.
Definition at line 29 of file LcTareStore.cpp.
Referenced by anonymous_namespace{test_lc_tare.cpp}::entity_matches_the_publish_path().
| int main | ( | ) |
Definition at line 294 of file test_lc_tare.cpp.
References anonymous_namespace{test_lc_tare.cpp}::entity_matches_the_publish_path(), anonymous_namespace{test_lc_tare.cpp}::fingerprint_tracks_what_the_curve_does(), g_failures, anonymous_namespace{test_lc_tare.cpp}::loaded_tare_is_corrected_by_recompute(), 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_tare.cpp}::unreadable_file_is_not_overwritten(), and anonymous_namespace{test_lc_tare.cpp}::untrusted_curves_keep_the_last_good_offset().
|
static |
Definition at line 35 of file test_lc_tare.cpp.