Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvConfigurationReader Class Reference

Restore the state of the system. More...

Public Member Functions

 PvConfigurationReader ()
 Constructor.
 
 ~PvConfigurationReader ()
 Destructor.
 
PvResult Load (const PvString &aFilename)
 Load a configuration file from disk. More...
 
PvResult LoadFromString (const PvString &aString)
 Loads a configuration from a string. More...
 
uint32_t GetDeviceCount ()
 Get the number of PvDevice configurations available. More...
 
PvResult GetDeviceName (uint32_t aIndex, PvString &aName)
 Get the configuration name (PvDevice). More...
 
PvResult Restore (const PvString &aName, PvDevice *aDevice)
 Apply a configuration. More...
 
PvResult Restore (uint32_t aIndex, PvDevice *aDevice)
 Apply a configuration to a PvDevice. More...
 
uint32_t GetStreamCount ()
 Get the number of stream configuration in this PvConfigurationReader. More...
 
PvResult GetStreamName (uint32_t aIndex, PvString &aName)
 Get the configuration name (PvStream). More...
 
PvResult Restore (const PvString &aName, PvStream *aStream)
 Apply a configuration to a PvStream. More...
 
PvResult Restore (uint32_t aIndex, PvStream *Stream)
 Apply a configuration to a PvStream. More...
 
uint32_t GetStringCount ()
 Get the number of custom-state strings in the configuration file. More...
 
PvResult GetStringName (uint32_t aIndex, PvString &aName)
 Get the custom-state string name (PvString) More...
 
PvResult Restore (const PvString &aKey, PvString &aValue)
 Apply a configuration. More...
 
PvResult Restore (uint32_t aIndex, PvString &aValue)
 Apply a configuration. More...
 
uint32_t GetGenParameterArrayCount ()
 Get the number of PvGenParameterArray objects saved in the configuration file. More...
 
PvResult GetGenParameterArrayName (uint32_t aIndex, PvString &aName)
 Get the configuration name (PvGenParameterArray). More...
 
PvResult Restore (const PvString &aKey, PvGenParameterArray *aParameterArray)
 Apply a configuration to a PvGenParameterArray. More...
 
PvResult Restore (uint32_t aIndex, PvGenParameterArray *aParameterArray)
 Apply a configuration to a PvGenParameterArray. More...
 
uint32_t GetPropertyListCount ()
 Get the number of PvPropertyList objects saved in the configuration file. More...
 
PvResult GetPropertyListName (uint32_t aIndex, PvString &aName)
 Get the configuration name (PvPropertyList). More...
 
PvResult Restore (const PvString &aKey, PvPropertyList *aPropertyList)
 Retrieves the data to a PvPropertyList. More...
 
PvResult Restore (uint32_t aIndex, PvPropertyList *aPropertyList)
 Retrieves the data to a PvPropertyList. More...
 
void SetErrorList (PvStringList *aList, const PvString &aPrefix)
 Sets the error list where all errors/warnings are logged. More...
 

Detailed Description

Restore the state of the system.

See PvConfigurationWriter.

To load your GigE Vision or USB3 Vision device controller (PvDevice object) or stream controller (PvStream object) state from disk:

  1. Create a configuration reader.
  2. Load the file from disk. Use Load.
  3. Get the number of configurations.
  4. Optionally, test for the name of a configuration.
  5. Apply a configuration to an object.
Note
If the device controller (PvDevice object) isn't connected to the GigE Vision or USB3 Vision device, it attempts to connect (as if calling PvDevice::Connect). If already connected, the settings are applied without changing the IP address and related information. The same applies to a PvStream that is already opened.

For a simple example illustrating how to use PvConfigurationWriter to store a configuration and PvConfigurationReader to retrieve it, refer to the sample entitled ConfigurationReader.

Member Function Documentation

uint32_t PvConfigurationReader::GetDeviceCount ( )

Get the number of PvDevice configurations available.

This family of methods returns the number of configurations in a configuration file. The methods include:

Returns
The number of configurations.
PvResult PvConfigurationReader::GetDeviceName ( uint32_t  aIndex,
PvString aName 
)

Get the configuration name (PvDevice).

The Get*Name methods let you determine the name of the configuration before calling the Restore methods.

Parameters
[in]aIndexThe index within the list of the devices; a value between 0 and GetDeviceCount-1.
[out]aNameThe configuration's name; the name stored using the aName parameter in the PvConfigurationWriter::Store method.
Returns
Includes:
uint32_t PvConfigurationReader::GetGenParameterArrayCount ( )

Get the number of PvGenParameterArray objects saved in the configuration file.

See GetDeviceCount.

Returns
See GetDeviceCount.
PvResult PvConfigurationReader::GetGenParameterArrayName ( uint32_t  aIndex,
PvString aName 
)

Get the configuration name (PvGenParameterArray).

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.
uint32_t PvConfigurationReader::GetPropertyListCount ( )

Get the number of PvPropertyList objects saved in the configuration file.

See GetDeviceCount.

Returns
See GetDeviceCount.
PvResult PvConfigurationReader::GetPropertyListName ( uint32_t  aIndex,
PvString aName 
)

Get the configuration name (PvPropertyList).

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.
uint32_t PvConfigurationReader::GetStreamCount ( )

Get the number of stream configuration in this PvConfigurationReader.

See GetDeviceCount.

Returns
See GetDeviceCount.
PvResult PvConfigurationReader::GetStreamName ( uint32_t  aIndex,
PvString aName 
)

Get the configuration name (PvStream).

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.
uint32_t PvConfigurationReader::GetStringCount ( )

Get the number of custom-state strings in the configuration file.

See GetDeviceCount.

Returns
See GetDeviceCount.
PvResult PvConfigurationReader::GetStringName ( uint32_t  aIndex,
PvString aName 
)

Get the custom-state string name (PvString)

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.
PvResult PvConfigurationReader::Load ( const PvString aFilename)

Load a configuration file from disk.

The Load method loads a configuration file from disk into the PvConfigurationReader object's internal memory. To apply a configuration state, use Restore.

Parameters
[in]aFilenameThe configuration file's name and path.
Returns
Includes:
PvResult PvConfigurationReader::LoadFromString ( const PvString aString)

Loads a configuration from a string.

The Load method loads a configuration from a string into the PvConfigurationReader object's internal memory. To apply a configuration state, use Restore.

Parameters
[in]aStringThe configuration to load.
Returns
Includes:
PvResult PvConfigurationReader::Restore ( const PvString aName,
PvDevice aDevice 
)

Apply a configuration.

This method is identical to the Restore(uint32_t,PvDevice*) family of methods, with the following exceptions:

  • These methods identify the configuration by name (aName) rather than index number (aIndex).
Parameters
[in]aNameThe configuration name.
[in]aDeviceThe target that receives the new configuration. The target might be a PvDevice (aDevice, a PvStream (aStream), or a custom configuration (aString).
Returns
Includes:
PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvDevice aDevice 
)

Apply a configuration to a PvDevice.

The Restore methods apply a configuration loaded into a configuration reader (using the Load method) to a GigE Vision or USB3 Vision device.

In general, the parameters for the Restore methods use a (ConfigurationIdentifier, Target) format. The ConfigurationIdentifier is the configuration's name or index number; Target is the PvDevice object, PvStream object, or custom string that receives the state.

Parameters
[in]aIndexThe configuration's index number.
[in]aDeviceThe target that receives the new configuration. The target might be a PvDevice (aDevice, a PvStream (aStream), or a custom configuration (aString).
Returns
Includes:
PvResult PvConfigurationReader::Restore ( const PvString aName,
PvStream aStream 
)

Apply a configuration to a PvStream.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameSee Restore(const PvString&,PvDevice*).
[out]aStreamSee Restore(const PvString&,PvDevice*), aDevice parameter.
Returns
Includes:
PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvStream aStream 
)

Apply a configuration to a PvStream.

See Restore(uint32_t,PvDevice*).

Parameters
[in]aIndexSee Restore(uint32_t,PvDevice*).
[out]aStreamSee Restore(uint32_t,PvDevice*), aDevice parameter.
Returns
See Restore(uint32_t,PvDevice*).
PvResult PvConfigurationReader::Restore ( const PvString aName,
PvString aString 
)

Apply a configuration.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameSee Restore(const PvString&,PvDevice*).
[out]aStringSee Restore(const PvString&,PvDevice*), aDevice parameter.
Returns
See Restore(const PvString&,PvDevice*).
PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvString aString 
)

Apply a configuration.

See Restore(uint32_t,PvDevice*).

Parameters
[in]aIndexSee Restore(uint32_t,PvString&).
[out]aStringSee Restore(uint32_t,PvDevice*), aDevice parameter.
Returns
Includes:
PvResult PvConfigurationReader::Restore ( const PvString aName,
PvGenParameterArray aParameterArray 
)

Apply a configuration to a PvGenParameterArray.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameName of the parameter array to restore from the persistence data
[out]aParameterArrayReference to the parameter array to restore that data to
Returns
Includes:
PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvGenParameterArray aParameterArray 
)

Apply a configuration to a PvGenParameterArray.

See Restore(uint32_t,PvDevice*).

Parameters
[in]aIndexIndex of the parameter array to restore from the persistence data
[out]aParameterArrayReference to the parameter array to restore that data to
Returns
Includes:
PvResult PvConfigurationReader::Restore ( const PvString aName,
PvPropertyList aPropertyList 
)

Retrieves the data to a PvPropertyList.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameName of the property list to restore from the persistence data
[out]aPropertyListReference to the property list to restore that data to
Returns
Includes:
PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvPropertyList aPropertyList 
)

Retrieves the data to a PvPropertyList.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aIndexIndex of the property list to restore from the persistence data
[out]aPropertyListReference to the property list to restore that data to
Returns
Includes:
void PvConfigurationReader::SetErrorList ( PvStringList aList,
const PvString aPrefix 
)

Sets the error list where all errors/warnings are logged.

Parameters
[in]aListA pointer to a string list. The content of the list is not reset, new errors are simply added to the list.
[in]aPrefixA contextual prefix prepended to all errors as they are added to the error list.

The documentation for this class was generated from the following files:

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com