Module adjustment

Module adjustment 

Source
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§

ClickValue
A turret click graduation, parsed from suffixed CLI/profile syntax like “0.1mil” / “0.25moa” / “0.125smoa” (MBA-1355).

Enums§

ClickBase
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) * factor conversion factor for a ClickBase:
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_adjustment short-range guard.
parse_click_value
Parses a suffixed click graduation string. The unit suffix is mandatory — one of mil, moa, smoa, iphy (iphy is accepted as an alias for smoa, the identical unit) — and the magnitude must be a positive, finite number.