Expand description
Transport-free tall-target and dsf derivation services.
§Tall-target
Replicates the CLI’s tall-target arithmetic exactly — same imperial/metric divisor
branch, same four validation guards, same tracking-CF band check via
crate::profile::validate_tracking_cf — as a versioned request/result pair the bridge
can expose to embedded consumers. The CLI’s Commands::TallTarget arm keeps its
println! formatting but calls tall_target_v1 for the arithmetic, so the two callers
cannot drift apart.
§dsf derivation (MBA-1357 Task 9)
derive_dsf_point_v1 is the model-driven entry point a JSON bridge caller with only a
bare crate::truing::TruingModelInputsV1 reaches: it widens the model into
crate::truing_dsf::DsfSolveInputs via the existing From impl (no wind, level shot,
no offsets, ICAO reference, no BC segments — see that impl’s own doc comment), solves,
and derives one Mach-keyed DSF point.
The CLI’s saved-profile dsf command has a richer input than any bare
TruingModelInputsV1 can express — wind, shooting angle, zero-POI offsets, sight-mount
offset, BC reference, BC segments, a custom drag curve (MBA-1357 Task 8’s
DsfSolveInputs, and the two regressions its review caught when that fidelity was first
silently narrowed). So the CLI keeps building its own DsfSolveInputs from the loaded
profile and solving directly via crate::truing_dsf::solve_for_dsf — unchanged from
Task 8 — rather than going through derive_dsf_point_v1’s narrower model. What it DOES
share with derive_dsf_point_v1, so the two callers’ arithmetic cannot drift apart, is
derive_dsf_point_from_solve_v1: the post-solve derivation (interpolation, Mach
computation, both gates, the DSF ratio) factored out of derive_dsf_point_v1 so it can
run against a TrajectoryResult from EITHER solve path. derive_dsf_point_v1 is a thin
“build inputs, solve, then call the shared derivation” wrapper around it.
Derive only. Neither function ever writes a DSF table, opens a profile, touches the
filesystem, or calls std::process::exit — persistence and printing are the CLI’s job.
No feature gate: must compile for wasm32-unknown-unknown. The tall-target half depends
only on crate::adjustment and crate::profile; the dsf half depends on
crate::truing, crate::truing_dsf, and crate::cli_api::TrajectoryResult, all
unconditional and filesystem-free.
Structs§
- Dial
Plan Request V1 - Request for
dial_plan_v1: the bridge’s wrapper aroundplan_corrections’s six flat parameters (MBA-1348 Task 6’s CLI wraps the same six from--elevation/--windage,--profile/inline optic flags,--range, and--prefer-hold/--max-hold). - DsfDerive
Request V1 - Request for a
dsfpoint derivation from a bare scalar-BC model (MBA-1357 Task 9). - DsfPoint
Result V1 - One derived Mach-keyed DSF point, plus any non-fatal warnings the derivation raised.
- Tall
Target Request V1 - Request for a tall-target correction-factor computation.
- Tall
Target Result V1 - Result of a tall-target correction-factor computation.
Enums§
- DsfService
Error V1 - Errors returned by
derive_dsf_point_v1andderive_dsf_point_from_solve_v1. One variant per failure mode (not a single stringly-typed variant) so a caller — in particular the JSON bridge — can match exhaustively instead of sniffing message text. - Tall
Target Error V1 - Errors returned by
tall_target_v1. One variant per guard (not a single stringly-typed variant) so a caller — in particular a future JSON bridge — can match exhaustively instead of sniffing message text; adding a fifth guard here forces everymatchon this type to be updated at compile time.
Functions§
- derive_
dsf_ point_ from_ solve_ v1 - The post-solve half of a
dsfpoint derivation: interpolation, Mach computation, both gates, and the DSF ratio, run against an ALREADY-SOLVEDresult(MBA-1357 Task 9). - derive_
dsf_ point_ v1 - Derive a
dsfpoint from a bare scalar-BC model (MBA-1357 Task 9) — the JSON bridge’s entry point, with no saved profile behind it. - dial_
plan_ v1 - Turn a TRUE angular
AngularCorrectioninto ranked dial/hold/hybrid plans for an inlineOpticProfile— the JSON bridge’s entry point toplan_corrections. - tall_
target_ v1 - Computes the tall-target correction factor: same arithmetic and validation guards as the
CLI’s
tall-targetcommand, minus the printing.