OptrisOptrisDocumentation

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

AttachmentRequest

class optris_sdk.snapshot.AttachmentRequest

What the SDK tells a provider about the file it is writing.

**Do not use this to decide whether your own locks are already
held. It is false in two cases where the SDK is driving.** A
recording's provider never runs on the thread that started the
recording, yet this still reads false for the first file of a
manually started recording, where it runs on the thread that
writes the recording. It also reads
false for an interval-capture snapshot, which runs on the SDK's
timer thread. For anything other than a snapshot, assume the
provider is on an SDK thread whatever this says. What it does
distinguish reliably today is a manual `save_snapshot()`
(false, and genuinely the caller's thread) from an alarm-fired
file or a segment rollover (true).

**A stopwatch reading, not a date.** It is the frame's own
`timestamp_us` verbatim -- monotonic, on whatever epoch the
transport counts from -- so a difference between two of these
is a duration and the absolute value means nothing as a time
of day. A still used to report the computer's wall clock here
while a recording reported the frame's, so the two were not
comparable at all.

**If you add files anyway they are dropped, a line goes in the
log naming the format and the count, and the file is still
written.** There used to be no way to ask and the write was
*refused* over whatever came back, so an application that
keeps one provider registered for the life of a camera lost
every CSV and every JPEG alarm still -- the file, not the
attachment.
  • Attribute scope — which kind of file -- SCOPE_SNAPSHOT, SCOPE_RECORDING or SCOPE_RECORDING_SEGMENT.
  • Attribute segment_index — 0 for a snapshot or the first file of a recording, then 1, 2, ... for each subsequent segment.
  • Attribute on_action_thread — true when the SDK is driving the provider itself -- an alarm or a segment rollover -- rather than running it on a thread the application drove.
  • Attribute timestamp_us — capture time of the frame that opened this file, or 0 when unknown.
  • Attribute format — which container is being written -- FORMAT_PNG, FORMAT_TIFF, FORMAT_CSV, FORMAT_JPEG or FORMAT_MKV. Use it to decide what to attach; for whether you may, read can_carry_attachments.
  • Attribute can_carry_attachments — whether this file can carry an attachment at all. False for a CSV and a JPEG still, which have nowhere to put one.
  • Attribute path — the file about to be written.
  • Attribute cause — the optris_sdk.alarms.AlarmEvent that caused this file, or None for a manual save.

AttachmentRequest — methods

__repr__()