optris::sdk::Detector
Keeping the detector honest: how it is held at temperature, and when the shutter closes to re-reference it.
Both halves exist for the same reason. A microbolometer drifts as its own temperature changes, so the camera either holds the detector at a fixed temperature, or closes the shutter over it to re-measure a uniform reference -- a non-uniformity correction -- or both. Chip heating used to sit under Optics(), which it never had anything to do with.
A handle, not an owner. Reached through Imager::Detector().
Public functions
Detector
Detector(ClientBridge *bridge)
Wraps the imager's shared state. Constructed by the SDK; get one from Imager::Detector() rather than building it yourself.
SetAuto
void SetAuto(const AutoNucConfig &config)
Automatic shutter calibration, as one value.
GetAuto
auto GetAuto() const -> AutoNucConfig
The shutter schedule in force. The intervals are in seconds, and every field is read back from the engine rather than echoed from SetAuto() -- including temp_drift_threshold_c, which is the value the flag scheduler actually compares drift against.
It was not always. Through v12.0 temp_drift_threshold_c was parked on the bridge and never consulted, because the engine compared against a literal 0.1 C; this comment said so, and went on saying so after the engine started taking the threshold. If you are reading an older copy of this header, that is the claim to distrust.
GetShutterDeferral
auto GetShutterDeferral() const -> ShutterDeferral
What the while-recording policy is doing, and what it has cost so far.
The honest half of AutoNucConfig::while_recording. Setting a policy says what you want; this says whether it is in force and how far the detector has drifted while it was. A suppressed cycle changes nothing an application can see -- the stream has no gap, the temperatures still look like temperatures -- so without this a degraded recording is indistinguishable from a good one from inside the process that is making it.
Read ShutterDeferral::policy_in_force before anything else. It is false while a process-interface input owns the flag, because the SDK then runs no cycle to hold and the setting is moot rather than working -- the one case where a configuration that was accepted does nothing.
The file carries the same facts permanently, which is the part that matters months later: see Turning the flag off while recording.
Everything zero and false on a camera running the default, and on a recording or a still, neither of which has a shutter.
TriggerShutter
void TriggerShutter()
Close the shutter now, and re-reference the detector from it.
This is the non-uniformity correction. On this hardware the two are one operation and there is no second one to offer: the shutter closes over the detector, the pipeline accumulates a per-pixel offset table from the frames captured while it is closed, and the shutter reopens. The camera has no command that corrects without moving the flag -- the firmware does not compute a correction at all, the host does, from what the closed flag gives it. So an application offering explicit control needs one button, not two.
The frames during the cycle are not measurements and are not delivered; the stream pauses for something over a second. Follow it with Imager::SetShutterCallback().
Exceptions
| Name | Description |
|---|---|
FeatureNotSupportedException |
while a process-interface input is configured as Shutter Control. The flag then belongs to the camera firmware and the SDK cannot move it; ask IsShutterExternallyControlled() first and disable the control rather than offering one that refuses. |
DeviceException |
on failure. |
IsShutterExternallyControlled
auto IsShutterExternallyControlled() const -> bool
Whether the shutter flag belongs to a process-interface input rather than to the SDK.
True while any PIF input is configured as Shutter Control (PifChannelKind::kFlagControl). The camera firmware then drives the flag from that pin, and for as long as it does:
- the SDK runs no shutter cycle of its own -- no automatic cycle, whatever
SetAuto()says, and no startup calibration cycle; TriggerShutter()is refused;- every closure the interface makes is still reported through
Imager::SetShutterCallback(), and still produces a correction.
So this is not "the shutter is disabled". It is "somebody else decides when", which is the point of the feature: a closure interrupts the measurement, and only the process knows when that is safe.
An application offering shutter controls should read this and say why they are unavailable. Reading it is better than inferring it from the channel table the application itself sent: this answers from what was actually applied to the camera, and it survives a reconnect.
False for a simulated camera and for a recording -- neither has an interface to hand the flag to.
GetLastShutterCorrection
auto GetLastShutterCorrection() const -> ShutterCorrectionEvent
What came of the most recent closure the process interface made.
The same value the ShutterCorrectionCallback was handed, kept so a handler installed afterwards does not have to wait for the next break in the production line to learn anything.
sequence == 0 means no closure has been reported on this camera yet -- which is also the answer for a camera whose flag no interface has taken, for a simulated camera and for a recording. Every real report has a sequence of 1 or more.
Survives a reconnect: the count and the last report belong to the camera handle, not to the device session.
GetLastNucCycle
auto GetLastNucCycle() const -> NucCycleReport
What the SDK's most recent own shutter cycle measured.
The same value Imager::SetNucCycleCallback() was handed, kept so a handler installed afterwards does not have to wait out an auto interval -- three minutes on a camera running normally -- to learn anything.
sequence == 0 means no cycle has been reported on this camera yet, which is also the answer for a simulated camera, for a recording, and for a camera on which every cycle so far was abandoned rather than decided. Every real report has a sequence of 1 or more.
Read NucCycleReport::has_delivery_share before NucCycleReport::delivery_share. A share of 0 means the camera could not be measured, not that no frames arrived, and the SDK itself reads an unmeasurable camera as a share of 1 -- so the two cases mean opposite things about whether a short cycle was the host's fault and only the flag tells them apart.
Survives a reconnect: the last report belongs to the camera handle, not to the device session. The sequence restarts at 1, because the adapter that counts cycles is rebuilt by the reopen.
SetChipHeating
void SetChipHeating(ChipHeatingMode mode, float temperature=40.0f)
Hold the detector at a fixed temperature, let it float, or let the camera decide.
Every supported camera can heat its detector. The 1M family needs it, so a fresh configuration for one starts in kAuto; the rest start floating and can be put into any mode.
The exception is the G7 optic, which must not be heated. That is a property of the optic rather than of the camera, so a multi-optic camera answers differently depending on which optic is selected, and the same camera on another optic will heat.
kFixed holds an absolute detector temperature, given in the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit) and clamped to 20-55 C (68-131 F).
The default of 40 means the SDK's default setpoint of 40 C in either unit. In Fahrenheit, 40 passed as a number is read the same way; 40 F would be below the clamp anyway. Any other value is read in the SDK's unit.
Exceptions
| Name | Description |
|---|---|
FeatureNotSupportedException |
for kAuto or kFixed where the detector may not be heated -- the G7 optic, or a camera with no heater. kFloating always succeeds there, because it is true. |
DeviceException |
when the camera refused the write; its state is then unknown until a later write succeeds. |
GetChipHeating
auto GetChipHeating() const -> std::pair< ChipHeatingMode, float >
The mode the detector is in, and the setpoint it is held at in the SDK's temperature unit -- an absolute detector temperature, not an offset from ambient. The device's state, not the last request.
The setpoint is NaN unless the mode is ChipHeatingMode::kFixed: no other mode holds the detector to a number.
Exceptions
| Name | Description |
|---|---|
FeatureNotSupportedException |
when the state is not known -- no camera open, or its last write was refused. |