CVB.Net 15.0
Device Class Reference

Generic CVB physical device. More...

Inherits INativeHandle.

Inherited by EmuDevice, GenICamDevice, NonStreamingDevice, VideoDevice, and VinDevice.

Public Member Functions

void Dispose ()
 IDisposable implementation. More...
 

Protected Member Functions

 Device (IntPtr handle, string resourceLocator)
 Creates the device from the given CVB object handle . More...
 
virtual void Dispose (bool disposing)
 IDispose helper function. More...
 

Protected Attributes

readonly object LockAnchor = new object()
 Lock anchor for device specific thread synchronization.
 

Properties

bool IsDisposed [get]
 Tests if the native handle has already been disposed. More...
 
IntPtr Handle [get]
 Gets the native CVB object handle. More...
 
string ResourceLocator [get]
 Gets the access token or path of the file name including its extension. More...
 
virtual Guid DriverGuid [get]
 Get the globally unique identifier of a CVB driver. More...
 
virtual TriggerState TriggerMode [get, set]
 Gets or sets the trigger mode of the device if possible. More...
 
abstract int StreamCount [get]
 Number of streams this device has.
 
abstract Driver.Stream Stream [get]
 Convenience property to access the first stream if present. More...
 
abstract DeviceImage DeviceImage [get]
 Gets, if available, the device image pointing to the latest synchronized image. More...
 
virtual IDeviceControl DeviceControl [get]
 Gets the IDeviceControl interface if present. More...
 
virtual IDigitalIO DigitalIO [get]
 Gets the IDigitalIO interface object if present. More...
 
virtual ISoftwareTrigger SoftwareTrigger [get]
 Gets the ISoftwareTrigger interface object if present. More...
 
DeviceNodeMapDictionary NodeMaps [get]
 Gets the dictionary holding all available NodeMaps. More...
 
virtual IRegPort RegPort [get]
 Gets the register port interface of this device if present. More...
 
virtual IImageRect ImageRect [get]
 Gets the IImageRect interface object if present. More...
 
NotifyDictionary Notify [get]
 Gets the INotify INotifyObservables if present. More...
 
virtual ConnectionState ConnectionState [get, protected set]
 Gets the current Cvb.ConnectionState of this Device object.
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method. More...
 
EventHandler< PropertyValueChangedEventArgs< IntPtr > > HandleChange
 Fired if the native Handle changes due to an operation. More...
 
EventHandler< ConnectionStateChangeEventArgsConnectionStateChanged
 Event that is fired when the ConnectionState changes.
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Generic CVB physical device.

A device may provide an image stream or just expose a configuration interface.

See DeviceFactory for creating instances of this object.

Constructor & Destructor Documentation

◆ Device()

Device ( IntPtr  handle,
string  resourceLocator 
)
protected

Creates the device from the given CVB object handle .

Parameters
handleHandle to create object from.
resourceLocatorAccess token or rooted path for the device file.

Member Function Documentation

◆ Dispose() [1/2]

void Dispose ( )

IDisposable implementation.

Call this method to release the resources allocated by this device immediately. Remember that after calling Dispose, any subsequent access to references to this image will result in an ObjectDisposedException.

◆ Dispose() [2/2]

virtual void Dispose ( bool  disposing)
protectedvirtual

IDispose helper function.

Parameters
disposingtrue when called via IDisposable.Dispose, false when called by the finalizer.

Reimplemented in EmuDevice, GenICamDevice, VideoDevice, and VinDevice.

Property Documentation

◆ DeviceControl

virtual IDeviceControl DeviceControl
get

Gets the IDeviceControl interface if present.

Object for accessing the interface; null if not available.

◆ DeviceImage

abstract DeviceImage DeviceImage
get

Gets, if available, the device image pointing to the latest synchronized image.

These kind of images are often used for display purposes (e.g. bound to a display's image property.

Even when acquisition is running the returned image object will not change! Only the buffer content changes.

Device image object if applicable to this driver; null if none available. NonStreamingDevices do not have images for instance.

◆ DigitalIO

virtual IDigitalIO DigitalIO
get

Gets the IDigitalIO interface object if present.

Object for accessing the interface; null if not available.

◆ DriverGuid

virtual Guid DriverGuid
get

Get the globally unique identifier of a CVB driver.

GUID of the driver this device resides in.

A CVB driver is everything which implements the IGrabber interface. These can be Video Interface (Vin) drivers or Videos (Avis) or file lists (Emu).

Exceptions
ObjectDisposedExceptionIf this device has already been disposed.

◆ Handle

IntPtr Handle
get

Gets the native CVB object handle.

It is normally not necessary to work with this handle in CVB.Net. Note that using this handle in connection with the legacy CVB managed wrappers may actually be disruptive to your application.

Implements INativeHandle.

◆ ImageRect

virtual IImageRect ImageRect
get

Gets the IImageRect interface object if present.

Object for accessing the interface; null if not available.

◆ IsDisposed

bool IsDisposed
get

Tests if the native handle has already been disposed.

true if this object has beed disposed; false if not.

Implements INativeHandle.

◆ NodeMaps

Gets the dictionary holding all available NodeMaps.

Dictionary containing all available node maps. null if no node map interface is available on this device.

◆ Notify

NotifyDictionary Notify
get

Gets the INotify INotifyObservables if present.

Dictionary containing all available observables. null if no node map interface is available on this device.

◆ RegPort

virtual IRegPort RegPort
get

Gets the register port interface of this device if present.

Object for accessing the interface; null if not available.

◆ ResourceLocator

string ResourceLocator
get

Gets the access token or path of the file name including its extension.

String containing the access token or rooted path for a file name.

◆ SoftwareTrigger

virtual ISoftwareTrigger SoftwareTrigger
get

Gets the ISoftwareTrigger interface object if present.

Object for accessing the interface; null if not available.

◆ Stream

abstract Driver.Stream Stream
get

Convenience property to access the first stream if present.

The first available stream or null otherwise.

◆ TriggerMode

virtual TriggerState TriggerMode
getset

Gets or sets the trigger mode of the device if possible.

Setting the trigger mode is only possible if this value is not TriggerState.NotSupported.

A value of TriggerState.Unknown indicates the trigger mode has not yet been set by the user and is device configuration dependent.

Event Documentation

◆ HandleChange

EventHandler<PropertyValueChangedEventArgs<IntPtr> > HandleChange

Fired if the native Handle changes due to an operation.

You only need to register to this event if you are working directly with the native handle and assigned it to another object.

When this event is being fired, the change is in the middle of the process: all internal management has been changed (including the device Handle), but the old handle is still pointing to a valid object.

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.