kinavis-alerts
Bridge alert management (BAM) for the KINAVIS crates.
Each context reports events in its own enum: guidance (track exceeded), traffic
(CPA alarm), anchor watch (dragging). Which condition an event represents is
defined by the Reportable trait, implemented for every workspace event type
and implementable for application unions. Priority is a vessel policy
(AlertPolicy). AlertManager classifies conditions into alarms, warnings and
cautions, keeps one alert per condition regardless of repetition, tracks active
/ acknowledged / rectified states, and lists standing alerts by priority.
No allocation; builds for bare-metal targets. The board is several kilobytes and
deliberately not Copy: keep it behind a reference or in a static.
use GuidanceEvent;
use ;
use ;
let mut alerts = new;
let now = from_unix_seconds;
// Guidance reports XTE beyond the limit.
let mut events = new;
events.push;
let changes = alerts.ingest;
assert_eq!;
let standing = alerts.alerts;
assert_eq!;
assert_eq!;
alerts.acknowledge?;
assert_eq!;
assert!;
# Ok::
Feature flags
std(default) — standard library maths in the kernel.libm— forno_stdtargets:--no-default-features --features libm.serde— serialisation of the value types.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.