1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use crateDevice;
use crate;
/// ASCOM SafetyMonitor device trait.
///
/// A generic trigger for unsafe conditions. Not limited to weather — any
/// condition that should halt imaging operations: wind, rain, cloud cover,
/// door open, power failure, equipment malfunction, dew heater offline,
/// dead man's switch timeout, or any custom safety logic.
///
/// Imaging applications (NINA, SGP, Voyager) poll `is_safe()` and will
/// abort sequences when it returns `false`.
///
/// # Example
///
/// ```rust
/// use ascom_alpaca_core::prelude::*;
/// # struct MySafety { wind_ok: bool, power_ok: bool }
/// # impl Device for MySafety {
/// # fn static_name(&self) -> &str { "Safety" }
/// # fn unique_id(&self) -> &str { "s-001" }
/// # fn device_type(&self) -> DeviceType { DeviceType::SafetyMonitor }
/// # }
///
/// impl SafetyMonitor for MySafety {
/// fn is_safe(&self) -> AlpacaResult<bool> {
/// Ok(self.wind_ok && self.power_ok)
/// }
/// }
/// ```