CVB.Net 14.1
CompositeStreamBase Class Reference

Base class for streams that work with composites. More...

Inherits IStream, and INativeHandle.

Inherited by CompositeStream, ImageStream, and PointCloudStream.

Public Member Functions

void Dispose ()
 IDisposable implementation.
 
void Start ()
 Starts both the engine using EngineStart() and then the device using DeviceStart().
 
void Stop ()
 Stops both the engine using EngineStart() and then the device using DeviceStart().
 
bool TryStop ()
 Tries to stop the Device using TryDeviceStop and then the engine using TryEngineStop(). Does not throw an exception if stopping wasn't successful. More...
 
void Abort ()
 Aborts both the engine using EngineStart() and then the device using DeviceStart().
 
bool TryAbort ()
 Tries to abort the device using TryDeviceAbort and then the engine using TryEngineAbort. Does not throw an exception if aborting wasn't successful. More...
 
virtual void EngineStart ()
 Starts the acquisition engine. This starts continuous acquisition that needs to be stopped via EngineStop(), EngineStop(UsTimeSpan) or EngineAbort.
 
virtual void EngineStart (long bufferCountToAcquire)
 Starts the acquisition engine. More...
 
virtual void EngineStop ()
 Stops the acquisition engine.
 
virtual void EngineStop (UsTimeSpan timeout)
 Stops the acquisition engine. More...
 
virtual bool TryEngineStop ()
 Tries to stop the acquisition engine. Does not throw an exception when engine could not be stopped. More...
 
virtual bool TryEngineStop (UsTimeSpan timeout)
 Tries to stop the acquisition engine. Does not throw an exception when engine could not be stopped. More...
 
virtual void EngineAbort ()
 Aborts the acquisition engine. Does not throw an exception when engine could not be aborted. More...
 
virtual bool TryEngineAbort ()
 Aborts the acquisition engine. More...
 
virtual void DeviceStart ()
 Starts the device acquisition.
 
virtual void DeviceStart (long frameCountToAcquire)
 Starts the device acquisition. More...
 
virtual void DeviceStop ()
 Stops the device acquisition. More...
 
virtual bool TryDeviceStop ()
 Tries to stop the device acquisition. Des not throw an exception when the device could not be stopped. More...
 
virtual void DeviceAbort ()
 Aborts the device acquisition. More...
 
virtual bool TryDeviceAbort ()
 Tries to abort the device acquisition. Does not throw an error if the device could not be aborted. More...
 
void RegisterManagedFlowSetPool (int numFlowSets)
 Registers an internal flow-set pool. More...
 
void DeregisterFlowSetPool ()
 Removes an existing flow set pool from the acquisition engine. More...
 
void Start ()
 Start the acquisition.
 
void Stop ()
 Stops the acquisition.
 
void Abort ()
 Stops the acquisition of images immediately.
 

Static Public Attributes

static readonly UsTimeSpan INFINITY = UsTimeSpan.FromMilliseconds(ENDLESS)
 Constant for infinite time span.
 

Protected Member Functions

 CompositeStreamBase (Device device, int index)
 Constructor More...
 
virtual void Dispose (bool disposing)
 IDisposable helper function. More...
 
IntPtr WaitForNextComposite (UsTimeSpan timeout, out WaitStatus waitStatus)
 Waits for and returns the next composite of the stream. More...
 
IntPtr WaitForNextComposite (UsTimeSpan timeout, CancellationToken token, out WaitStatus waitStatus)
 Waits for and returns the next composite of the stream. More...
 
RegisterComposite< T > (T composite)
 Registers a composite for deregistration on disposal. More...
 

Properties

Device Parent [get]
 Gets the parent Device.
 
IntPtr Handle [get]
 Native handle of the PointCloud.
 
bool IsDisposed [get]
 Gets if the native handle has been disposed.
 
StreamNodeMapDictionary NodeMaps [get]
 Gets the dictionary holding all available GenApi.NodeMaps. More...
 
AcquisitionInterface AcquisitionInterface [get]
 Gets the acquisition interface to use on this stream. Composite streams currently only support AcquisitionInterface.Grab3.
 
bool IsIndexed [get]
 Gets if this stream is indexed (has a fixed amount of data).
 
AcquisitionState AcquisitionState [get, protected set]
 Current acquisition state of the stream.
 
int FlowSetCount [get]
 Gets the number of registered flow sets.
 
int MinRequireedFlowSetCount [get]
 Gets minimum number of flow-sets required for the acquisition. More...
 
- Properties inherited from IStream
AcquisitionInterface AcquisitionInterface [get]
 Gets or sets the acquisition interface to use on this stream.
 
bool IsIndexed [get]
 Gets if this stream is indexed (has a fixed amount of data).
 
- 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...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Base class for streams that work with composites.

Constructor & Destructor Documentation

◆ CompositeStreamBase()

CompositeStreamBase ( Device  device,
int  index 
)
protected

Constructor

Parameters
deviceParent device.
indexIndex of the desired stream on this device.

Member Function Documentation

◆ DeregisterFlowSetPool()

void DeregisterFlowSetPool ( )

Removes an existing flow set pool from the acquisition engine.

This call is only allowed when the acquisition engine is not running.

Removing the flow set pool can be useful in between changes of FlowSetCount to reduce memory.

◆ DeviceAbort()

virtual void DeviceAbort ( )
virtual

Aborts the device acquisition.

Exceptions
CvbExceptionWhen an error during abortion occurs.

◆ DeviceStart()

virtual void DeviceStart ( long  frameCountToAcquire)
virtual

Starts the device acquisition.

Parameters
frameCountToAcquireNumber of buffers to acquire before stopping. ENDLESS for endless.
Exceptions
CvbExceptionWhen an error during starting occurs.

◆ DeviceStop()

virtual void DeviceStop ( )
virtual

Stops the device acquisition.

Exceptions
CvbExceptionWhen an error during stopping occurs.

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDisposable helper function.

Parameters
disposing

◆ EngineAbort()

virtual void EngineAbort ( )
virtual

Aborts the acquisition engine. Does not throw an exception when engine could not be aborted.

Exceptions
CvbExceptionWhen an error occurs during engine abort.

◆ EngineStart()

virtual void EngineStart ( long  bufferCountToAcquire)
virtual

Starts the acquisition engine.

Parameters
bufferCountToAcquireNumber of buffers to acquire before stopping. ENDLESS for endless until EngineStop(), EngineStop(UsTimeSpan) or EngineAbort is called.
Exceptions
CvbExceptionWhen an error during starting occurs.

◆ EngineStop()

virtual void EngineStop ( UsTimeSpan  timeout)
virtual

Stops the acquisition engine.

Parameters
timeoutTime to wait for the last data to be acquired.
Exceptions
CvbExceptionWhen an error occurs during engine stop. Error can only occur when in a state other than AcquisitionState.Started.

◆ RegisterComposite< T >()

T RegisterComposite< T > ( composite)
protected

Registers a composite for deregistration on disposal.

Template Parameters
TReturned composite type.
Parameters
compositeComposite to register.
Returns
The given composite .
Type Constraints
T :INativeHandle 

◆ RegisterManagedFlowSetPool()

void RegisterManagedFlowSetPool ( int  numFlowSets)

Registers an internal flow-set pool.

Creates an internal flow-set pool with numFlowSets flow-sets. Any previously registered flow-set pool will be deregistered.

To reduce memory consumption call DeregisterFlowSetPool before this call as first the new memory is created to be exception safe.

Parameters
numFlowSetsNumber of flow-sets to allocate.

◆ TryAbort()

bool TryAbort ( )

Tries to abort the device using TryDeviceAbort and then the engine using TryEngineAbort. Does not throw an exception if aborting wasn't successful.

Returns
True if aborting was successful, false otherwise.

◆ TryDeviceAbort()

virtual bool TryDeviceAbort ( )
virtual

Tries to abort the device acquisition. Does not throw an error if the device could not be aborted.

Returns
True if device was aborted, false otherwise.

◆ TryDeviceStop()

virtual bool TryDeviceStop ( )
virtual

Tries to stop the device acquisition. Des not throw an exception when the device could not be stopped.

Returns
True if device was stopped, false otherwise.

◆ TryEngineAbort()

virtual bool TryEngineAbort ( )
virtual

Aborts the acquisition engine.

Returns
True if the engine was aborted, false otherwise.

◆ TryEngineStop() [1/2]

virtual bool TryEngineStop ( )
virtual

Tries to stop the acquisition engine. Does not throw an exception when engine could not be stopped.

Returns
True if engine was stopped, false otherwise.

◆ TryEngineStop() [2/2]

virtual bool TryEngineStop ( UsTimeSpan  timeout)
virtual

Tries to stop the acquisition engine. Does not throw an exception when engine could not be stopped.

Parameters
timeoutTime to wait for the last data to be acquired.
Returns
True if engine was stopped, false otherwise.

◆ TryStop()

bool TryStop ( )

Tries to stop the Device using TryDeviceStop and then the engine using TryEngineStop(). Does not throw an exception if stopping wasn't successful.

Returns
True if stopping was successful, false otherwise.

◆ WaitForNextComposite() [1/2]

IntPtr WaitForNextComposite ( UsTimeSpan  timeout,
CancellationToken  token,
out WaitStatus  waitStatus 
)
protected

Waits for and returns the next composite of the stream.

Parameters
timeoutTime to wait before timeout.
tokenToken to cancel the operation.
waitStatusReturn status of the operation.
Returns
Acquired composite.
Exceptions
ArgumentNullExceptionWhen token is null.

◆ WaitForNextComposite() [2/2]

IntPtr WaitForNextComposite ( UsTimeSpan  timeout,
out WaitStatus  waitStatus 
)
protected

Waits for and returns the next composite of the stream.

Parameters
timeoutTime to wait before timeout.
waitStatusReturn status of the operation.
Returns
Acquired composite.

Property Documentation

◆ MinRequireedFlowSetCount

int MinRequireedFlowSetCount
get

Gets minimum number of flow-sets required for the acquisition.

The count is as reported by the underlying transport layer provider and will at least be 3.

◆ NodeMaps

Gets the dictionary holding all available GenApi.NodeMaps.

Dictionary containing all available node maps.

Event Documentation

◆ 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.