OptrisOptrisDocumentation

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

optris::sdk::NucCycleReport

What one SDK-commanded shutter cycle asked for, what it got, and what it did.

Delivered through Imager::SetNucCycleCallback(), once per cycle that reached a decision, when the decision is taken -- which is at the end of the closure, before the reopen is waited out. Detector::GetLastNucCycle() returns the most recent one, for a subscriber that installed its handler after a cycle had already happened.

Why this exists: Why this exists Every number here was already computed, once per cycle, and went only to the log. A fifteen-camera host reported the symptom this is for: 24 cycles on one camera that all logged "Finalizing with 8 frames" and were indistinguishable from 24 good ones, while the tile showed a near-uniform field -- a dark reference averaged from frames of the scene. The log lines carried no serial and the quantity that separates a slow camera from a host losing frames was unreachable, because every rate the SDK publishes is measured where frames arrive, so the two are identical on a clock.

Not published for a cycle that was abandoned: Not published for a cycle that was abandoned A cycle taken over by a process interface, or cut short by a mode switch, a reconnect or shutdown, never reaches a decision and publishes nothing. sequence is how a consumer sees that: it counts cycles reported, so it does not advance.

Public attributes

outcome

NucCycleOutcome outcome = NucCycleOutcome::kApplied

What the cycle did to the dark reference.

requested_camera_frames

uint32_t requested_camera_frames = 0

The closure the SDK asked the camera for, in the camera's own frames.

The hardware is handed a count of its own frames and reopens by itself after that many; the SDK never commands the reopen. So this is not comparable with the received-frame counts below -- the two are different units. The conversion between them is delivery_share.

planned_frame_period_ms

float planned_frame_period_ms = 0.0F

The frame period the closure was planned at, in milliseconds, measured where frames arrive.

Carried because it is the input the plan was wrong about: on a host losing frames the measured period is longer than the camera's, and a closure computed from it alone came out shorter than a healthy one -- 25 frames at 32 Hz, 24 at 21, 21 at 10.

has_delivery_share

bool has_delivery_share = false

Whether delivery_share rests on a measurement.

Read this before delivery_share. A camera whose stream format carries no frame counter cannot be measured at all, and such a camera reports a share of 0, which every caller inside the SDK reads as 1 -- the value assumed unconditionally before any of this existed, so an unmeasurable camera keeps exactly its old closure.

An application must be able to tell "the share is 1" from "nobody could measure it", and 0 is not that answer: it is a sentinel a reader would have to know about, and the two cases mean opposite things about whether a short cycle is the host's fault. So the flag says which, on the same convention optris_sdk_image::has_frame_metadata uses. When it is false, delivery_share is 0 and expected_received_frames is the count a share of 1 implies.

delivery_share

float delivery_share = 0.0F

Arrivals per frame the camera took, over the frames before this cycle. 1 on a host receiving everything; 0 and meaningless when has_delivery_share is false.

Counted where the transport hands the frame over, ahead of the subsampling and export gates, because those drop frames deliberately: measured after them a camera subsampled to 8 Hz would report 0.125 and be declared starved for as long as the subsampling lasted.

expected_received_frames

uint32_t expected_received_frames = 0

How many frames the SDK expected the closure to deliver to the host, from requested_camera_frames and delivery_share.

Compare against frames_kept + frames_discarded. A gap is the host losing frames inside the closure.

camera_counter_span

uint32_t camera_counter_span = 0

How far the camera's own frame counter advanced across the closure.

The only quantity on the frame that says how many frames there were, rather than how many arrived. Zero when the stream format carries no counter, and then ended_at_reopen is always false because nothing could observe the reopen.

frames_kept

uint32_t frames_kept = 0

Shut-flag frames the pipeline accumulated into the new reference.

frames_discarded

uint32_t frames_discarded = 0

Shut-flag frames deliberately thrown away at the start of the closure, because the flag was still moving when their telemetry was sampled.

frames_rejected_not_shut

uint32_t frames_rejected_not_shut = 0

Frames the accumulation refused because the camera did not report the flag shut on them.

Scene frames that a window-based accumulation would have averaged into the dark reference. Non-zero means the closure and the frames arriving inside it had come out of step -- which on this issue's fifteen-camera host is what produced a flat field with only the moving parts of the scene left in it.

frames_target

uint32_t frames_target = 0

How many kept frames the cycle was aiming for.

frames_floor

uint32_t frames_floor = 0

The floor frames_kept was judged against. Below it the cycle is discarded.

capture_ms

uint32_t capture_ms = 0

How long the accumulation ran, in milliseconds.

ended_at_reopen

bool ended_at_reopen = false

Whether the capture ended because the camera's counter said its closure was spent, rather than because its frames were in hand.

True means the shutter reopened before the capture had what it needed. Always false when camera_counter_span is 0.

timestamp_us

uint64_t timestamp_us = 0

When the cycle's decision was taken, in microseconds on the host's monotonic clock -- std::chrono::steady_clock. For timing, not for dating; see host_time_us.

host_time_us

uint64_t host_time_us = 0

The same moment as a date: microseconds since the Unix epoch, from std::chrono::system_clock.

Read in the same breath as timestamp_us and not derived from it, for the reason spelled out on ShutterEvent::host_time_us: this clock is steppable and that one is not.

sequence

uint64_t sequence = 0

Cycles reported on this camera, from 1. A consumer that missed one can tell. Zero in the value returned by Detector::GetLastNucCycle() when none has been reported yet, which is how "no answer" is expressed without an optional over the C ABI.