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. | |
PvGenParameterArray * | GetParameters () |
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... | |
PvDevice * | GetDevice () |
Returns the device controller used by the camera bridge. More... | |
PvStream * | GetStream () |
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... | |
Used to provide a GenApi interface to a frame grabber camera.
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 | 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 the camera bridge using CLProtocol.
[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 the camera bridge to a GenCP camera.
[in] | aXMLID | the XML ID to use to build the GenApi interface. If not provided, the first manifest entry is used. |
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.
[in] | aPath | Path to the Pleora Camera File. |
PvResult PvCameraBridge::Disconnect | ( | ) |
Disconnects the camera bridge.
uint64_t PvCameraBridge::GetBytesReceivedFromCamera | ( | ) | const |
Returns how many bytes were received from the camera through the bridge.
uint64_t PvCameraBridge::GetBytesSentToCamera | ( | ) | const |
Returns how many bytes were sent to the camera through the bridge.
If the bridge is using CLProtocol returns the controller camera ID.
[out] | aCameraID | CLProtocol controller camera ID. |
If the bridge is using CLProtocol returns the CLProtocol device template.
[out] | aTemplate | String where the CLProtocol device template is copied. |
|
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.
[out] | aTemplates | List of string representing all available CLProtocol device templates. |
If the bridge is using CLProtocol returns the CLProtocol XML ID.
[out] | aXMLID | CLProtocol XML ID. |
PvDevice * PvCameraBridge::GetDevice | ( | ) |
Returns the device controller used by the camera bridge.
If the bridge is using GenCP returns the selected XML ID.
[in] | aXMLID | XML ID of the connected GenCP camera. |
PvResult PvCameraBridge::GetGenCPXMLIDs | ( | PvStringList & | aXMLIDs | ) |
Returns all available GenCP XML IDs.
[out] | aXMLIDs | A string list populated with the ID of all available GenApi XML IDs. |
PvGenParameterArray * PvCameraBridge::GetParameters | ( | ) |
Returns the GenApi interface of the camera.
bool PvCameraBridge::GetParametersSyncEnabled | ( | ) | const |
Whether or not camera-to-grabber smart parameters synchronization is enabled.
PvResult PvCameraBridge::GetPleoraCameraFileParserErrors | ( | PvStringList & | aErrors | ) |
Provides a list resulting from a failure of parsing a Pleora Camera File with ConnectPleoraCameraFile.
[out] | aErrors | List of strings containing the errors reported by the parser. |
If the bridge is setup from a Pleora Camera File, returns the YAML configuration file path.
[out] | aPath | String where the path is copied to. |
PvDeviceSerial PvCameraBridge::GetPort | ( | ) | const |
Returns the device serial port used by the camera bridge.
PvString PvCameraBridge::GetSource | ( | ) | const |
Returns the streaming source on which parameter sync is performed, if enabled.
PvStream * PvCameraBridge::GetStream | ( | ) |
Returns the stream used by the camera bridge.
Optional, can be NULL.
bool PvCameraBridge::IsConnected | ( | ) |
Returns true if the bridge is currently connected.
|
static |
Static method which reports if PoCL is enabled on a device.
[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 |
Static method which reports if PoCL is supported on a device.
[in] | aDevice | The device on which PoCL tested as being supported. |
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.
[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 for a CLProtocol camera and returns the camera ID and all its available GenApi XML IDs if found.
[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.
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 | ) |
Register an event sink used for callbacks.
[in] | aEventSink | A pointer to the event sink. |
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.
[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 | ) |
Sets whether or not camera-to-grabber smart parameters synchronization is enabled.
[in] | aEnabled | True to enable synchronization. |
Enables or disables PoCL on all connectors of a device.
[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 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.
[in] | aSource | String-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.
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.
PvResult PvCameraBridge::UnregisterEventSink | ( | PvCameraBridgeEventSink * | aEventSink | ) |
Unregister an event sink.
[in] | aEventSink | A pointer to the event sink. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com