CameraConfiguration
public sealed class CameraConfiguration : IDisposable
A camera's whole configuration, taken as one record and put back as one record, without going through a file.
ThermalCamera.SaveConfiguration(…) and ThermalCamera.LoadConfiguration(…) are the same pair through a file. This is the pair without one, for the application that wants to put a camera back the way it was at the end of a run, or try something and undo it, and has no business writing to a disk to do it.
It is opaque on purpose. A configuration carries the measuring regions, the alarm rules and the canvas placement as well as the scalar settings, none of which fit in a struct, and a type that could only carry the scalars would silently delete the caller's regions every time it was applied.
The opacity is also what makes the round trip complete, which saving setting by setting cannot be: a setting added by a later SDK rides along inside the record, so an application that round-trips one is never quietly missing the new one and never has to be revisited. There is nothing here to keep in step.
A record is a snapshot. Nothing about it tracks the camera afterwards, so one taken before a change is what puts the camera back after it.
It owns unmanaged memory: dispose it, or let using do it. Disposing twice is safe, as it is for every handle in this package.
Example
using CameraConfiguration saved = camera.GetConfiguration(); camera.Radiation = camera.Radiation with { Emissivity = 0.5f }; //... try something... camera.ApplyConfiguration(saved); // back the way it was
CameraConfiguration: properties
public string Serial { get; }
The serial of the camera this record was read from, or an empty string if it carries none.
- Throws
ObjectDisposedException: The record has been disposed.
What ConfigurationLoadOptions.RequireMatchingSerial is compared against, exposed so an application can show it, "restore the settings taken from 20112233?", before it commits to applying one.
CameraConfiguration: methods
public void Dispose()
Release the record. Safe to call twice.
Never touches the camera the record was read from, so a record may outlive its camera and be disposed afterwards.
public Canvas GetCanvas()
The canvas this record carries. You own it; dispose it.
The canvas is part of a saved configuration alongside the regions, deliberately: restoring the measuring areas of a turned, zoomed view without restoring the view would put every one of them in the wrong place.
A record written before the canvas existed loads an empty canvas, a pass-through, rather than failing, so reading this from an older file is safe and answers "nothing was placed".