CVB.Net 15.0

Read only node to calculate formulas on the client side with integer arithmetic. More...

Inherits IntegerBaseNode, and ISwissKnifeNode< TNode >.

Public Member Functions

 IntSwissKnifeNode (string name)
 Creates a new IntSwissKnifeNode with the given name .
 
 IntSwissKnifeNode (string name, Namespace nameSpace)
 Creates a new IntSwissKnifeNode with the given name and nameSpace .
 
- Public Member Functions inherited from IntegerBaseNode
override void FromString (string value)
 Sets this node's value from the string value .
 
override string ToString ()
 Gets the string representation of this node.
 
- Public Member Functions inherited from ValueNode
void FromString (string value)
 Sets the value of the node from the string value .
 
- Public Member Functions inherited from Node
void Dispose ()
 Disposes the native object wrapped by this object immediately.
 

Protected Member Functions

override void Dispose (bool disposing)
 IDispose helper function.
Parameters
disposingtrue when called via IDisposable.Dispose, false when called by the finalizer.

 
override AccessMode GetAccessMode ()
 Swiss knifes are always read only.
 
override CacheMode GetCacheMode ()
 Here we may have multiple ones and can give no sane answer.
 
override TimeSpan GetPollingTime ()
 Always time span zero as there may be multiple values.
 
- Protected Member Functions inherited from SelectorNode
 SelectorNode (IntPtr handle)
 Creates this SelectorNode object.
 
override void Dispose (bool disposing)
 IDispose helper function.
Parameters
disposingtrue when called via IDisposable.Dispose, false when called by the finalizer.

 
- Protected Member Functions inherited from ValueNode
 ValueNode (IntPtr handle)
 Creates the ValueNode.
 
override void Dispose (bool disposing)
 Additionally disposes of the registered events.
 
TimeSpan GetPollingTime ()
 Gets the polling time for this node.
 
int OnRead ()
 Calls the Read event and returns the ErrorCodes to deliver to the native server.
 
int OnWritten ()
 Calls the Written event and returns the ErrorCodes to deliver to the native server.
 
- Protected Member Functions inherited from Node
 Node (IntPtr handle)
 Creates a node from the given handle .
 
AccessMode GetAccessMode ()
 Implementation for getting the access mode.
 
CacheMode GetCacheMode ()
 Gets the current (dependent) cache mode of this node.
 

Properties

override NodeMap NodeMap [get, set]
 Gets the INodeMap this node resides in.
 
NodeDictionary< IntegerBaseNodeVariables [get]
 Dictionary containing all variables of this node.
 
string Formula [get, set]
 Formula that is evaluated when the value is read.
 
- Properties inherited from IntegerBaseNode
long Increment [get]
 Gets the increment of this Value.
 
long Max [get]
 Gets the maximal allowed number for this Value.
 
long Min [get]
 Gets the minimal allowed number for this Value.
 
NumberRepresentation Representation [get, set]
 Gets or sets how the value is to be represented.
 
string Unit [get]
 Gets the unit of this node's value.
 
long Value [get, set]
 Gets/Sets the value of this integer node.
 
- Properties inherited from SelectorNode
override NodeMap NodeMap [get, set]
 Gets the INodeMap this node resides in.
 
bool IsSelector [get]
 Gets whether this node selects at least one other.
 
ICollection< ValueNodeSelectedNodes [get]
 Gets the collection of all nodes selected by this one.
 
- Properties inherited from ValueNode
virtual bool IsStreamable [get, set]
 Gets or sets whether this node should be used, when the camera settings are stored.
 
TimeSpan PollingTime [get]
 Gets the polling time of this value.
 
- Properties inherited from Node
IntPtr Handle [get]
 Native CVB GevServer Node handle.
 
bool IsDisposed [get]
 Tests whether the native handle has been disposed.
 
virtual NodeMap NodeMap [get, set]
 Gets the parent Cvb.GevServer.NodeMap of this GevServerNode.
 
string ToolTip [get, set]
 Gets or sets the short descriptive text of this node.
 
string Description [get, set]
 Gets or sets the long descriptive text of this node.
 
AccessMode AccessMode [get]
 Gets the GenApi.AccessMode of this node.
 
AccessModeImposedAccessMode [get, set]
 Overrides the node's default AccessMode.
 
IntegerBaseNode IsImplementedConfig [get, set]
 Gets or sets the node that specifies whether a node is implemented in the device or not.
 
IntegerBaseNode IsAvailableConfig [get, set]
 Gets or sets the node that specifies whether a node is currently available or not.
 
IntegerBaseNode IsLockedConfig [get, set]
 Gets or sets the node that specifies whether a node is currently read only or not.
 
CacheMode CacheMode [get]
 Gets the cache mode of this node.
 
Visibility Visibility [get, set]
 Gets or sets the complexity level of this node.
 
Node AliasNode [get, set]
 Gets or sets the node that is an alias value for this node.
 
string Name [get]
 Gets the full name of this node.
 
Namespace Namespace [get]
 Gets the namespace this node is in.
 
bool IsImplemented [get]
 AccessMode helper to check whether this node is implemented.
 
bool IsAvailable [get]
 AccessMode helper to check whether this node is available.
 
bool IsReadable [get]
 AccessMode helper to check whether this node is readable.
 
bool IsWritable [get]
 AccessMode helper to check whether this node is writable.
 
string EventID [get]
 Nodes with an event identifier may become invalidated if an event/message is delivered from the device.
 
bool IsFeature [get]
 Gets whether this node is considered a feature node.
 
bool IsDeprecated [get]
 Gets whether this node is considered deprecated.
 

Additional Inherited Members

- Static Protected Member Functions inherited from Node
static Namespace ParseNamespace (string name)
 Gets the Namespace from the given name .
 
static string ParseName (string name)
 Gets the name part of the given node name .
 
static string EnsureNodeNameOnly (string name)
 Throws if the given name has a namespace prefix.
 
- Events inherited from ValueNode
EventHandler< ReplyStatusEventArgsRead
 This event is fired when the client reads a value.
 
EventHandler< ReplyStatusEventArgsWritten
 This event is fired when the client has written a value.
 
- Events inherited from Node
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
 

Detailed Description

Read only node to calculate formulas on the client side with integer arithmetic.

Due to the integer arithmetic used in this node a Math.Floor(double) operation is performed after each calculation: The computation 2 * (3 / 2) results to two and not three.

See the Formula property for available operations.

Constructor & Destructor Documentation

◆ IntSwissKnifeNode() [1/2]

IntSwissKnifeNode ( string name)

Creates a new IntSwissKnifeNode with the given name .

If the name does not contain a namespace prefix the Namespace.Custom is used.

You must add this node to a NodeMap before most operations are possible.

Parameters
nameName with optional namespace prefix.

◆ IntSwissKnifeNode() [2/2]

IntSwissKnifeNode ( string name,
Namespace nameSpace )

Creates a new IntSwissKnifeNode with the given name and nameSpace .

You must add this node to a NodeMap before most operations are possible.

Parameters
nameNode name without namespace prefix.
nameSpaceNamespace to place the node in.

Member Function Documentation

◆ GetAccessMode()

override AccessMode GetAccessMode ( )
protected

Swiss knifes are always read only.

Returns
AccessMode.RO.

◆ GetCacheMode()

override CacheMode GetCacheMode ( )
protected

Here we may have multiple ones and can give no sane answer.

Returns
CacheMode.NoCache.

◆ GetPollingTime()

override TimeSpan GetPollingTime ( )
protected

Always time span zero as there may be multiple values.

Returns
TimeSpan.Zero.

Property Documentation

◆ Formula

string Formula
getset

Formula that is evaluated when the value is read.

Add the Variables before setting the formula as the formula's validity is checked on set.

The following operations are supported:

(, ) brackets for grouping/overriding operator precedence: 3 * (2 + 3) results to 15.
+, -, *, / addition, subtraction, multiplication and devision: 3 * 7 + 4 / 2 results to 23.
% remainder: 7 % 4 results to 3.
** power: 2 ** 3 results to 8.
&, |, ^, ~ bitwise AND; OR, XOR and NOT: 2 | 1 results to 3.
&&, || logical AND and OR: 1 && 0 results to 0.
<>, =, >, <, <=, >= logical UNEQUAL, EQUAL, GREATER, LESS, LESS OR EQUAL and GREATER OR EQUAL: 3 >= 2 results to 1.
<<, >> shift left and shift right: 1 << 2 results to 4.
? : conditional operator <condition> ? <true case> : <false case>.
SGN Signum function: -1 if value smaller than 0; 0 if value equal to 0; 1 if value greater than 0: SGN(42) results to 1.
NEG Negative function: NEG(-42) results to 42.

Keep in mind that a Math.Floor(double) operation is executed after each calculation. Logical operations result in 1 for true and 0 for false. Any number that is evaluated in a logical true/false condition is true as long as it is not 0.

String containing the formula.

Implements ISwissKnifeNode< TNode >.

◆ Variables

NodeDictionary<IntegerBaseNode> Variables
get

Dictionary containing all variables of this node.

The variable names (the key of the dictionary) must consist only of capitalized alphabetical characters.

Dictionary where the key is the variable name and the value is the node holding the variables value.

Implements ISwissKnifeNode< TNode >.