OptrisOptrisDocumentation

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

optris::sdk::SignalId

Identifies one observable value.

index addresses a region slot, a PIF channel or a user slot. Region slots are generational: the low 20 bits are the slot and the high 12 bits a generation counter, so a rule holding a stale reference resolves to "orphaned" rather than to a different region that happens to have reused the slot.

Generations start at 1, so a region signal whose index is zero is always unresolved and never names a live region. Leaving it zero is the documented way to say "the region this rule is attached to": RuleEngine::Add() and RuleEngine::Update() fill it in from that region. Get the slot of some other region from RegionEngine::SignalSlot().

Public attributes

domain

SignalDomain domain = SignalDomain::kDevice

which family of signals

field

SignalField field = SignalField::kValue

which value within it

index

uint32_t index = 0

Which producer: a region slot, a PIF channel, a motion zone or a user slot, depending on domain. Unused for kDevice.

Public static functions

Region

static auto Region(uint32_t slot, SignalField f) -> SignalId

A statistic of one region. slot is the generational slot, not the region id -- see the note above. Zero means "not resolved yet"; it is never a live region.

Region

static auto Region(SignalField f) -> SignalId

A statistic of whichever region the rule is attached to. The camera resolves the slot when the rule is added and again whenever it is updated.

Device

static auto Device(SignalField f) -> SignalId

A reading from the camera itself: chip, housing or shutter temperature, focus position and so on.

Pif

static auto Pif(uint8_t channel, SignalField f) -> SignalId

One channel of the process interface, digital or analogue.

Motion

static auto Motion(uint32_t zone_id, SignalField f) -> SignalId

A motion-detection zone's observations, indexed by zone id.

User

static auto User(uint32_t slot) -> SignalId

A value the application publishes itself -- a line pressure, a batch number, a reading from another instrument. It behaves like any other signal, so a rule on it gets the same warning band, dead-band and delays.

Public functions

Key

auto Key() const -> uint64_t

Pack into a single 64-bit key, for hashing and serialization.

Friends

operator==

auto operator==(const SignalId &a, const SignalId &b) -> bool

Two ids naming the same observation.

Member-wise, and index is compared verbatim. For a region signal that means the generation counts: an id built before the slot was reused is not equal to one built after, which is the whole point of packing a generation in. Compare RegionSlotOf(index) yourself if you want "same slot, any generation". There is no ordering and no std::hash specialization; use Key() when you need either.