Class PvCameraBridge
Bridge between a PvDevice and a camera connected through a serial port.
Implements
Inherited Members
Namespace: eBUSDotNetReceive
Assembly: eBUSDotNetReceive.dll
Syntax
public class PvCameraBridge : IDisposable
Remarks
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.
<b>To use PvCameraBridge:</b>
- Connect to a device using PvDevice.
- Create a PvCameraBridge with the device and serial port.
- Call Connect to establish communication with the camera.
- Use GetParameters to access camera settings.
- Call StartAcquisition/StopAcquisition to control image capture.
Constructors
View SourcePvCameraBridge(PvDevice, PvDeviceSerial, PvStream)
Constructor.
Declaration
public PvCameraBridge(PvDevice aDevice, PvDeviceSerial aPort, PvStream aStream = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDevice | aDevice | The PvDevice to use for communication. |
| PvDeviceSerial | aPort | The serial port to use for camera communication. |
| PvStream | aStream | Optional PvStream for image acquisition. |
Fields
View SourceswigCMemOwn
Determines who is responsible for deleting the underlying C++ object.
Declaration
protected bool swigCMemOwn
Field Value
| Type | Description |
|---|---|
| bool |
Properties
View SourceBytesReceivedFromCamera
Returns the total number of bytes received from the camera.
Declaration
public ulong BytesReceivedFromCamera { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
BytesSentToCamera
Returns the total number of bytes sent to the camera.
Declaration
public ulong BytesSentToCamera { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
IsConnected
Checks if the bridge is connected to a camera.
Declaration
public bool IsConnected { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ParametersSyncEnabled
Gets or sets whether parameter synchronization is enabled.
Declaration
public bool ParametersSyncEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Port
Returns the serial port used by this bridge.
Declaration
public PvDeviceSerial Port { get; }
Property Value
| Type | Description |
|---|---|
| PvDeviceSerial |
Source
Gets or sets the source name for parameters sync and acquisition start/stop.
Declaration
public string Source { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceConnectCLProtocol(string)
Connects to a camera using CameraLink Protocol.
Declaration
public PvResult ConnectCLProtocol(string aTemplate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aTemplate | The CameraLink Protocol template to use. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
ConnectCLProtocol(string, string)
Connects to a camera using CameraLink Protocol.
Declaration
public PvResult ConnectCLProtocol(string aTemplate, string aXMLID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aTemplate | The CameraLink Protocol template to use. |
| string | aXMLID | Optional XML ID to use. If empty, the first matching ID is used. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
ConnectGenCP()
Connects to a camera using GenCP.
Declaration
public PvResult ConnectGenCP()
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
ConnectGenCP(string)
Connects to a camera using GenCP.
Declaration
public PvResult ConnectGenCP(string aXMLID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aXMLID | Optional XML ID to use. If empty, the first matching ID is used. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
ConnectPleoraCameraFile(string)
Connects to a camera using a Pleora Camera File.
Declaration
public PvResult ConnectPleoraCameraFile(string aPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aPath | Path to the Pleora Camera File (.pcf). |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
Disconnect()
Disconnects from the camera.
Declaration
public PvResult Disconnect()
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
Dispose()
Dispose.
Declaration
public void Dispose()
Dispose(bool)
Dispose
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
~PvCameraBridge()
Destructor.
Declaration
protected ~PvCameraBridge()
GetCLProtocolCameraID(out string)
Returns the camera ID from the CameraLink Protocol connection.
Declaration
public PvResult GetCLProtocolCameraID(out string aCameraID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aCameraID | The camera ID. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetCLProtocolTemplate(out string)
Returns the CameraLink Protocol template currently in use.
Declaration
public PvResult GetCLProtocolTemplate(out string aTemplate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aTemplate | The template name. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetCLProtocolTemplates(ref PvStringList)
Returns the list of available CameraLink Protocol templates.
Declaration
public static PvResult GetCLProtocolTemplates(ref PvStringList aTemplates)
Parameters
| Type | Name | Description |
|---|---|---|
| PvStringList | aTemplates | List of template names. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetCLProtocolXMLID(out string)
Returns the XML ID used for the CameraLink Protocol connection.
Declaration
public PvResult GetCLProtocolXMLID(out string aXMLID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aXMLID | The XML ID. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetDevice()
Returns the PvDevice used by this bridge.
Declaration
public PvDevice GetDevice()
Returns
| Type | Description |
|---|---|
| PvDevice | Pointer to the PvDevice. |
GetGenCPXMLID(out string)
Returns the XML ID used for the GenCP connection.
Declaration
public PvResult GetGenCPXMLID(out string aXMLID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aXMLID | The XML ID. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetGenCPXMLIDs(ref PvStringList)
Returns the list of XML IDs available for GenCP connection.
Declaration
public PvResult GetGenCPXMLIDs(ref PvStringList aXMLIDs)
Parameters
| Type | Name | Description |
|---|---|---|
| PvStringList | aXMLIDs | List of XML IDs. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetParameters()
Returns the GenICam parameter array for the camera.
Declaration
public PvGenParameterArray GetParameters()
Returns
| Type | Description |
|---|---|
| PvGenParameterArray | Pointer to the parameter array. |
GetPleoraCameraFileParserErrors(ref PvStringList)
Returns parser errors from the last Pleora Camera File load.
Declaration
public PvResult GetPleoraCameraFileParserErrors(ref PvStringList aErrors)
Parameters
| Type | Name | Description |
|---|---|---|
| PvStringList | aErrors | List of error messages. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetPleoraCameraFilePath(out string)
Returns the path of the currently loaded Pleora Camera File.
Declaration
public PvResult GetPleoraCameraFilePath(out string aPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aPath | Path to the Pleora Camera File. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
GetStream()
Returns the PvStream used by this bridge.
Declaration
public PvStream GetStream()
Returns
| Type | Description |
|---|---|
| PvStream | Pointer to the PvStream, or NULL if none. |
IsPoCLEnabled(PvDevice)
Checks if Power over Camera Link (PoCL) is currently enabled.
Declaration
public static bool IsPoCLEnabled(PvDevice aDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDevice | aDevice | The device to check. |
Returns
| Type | Description |
|---|---|
| bool | True if PoCL is enabled, false otherwise. |
IsPoCLSupported(PvDevice)
Checks if Power over Camera Link (PoCL) is supported by the device.
Declaration
public static bool IsPoCLSupported(PvDevice aDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDevice | aDevice | The device to check. |
Returns
| Type | Description |
|---|---|
| bool | True if PoCL is supported, false otherwise. |
Load(string, ref PvConfigurationReader, ref PvStringList)
Loads the camera bridge configuration.
Declaration
public PvResult Load(string aPrefix, ref PvConfigurationReader aReader, ref PvStringList aErrors)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aPrefix | Prefix for configuration entries. |
| PvConfigurationReader | aReader | Configuration reader to use. |
| PvStringList | aErrors | List of errors encountered during load. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
ProbeCLProtocol(string, out string, ref PvStringList)
Probes a camera using CameraLink Protocol to retrieve its identification.
Declaration
public PvResult ProbeCLProtocol(string aTemplate, out string aCameraID, ref PvStringList aXMLIDs)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aTemplate | The CameraLink Protocol template to use. |
| string | aCameraID | The camera ID retrieved from the camera. |
| PvStringList | aXMLIDs | List of XML IDs that match the camera. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
Recover()
Deprecated, do not use.
Declaration
public PvResult Recover()
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
RegisterEventSink(PvCameraBridgeEventSink)
Registers an event sink to receive notifications.
Declaration
public PvResult RegisterEventSink(PvCameraBridgeEventSink aEventSink)
Parameters
| Type | Name | Description |
|---|---|---|
| PvCameraBridgeEventSink | aEventSink | Pointer to the event sink to register. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
ResetStatistics()
Resets communication statistics.
Declaration
public void ResetStatistics()
Save(string, ref PvConfigurationWriter)
Saves the camera bridge configuration.
Declaration
public PvResult Save(string aPrefix, ref PvConfigurationWriter aWriter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | aPrefix | Prefix for configuration entries. |
| PvConfigurationWriter | aWriter | Configuration writer to use. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
SetPoCLEnabled(PvDevice, bool)
Enables or disables Power over Camera Link (PoCL).
Declaration
public static PvResult SetPoCLEnabled(PvDevice aDevice, bool aEnabled)
Parameters
| Type | Name | Description |
|---|---|---|
| PvDevice | aDevice | The device to configure. |
| bool | aEnabled | True to enable PoCL, false to disable. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
StartAcquisition()
Starts image acquisition on the camera.
Declaration
public PvResult StartAcquisition()
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
StopAcquisition()
Stops image acquisition on the camera.
Declaration
public PvResult StopAcquisition()
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |
UnregisterEventSink(PvCameraBridgeEventSink)
Unregisters a previously registered event sink.
Declaration
public PvResult UnregisterEventSink(PvCameraBridgeEventSink aEventSink)
Parameters
| Type | Name | Description |
|---|---|---|
| PvCameraBridgeEventSink | aEventSink | Pointer to the event sink to unregister. |
Returns
| Type | Description |
|---|---|
| PvResult | Result of the operation. |