STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_cubic_store_namespace.cpp File Reference
#include <cinttypes>
#include <cmath>
#include <cstdio>
#include <filesystem>
#include <fstream>
#include <nlohmann/json.hpp>
#include <string>
#include "calibration/CubicCalibrationStore.hpp"
Include dependency graph for test_cubic_store_namespace.cpp:

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...

Functions

std::string anonymous_namespace{test_cubic_store_namespace.cpp}::scratch (const char *name)
 A unique scratch path per test — hermetic, no committed fixtures, parallel-safe.
json anonymous_namespace{test_cubic_store_namespace.cpp}::read_json (const std::string &path)
double anonymous_namespace{test_cubic_store_namespace.cpp}::eval_abcd (const json &arr, double x)
void anonymous_namespace{test_cubic_store_namespace.cpp}::add_pt_points (CubicCalibrationStore &s, uint16_t uid)
 GN2 High's real captured shape: a 5000 psi PT, ADC codes in the hundreds of millions.
void anonymous_namespace{test_cubic_store_namespace.cpp}::add_lc_points (CubicCalibrationStore &s, uint16_t uid)
 The LOX Scale's real captured shape: a load cell, codes in the hundreds of thousands.
void anonymous_namespace{test_cubic_store_namespace.cpp}::pt_lc_logical_collision ()
void anonymous_namespace{test_cubic_store_namespace.cpp}::logical_1_collision ()
void anonymous_namespace{test_cubic_store_namespace.cpp}::kind_round_trip ()
void anonymous_namespace{test_cubic_store_namespace.cpp}::legacy_file_without_kind ()
void anonymous_namespace{test_cubic_store_namespace.cpp}::add_point_rejects_unknown_uid ()
void anonymous_namespace{test_cubic_store_namespace.cpp}::recovery_regenerates_overwritten_pt_curve ()
void anonymous_namespace{test_cubic_store_namespace.cpp}::unreadable_file_is_not_overwritten ()
void role_moved_to_t7_keeps_its_unit ()
void t7_role_follows_within_t7 ()
void disabled_board_orphan_is_not_applied ()
void removed_board_does_not_win_the_logical_map ()
int main ()

Variables

static int g_failures = 0

Macro Definition Documentation

◆ CHECK

Typedef Documentation

◆ json

using json = nlohmann::json

Definition at line 31 of file test_cubic_store_namespace.cpp.

Enumeration Type Documentation

◆ SensorKind

enum class fsw::calibration::SensorKind
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.

Function Documentation

◆ disabled_board_orphan_is_not_applied()

◆ main()

◆ removed_board_does_not_win_the_logical_map()

◆ role_moved_to_t7_keeps_its_unit()

◆ t7_role_follows_within_t7()

Variable Documentation

◆ g_failures

int g_failures = 0
static

Definition at line 33 of file test_cubic_store_namespace.cpp.