Bridge between a PvDevice and a camera connected through a serial port. More...
#include <PvCameraBridge.h>
Public Member Functions | |
| PvCameraBridge (PvDevice *aDevice, PvDeviceSerial aPort, PvStream *aStream=NULL) | |
| Constructor. More... | |
| virtual | ~PvCameraBridge () |
| Destructor. | |
| PvGenParameterArray * | GetParameters () |
| Returns the GenICam parameter array for the camera. More... | |
| bool | IsConnected () |
| Checks if the bridge is connected to a camera. More... | |
| PvResult | Disconnect () |
| Disconnects from the camera. More... | |
| PvResult | Recover () |
| Deprecated, do not use. More... | |
| PvDeviceSerial | GetPort () const |
| Returns the serial port used by this bridge. More... | |
| PvDevice * | GetDevice () |
| Returns the PvDevice used by this bridge. More... | |
| PvStream * | GetStream () |
| Returns the PvStream used by this bridge. More... | |
| PvResult | StartAcquisition () |
| Starts image acquisition on the camera. More... | |
| PvResult | StopAcquisition () |
| Stops image acquisition on the camera. More... | |
| bool | GetParametersSyncEnabled () const |
| Returns whether parameter synchronization is enabled. More... | |
| void | SetParametersSyncEnabled (bool aEnabled) |
| Enables or disables parameter synchronization. More... | |
| PvString | GetSource () const |
| Returns the current source name for parameters sync and acquisition start/stop. More... | |
| void | SetSource (const PvString &aSource) |
| Sets the source name for parameters sync and acquisition start/stop. More... | |
| PvResult | RegisterEventSink (PvCameraBridgeEventSink *aEventSink) |
| Registers an event sink to receive notifications. More... | |
| PvResult | UnregisterEventSink (PvCameraBridgeEventSink *aEventSink) |
| Unregisters a previously registered event sink. More... | |
| PvResult | ConnectPleoraCameraFile (const PvString &aPath) |
| Connects to a camera using a Pleora Camera File. More... | |
| PvResult | GetPleoraCameraFileParserErrors (PvStringList &aErrors) |
| Returns parser errors from the last Pleora Camera File load. More... | |
| PvResult | GetPleoraCameraFilePath (PvString &aPath) const |
| Returns the path of the currently loaded Pleora Camera File. More... | |
| PvResult | ProbeCLProtocol (const PvString &aTemplate, PvString &aCameraID, PvStringList &aXMLIDs) |
| Probes a camera using CameraLink Protocol to retrieve its identification. More... | |
| PvResult | ConnectCLProtocol (const PvString &aTemplate, const PvString &aXMLID="") |
| Connects to a camera using CameraLink Protocol. More... | |
| PvResult | GetCLProtocolTemplate (PvString &aTemplate) const |
| Returns the CameraLink Protocol template currently in use. More... | |
| PvResult | GetCLProtocolCameraID (PvString &aCameraID) const |
| Returns the camera ID from the CameraLink Protocol connection. More... | |
| PvResult | GetCLProtocolXMLID (PvString &aXMLID) const |
| Returns the XML ID used for the CameraLink Protocol connection. More... | |
| PvResult | GetGenCPXMLIDs (PvStringList &aXMLIDs) |
| Returns the list of XML IDs available for GenCP connection. More... | |
| PvResult | ConnectGenCP (const PvString &aXMLID="") |
| Connects to a camera using GenCP. More... | |
| PvResult | GetGenCPXMLID (PvString &aXMLID) const |
| Returns the XML ID used for the GenCP connection. More... | |
| PvResult | Save (const PvString &aPrefix, PvConfigurationWriter &aWriter) |
| Saves the camera bridge configuration. More... | |
| PvResult | Load (const PvString &aPrefix, PvConfigurationReader &aReader, PvStringList &aErrors) |
| Loads the camera bridge configuration. More... | |
| uint64_t | GetBytesSentToCamera () const |
| Returns the total number of bytes sent to the camera. More... | |
| uint64_t | GetBytesReceivedFromCamera () const |
| Returns the total number of bytes received from the camera. More... | |
| void | ResetStatistics () |
| Resets communication statistics. More... | |
Static Public Member Functions | |
| static PvResult | GetCLProtocolTemplates (PvStringList &aTemplates) |
| Returns the list of available CameraLink Protocol templates. More... | |
| static bool | IsPoCLSupported (PvDevice *aDevice) |
| Checks if Power over Camera Link (PoCL) is supported by the device. More... | |
| static bool | IsPoCLEnabled (PvDevice *aDevice) |
| Checks if Power over Camera Link (PoCL) is currently enabled. More... | |
| static PvResult | SetPoCLEnabled (PvDevice *aDevice, bool aEnabled) |
| Enables or disables Power over Camera Link (PoCL). More... | |
Bridge between a PvDevice and a camera connected through a serial port.
Used to provide a GenApi interface to a frame grabber camera.
PvCameraBridge provides communication with cameras connected through serial ports (RS-232, Camera Link, etc.) and supports multiple protocols including Pleora Camera File (PCF), CameraLink Protocol (CLP), and GenCP.
Can be used to provide a camera bridge to:
The Pleora Camera Files are intended for future use. Contact your Pleora representative if you would like to learn more about this feature.
| PvCameraBridge::PvCameraBridge | ( | PvDevice * | aDevice, |
| PvDeviceSerial | aPort, | ||
| PvStream * | aStream = NULL |
||
| ) |
Constructor.
| [in] | aDevice | The PvDevice to use for communication. |
| [in] | aPort | The serial port to use for camera communication. |
| [in] | aStream | Optional PvStream for image acquisition. |
| [in] | aDevice | Device (typically a frame grabber) the camera is connected to. |
| [in] | aPort | Serial port on the device used to interface the camera. |
| [in] | aStream | Stream objects used to received images from the frame grabber and camera. |
| PvResult PvCameraBridge::ConnectCLProtocol | ( | const PvString & | aTemplate, |
| const PvString & | aXMLID = "" |
||
| ) |
Connects to a camera using CameraLink Protocol.
Connects the camera bridge using CLProtocol.
| [in] | aTemplate | The CameraLink Protocol template to use. |
| [in] | aXMLID | Optional XML ID to use. If empty, the first matching ID is used. |
| [in] | aTemplate | The CLProtocol device template. |
| [in] | aXMLID | the XML ID to use to build the GenApi interface. If not provided, the first available is used. |
Connects to a camera using GenCP.
Connects the camera bridge to a GenCP camera.
| [in] | aXMLID | Optional XML ID to use. If empty, the first matching ID is used. |
| [in] | aXMLID | the XML ID to use to build the GenApi interface. If not provided, the first manifest entry is used. |
Connects to a camera using a Pleora Camera File.
Connects the camera bridge using a Pleora Camera File.
| [in] | aPath | Path to the Pleora Camera File (.pcf). |
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.
| [in] | aPath | Path to the Pleora Camera File. |
| PvResult PvCameraBridge::Disconnect | ( | ) |
Disconnects from the camera.
Disconnects the camera bridge.
| uint64_t PvCameraBridge::GetBytesReceivedFromCamera | ( | ) | const |
Returns the total number of bytes received from the camera.
Returns how many bytes were received from the camera through the bridge.
| uint64_t PvCameraBridge::GetBytesSentToCamera | ( | ) | const |
Returns the total number of bytes sent to the camera.
Returns how many bytes were sent to the camera through the bridge.
Returns the camera ID from the CameraLink Protocol connection.
If the bridge is using CLProtocol returns the controller camera ID.
| [out] | aCameraID | The camera ID. |
| [out] | aCameraID | CLProtocol controller camera ID. |
Returns the CameraLink Protocol template currently in use.
If the bridge is using CLProtocol returns the CLProtocol device template.
| [out] | aTemplate | The template name. |
| [out] | aTemplate | String where the CLProtocol device template is copied. |
|
static |
Returns the list of available CameraLink Protocol templates.
Lists all avaiable CLProtocol device templates.
| [out] | aTemplates | List of template names. |
This function can succeed and aTemplates be empty if the enumeration is successful but no CLProtocol device templates are found.
| [out] | aTemplates | List of string representing all available CLProtocol device templates. |
Returns the XML ID used for the CameraLink Protocol connection.
If the bridge is using CLProtocol returns the CLProtocol XML ID.
| [out] | aXMLID | The XML ID. |
| [out] | aXMLID | CLProtocol XML ID. |
| PvDevice * PvCameraBridge::GetDevice | ( | ) |
Returns the XML ID used for the GenCP connection.
If the bridge is using GenCP returns the selected XML ID.
| [out] | aXMLID | The XML ID. |
| [in] | aXMLID | XML ID of the connected GenCP camera. |
| PvResult PvCameraBridge::GetGenCPXMLIDs | ( | PvStringList & | aXMLIDs | ) |
Returns the list of XML IDs available for GenCP connection.
Returns all available GenCP XML IDs.
| [out] | aXMLIDs | List of XML IDs. |
| [out] | aXMLIDs | A string list populated with the ID of all available GenApi XML IDs. |
| PvGenParameterArray * PvCameraBridge::GetParameters | ( | ) |
Returns the GenICam parameter array for the camera.
Returns the GenApi interface of the camera.
| bool PvCameraBridge::GetParametersSyncEnabled | ( | ) | const |
Returns whether parameter synchronization is enabled.
Whether or not camera-to-grabber smart parameters synchronization is enabled.
| PvResult PvCameraBridge::GetPleoraCameraFileParserErrors | ( | PvStringList & | aErrors | ) |
Returns parser errors from the last Pleora Camera File load.
Provides a list resulting from a failure of parsing a Pleora Camera File with ConnectPleoraCameraFile.
| [out] | aErrors | List of error messages. |
| [out] | aErrors | List of strings containing the errors reported by the parser. |
Returns the path of the currently loaded Pleora Camera File.
If the bridge is setup from a Pleora Camera File, returns the YAML configuration file path.
| [out] | aPath | Path to the Pleora Camera File. |
| [out] | aPath | String where the path is copied to. |
| PvDeviceSerial PvCameraBridge::GetPort | ( | ) | const |
Returns the serial port used by this bridge.
Returns the device serial port used by the camera bridge.
| PvString PvCameraBridge::GetSource | ( | ) | const |
Returns the current source name for parameters sync and acquisition start/stop.
Returns the streaming source on which parameter sync is performed, if enabled.
| PvStream * PvCameraBridge::GetStream | ( | ) |
| bool PvCameraBridge::IsConnected | ( | ) |
Checks if the bridge is connected to a camera.
Returns true if the bridge is currently connected.
|
static |
Checks if Power over Camera Link (PoCL) is currently enabled.
Static method which reports if PoCL is enabled on a device.
| [in] | aDevice | The device to check. |
| [in] | aDevice | The 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.
|
static |
Checks if Power over Camera Link (PoCL) is supported by the device.
Static method which reports if PoCL is supported on a device.
| [in] | aDevice | The device to check. |
| [in] | aDevice | The device on which PoCL tested as being supported. |
| PvResult PvCameraBridge::Load | ( | const PvString & | aPrefix, |
| PvConfigurationReader & | aReader, | ||
| PvStringList & | aErrors | ||
| ) |
Loads the camera bridge configuration.
Restores a the camera bridge.
| [in] | aPrefix | Prefix for configuration entries. |
| [in] | aReader | Configuration reader to use. |
| [out] | aErrors | List of errors encountered during load. |
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.
| [in] | aPrefix | The prefix to used to identify this camera bridge in the persistence data. |
| [in] | aReader | Configuration reader used to read back the camera bridge state. |
| [out] | aErrors | A list where all persistence errors are appended. |
| PvResult PvCameraBridge::ProbeCLProtocol | ( | const PvString & | aTemplate, |
| PvString & | aCameraID, | ||
| PvStringList & | aXMLIDs | ||
| ) |
Probes a camera using CameraLink Protocol to retrieve its identification.
Probes for a CLProtocol camera and returns the camera ID and all its available GenApi XML IDs if found.
| [in] | aTemplate | The CameraLink Protocol template to use. |
| [out] | aCameraID | The camera ID retrieved from the camera. |
| [out] | aXMLIDs | List of XML IDs that match the camera. |
| [in] | aTemplate | The CL Protocol device template. See GetCLProtocolTemplates. |
| [out] | aCameraID | A string containing the CLProtocol device identifier for the camera. |
| [out] | aXMLIDs | A string list populated with the ID of all available GenApi XML IDs. |
| PvResult PvCameraBridge::Recover | ( | ) |
Deprecated, do not use.
Deprecated.
Instead, on disconnect event use Save to store the serial bridge state. After reconnection, use Load to bring it back.
| PvResult PvCameraBridge::RegisterEventSink | ( | PvCameraBridgeEventSink * | aEventSink | ) |
Registers an event sink to receive notifications.
Register an event sink used for callbacks.
| [in] | aEventSink | Pointer to the event sink to register. |
| [in] | aEventSink | A pointer to the event sink. |
| void PvCameraBridge::ResetStatistics | ( | ) |
Resets communication statistics.
Resets the camera bridge statistics.
| PvResult PvCameraBridge::Save | ( | const PvString & | aPrefix, |
| PvConfigurationWriter & | aWriter | ||
| ) |
Saves the camera bridge configuration.
Persists the current display thread configuration.
| [in] | aPrefix | Prefix for configuration entries. |
| [in] | aWriter | Configuration writer to use. |
This call builds a list of properties containing pairs of names/values.
| [in] | aPrefix | The prefix to used to identify this camera bridge in the persistence data. |
| [in] | aWriter | Configuration writer used to persist the camera bridge state. |
| void PvCameraBridge::SetParametersSyncEnabled | ( | bool | aEnabled | ) |
Enables or disables parameter synchronization.
Sets whether or not camera-to-grabber smart parameters synchronization is enabled.
| [in] | aEnabled | True to enable, false to disable. |
| [in] | aEnabled | True to enable synchronization. |
Enables or disables Power over Camera Link (PoCL).
Enables or disables PoCL on all connectors of a device.
| [in] | aDevice | The device to configure. |
| [in] | aEnabled | True to enable PoCL, false to disable. |
| [in] | aDevice | The device on which PoCL is enabled or disabled. |
| [in] | aEnabled | True to enable PoCL, false to disable it. |
| void PvCameraBridge::SetSource | ( | const PvString & | aSource | ) |
Sets the source name for parameters sync and acquisition start/stop.
Sets the streaming source on which parameter sync is performed, if enabled.
| [in] | aSource | The source name. |
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.
| [in] | aSource | String-based representation of the streaming source from the SourceSelector GenApi parameter. |
| PvResult PvCameraBridge::StartAcquisition | ( | ) |
Starts image acquisition on the camera.
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.
| PvResult PvCameraBridge::StopAcquisition | ( | ) |
Stops image acquisition on the camera.
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.
| PvResult PvCameraBridge::UnregisterEventSink | ( | PvCameraBridgeEventSink * | aEventSink | ) |
Unregisters a previously registered event sink.
Unregister an event sink.
| [in] | aEventSink | Pointer to the event sink to unregister. |
| [in] | aEventSink | A pointer to the event sink. |
Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com