OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C++ API referencev12.0

optris::sdk::Condition

A condition is the alarm band, an optional warning (pre-alarm) band, and the temporal shaping applied to both.

Public attributes

compare

Compare compare = Compare::kAbove

Which test the bands use. It applies to the warning band as well as the alarm band: a rule has one shape of comparison and two sets of limits, never one band above and another outside.

alarm

Limits alarm

The band whose satisfaction means kActive. Always evaluated; a rule with no warning band is just this one.

Which of its fields matter depends on compare -- see Limits. A kInvalid watchdog reads none of them. A kChanged rule on a measured input (region, motion or device) is rejected outright when alarm.delta is zero, because a zero delta on a temperature rings on float noise every frame; on a PIF or user signal a zero delta is allowed, since there a change really is a change.

warning

std::optional< Limits > warning

The pre-alarm band. Evaluated with the same compare; an alarm always overrides a warning.

on_delay

std::chrono::milliseconds on_delay {0}

How long the condition must hold before the state rises.

A duration, not a frame count. A frame count only means a duration in combination with a frame rate, and the frame rate is a property of the operation mode, which an operator can change at any time from the same application. Sixteen frames was half a second on a 32 Hz camera and a full second on a 16 Hz one, so switching a PI 640i between modes silently doubled or halved every debounce on it, and the same alarm copied between a 27 Hz PI and a 50 Hz Xi debounced for different lengths of time while reading identically in the UI. None of that was visible to the user, which is what made it worth changing rather than documenting.

The evaluator still counts consecutive qualifying observations; the engine converts this to a count at evaluation time from the interval it observes between them, so a mode change re-derives the count with no caller involvement. A delay shorter than one observation interval debounces one observation, not zero -- rounding to zero would switch a debounce off when the camera moved to a slower mode, which is the failure this exists to remove.

off_delay

std::chrono::milliseconds off_delay {0}

How long it must stop holding before the state falls. Set independently of on_delay, so a slow-to-arm, quick-to-clear alarm is expressible. See on_delay for how a duration becomes a count.

latching

bool latching = false

Once active, stay active until Acknowledge(), and then only if the condition has actually released.