CVB.Net 14.0
GevServer Class Reference

Common Vision Blox GigE Vision Server implements a GigE Vision camera in software. More...

Inherits INativeHandle.

Public Member Functions

 GevServer ()
 Creates a non-streaming GigE Vision server object. More...
 
void Dispose ()
 Disposes the native object wrapped by this object immediately. More...
 
void Start (IPAddress address)
 Starts this server and binds it to the given address . More...
 
void Stop ()
 Stops this server. More...
 

Static Public Member Functions

static GevServer CreateWithConstSize (Size2D size, ColorModel colorModel, DataType dataType, DriverType driverType=DriverType.Auto)
 Creates a new GevServer object with a constant width and height. More...
 
static GevServer CreateWithConstSize (Size2D size, PfncFormat pixelFormat, DriverType driverType=DriverType.Auto)
 Creates a new GevServer object with a constant width and height. More...
 
static GevServer CreateWithVariableSize (Size2D maxSize, ColorModel colorModel, DataType dataType, DriverType driverType=DriverType.Auto)
 Creates a new GevServer object with a client configurable width, height and offsets. More...
 
static GevServer CreateWithVariableSize (Size2D maxSize, PfncFormat pixelFormat, DriverType driverType=DriverType.Auto)
 Creates a new GevServer object with a client configurable width, height and offsets. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 IDispose helper function. More...
 

Properties

IntPtr Handle [get]
 Native CVB GevServer handle. More...
 
bool IsDisposed [get]
 Tests whether the native handle has been disposed.
 
GevServerState State [get]
 Gets the the current state this server is in. More...
 
DriverType DriverType [get]
 Gets the GigE Vision driver used by this server object.
 
string UserVersion [get, set]
 Gets or sets the user defined version that is appended to the device version. More...
 
IPEndPoint LocalEndPoint [get]
 Gets the local end point this server is bound to. More...
 
IPEndPoint RemoteEndPoint [get]
 Gets the remote end point this server is connected to. More...
 
NodeMap NodeMap [get]
 Gets this GevServer Cvb.GevServer.NodeMap.
 
Stream Stream [get]
 Gets the Cvb.GevServer.Stream for sending Images or other data. More...
 
- 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< GevServerStateChangedEventArgsStateChanged
 Fired when the State changes. More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Common Vision Blox GigE Vision Server implements a GigE Vision camera in software.

Constructor & Destructor Documentation

◆ GevServer()

GevServer ( )

Creates a non-streaming GigE Vision server object.

For stream-capable variants see CreateWithConstSize(Size2D, ColorModel, DataType, DriverType) or CreateWithVariableSize(Size2D, ColorModel, DataType, DriverType).

You can use this server for pure communication use cases via the GenApi (think e.g. of a lighting controller or motor lens).

Member Function Documentation

◆ CreateWithConstSize() [1/2]

static GevServer CreateWithConstSize ( Size2D  size,
ColorModel  colorModel,
DataType  dataType,
DriverType  driverType = DriverType.Auto 
)
static

Creates a new GevServer object with a constant width and height.

Tries to map the given colorModel and dataType to a PfncFormat.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in GevServerState.Configuration State.

Parameters
sizeWidth and height in pixels.
colorModelColor model of the image to send.
dataTypeCVB data type of the image to send.
driverTypeThe DriverType to use.
Returns
Newly created server object in GevServerState.Configuration state.

◆ CreateWithConstSize() [2/2]

static GevServer CreateWithConstSize ( Size2D  size,
PfncFormat  pixelFormat,
DriverType  driverType = DriverType.Auto 
)
static

Creates a new GevServer object with a constant width and height.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in GevServerState.Configuration State.

Parameters
sizeWidth and height in pixels.
pixelFormatGenICam PFNC format value.
driverTypeThe DriverType to use.
Returns
Newly created server object in GevServerState.Configuration state.

◆ CreateWithVariableSize() [1/2]

static GevServer CreateWithVariableSize ( Size2D  maxSize,
ColorModel  colorModel,
DataType  dataType,
DriverType  driverType = DriverType.Auto 
)
static

Creates a new GevServer object with a client configurable width, height and offsets.

Tries to map the given colorModel and dataType to a PfncFormat.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in GevServerState.Configuration State.

Parameters
maxSizeMaximal width and height in pixels.
colorModelColor model of the image to send.
dataTypeCVB data type of the image to send.
driverTypeThe DriverType to use.
Returns
Newly created server object in GevServerState.Configuration state.

◆ CreateWithVariableSize() [2/2]

static GevServer CreateWithVariableSize ( Size2D  maxSize,
PfncFormat  pixelFormat,
DriverType  driverType = DriverType.Auto 
)
static

Creates a new GevServer object with a client configurable width, height and offsets.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in GevServerState.Configuration State.

Parameters
maxSizeMaximal width and height in pixels.
pixelFormatGenICam PFNC format value.
driverTypeThe DriverType to use.
Returns
Newly created server object in GevServerState.Configuration state.

◆ Dispose() [1/2]

void Dispose ( )

Disposes the native object wrapped by this object immediately.

Call this method to release the resources allocated by this node 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.

◆ Start()

void Start ( IPAddress  address)

Starts this server and binds it to the given address .

All communication channels are bound and the GenApi XML description is generated.

On success the state changes to GevServerState.Disconnected.

Parameters
addressIP address version 4 to bind to.

◆ Stop()

void Stop ( )

Stops this server.

Stopping the server results, depending on the current state, in a chain from GevServerState.AcquisitionEnabled to GevServerState.Connected to GevServerState.Disconnected to GevServerState.Configuration.

Property Documentation

◆ Handle

IntPtr Handle
get

Native CVB GevServer 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.

◆ LocalEndPoint

IPEndPoint LocalEndPoint
get

Gets the local end point this server is bound to.

This value is only set if State is not GevServerState.Configuration.

IPEndPoint containing the current IPAddress and port. null if not bound.

◆ RemoteEndPoint

IPEndPoint RemoteEndPoint
get

Gets the remote end point this server is connected to.

This value is only set if State is GevServerState.Connected or GevServerState.AcquisitionEnabled.

IPEndPoint containing the current IPAddress and port. null if not connected.

◆ State

GevServerState State
get

Gets the the current state this server is in.

Access to this property is thread-safe.

◆ Stream

Gets the Cvb.GevServer.Stream for sending Images or other data.

This property is only non-null if you created the server object via CreateWithConstSize(Size2D, ColorModel, DataType, DriverType) or CreateWithVariableSize(Size2D, ColorModel, DataType, DriverType).

The Cvb.GevServer.Stream object if this server object is streaming capable; null for non-streaming server.

◆ UserVersion

string UserVersion
getset

Gets or sets the user defined version that is appended to the device version.

This property is mandatory as soon as you change anything about the GenApi nodes! As the GenApi XML description is auto-generated the client needs a way to distinguish between different GevServer instances with differing feature sets.

If you change anything about the GenApi nodes on certain user version, you must increase the NodeMap.XmlFileVersion.

This version information is appended to the CVGevServer version. The available memory for the overall information is limited by the GigE Vision standard to 32 bytes which results in up to 31 ASCII characters text (actual encoding is UTF-8) as strings must be nul-terminated. Longer version information is silently cropped!

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.

◆ StateChanged

EventHandler<GevServerStateChangedEventArgs> StateChanged

Fired when the State changes.

State changes on the server side can only happen through the Start and Stop methods. All other state changes originate from the remote client.