Expand description
Transport-free card-generation services (come-ups, range table, wind card).
These replicate the CLI’s card commands exactly — same zero solve, same sampled
trajectory, same nearest-sample row selection, same adjustment/bias/CF/click
ordering via crate::adjustment — as versioned request/response types the
bridge can expose to embedded consumers. The CLI remains the reference
implementation; tests/card_bridge_golden.rs asserts row-for-row agreement.
§Unit convention
Unlike solve-json (explicit SI), card requests are denominated in the declared
units system, exactly like the CLI flags they mirror: imperial = fps, grains,
inches, yards, °F, inHg, mph; metric = m/s, grams, mm, meters, °C, hPa, m/s.
A DOPE card is a display artifact; its inputs and outputs share the shooter’s
unit world, and this keeps the request shape identical to the documented CLI
surface.
Structs§
- Card
BcSegment V1 - One velocity band of an explicit velocity-keyed BC schedule
(
CardRequestV1::bc_segments).velocity_min/velocity_maxare in the request’sunitsvelocity unit and must satisfyvelocity_min < velocity_max;bcis the BC (for the request’sdrag_model) that applies inside the band. - Card
Request V1 - Everything the three card surfaces share: load, zero, atmosphere, display axes.
Field values are in the
unitssystem (see module docs). - Card
Response V1 - Card
RowV1 - Card
Units Block V1 - PdfCard
Options V1 - Presentation knobs for the PDF dope card: the header/footer labels the printed card
carries and the table’s font size. The ballistics axes it prints (elevation unit,
windage unit, click graduations, tracking CFs, zero-set biases) are NOT here — they are
already fields on
CardRequestV1, shared with the on-screen card, precisely so the two cannot disagree about what a row means. - PdfCard
V1 - A rendered PDF dope card: the document plus the facts a transport needs to describe it without re-parsing the bytes.
- Stored
Card Response V1 - A stored
CardResponseV1, as a deserializable mirror. - Stored
Card RowV1 - One stored row (see
CardRowV1, which this mirrors). Onlyrangeis required; a column the stored card did not carry staysNoneand prints as an em-dash rather than a fabricated zero. Unknown fields are ignored, for the reasonStoredCardResponseV1gives. - Stored
Card Units Block V1 - The
unitsblock of a stored response (seeCardUnitsBlockV1, which this mirrors). Unknown fields are ignored, for the reasonStoredCardResponseV1gives. - Stored
Card V1 - A card whose rows already exist: print THESE numbers instead of solving.
Enums§
- Card
Service Error - Card
Units - Drag
Model V1 - Drag model selector mirroring the CLI’s
--drag-modelstrings. - PdfRow
Source - Where the printed rows came from — reported so a caller can verify it got a reprint rather than a re-solve, which is otherwise indistinguishable from the document.
Constants§
- CARD_
SCHEMA_ VERSION_ V1 - Schema version of the card request/response contract.
- MAX_
PDF_ PAGES - Pages a printable card may run to. Bounds the one row set the row cap above cannot: few enough rows, but at a font scale that fits very few of them per page.
- MAX_
PDF_ ROWS - Rows a printable card may carry.
- PDF_
CARD_ KIND - The one card kind
card.pdfcan print, in thekindspellingCardResponseV1::kinduses.
Functions§
- come_
ups_ v1 - Come-ups: elevation dial per range plus the incremental come-up between rows.
Mirrors the CLI’s
come-upscommand row-for-row. - pdf_
card_ v1 - Render the printable PDF dope card for a card request.
- range_
table_ v1 - Range table: drop and wind on possibly different display axes.
Mirrors the CLI’s
range-tablecommand row-for-row (two solves: with wind for drift, without wind for the pure elevation axis). - wind_
card_ v1 - Wind card: drift matrix, ranges x wind speeds, per wind-FROM angle.
Mirrors the CLI’s
wind-cardcommand cell-for-cell. The windage axis usesadjustment_unit(the CLI’s wind-card has a single unit for the matrix).