Expand description
Turret adjustment-unit conversions and click-value parsing (MBA-1355).
Shared by the CLI (main.rs) and the WASM terminal (wasm.rs). This lives in the
library crate — not main.rs — so it compiles for wasm32-unknown-unknown with no
feature gate. To avoid a circular dependency on main.rs’s clap AdjustmentUnit
ValueEnum, this module defines its own minimal angular base (ClickBase) and factor
table; main.rs maps its own AdjustmentUnit onto ClickBase/adjustment_factor
locally (see drop_to_adjustment in main.rs).
Structs§
- Click
Value - A turret click graduation, parsed from suffixed CLI/profile syntax like “0.1mil” / “0.25moa” / “0.125smoa” (MBA-1355).
Enums§
- Click
Base - Angular base unit for a turret click graduation (MBA-1355). A click graduation is always expressed in mil, (true) MOA, or SMOA/IPHY — never in whole clicks itself.
Functions§
- adjustment_
factor - The
(drop_yd / range_yd) * factorconversion factor for aClickBase: - clicks_
for - Whole-click adjustment for a drop at a range: the angular value in the graduation’s
own base unit divided by the graduation, rounded to the nearest click (ties away from
zero). Sign is preserved. Ranges under 1 yard are defined as zero adjustment, matching
the CLI’s
drop_to_adjustmentshort-range guard. - parse_
click_ value - Parses a suffixed click graduation string. The unit suffix is mandatory — one of
mil,moa,smoa,iphy(iphyis accepted as an alias forsmoa, the identical unit) — and the magnitude must be a positive, finite number.