Impact Acquire SDK Python
Property Class Reference

A base class for properties. More...

Inheritance diagram for Property:
[legend]

Public Member Functions

 __init__ (self, *args)
 Constructs a new unbound mvIMPACT.acquire.Property object.
 
 dictSize (self)
 Returns the size of the properties translation dictionary.
 
 getAllowsValueCombinations (self)
 Checks if this enumerated property allows the combination of enum values.
 
 getHasDict (self)
 Returns whether this property defines a translation dictionary or not.
 
 getHasMaxValue (self)
 Checks if a maximum value is defined for this property.
 
 getHasMinValue (self)
 Checks if a minimum value is defined for this property.
 
 getHasStepWidth (self)
 Checks if a step width is defined for this property.
 
 maxValCount (self)
 Returns maximum number of values that can be managed by this property.
 
 readS (self, *args)
 Reads data from this property as a string.
 
 readSArray (self, *args)
 Reads data from this property as a string.
 
 removeValue (self, index=0)
 Removes a certain value from the property's data.
 
 resizeValArray (self, newSize)
 Resizes the property's data array.
 
 stringFormatString (self)
 Returns the internal format string this property uses to convert data to strings.
 
 valCount (self)
 Returns the current number of values managed by this property.
 
 writeS (self, *args)
 Assigns a new value to this property.
 

Properties

 allowsValueCombinations = property (getAllowsValueCombinations, None, None, None)
 A bool property (read-only) which checks if this enumerated property allows the combination of enum values.
 
 hasDict = property (getHasDict, None, None, None)
 A bool property (read-only) which checks whether this property defines a translation dictionary or not.
 
 hasMaxValue = property (getHasMaxValue, None, None, None)
 A bool property (read-only) which checks if a maximum value is defined for this property.
 
 hasMinValue = property (getHasMinValue, None, None, None)
 A bool property (read-only) which checks if a minimum value is defined for this property.
 
 hasStepWidth = property (getHasStepWidth, None, None, None)
 A bool property (read-only) which checks if a step width is defined for this property.
 
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

A base class for properties.

A property can be used to represent certain values like e.g. the input channel of a device. Depending on the way the property has been created it is either possible to read and write data to it or ( when the mvIMPACT.acquire.cfWriteAccess flag is NOT set ) just to read the data. In rare cases it might also be possible that the user is is not allowed to read the data of a property. To find out what you are allowed to do with a property or any other component the function mvIMPACT.acquire.Component.flags() can be called.

A property can contain either a single value or an array of values of the same type (e.g. 4 integer values could be used to represent a property call 'Rectangle'. It can even (if the mvIMPACT.acquire.cfFixedSize flag is not set) contain a different number of values all the time its data is queried. E.g. for a property 'searchresults' each time some function is called which writes its results to this property the property could contain a different number of integer values afterwards.

Every properties value can be read and written either as string or by it actual value type. So you can either assign the value of an integer property by using the standard 'write' function that accepts the value to be the type of the property or the function mvIMPACT.acquire.Property.writeS can be used to set the property via a string containing the new value.

prop = acquire.PropertyI(hObj)
prop.writeS("5") # string assignment
prop.write(5) # integer assignment

In addition to that float and int Properties might define a translation dictionary. This cannot be done by the user, but the user can work with the dictionary afterwards. A translation dictionary is a table which maps strings to certain values (e.g. integers).

The translation dictionary serves two purposes: Once it has been defined this property can only be assigned values ( which can either be passed as a string or as the actual value ) which are contained in the translation table. Thus this makes it very easy to restrict a certain property to a fixed number of values, which can be assigned to it. Properties that have a translation dictionary will typically be defined by declaring a template instance with the type of the enumeration.

The second benefit of a translation dictionary is that certain values can be assigned a meaningful description via its translation. When a translation table has been defined either the string translation can be used to assign its value or its actual data type. A float property e.g. might define a translation table like this: 'Auto -> 0', 'auto -> 1', 'OnLowLevel -> 2'. Now to set this property to use the 'on low level' trigger mode this can be done by calling one of the 'write' functions.

prop = getPropertyFromSomewhere() # assuming this function will return a 'PropertyICameraTriggerMode' instance!
prop.writeS("OnLowLevel") # set value via the translation string
prop.write(acquire.ctmOnLowLevel) # set value via enum type

This can also be extremely useful to populate combo boxes for GUI applications.

Float and int properties can also define certain constants like a max. value or a min. value. If a property does define such values it can't be assigned values which do not lie within the defined range. To find out if constants are defined The user can call the functions mvIMPACT.acquire.Property.hasMaxValue, mvIMPACT.acquire.Property.hasMinValue and mvIMPACT.acquire.Property.hasStepWidth. To query to actual value of the max, min or step width the functions getMaxValue, getMinValue and getStepWidth of the classes mvIMPACT.acquire.PropertyF, mvIMPACT.acquire.PropertyI and mvIMPACT.acquire.PropertyI64 can be called.

When reading the value of a property as a string the user can define a format string telling the property module how to format the returned string. This works pretty much like when working e.g. with the printf function.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args )

Constructs a new unbound mvIMPACT.acquire.Property object.

OVERLOAD 1:

Properties constructed this way can't be used for anything unless they are bound to a internal driver property with a mvIMPACT.acquire.ComponentLocator object.

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

Properties successfully constructed this way can be worked with directly. If hObj does not reference an internal driver property a mvIMPACT.acquire.ENotAProperty exception will be thrown.

Parameters
hProp[in] A valid handle to a property

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

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

Reimplemented from Component.

Reimplemented in PropertyPtr, PropertyS, PropertyI, PropertyIAcquisitionField, PropertyIAcquisitionMode, PropertyIAcquisitionStartStopBehaviour, PropertyIAoiMode, PropertyIAutoControlSpeed, PropertyIAutoControlMode, PropertyIAutoExposureControl, PropertyIAutoGainControl, PropertyIAutoOffsetCalibration, PropertyIBayerConversionMode, PropertyIBayerMosaicParity, PropertyIBayerWhiteBalanceResult, PropertyIBlueFOXDigitalInputThreshold, PropertyIBlueFOXFooterMode, PropertyIBlueFOXInfoSensorCapabilities, PropertyIBlueFOXOffsetAutoBlackSpeed, PropertyIBlueFOXSensorTiming, PropertyIBlueFOXTransferSize, PropertyIBoolean, PropertyICameraAoiMode, PropertyICameraBinningMode, PropertyICameraDataFormat, PropertyICameraExposeMode, PropertyICameraExternalSyncEdge, PropertyICameraExternalSyncOutput, PropertyICameraFlashMode, PropertyICameraFlashType, PropertyICameraHDRMode, PropertyICameraInterlacedType, PropertyICameraLinkDataValidMode, PropertyICameraOutput, PropertyICameraPixelClock, PropertyICameraScanMode, PropertyICameraSerialPortBaudRate, PropertyICameraShutterMode, PropertyICameraTapsXGeometry, PropertyICameraTapsYGeometry, PropertyICameraTestMode, PropertyICameraTriggerMode, PropertyICameraTriggerSource, PropertyIChannelSplitMode, PropertyIClampMode, PropertyIColorTwistInputCorrectionMatrixMode, PropertyIColorTwistOutputCorrectionMatrixMode, PropertyIColorProcessingMode, PropertyIDarkCurrentFilterMode, PropertyIDefectivePixelsFilterMode, PropertyIDeviceAccessMode, PropertyIDeviceAdvancedOptions, PropertyIDeviceCapability, PropertyIDeviceClass, PropertyIDeviceDigitalOutputMode, PropertyIDeviceImageTrigger, PropertyIDeviceInterfaceLayout, PropertyIDeviceLoadSettings, PropertyIDevicePowerMode, PropertyIDeviceScanRateMode, PropertyIDeviceSignalOutputStartEvent, PropertyIDeviceState, PropertyIDeviceSyncOutMode, PropertyIDeviceTriggerInterface, PropertyIDeviceTriggerMode, PropertyIDigIOState, PropertyIDigitalIOMeasurementMode, PropertyIDigitalIOMeasurementSource, PropertyIDigitalOutputControlMode, PropertyIDigitalSignal, PropertyIFieldGateMode, PropertyIFlatFieldFilterCorrectionMode, PropertyIFlatFieldFilterMode, PropertyIHWUpdateResult, PropertyII2COperationMode, PropertyII2COperationStatus, PropertyIImageBufferPixelFormat, PropertyIImageBufferFormatReinterpreterMode, PropertyIImageDestinationPixelFormat, PropertyIImageProcessingFilter, PropertyIImageProcessingMode, PropertyIImageProcessingOptimization, PropertyIImageProcessingResult, PropertyIRequestImageMemoryMode, PropertyIImageRequestControlMode, PropertyIInfoSensorColorMode, PropertyIInfoSensorType, PropertyIInterfaceEnumerationBehaviour, PropertyIInterlacedMode, PropertyILineCounter, PropertyILUTGammaMode, PropertyILUTImplementation, PropertyILUTInterpolationMode, PropertyILUTMapping, PropertyILUTMode, PropertyIMemoryManagerMode, PropertyIMemoryManagerPoolMode, PropertyIMirrorMode, PropertyIMirrorOperationMode, PropertyIOnBoardMemoryMode, PropertyIPayloadType, PropertyIPolarizedDataExtractionMode, PropertyIPolarizedDataExtractionInterpolationMode, PropertyIPulseStartTrigger, PropertyIRequestResult, PropertyIRequestState, PropertyIRTCtrlModes, PropertyIRTProgOpCodes, PropertyIScalerMode, PropertyIScalerInterpolationMode, PropertyIScanClock, PropertyIScanStandard, PropertyITriggerMoment, PropertyIUserDataAccessRight, PropertyIUserDataReconnectBehaviour, PropertyIVideoStandard, PropertyIVirtualDeviceImageType, PropertyIVirtualDeviceTestMode, PropertyIWhiteBalanceCalibrationMode, PropertyIWhiteBalanceParameter, PropertyI64, PropertyI64BufferPartDataType, PropertyI64BayerMosaicParity, PropertyI64DeviceTriggerOverlap, and PropertyF.

Member Function Documentation

◆ dictSize()

dictSize ( self)

Returns the size of the properties translation dictionary.

If the property does define a translation dictionary this function returns the number of elements contained in this dictionary.

Returns
  • The size of the properties translation dictionary.
  • 0 If this property does not define a translation dictionary.

◆ getAllowsValueCombinations()

getAllowsValueCombinations ( self)

Checks if this enumerated property allows the combination of enum values.

If this function returns true, the enum constants can be 'ored' together. This works for the enum constants as well as for the string representations returned in the properties translation dictionary.

if a property e.g. defines a dictionary (('1', "one"), ('2', "two")) the following write operations will be valid:

prop = getPropFromSomewhere()
prop.write( 1 | 2 )
prop.write( "one | two" )

If this function returns true code like this will be valid:

prop = getPropFromSomewhere()
prop.write(1 | 2)
prop.write("one | two")
Returns
  • true if this property allows the combination of enum values.
  • false otherwise.

◆ getHasDict()

getHasDict ( self)

Returns whether this property defines a translation dictionary or not.

Returns
  • true if this property defines a translation table
  • false otherwise

◆ getHasMaxValue()

getHasMaxValue ( self)

Checks if a maximum value is defined for this property.

Since
1.12.63
Returns
  • true if this property defines a maximum value
  • false otherwise

◆ getHasMinValue()

getHasMinValue ( self)

Checks if a minimum value is defined for this property.

Since
1.12.63
Returns
  • true if this property defines a minimum value
  • false otherwise

◆ getHasStepWidth()

getHasStepWidth ( self)

Checks if a step width is defined for this property.

Since
1.12.63
Returns
  • true if this property defines a step width
  • false otherwise

◆ maxValCount()

maxValCount ( self)

Returns maximum number of values that can be managed by this property.

For the majority of properties this function will return '1', but as properties might manage more than a single value, this value might be interesting from time to time.

Returns
the maximum number of values that can be managed by this property.

◆ readS()

readS ( self,
* args )

Reads data from this property as a string.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT.acquire.ImpactAcquireException.
Returns
A string containing the data questioned.
Parameters
index[in] The index of the desired value(only necessary for properties containing more than one value)
format[in] The format string telling the function how to format the result. If left empty the property uses its standard way of converting its data into a string

◆ readSArray()

readSArray ( self,
* args )

Reads data from this property as a string.

This function can be used to query a set of values if this property stores more than a single value which might be useful for GUI applications.

PropertyI p = getPropFromSomewhere()
p.write(1)
p.write(2, 1)
p.write(666, 2)
s = p.readSArray("%d", "&&:", 1)
# now s should contain '2&&:666'
s = p.readSArray("%4d", " ", 0, 1)
# now s should contain ' 1, 2'
Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT.acquire.ImpactAcquireException.
Returns
A string containing the data questioned.
Parameters
format[in] The format string telling the function how to format the result. If left empty the property uses its standard way of converting its data into a string
delimiter[in] This string is used to separate the individual values from one another. If left empty, a single blank will separate the data.
startIndex[in] The index of the first of the desired values
endIndex[in] The index of the last of the desired values. If INT_MAX is passed, every from startIndex to the last value stored by the property will be returned.
mode[in] Specifies the mode this function operates in. Currently only the LSB affects the behaviour of this function. When the LSB is set, the translation dictionary (if defined) will be ignored for this call.

◆ removeValue()

removeValue ( self,
index = 0 )

Removes a certain value from the property's data.

Returns
A const reference to the calling property.
Parameters
index[in] The index of the value to be removed

◆ resizeValArray()

resizeValArray ( self,
newSize )

Resizes the property's data array.

This function resizes the internal data array of this property. The size of this array represents the number of values, which can be stored within the property. This function will only succeed, if the mvIMPACT.acquire.cfFixedSize is NOT set for this property and the user has "write rights" for this property. Otherwise an exception will be thrown. Whenever the user successfully writes an array of values to a property and this array contains more elements than the current internal data array can accommodate at the desired offset the internal data array will be increased automatically.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT.acquire.ImpactAcquireException.
In order to be allowed to modify the number of values a property can store, the mvIMPACT.acquire.cfFixedSize flag must NOT be set.
See also
mvIMPACT.acquire.Component.isWriteable
Returns
A const reference to the calling property.
Parameters
newSize[in] The new number of values this property shall be allowed to store

◆ stringFormatString()

stringFormatString ( self)

Returns the internal format string this property uses to convert data to strings.

Returns
A string containing the format string internally used by the property whenever the user reads a value as a string without specifying a format string and the property is not a string type one.

◆ valCount()

valCount ( self)

Returns the current number of values managed by this property.

For the majority of properties this function will return '1', but as properties might manage more than a single value, this value might be interesting from time to time.

Returns
the current number of values managed by this property.

◆ writeS()

writeS ( self,
* args )

Assigns a new value to this property.

OVERLOAD 1:

The user caller have "write rights" for this property in order to be able to modify its value. Also if index is greater than the current internal data array size of this property the user must be allowed to change to size of the properties internal data array (the mvIMPACT.acquire.cfFixedSize flag must NOT be set).

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT.acquire.ImpactAcquireException.
See also
mvIMPACT.acquire.Component.isWriteable,
mvIMPACT.acquire.Component.flags,
mvIMPACT.acquire.Property.writeS
Returns
A const reference to the calling property.
Parameters
value[in] The new value for this property at the given index.
index[in] The index of the value to modify

OVERLOAD 2: Assigns new values to this property.

The user must have "write rights" for this property in order to be able to modify its values. Also if index is greater than the current internal data array size of this property the user must be allowed to change to size of the properties internal data array (the mvIMPACT.acquire.cfFixedSize flag must NOT be set). This function behaves exactly like mvIMPACT.acquire.Property.writeS except that is can be used to assign more than one value at the same time. The parameter index here serves as an offset. If for example a property holds 3 values 'one', 'two' and 'three' before this call and the function is then called with an array containing the string 'orange' and 'blue' and index = 2 then after a successful call to this function the property will hold the data 'one', 'two', 'orange' and 'blue'.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT.acquire.ImpactAcquireException.
See also
mvIMPACT.acquire.Component.isWriteable,
mvIMPACT.acquire.Component.flags,
mvIMPACT.acquire.Property.writeS
Returns
A const reference to the calling property.
Parameters
sequence[in] A constant reference to an array containing the strings to be assigned to the property
index[in] The offset from where to start to assign the values

OVERLOAD 3: Assigns new values to this property.

The user must have "write rights" for this property in order to be able to modify its values. Also if index is greater than the current internal data array size of this property the user must be allowed to change to size of the properties internal data array (the mvIMPACT.acquire.cfFixedSize flag must NOT be set). This function behaves exactly like mvIMPACT.acquire.Property.writeS except that is can be used to assign more than one value at the same time. The parameter index here serves as an offset. If for example a property holds 3 values 'one', 'two' and 'three' before this call and the function is then called with an array containing the string 'orange' and 'blue' and index = 2 then after a successful call to this function the property will hold the data 'one', 'two', 'orange' and 'blue'.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT.acquire.ImpactAcquireException.
See also
mvIMPACT.acquire.Component.isWriteable,
mvIMPACT.acquire.Component.flags,
mvIMPACT.acquire.Property.writeS
Returns
A const reference to the calling property.
Parameters
sequence[in] A constant reference to an array containing the strings to be assigned to the property
index[in] The offset from where to start to assign the values

Property Documentation

◆ allowsValueCombinations

allowsValueCombinations = property (getAllowsValueCombinations, None, None, None)
static

A bool property (read-only) which checks if this enumerated property allows the combination of enum values.

See mvIMPACT.acquire.Property.getAllowsValueCombinations()

◆ hasDict

hasDict = property (getHasDict, None, None, None)
static

A bool property (read-only) which checks whether this property defines a translation dictionary or not.

See mvIMPACT.acquire.Property.getHasDict()

◆ hasMaxValue

hasMaxValue = property (getHasMaxValue, None, None, None)
static

A bool property (read-only) which checks if a maximum value is defined for this property.

See mvIMPACT.acquire.Property.getHasMaxValue()

◆ hasMinValue

hasMinValue = property (getHasMinValue, None, None, None)
static

A bool property (read-only) which checks if a minimum value is defined for this property.

See mvIMPACT.acquire.Property.getHasMinValue()

◆ hasStepWidth

hasStepWidth = property (getHasStepWidth, None, None, None)
static

A bool property (read-only) which checks if a step width is defined for this property.

See mvIMPACT.acquire.Property.getHasStepWidth()

◆ thisown

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