pub struct FaultDetector {
pub comm_timeout: Option<Duration>,
}Expand description
Fault detection engine.
Call FaultDetector::evaluate periodically (e.g. every 10 s) against
the object database. It returns a list of objects whose reliability
changed so the caller can update them.
Fields§
§comm_timeout: Option<Duration>Timeout after which an object is considered to have a communication
failure. Set to None to disable communication-failure detection.
Implementations§
Source§impl FaultDetector
impl FaultDetector
Sourcepub fn new(comm_timeout: Option<Duration>) -> Self
pub fn new(comm_timeout: Option<Duration>) -> Self
Create a new fault detector with the given communication timeout.
Sourcepub fn evaluate(&self, db: &mut ObjectDatabase) -> Vec<ReliabilityChange>
pub fn evaluate(&self, db: &mut ObjectDatabase) -> Vec<ReliabilityChange>
Evaluate reliability for all objects in the database.
For each analog object (AI, AO, AV) that has MIN_PRES_VALUE and
MAX_PRES_VALUE properties, the present value is compared against
those limits. If out of range the reliability is set to
OVER_RANGE or UNDER_RANGE; otherwise NO_FAULT_DETECTED.
Returns a list of changes that were applied to the database.