OptrisOptrisDocumentation

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

optris::sdk::ImagerConfig

Complete imager configuration.

Public attributes

serial

std::string serial

Which camera to open. Empty takes the first one found, which is what a single-camera application wants.

Empty and unknown are different requests. Empty means "any camera"; a serial that names a camera which is not attached fails, naming the serial, and never falls back to another camera. Opening the wrong camera cannot be noticed downstream -- the frames carry no mark saying which device produced them -- so it has to be refused here.

Decimal digits only, and not "0": no camera carries serial 0, so it is refused rather than read as "any camera". Anything else that is not a plain number raises ConfigException before any camera is touched.

transport

Transport transport = Transport::kAuto

Whether to look for that camera on USB, on the network, or both.

network

NetworkConfig network

Where to find it on the network, when it is there. Ignored when transport is kUsb.

video_path

std::string video_path

Open a specific device node instead of searching. Normally empty; useful when two cameras of the same model are attached.

control_path

std::string control_path

likewise, for the control channel

connection_timeout

std::chrono::milliseconds connection_timeout {0}

How long without a frame counts as a stalled stream, for both transports. Zero -- the default -- means "use this camera's saved configuration", which is ten seconds from the factory but is a per-machine file and may be anything.

Naming a value here makes the wait the application's rather than the machine's, which is what a program that must react to a dead picture quickly needs, and what shortens the discovery that a re-opened camera is not delivering. Read back with Imager::GetConnectionTimeout(), which resolves the zero.

Finer than the saved file, which holds whole seconds. The frame path is polled every 50 ms, so anything above that is honest.

It also bounds the first open of an Xi 80, Xi 320 MT or Xi 410 whose calibration is not on this machine yet. That open reads the calibration out of the camera's video stream, and waits this long for the stream's first frame before trying the next source, which over Ethernet can take a few seconds. An open whose calibration is already on this machine does not wait for it.

bit_depth

SensorBitDepth bit_depth = SensorBitDepth::k14Bit

sensor depth

temp_range_min

int temp_range_min = -20

The requested range, in whole degrees of the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit); see TemperatureRange for how Fahrenheit is matched. The defaults -20 and 100 are compile-time Celsius numbers, so a Fahrenheit program sets both (-4 and 212 for the same range).

temp_range_max

int temp_range_max = 100

requested range, high end

operation_mode

std::optional< OperationMode > operation_mode

The operation mode to open in, refused if the camera has no such mode.

Unset -- the default -- opens in whatever mode the camera's saved configuration and calibration settle on, which is what every existing caller gets and is unchanged.

Set it to a mode from DeviceInfo::operation_modes, or one kept from an earlier session, and the camera opens in that mode directly. The point is the frame the first callback delivers: without this, an application that wants a particular mode has to open, see whatever mode the open picked, and then switch -- so its first frames arrive at the wrong size and its window resizes under the operator.

It is honoured exactly or refused. A mode this camera's calibration does not offer throws ConfigException naming what was asked for; nothing is rounded to a neighbouring mode. That refusal is the reason to use this rather than setting the loose fields around it: a restored preference that cannot be honoured has its frame rate quietly substituted, deliberately, because a camera with two cables declares two rates and only one preference is stored. A mode you named is a request, and a request is answered or refused.

And it avoids a running mode switch, which matters beyond the window size. Opening in the wanted mode means never calling SetOperationMode() on a streaming camera, which re-enters the startup calibration and marks about thirty seconds of frames as not measurements before the readings are right again. An application that restores a saved mode this way never pays for it, instead of paying on every restore.

Matched on the same key SetOperationMode() uses: the optics number and its label, both temperature limits, the frame size and the frame rate. optics_unit is not part of it.

That only matters if you assemble a mode by hand. One read from DeviceInfo::operation_modes carries this camera's own label and matches; one built by hand has to carry the same label, or leave optics_fov at 0 with an empty label, which matches the camera's first optic rather than a named one.

Note: This names the mode to open in. It does not say what mode an open would have picked on its own -- that question cannot be answered before the camera is claimed, because the mode list is derived from what the streaming device reports it can deliver on the cable in use.

extended_range

bool extended_range = false

Open with the range extension on. Off by default, as in v11; see TemperatureRange::extended for what it is and is not for.

high_precision

bool high_precision = true

Open with the high-precision temperature table selected where the mode offers one. On by default, as in v11. See TemperatureRange::high_precision -- in particular for what it does not change.

calibration_path

std::string calibration_path

Where to find calibration data. Empty uses the standard location and downloads what is missing.

A directory named here is searched before the SDK reaches for the network, which is what a machine with the files on a USB stick or a network share needs.

allow_calibration_download

bool allow_calibration_download = true

Whether the SDK may fetch missing calibration files from Optris over the internet.

True is the default and the historical behaviour: the first time a camera is opened on a machine, the SDK downloads what it needs. Set it to false on a machine that has no route out or is not allowed one -- a factory PC behind a firewall -- and the SDK will use only the camera itself and calibration_path.

When this is false and the files cannot be found locally, the camera still opens and still streams. The open does not fail, and the frames carry no mark of it: FrameMetadata's thermal_data_reliable is about the shutter correction and the detector settling, not about whether a calibration was ever found. An open-progress handler does see OpenPhase::kCalibrationMissing go past -- and that enumerator says in place that it is a warning and OpenPhase::kEstablished still follows -- but an application that only catches exceptions is told nothing.

Ask instead. Imager::GetCalibrationStatus() reports CalibrationStatus::kMissing, and Imager::GetCalibrationDiagnosis() names which of the two -- the directory or the download -- was the problem, which is the whole question on an offline machine. A factory PC that opens a camera and never asks ships streaming non-measurements with nothing reported.

CalibrationException is thrown only when the open itself failed and calibration was found missing along the way; it then carries that same sentence, because the missing files are the more actionable half of such a report.

radiation

RadiationConfig radiation

Emissivity and the surroundings -- what turns measured energy into a temperature of an object.

palette

Palette palette = Palette::kIronBow

colours for the RGBA output

custom_palette

std::optional< CustomPalette > custom_palette

A palette the application supplied, overriding palette.

Unset means the built-in palette is in force. Saved and restored with the rest of the configuration, and the colours go into the file rather than a reference to them -- so a program reading the file back draws the right picture whether or not it has ever seen this palette before.

regions

std::vector< Region > regions

Measuring areas and the alarms attached to them. Saved and restored by Imager::SaveConfig()/LoadConfig() -- a demo that cannot save its measuring areas gets rebuilt by hand at every rehearsal.

rules

std::vector< Rule > rules

Rules not attached to a region: PIF alarms, device alarms, and free alarms on application values.

motion_zones

std::map< uint32_t, MotionZone > motion_zones

Motion detectors, by zone id. Saved and restored alongside the rules, because a motion alarm is a rule watching a zone's signals: restoring the rule without the zone leaves it waiting on a signal nothing publishes, and it can never fire.

color_windows

std::map< uint32_t, ColorWindow > color_windows

Isotherm bands, by window id.

Part of how the picture looks, like the palette beside it, and saved for the same reason: a camera restored from a config should look the way it did. They were absent from this record in an earlier v12 build, so SaveConfiguration() dropped every band a caller had set.

A band with motion_only needs a motion zone to be worth anything, which is why the zones are saved beside these.

canvas

Canvas canvas

Where this camera's frame sits in view space. Saved and restored alongside the regions, because a placement and the regions on it are one arrangement: restoring the measuring areas of a rotated, zoomed view without restoring the view puts every one of them in the wrong place. The default is a pass-through, so a config written before canvases existed loads unchanged.

output_directory

std::string output_directory

Where alarm-driven snapshots and recordings are written when their action does not name a directory.