Impact Acquire SDK Python
PropertyS Class Reference

A class to represent string properties. More...

Inheritance diagram for PropertyS:
[legend]

Public Member Functions

 __init__ (self, *args)
 Constructs a new unbound mvIMPACT.acquire.PropertyS object.
 
 binaryDataBufferMaxSize (self)
 Reads the max size(in bytes) of binary data this property can store.
 
 binaryDataBufferSize (self, index=0)
 Returns the size(in bytes) needed for the binary representation of the string buffer.
 
 read (self, *args)
 Reads a value from a property.
 
 readBinary (self, *args)
 Reads a value stored in the property as binary data.
 
 write (self, *args)
 Writes one value to the property.
 
 writeBinary (self, *args)
 Writes a block of binary data to one entry of the property.
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

A class to represent string properties.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args )

Constructs a new unbound mvIMPACT.acquire.PropertyS object.

OVERLOAD 1:

OVERLOAD 2: Constructs a new mvIMPACT.acquire.PropertyS object.

Parameters
hProp[in] A valid handle to the string property

OVERLOAD 3: Constructs a new mvIMPACT.acquire.PropertyS from an existing one.

Parameters
src[in] A constant reference to the mvIMPACT.acquire.PropertyS object, this object shall be created from

Reimplemented from Property.

Member Function Documentation

◆ binaryDataBufferMaxSize()

binaryDataBufferMaxSize ( self)

Reads the max size(in bytes) of binary data this property can store.

When binary data shall be stored in a string property, the user will need to allocate memory when this data shall be written to the property. To find out how much binary data can be stored by a property before calling the function mvIMPACT.acquire.PropertyS.writeBinary this function can be used.

See also
mvIMPACT.acquire.PropertyS.readBinary,
mvIMPACT.acquire.PropertyS.writeBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Returns
The size(in bytes) needed for the binary representation of the string buffer.

◆ binaryDataBufferSize()

binaryDataBufferSize ( self,
index = 0 )

Returns the size(in bytes) needed for the binary representation of the string buffer.

When binary data has been stored in a string property it has been stored in Base64 format internally. If the user wants to know the length of the binary data in decoded format, this function can be called.

See also
mvIMPACT.acquire.PropertyS.readBinary,
mvIMPACT.acquire.PropertyS.writeBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Returns
The size(in bytes) needed for the binary representation of the string buffer.
Parameters
index[in] The index of the value for which to query the buffer size(if this property holds more than one value).

◆ read()

read ( self,
* args )

Reads a value from a property.

OVERLOAD 1:

This function queries a single value stored under index index in the property.

Returns
The value stored at index within the property.
Parameters
index[in] The index of the value to read from the property.

OVERLOAD 2: Reads a set of values from a property.

This function queries a set of values from a property and stores these values into sequence.

Parameters
sequence[out] A reference to a container to store the data read from the property into.
start[in] The index from where to start reading values from the property.
end[in] The index where to stop reading values from the property.

OVERLOAD 3: Reads a set of values from a property.

This function queries a set of values from a property and stores these values into sequence.

Parameters
sequence[out] A reference to a container to store the data read from the property into.
start[in] The index from where to start reading values from the property.
end[in] The index where to stop reading values from the property.

OVERLOAD 4: Reads a set of values from a property.

This function queries a set of values from a property and stores these values into sequence.

Parameters
sequence[out] A reference to a container to store the data read from the property into.
start[in] The index from where to start reading values from the property.
end[in] The index where to stop reading values from the property.

◆ readBinary()

readBinary ( self,
* args )

Reads a value stored in the property as binary data.

OVERLOAD 1:

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

Reading binary data with this function obviously only makes sense if the property has been assigned the value by a previous call to mvIMPACT.acquire.PropertyS.writeBinary (here you find a small code example as well). However using this method any kind of data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

See also
mvIMPACT.acquire.PropertyS.writeBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Returns
The binary data representation of the specified property value as a new std.string object.
Parameters
index[in] The index of the value to get(if this property holds more than one value).
boLegacyMode[in] If set to true this allows applications compiled with Impact Acquire 2.32.0 or greater using this function to run on systems with Impact Acquire smaller than 2.32.0. The legacy version of this function runs slower!

OVERLOAD 2: Reads a value stored in the property as binary data.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

Reading binary data with this function obviously only makes sense if the property has been assigned the value by a previous call to mvIMPACT.acquire.PropertyS.writeBinary (here you find a small code example as well). However using this method any kind of data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

See also
mvIMPACT.acquire.PropertyS.writeBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Parameters
pBuf[in] A pointer to a piece of memory that shall receive the binary data stored by the this property.
bufSize[in] The size of the buffer pointed to by pBuf in bytes.
index[in] The index of the value to get(if this property holds more than one value).
boLegacyMode[in] If set to true this allows applications compiled with Impact Acquire 2.32.0 or greater using this function to run on systems with Impact Acquire smaller than 2.32.0. The legacy version of this function runs slower!

OVERLOAD 3: Reads a value stored in the property as binary data.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

Reading binary data with this function obviously only makes sense if the property has been assigned the value by a previous call to mvIMPACT.acquire.PropertyS.writeBinary (here you find a small code example as well). However using this method any kind of data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

See also
mvIMPACT.acquire.PropertyS.writeBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Parameters
pBuf[in] A pointer to a piece of memory that shall receive the binary data stored by the this property.
bufSize[in] The size of the buffer pointed to by pBuf in bytes.
index[in] The index of the value to get(if this property holds more than one value).
boLegacyMode[in] If set to true this allows applications compiled with Impact Acquire 2.32.0 or greater using this function to run on systems with Impact Acquire smaller than 2.32.0. The legacy version of this function runs slower!

OVERLOAD 4: Reads a value stored in the property as binary data.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

Reading binary data with this function obviously only makes sense if the property has been assigned the value by a previous call to mvIMPACT.acquire.PropertyS.writeBinary (here you find a small code example as well). However using this method any kind of data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

See also
mvIMPACT.acquire.PropertyS.writeBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Parameters
pBuf[in] A pointer to a piece of memory that shall receive the binary data stored by the this property.
bufSize[in] The size of the buffer pointed to by pBuf in bytes.
index[in] The index of the value to get(if this property holds more than one value).
boLegacyMode[in] If set to true this allows applications compiled with Impact Acquire 2.32.0 or greater using this function to run on systems with Impact Acquire smaller than 2.32.0. The legacy version of this function runs slower!

◆ write()

write ( self,
* args )

Writes one value to the property.

OVERLOAD 1:

This function writes a single value under index index to the property.

Returns
A const 'self' reference.
Parameters
value[in] The value to write to the property.
index[in] The index defining at which position to write the value.

OVERLOAD 2: Writes a set of values to the property.

This function writes a set of values starting at index to the property.

Returns
A const 'self' reference.
Parameters
sequence[in] An array containing the values to write to the property.
index[in] The index where to write the first value to the property.

OVERLOAD 3: Writes a set of values to the property.

This function writes a set of values starting at index to the property.

Returns
A const 'self' reference.
Parameters
sequence[in] An array containing the values to write to the property.
index[in] The index where to write the first value to the property.

◆ writeBinary()

writeBinary ( self,
* args )

Writes a block of binary data to one entry of the property.

OVERLOAD 1:

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

By writing binary data with this function arbitrary data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

binData = '\x00\xFF\x80\x33'
binaryProp = acquire.PropertyS(getHandleFromSomewhere())
binaryProp.writeBinary(binData)

To find out if a property contains binary data check if mvIMPACT.acquire.cfContainsBinaryData is set e.g. by calling

binaryProp = acquire.PropertyS(getHandleFromSomewhere())
if pseudoBinaryProp.flags() & acquire.cfContainsBinaryData:
# Yes!! Binary data!

Performance considerations:

Impact Acquire 2.15.0 and newer:

  • Base64 encoding/decoding only is performed when read string data previously written as binary data and vice versa.
  • encoding/decoding only is performed if the 2 internal caches are out of sync. so only on the first read access using the other format.
  • this version is more efficient compared to previous implementations.

Impact Acquire versions smaller than 2.15.0

  • Base64 encoding/decoding always is performed when reading/writing data in binary format.
Note
When a property stores binary data that came from a GenICam chunk buffer additional copy operations from the GenApi runtime will take place. This can be considered as an additional copy operation into the application binary buffer. So binary chunk data should be avoided if possible!
See also
mvIMPACT.acquire.PropertyS.readBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Parameters
value[in] A const reference to the string holding the binary data that shall be stored by the this property.
index[in] The index defining at which position to write the value.

OVERLOAD 2: Writes a block of binary data to one entry of the property.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

By writing binary data with this function arbitrary data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

To find out if a property contains binary data check if mvIMPACT.acquire.cfContainsBinaryData is set e.g. by calling

Performance considerations:

Impact Acquire 2.15.0 and newer:

  • Base64 encoding/decoding only is performed when read string data previously written as binary data and vice versa.
  • encoding/decoding only is performed if the 2 internal caches are out of sync. so only on the first read access using the other format.
  • this version is more efficient compared to previous implementations.

Impact Acquire versions smaller than 2.15.0

  • Base64 encoding/decoding always is performed when reading/writing data in binary format.
Note
When a property stores binary data that came from a GenICam chunk buffer additional copy operations from the GenApi runtime will take place. This can be considered as an additional copy operation into the application binary buffer. So binary chunk data should be avoided if possible!
See also
mvIMPACT.acquire.PropertyS.readBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Parameters
pBuf[in] A const pointer to a piece of memory holding the binary data that shall be stored by the this property.
bufSize[in] The size of the buffer pointed to by pBuf in bytes.
index[in] The index defining at which position to write the value.

OVERLOAD 3: Writes a block of binary data to one entry of the property.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

By writing binary data with this function arbitrary data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

To find out if a property contains binary data check if mvIMPACT.acquire.cfContainsBinaryData is set e.g. by calling

Performance considerations:

Impact Acquire 2.15.0 and newer:

  • Base64 encoding/decoding only is performed when read string data previously written as binary data and vice versa.
  • encoding/decoding only is performed if the 2 internal caches are out of sync. so only on the first read access using the other format.
  • this version is more efficient compared to previous implementations.

Impact Acquire versions smaller than 2.15.0

  • Base64 encoding/decoding always is performed when reading/writing data in binary format.
Note
When a property stores binary data that came from a GenICam chunk buffer additional copy operations from the GenApi runtime will take place. This can be considered as an additional copy operation into the application binary buffer. So binary chunk data should be avoided if possible!
See also
mvIMPACT.acquire.PropertyS.readBinary,
mvIMPACT.acquire.PropertyS.binaryDataBufferSize,
mvIMPACT.acquire.PropertyS.binaryDataBufferMaxSize
Parameters
pBuf[in] A const pointer to a piece of memory holding the binary data that shall be stored by the this property.
bufSize[in] The size of the buffer pointed to by pBuf in bytes.
index[in] The index defining at which position to write the value.

Property Documentation

◆ thisown

thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static