OptrisOptrisDocumentation

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

SessionEvent

class optris_sdk.session.SessionEvent

Something happened to a session, or to one of its cameras.

The argument to a RecordingSession.on_event handler.

  • Attribute phase — one of the RECORDING_* constants in optris_sdk.recording. The three per-source phases -- RECORDING_SOURCE_LOST, _RESUMED and _ENDED -- arrive only here: the single-camera callback has nowhere to put a source index.
  • Attribute path — the file. For RECORDING_SEGMENT_COMPLETED this is the finished file, not the one just opened.
  • Attribute message — why, for RECORDING_FAILED. Empty otherwise.
  • Attribute source — which camera this is about, or None for an event about the session as a whole. The ABI spells that -1; it is None here because it is not an index.
  • Attribute stop_reason — who ended the session, on RECORDING_STOPPED -- RECORDING_STOP_UNKNOWN on every other phase. Branch on this rather than on message; optris_sdk.recording.recording_stop_reason_name spells it out.

SessionEvent — properties

failed

Whether this is the event that says the file is not being written.

Worth watching even if you ignore everything else. A session whose trailer could not be written raises this naming the file before the stop arrives, and it is the only way to learn the file came out damaged -- neither write_frame nor stop can report it.

SessionEvent — methods

__repr__()