pub struct Configuration {
pub identity: DocumentIdentity,
pub values: Vec<SavedValue>,
pub omitted: Vec<Omission>,
}Expand description
A camera configuration: the streamable features’ values, and the camera they were read from.
Fields§
§identity: DocumentIdentityThe camera the configuration was saved from, as its XML names it. Empty fields when a file does not say.
values: Vec<SavedValue>The values, in the order a restore writes them.
omitted: Vec<Omission>What a save left out. Written to a file as comments, so a reader sees why a feature is missing; not read back.
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn to_text(&self) -> String
pub fn to_text(&self) -> String
The configuration as a file, in the layout GenApi’s reference
implementation writes (CFeatureBag, ADR-0028):
# {05D8C294-F295-4dfb-9D01-096BD04049F4}
# viva-genicam configuration
# VendorName = Basler
# ModelName = acA1600-20gm
# DeviceXmlVersion = 3.2.1
# not saved: ExposureTime: locked by ExposureAuto
GainSelector<TAB>AnalogAll
Gain<TAB>{GainSelector=DigitalAll}<TAB>9One value per line, the feature name and the value separated by a tab
(<TAB> above);
a value read under selectors puts them between the two, in braces.
Lines starting with # are comments: the camera’s identity, and what
the save left out and why.
Sourcepub fn parse(text: &str) -> Result<Self, ParseConfigurationError>
pub fn parse(text: &str) -> Result<Self, ParseConfigurationError>
Read a configuration file: ours, or one in the same layout from another GenApi-based tool.
Blank lines and # comments are skipped, and line endings may be
\n or \r\n. The camera’s identity is read from the comments this
crate writes; a file without them has an empty
Configuration::identity. A file of GenApi’s other format
(CFeatureBagger) is refused, as is a line with no value.