OptrisOptrisDocumentation

Documentation/OTC SDK/optris_sdk — Python API referencev12.0

ActionCompleted

class optris_sdk.alarms.ActionCompleted

What an alarm action did, once it was done.

Read this if you show a list of what an alarm did, or if you have ever had to guess whether a snapshot was written. Three of the four outcomes are not failures, and until this reached Python none of them could be told apart from an alarm that never fired: a picture written, a picture declined by the action's own minimum spacing, and a picture dropped because the action queue was full.

  • Attribute rule_id — whose action this was.
  • Attribute action_index — its position in that rule's action list. This is the field that says which action of a rule finished, so a rule with a snapshot and a recording can be told apart.
  • Attribute outcome — one of the ACTION_OUTCOME_* values; see action_outcome_name.
  • Attribute path — the file that was written, for ACTION_OUTCOME_WRITTEN, and '' for every other outcome.
  • Attribute timestamp_us — the causing alarm event's own timestamp, carried through unchanged. A stopwatch reading rather than a date, monotonic, and comparable only against other events of the same rule.
  • Attribute sequence — the causing alarm event's sequence, carried through unchanged. This is the field to correlate on: an application showing a line per activation already has it, so the match is exact where matching on a rule id and a nearby time is a guess a chattering alarm gets wrong.

ActionCompleted — properties

outcome_name

was_written

Whether a file was actually written.

A separate question from "did the action run": the two skipped outcomes are both successful endings that produce no file.

ActionCompleted — methods

blank(cls)

The SDK's own defaulted record, for a test.

The counterpart of ActionError.blank, and here the default is a decision rather than a zero fill: optris_sdk_action_completed_init() is documented to leave the outcome at ACTION_OUTCOME_UNKNOWN. A record built from Python zeros would have to know that, and would be wrong the day it changes.

__repr__()