Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvCameraBridge Class Reference

Used to provide a GenApi interface to a frame grabber camera. More...

Public Member Functions

 PvCameraBridge (PvDevice *aDevice, PvDeviceSerial aPort, PvStream *aStream=NULL)
 Constructor. More...
 
virtual ~PvCameraBridge ()
 Destructor.
 
PvGenParameterArrayGetParameters ()
 Returns the GenApi interface of the camera. More...
 
bool IsConnected ()
 Returns true if the bridge is currently connected. More...
 
PvResult Disconnect ()
 Disconnects the camera bridge. More...
 
PvResult Recover ()
 Deprecated. More...
 
PvDeviceSerial GetPort () const
 Returns the device serial port used by the camera bridge. More...
 
PvDeviceGetDevice ()
 Returns the device controller used by the camera bridge. More...
 
PvStreamGetStream ()
 Returns the stream used by the camera bridge. More...
 
PvResult StartAcquisition ()
 Starts the acquisition on the camera. More...
 
PvResult StopAcquisition ()
 Stops the acquisition on the camera. More...
 
bool GetParametersSyncEnabled () const
 Whether or not camera-to-grabber smart parameters synchronization is enabled. More...
 
void SetParametersSyncEnabled (bool aEnabled)
 Sets whether or not camera-to-grabber smart parameters synchronization is enabled. More...
 
PvString GetSource () const
 Returns the streaming source on which parameter sync is performed, if enabled. More...
 
void SetSource (const PvString &aSource)
 Sets the streaming source on which parameter sync is performed, if enabled. More...
 
PvResult RegisterEventSink (PvCameraBridgeEventSink *aEventSink)
 Register an event sink used for callbacks. More...
 
PvResult UnregisterEventSink (PvCameraBridgeEventSink *aEventSink)
 Unregister an event sink. More...
 
PvResult ConnectPleoraCameraFile (const PvString &aPath)
 Connects the camera bridge using a Pleora Camera File. More...
 
PvResult GetPleoraCameraFileParserErrors (PvStringList &aErrors)
 Provides a list resulting from a failure of parsing a Pleora Camera File with ConnectPleoraCameraFile. More...
 
PvResult GetPleoraCameraFilePath (PvString &aPath) const
 If the bridge is setup from a Pleora Camera File, returns the YAML configuration file path. More...
 
PvResult ProbeCLProtocol (const PvString &aTemplate, PvString &aCameraID, PvStringList &aXMLIDs)
 Probes for a CLProtocol camera and returns the camera ID and all its available GenApi XML IDs if found. More...
 
PvResult ConnectCLProtocol (const PvString &aTemplate, const PvString &aXMLID="")
 Connects the camera bridge using CLProtocol. More...
 
PvResult GetCLProtocolTemplate (PvString &aTemplate) const
 If the bridge is using CLProtocol returns the CLProtocol device template. More...
 
PvResult GetCLProtocolCameraID (PvString &aCameraID) const
 If the bridge is using CLProtocol returns the controller camera ID. More...
 
PvResult GetCLProtocolXMLID (PvString &aXMLID) const
 If the bridge is using CLProtocol returns the CLProtocol XML ID. More...
 
PvResult GetGenCPXMLIDs (PvStringList &aXMLIDs)
 Returns all available GenCP XML IDs. More...
 
PvResult ConnectGenCP (const PvString &aXMLID="")
 Connects the camera bridge to a GenCP camera. More...
 
PvResult GetGenCPXMLID (PvString &aXMLID) const
 If the bridge is using GenCP returns the selected XML ID. More...
 
PvResult Save (const PvString &aPrefix, PvConfigurationWriter &aWriter)
 Persists the current display thread configuration. More...
 
PvResult Load (const PvString &aPrefix, PvConfigurationReader &aReader, PvStringList &aErrors)
 Restores a the camera bridge. More...
 
uint64_t GetBytesSentToCamera () const
 Returns how many bytes were sent to the camera through the bridge. More...
 
uint64_t GetBytesReceivedFromCamera () const
 Returns how many bytes were received from the camera through the bridge. More...
 
void ResetStatistics ()
 Resets the camera bridge statistics.
 

Static Public Member Functions

static PvResult GetCLProtocolTemplates (PvStringList &aTemplates)
 Lists all avaiable CLProtocol device templates. More...
 
static bool IsPoCLSupported (PvDevice *aDevice)
 Static method which reports if PoCL is supported on a device. More...
 
static bool IsPoCLEnabled (PvDevice *aDevice)
 Static method which reports if PoCL is enabled on a device. More...
 
static PvResult SetPoCLEnabled (PvDevice *aDevice, bool aEnabled)
 Enables or disables PoCL on all connectors of a device. More...
 

Detailed Description

Used to provide a GenApi interface to a frame grabber camera.

Can be used to provide a camera bridge to:

  • A GenCP compliant camera
  • A camera that can be controlled through a CLProtocol library
  • A camera described by a Pleora Camera file (for future use only)

The Pleora Camera Files are intended for future use. Contact your Pleora representative if you would like to learn more about this feature.

Constructor & Destructor Documentation

PvCameraBridge::PvCameraBridge ( PvDevice aDevice,
PvDeviceSerial  aPort,
PvStream aStream = NULL 
)

Constructor.

Parameters
[in]aDeviceDevice (typically a frame grabber) the camera is connected to.
[in]aPortSerial port on the device used to interface the camera.
[in]aStreamStream objects used to received images from the frame grabber and camera.

Member Function Documentation

PvResult PvCameraBridge::ConnectCLProtocol ( const PvString aTemplate,
const PvString aXMLID = "" 
)

Connects the camera bridge using CLProtocol.

Parameters
[in]aTemplateThe CLProtocol device template.
[in]aXMLIDthe XML ID to use to build the GenApi interface. If not provided, the first available is used.
Returns
Includes:
PvResult PvCameraBridge::ConnectGenCP ( const PvString aXMLID = "")

Connects the camera bridge to a GenCP camera.

Parameters
[in]aXMLIDthe XML ID to use to build the GenApi interface. If not provided, the first manifest entry is used.
Returns
Includes:
PvResult PvCameraBridge::ConnectPleoraCameraFile ( const PvString aPath)

Connects the camera bridge using a Pleora Camera File.

A Pleora Camera File is a YAML file made of ID, init sequence and parameter description sectons that can be used to setup a camera bridge.

The Pleora Camera Files are intended for future use. Please contact your Pleora representative if you would like to learn more about this feature.

Parameters
[in]aPathPath to the Pleora Camera File.
Returns
Includes:
PvResult PvCameraBridge::Disconnect ( )

Disconnects the camera bridge.

Returns
Includes:
uint64_t PvCameraBridge::GetBytesReceivedFromCamera ( ) const

Returns how many bytes were received from the camera through the bridge.

Returns
Bytes received from the camera.
uint64_t PvCameraBridge::GetBytesSentToCamera ( ) const

Returns how many bytes were sent to the camera through the bridge.

Returns
Bytes sent to the camera.
PvResult PvCameraBridge::GetCLProtocolCameraID ( PvString aCameraID) const

If the bridge is using CLProtocol returns the controller camera ID.

Parameters
[out]aCameraIDCLProtocol controller camera ID.
Returns
Includes:
PvResult PvCameraBridge::GetCLProtocolTemplate ( PvString aTemplate) const

If the bridge is using CLProtocol returns the CLProtocol device template.

Parameters
[out]aTemplateString where the CLProtocol device template is copied.
Returns
Includes:
PvResult PvCameraBridge::GetCLProtocolTemplates ( PvStringList aTemplates)
static

Lists all avaiable CLProtocol device templates.

This function can succeed and aTemplates be empty if the enumeration is successful but no CLProtocol device templates are found.

Parameters
[out]aTemplatesList of string representing all available CLProtocol device templates.
Returns
Includes:
PvResult PvCameraBridge::GetCLProtocolXMLID ( PvString aXMLID) const

If the bridge is using CLProtocol returns the CLProtocol XML ID.

Parameters
[out]aXMLIDCLProtocol XML ID.
Returns
Includes:
PvDevice * PvCameraBridge::GetDevice ( )

Returns the device controller used by the camera bridge.

Returns
Device pointer.
PvResult PvCameraBridge::GetGenCPXMLID ( PvString aXMLID) const

If the bridge is using GenCP returns the selected XML ID.

Parameters
[in]aXMLIDXML ID of the connected GenCP camera.
Returns
Includes:
PvResult PvCameraBridge::GetGenCPXMLIDs ( PvStringList aXMLIDs)

Returns all available GenCP XML IDs.

Parameters
[out]aXMLIDsA string list populated with the ID of all available GenApi XML IDs.
Returns
Includes:
PvGenParameterArray * PvCameraBridge::GetParameters ( )

Returns the GenApi interface of the camera.

Returns
GenApi interface of the camera or NULL if not connected.
bool PvCameraBridge::GetParametersSyncEnabled ( ) const

Whether or not camera-to-grabber smart parameters synchronization is enabled.

Returns
True if enabled.
PvResult PvCameraBridge::GetPleoraCameraFileParserErrors ( PvStringList aErrors)

Provides a list resulting from a failure of parsing a Pleora Camera File with ConnectPleoraCameraFile.

Parameters
[out]aErrorsList of strings containing the errors reported by the parser.
Returns
Includes:
PvResult PvCameraBridge::GetPleoraCameraFilePath ( PvString aPath) const

If the bridge is setup from a Pleora Camera File, returns the YAML configuration file path.

Parameters
[out]aPathString where the path is copied to.
Returns
Includes:
PvDeviceSerial PvCameraBridge::GetPort ( ) const

Returns the device serial port used by the camera bridge.

Returns
Device serial port.
PvString PvCameraBridge::GetSource ( ) const

Returns the streaming source on which parameter sync is performed, if enabled.

Returns
Streaming source used for parameter synchronization.
PvStream * PvCameraBridge::GetStream ( )

Returns the stream used by the camera bridge.

Optional, can be NULL.

Returns
Stream pointer.
bool PvCameraBridge::IsConnected ( )

Returns true if the bridge is currently connected.

Returns
True if connected.
bool PvCameraBridge::IsPoCLEnabled ( PvDevice aDevice)
static

Static method which reports if PoCL is enabled on a device.

Parameters
[in]aDeviceThe device on which PoCL is tested.

PoCL can be enabled/disabled individually on each connector. Here we report that PoCL is enabled if it is enabled on at least one connector.

True is returned if PoCL is enabled on all availble connectors.

Returns
True if PoCL is enabled on the device.
bool PvCameraBridge::IsPoCLSupported ( PvDevice aDevice)
static

Static method which reports if PoCL is supported on a device.

Parameters
[in]aDeviceThe device on which PoCL tested as being supported.
Returns
True if PoCL is supported on the device.
PvResult PvCameraBridge::Load ( const PvString aPrefix,
PvConfigurationReader aReader,
PvStringList aErrors 
)

Restores a the camera bridge.

The load works on a best effort basis. Whatever can be restored will be restored.

The order to properties in the aPropertyList is not important.

Parameters
[in]aPrefixThe prefix to used to identify this camera bridge in the persistence data.
[in]aReaderConfiguration reader used to read back the camera bridge state.
[out]aErrorsA list where all persistence errors are appended.
Returns
Includes:
PvResult PvCameraBridge::ProbeCLProtocol ( const PvString aTemplate,
PvString aCameraID,
PvStringList aXMLIDs 
)

Probes for a CLProtocol camera and returns the camera ID and all its available GenApi XML IDs if found.

Parameters
[in]aTemplateThe CL Protocol device template. See GetCLProtocolTemplates.
[out]aCameraIDA string containing the CLProtocol device identifier for the camera.
[out]aXMLIDsA string list populated with the ID of all available GenApi XML IDs.
Returns
Includes:
PvResult PvCameraBridge::Recover ( )

Deprecated.

Instead, on disconnect event use Save to store the serial bridge state. After reconnection, use Load to bring it back.

Returns
Includes:
PvResult PvCameraBridge::RegisterEventSink ( PvCameraBridgeEventSink aEventSink)

Register an event sink used for callbacks.

Parameters
[in]aEventSinkA pointer to the event sink.
Returns
Includes:
PvResult PvCameraBridge::Save ( const PvString aPrefix,
PvConfigurationWriter aWriter 
)

Persists the current display thread configuration.

This call builds a list of properties containing pairs of names/values.

Parameters
[in]aPrefixThe prefix to used to identify this camera bridge in the persistence data.
[in]aWriterConfiguration writer used to persist the camera bridge state.
Returns
Includes:
void PvCameraBridge::SetParametersSyncEnabled ( bool  aEnabled)

Sets whether or not camera-to-grabber smart parameters synchronization is enabled.

Parameters
[in]aEnabledTrue to enable synchronization.
PvResult PvCameraBridge::SetPoCLEnabled ( PvDevice aDevice,
bool  aEnabled 
)
static

Enables or disables PoCL on all connectors of a device.

Parameters
[in]aDeviceThe device on which PoCL is enabled or disabled.
[in]aEnabledTrue to enable PoCL, false to disable it.
Returns
Includes:
void PvCameraBridge::SetSource ( const PvString aSource)

Sets the streaming source on which parameter sync is performed, if enabled.

If not using a multi-source device, leave empty. If using a multi-source device, set to the SourceSelector of the source the camera belongs to.

Parameters
[in]aSourceString-based representation of the streaming source from the SourceSelector GenApi parameter.
PvResult PvCameraBridge::StartAcquisition ( )

Starts the acquisition on the camera.

Uses the GenApi interface to set TLParamsLocked and execute the AcquisitionStart command if these parameters exist. If they do not exist the function still succeeds.

Some cameras only stream if AcquisitionStart/AcquisitionStop and TLParamsLocked are managed properly. In a generic camera bridge application it is recommended to always call StartAcquisition and StopAcquisition on the camera bridge after starting and before stopping acquisition on the device (grabber) itself.

Returns
Includes:
PvResult PvCameraBridge::StopAcquisition ( )

Stops the acquisition on the camera.

Uses the GenApi interface to execute the AcquisitionStop command and set TLParamsLocked to 0 if these parameters exist. If they do not exist the function still succeeds.

Returns
Includes:
PvResult PvCameraBridge::UnregisterEventSink ( PvCameraBridgeEventSink aEventSink)

Unregister an event sink.

Parameters
[in]aEventSinkA pointer to the event sink.
Returns
Includes:
See also
RegisterEventSink

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

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