Ensenso::NxLibItem¶
- class Ensenso.NxLibItem¶
This class simplifies the concatenation of string and integer constants to an NxLib compatible item path specification via its
operator[]
. Assignment and comparison operators simplify the usage of NxLib tree items, almost as if using local variables.In contrast to the C++ implementation of NxLibItem the C# version does not supply assignment and comparison operators because of operator overloading restrictions in C#.
Public Functions
- NxLibItem (string path = "")¶
Constructor.
- Param path
The path to a node of the tree, which is going to be referenced.
- void checkReturnCode (int returnCode)¶
Checks the given return code and throws an NxLibException if its value is not
NxLib.OperationSucceeded
.Throws NxLibException.
- Param returnCode
The return code to be checked.
- int Compare (int value)¶
Compares the item’s value to an integer.
Throws NxLibException if the item does not exist or the item type is not compatible.
- Param value
The value to compare the item’s value with.
- Return
-1
If the item’s value is smaller than the constant.0
If the values are equal.1
If the item’s value is larger than the constant.
- int Compare (out int returnCode, int value)
Compares the item’s value to an integer.
- Param returnCode
The return code of the operation.
- Param value
The value to compare the item’s value with.
- Return
-1
If the item’s value is smaller than the constant.0
If the values are equal.1
If the item’s value is larger than the constant.2
If the item does not exist or the item type is not compatible.
- int Compare (string value)
Compares the item’s value to a string.
Throws NxLibException if the item does not exist or the item type is not compatible.
- Param value
The value to compare the item’s value with.
- Return
0
If the values are equal.1
If the values are not equal.
- int Compare (out int returnCode, string value)
Compares the item’s value to a string.
- Param returnCode
The return code of the operation.
- Param value
The value to compare the item’s value with.
- Return
0
If the values are equal.1
If the values are not equal.2
If the item does not exist or the item type is not compatible.
- int Compare (double value)
Compares the item’s value to a double.
Throws NxLibException if the item does not exist or the item type is not compatible.
- Param value
The value to compare the item’s value with.
- Return
-1
If the item’s value is smaller than the constant.0
If the values are equal.1
If the item’s value is larger than the constant.
- int Compare (out int returnCode, double value)
Compares the item’s value to a double.
- Param returnCode
The return code of the operation.
- Param value
The value to compare the item’s value with.
- Return
-1
If the item’s value is smaller than the constant.0
If the values are equal.1
If the item’s value is larger than the constant.2
If the item does not exist or the item type is not compatible.
- int Compare (bool value)
Compares the item’s value to a boolean.
Throws NxLibException if the item does not exist or the item type is not compatible.
- Param value
The value to compare the item’s value with.
- Return
0
If the values are equal.1
If the values are not equal.
- int Compare (out int returnCode, bool value)
Compares the item’s value to a boolean.
- Param returnCode
The return code of the operation.
- Param value
The value to compare the item’s value with.
- Return
0
If the values are equal.1
If the values are not equal.2
If the item does not exist or the item type is not compatible.
- void Set (int value)¶
Sets an item to the specified integer value.
The resulting item will be of type Number.
Throws NxLibException.
- Param value
The value to set.
- void Set (out int returnCode, int value)
Sets an item to the specified integer value.
The resulting item will be of type Number.
- Param returnCode
The return code of the operation.
- Param value
The value to set.
- void Set (double value)
Sets an item to the specified floating point value.
The resulting item will be of type Number.
Throws NxLibException.
- Param value
The value to set.
- void Set (out int returnCode, double value)
Sets an item to the specified floating point value.
The resulting item will be of type Number.
- Param returnCode
The return code of the operation.
- Param value
The value to set.
- void Set (bool value)
Sets an item to the specified boolean value.
The resulting item will be of type Boolean.
Throws NxLibException.
- Param value
The value to set.
- void Set (out int returnCode, bool value)
Sets an item to the specified boolean value.
The resulting item will be of type Boolean.
- Param returnCode
The return code of the operation.
- Param value
The value to set.
- void Set (string value)
Sets an item to the specified string.
The resulting item will be of type String.
Throws NxLibException.
- Param value
The value to set.
- void Set (out int returnCode, string value)
Sets an item to the specified string.
The resulting item will be of type String.
- Param returnCode
The return code of the operation.
- Param value
The value to set.
- void SetNull ()¶
Sets an item to the value Null.
Throws NxLibException.
- void SetNull (out int returnCode)
Sets an item to the value Null.
- Param returnCode
The return code of the operation.
- void SetJson (string value, bool onlyWriteableNodes = false)¶
Sets an item to the given JSON value.
The value itself might be an entire tree structure which will be placed under the specified node.
Throws NxLibException.
- Param value
The value to set.
- Param onlyWriteableNodes
Whether the function should try to write each single node into the existing tree structure instead of replacing the entire subtree. When specifying true here the function will not complain if certain nodes could not be written due to access restrictions. This can be used to restore the state of the library or the Parameters node of a camera if the tree state has previously been captured via
AsJson()
. When this parameter is set to false, all items of the entire subtree must not be access restricted in order for the function call to succeed! If this parameter is set and the given JSON value does not match the current structure of the node, the function will return the error codeNxLib.ItemTypeNotCompatible
. This indicates, that there was not a single node with the same structure as in the JSON string and the function could never modify any value. In this case you probably tried to apply the JSON value to the wrong path.
- void SetJson (out int returnCode, string value, bool onlyWriteableNodes = false)
Sets an item to the given JSON value.
The value itself might be an entire tree structure which will be placed under the specified node.
- Param returnCode
The return code of the operation.
- Param value
The value to set.
- Param onlyWriteableNodes
See the corresponding parameter of
SetJson()
.
- bool IsNull ()¶
Returns whether the item is of type Null or not.
Throws NxLibException.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsNull (out int returnCode)
Returns whether the item is of type Null or not.
- Param returnCode
The return code of the operation.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsString ()¶
Returns whether the item is of type String or not.
Throws NxLibException.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsString (out int returnCode)
Returns whether the item is of type String or not.
- Param returnCode
The return code of the operation.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsNumber ()¶
Returns whether the item is of type Number or not.
Throws NxLibException.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsNumber (out int returnCode)
Returns whether the item is of type Number or not.
- Param returnCode
The return code of the operation.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsBool ()¶
Returns whether the item is of type Bool or not.
Throws NxLibException.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsBool (out int returnCode)
Returns whether the item is of type Bool or not.
- Param returnCode
The return code of the operation.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsArray ()¶
Returns whether the item is of type Array or not.
Throws NxLibException.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsArray (out int returnCode)
Returns whether the item is of type Array or not.
- Param returnCode
The return code of the operation.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsObject ()¶
Returns whether the item is of type Object or not.
Throws NxLibException.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- bool IsObject (out int returnCode)
Returns whether the item is of type Object or not.
- Param returnCode
The return code of the operation.
- Return
True if the item was of the corresponding JSON type, otherwise false.
- string AsString ()¶
Tries to read a string from this tree item.
Throws NxLibException.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- string AsString (out int returnCode)
Tries to read a string from this tree item.
- Param returnCode
The return code of the operation.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- int AsInt ()¶
Tries to read an integer number from this tree item.
Throws NxLibException.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- int AsInt (out int returnCode)
Tries to read an integer number from this tree item.
- Param returnCode
The return code of the operation.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- double AsDouble ()¶
Tries to read a double value from this tree item.
Throws NxLibException.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- double AsDouble (out int returnCode)
Tries to read a double value from this tree item.
- Param returnCode
The return code of the operation.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- bool AsBool ()¶
Tries to read a boolean value from this tree item.
Throws NxLibException.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- bool AsBool (out int returnCode)
Tries to read a boolean value from this tree item.
- Param returnCode
The return code of the operation.
- Return
The item value if the item was of the corresponding JSON type. Otherwise the return value is undefined.
- string AsJson ()¶
Tries to read this tree item and return its JSON representation.
Throws NxLibException.
- string AsJson (bool prettyPrint)
Tries to read this tree item and return its JSON representation.
Throws NxLibException.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- string AsJson (bool prettyPrint, int numberPrecision)
Tries to read this tree item and return its JSON representation.
Throws NxLibException.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- Param numberPrecision
The accuracy of numbers.
- string AsJson (bool prettyPrint, int numberPrecision, bool allowScientificFormat)
Tries to read this tree item and return its JSON representation.
Throws NxLibException.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- Param numberPrecision
The accuracy of numbers.
- Param allowScientificFormat
Whether to allow scientific notation.
- Return
The item value as JSON string if the item exists. This might also be an entire subtree in JSON representation!
- string AsJson (out int returnCode, bool prettyPrint = false, int numberPrecision = 18, bool allowScientificFormat = false)
Tries to read this tree item and return its JSON representation.
- Param returnCode
The error code when accessing the item.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- Param numberPrecision
The accuracy of numbers.
- Param allowScientificFormat
Whether to allow scientific notation.
- Return
The item value as JSON string if the item exists. This might also be an entire subtree in JSON representation!
- string AsJsonMeta ()¶
Retrieves an item value or an entire subtree in JSON representation including item metadata (protection, extended type, internal flags).
This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
Throws NxLibException.
- string AsJsonMeta (int numLevels)
Retrieves an item value or an entire subtree in JSON representation including item metadata (protection, extended type, internal flags).
This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
Throws NxLibException.
- Param numLevels
The depth of the returned subtree.
- string AsJsonMeta (int numLevels, bool prettyPrint)
Retrieves an item value or an entire subtree in JSON representation including item metadata (protection, extended type, internal flags).
This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
Throws NxLibException.
- Param numLevels
The depth of the returned subtree.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- string AsJsonMeta (int numLevels, bool prettyPrint, int numberPrecision)
Retrieves an item value or an entire subtree in JSON representation including item metadata (protection, extended type, internal flags).
This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
Throws NxLibException.
- Param numLevels
The depth of the returned subtree.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- Param numberPrecision
The accuracy of numbers.
- string AsJsonMeta (int numLevels, bool prettyPrint, int numberPrecision, bool allowScientificFormat)
Retrieves an item value or an entire subtree in JSON representation including item metadata(protection, extended type, internal flags).
This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
Throws NxLibException.
- Param numLevels
The depth of the returned subtree.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- Param numberPrecision
The accuracy of numbers.
- Param allowScientificFormat
Whether to allow scientific notation.
- Return
The item value as JSON string with meta data if the item exists.
- string AsJsonMeta (out int returnCode, int numLevels = -1, bool prettyPrint = false, int numberPrecision = 18, bool allowScientificFormat = true)
Retrieves an item value or an entire subtree in JSON representation including item metadata(protection, extended type, internal flags).
This function is only intended to be used by NxTreeEdit to visualize the entire tree state.
- Param returnCode
The error code when accessing the item.
- Param numLevels
The depth of the returned subtree.
- Param prettyPrint
Whether to format the JSON string with line breaks and tabs.
- Param numberPrecision
The accuracy of numbers.
- Param allowScientificFormat
Whether to allow scientific notation.
- Return
The item value as JSON string with meta data if the item exists.
- int Type ()¶
Retrieves the item type of a tree item.
Throws NxLibException.
- Return
The enum type of this item.
NxLib.ItemTypeInvalid
An error occurred, refer to the result parameter for further information.NxLib.ItemTypeNull
The item is of type Null.NxLib.ItemTypeNumber
The item is a number. This can be an integer or floating point value.NxLib.ItemTypeString
The item is a string.NxLib.ItemTypeBool
The item is a boolean value.NxLib.ItemTypeArray
The item is an array. The number of array elements can be queried withCount()
. The array can be empty.NxLib.ItemTypeObject
The item is an object. The number of children can be queried withCount()
. The object can be empty.
- int Type (out int returnCode)
Retrieves the item type of a tree item.
- Param returnCode
The error code when accessing the item.
- Return
The enum type of this item. See
Type()
for available types.
- bool Exists ()¶
Returns whether an item with the corresponding path exists in the tree.
Throws NxLibException.
- Return
True if the item exists, false otherwise.
- bool Exists (out int returnCode)
Returns whether an item with the corresponding path exists in the tree.
- Param returnCode
The error code when accessing the item.
- Return
True if the item exists, false otherwise.
- void Erase ()¶
Erase an item or subtree.
Throws NxLibException.
- void Erase (out int returnCode)
Erases an item or subtree.
- Param returnCode
The error code when accessing the item.
- string Name ()¶
Retrieves string of an item.
This function is intended to be used to enumerate subitems of an object. The subitems can be accessed by the index notation, then the corresponding names can be queried with
Name()
.Throws NxLibException.
- Return
The item’s name.
- string Name (out int returnCode)
Retrieves string of an item.
This function is intended to be used to enumerate subitems of an Object. The subitems can be accessed by the index notation, then the corresponding names can be queried with
Name()
.- Param returnCode
The error code when accessing the item.
- Return
The item’s name.
- int Count ()¶
Retrieves the number of subitems of an object or the number of elements of an array item. In case of a binary item its data size in bytes is returned.
Retrieves the number of subitems of an object or Array. Calling the function on scalar nodes will return an error.
Calling this function on a binary node will retrieve the binary data size in bytes, but it is recommended to use
GetBinaryDataInfo()
instead to get and verify all format properties of the binary blob before retrieving it.Throws NxLibException.
- Return
The number of subitems.
- int Count (out int returnCode)
Retrieves the number of subitems of an object or the number of elements of an array item. In case of a binary item its data size in bytes is returned.
Retrieves the number of subitems of an object or Array. Calling the function on scalar nodes will return an error.
Calling this function on a binary node will retrieve the binary data size in bytes, but it is recommended to use
GetBinaryDataInfo()
instead to get and verify all format properties of the binary blob before retrieving it.- Param returnCode
The error code when accessing the item.
- Return
The number of subitems.
- void GetBinaryDataInfo (out int width, out int height, out int channels, out int bytesPerElement, out bool isFloat, out double timestamp)¶
Reads the properties of a binary node.
Throws NxLibException.
- Param width
Width of the image.
- Param height
Height of the image.
- Param channels
Number of channels, i.e. elements per pixels.
- Param bytesPerElement
Size of each element.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- Param timestamp
Timestamp when the binary blob was generated.
- void GetBinaryDataInfo (out int returnCode, out int width, out int height, out int channels, out int bytesPerElement, out bool isFloat, out double timestamp)
Reads the properties of a binary node.
- Param returnCode
The error code when accessing the item.
- Param width
Width of the image.
- Param height
Height of the image.
- Param channels
Number of channels, i.e. elements per pixels.
- Param bytesPerElement
Size of each element.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- Param timestamp
Timestamp when the binary blob was generated.
- void GetBinaryData<T> (out T[] destinationBuffer, out int numBytesCopied, out double timestamp)¶
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
Throws NxLibException.
- Tparam T
Type of the items in the
destinationBuffer
.- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryData<T> (out int returnCode, out T[] destinationBuffer, out int numBytesCopied, out double timestamp)
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
- Tparam T
Type of the items in the
destinationBuffer
.- Param returnCode
The error code when accessing the item.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryDataByte (out byte[] destinationBuffer, out int numBytesCopied, out double timestamp)¶
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
Throws NxLibException.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryDataShort (out short[] destinationBuffer, out int numBytesCopied, out double timestamp)¶
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
Throws NxLibException.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryDataFloat (out float[] destinationBuffer, out int numBytesCopied, out double timestamp)¶
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
Throws NxLibException.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryDataByte (out int result, out byte[] destinationBuffer, out int numBytesCopied, out double timestamp)
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
- Param result
The error code when accessing the item.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryDataShort (out int result, out short[] destinationBuffer, out int numBytesCopied, out double timestamp)
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
- Param result
The error code when accessing the item.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void GetBinaryDataFloat (out int result, out float[] destinationBuffer, out int numBytesCopied, out double timestamp)
Retrieves data of a binary item.
This function returns the binary item data in an array. The array object will be automatically resized to fit the data. If the binary data size is not divisible by the vector element size, an error will be returned.
- Param result
The error code when accessing the item.
- Param destinationBuffer
The array where the binary data will be copied to. The function will take care of allocating an array object of sufficient size.
- Param numBytesCopied
Number of bytes copied to the
destinationBuffer
.- Param timestamp
Timestamp when the binary blob was generated. Can be set to zero when the time stamp should not be retrieved.
- void SetBinaryData<T> (T[] buffer)¶
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Tparam T
Type of the items in the
buffer
.- Param buffer
An array from which the binary data should be copied.
- void SetBinaryData<T> (out int returnCode, T[] buffer)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Tparam T
Type of the items in the
buffer
.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryDataByte (byte[] buffer)¶
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryDataShort (short[] buffer)¶
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryDataFloat (float[] buffer)¶
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryDataByte (out int returnCode, byte[] buffer)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryDataShort (out int returnCode, short[] buffer)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryDataFloat (out int returnCode, float[] buffer)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- void SetBinaryData<T> (T[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Tparam T
Type of the items in the
buffer
.- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryData<T> (out int returnCode, T[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Tparam T
Type of the items in the
buffer
.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryDataByte (byte[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryDataShort (short[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryDataFloat (float[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.Throws NxLibException.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryDataByte (out int returnCode, byte[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryDataShort (out int returnCode, short[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void SetBinaryDataFloat (out int returnCode, float[] buffer, int width, int height, int channelCount, bool isFloat)
Sets data of a binary item.
The data format must be identical to the current format of the binary node. The current format can be queried using
GetBinaryDataInfo()
. The time stamp of the node will be set to the current UTC time.- Param returnCode
The error code when accessing the item.
- Param buffer
An array from which the binary data should be copied.
- Param width
Width of the Image.
- Param height
Height of the Image.
- Param channelCount
Amount of Channels.
- Param isFloat
Whether elements are an IEEE float type of the corresponding size.
- void WaitForChange ()¶
Blocks until the item’s value changes.
Throws NxLibException.
- void WaitForType (int type, bool waitForEqual)¶
Waits for a type change to the specified item.
When the condition to wait for is already satisfied initially, the function returns immediately.
Throws NxLibException.
- Param type
The type constant to wait for. See
Type()
for valid types.- Param waitForEqual
Whether to wait until the item has the indicated type, or whether to wait until the item has a type other than the specified one.
- void WaitForType (out int returnCode, int type, bool waitForEqual)
Waits for a type change to the specified item.
When the condition to wait for is already satisfied initially, the function returns immediately.
- Param returnCode
The error code when accessing the item.
- Param type
The type constant to wait for. See
Type()
for valid types.- Param waitForEqual
Whether to wait until the item has the indicated type, or whether to wait until the item has a type other than the specified one.
- void WaitForValue (int value, bool waitForEqual)¶
Waits for specific integer value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
Throws NxLibException.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- void WaitForValue (out int returnCode, int value, bool waitForEqual)
Waits for specific integer value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
- Param returnCode
The error code when accessing the item.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- void WaitForValue (double value, bool waitForEqual)
Waits for specific double value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
Throws NxLibException.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- void WaitForValue (out int returnCode, double value, bool waitForEqual)
Waits for specific double value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
- Param returnCode
The error code when accessing the item.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- void WaitForValue (bool value, bool waitForEqual)
Waits for specific boolean value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
Throws NxLibException.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- void WaitForValue (out int returnCode, bool value, bool waitForEqual)
Waits for specific boolean value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
- Param returnCode
The error code when accessing the item.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- void WaitForValue (string value, bool waitForEqual)
Waits for specific string value of an item.
When the condition to wait for is already satisfied initially, the function returns immediately.
Throws NxLibException.
- Param value
The value to wait for.
- Param waitForEqual
Whether to wait until the item has the given value, or whether to wait until the item has a value different than the specified one.
- NxLibItem MakeUniqueItem (string itemName = "")¶
Checks whether the item name is taken. If yes, the item gets a new unique name.
Usually used to create a temporary unique NxLibItem as slot for an NxLibCommand.
Throws NxLibException.
- Param itemName
The base name of the item. Defaults to Temporary if left empty.
- Return
A unique NxLibItem.
- NxLibItem MakeUniqueItem (out int returnCode, string itemName = "")
Checks whether the item name is taken. If yes, the item gets a new unique name.
Usually used to create a temporary unique NxLibItem as slot for an NxLibCommand.
- Param returnCode
The error code when accessing the item.
- Param itemName
The base name of the item. Defaults to Temporary if left empty.
- Return
A unique NxLibItem.
Public Members
- string path¶
The path to the referenced node of the tree.