Feature
- class vmbpy.BoolFeature
The BoolFeature is a feature represented by a boolean value.
- get() bool
Get current feature value of type bool.
- Returns:
Feature value of type bool.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- set(val)
Set current feature value of type bool.
- Parameters:
val – The boolean value to set.
- Raises:
VmbFeatureError – If access rights are not sufficient.
VmbFeatureError – If called with an invalid value.
VmbFeatureError – If executed within a registered change_handler.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.FloatFeature
The FloatFeature is a feature represented by a floating point number.
- get() float
Get current value (float).
- Returns:
Current float value.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_increment() float | None
Get increment (steps between valid values, starting from minimum value).
- Returns:
The increment or
None
if the feature currently has no increment.- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_range() Tuple[float, float]
Get range of accepted values
- Returns:
A pair of range boundaries. First value is the minimum, second value is the maximum.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- set(val: float)
Set current value of type float.
- Parameters:
val – The float value to set.
- Raises:
VmbFeatureError – If access rights are not sufficient.
VmbFeatureError – If value is out of bounds.
VmbFeatureError – If executed within a registered change_handler.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.IntFeature
The IntFeature is a feature represented by an integer.
- get() int
Get current value (int).
- Returns:
Current int value.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_increment() int
Get increment (steps between valid values, starting from minimal values).
- Returns:
The increment of this feature.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_range() Tuple[int, int]
Get range of accepted values.
- Returns:
A pair of range boundaries. First value is the minimum, second value is the maximum.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- set(val: int)
Set current value of type int.
- Parameters:
val – The int value to set.
- Raises:
VmbFeatureError – If access rights are not sufficient.
VmbFeatureError – If value is out of bounds or misaligned to the increment.
VmbFeatureError – If executed within a registered change_handler.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.StringFeature
The StringFeature is a feature represented by a string.
- get() str
Get current value (str)
- Returns:
Current str value.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_max_length() int
Get maximum string length the Feature can store.
Note
In this context, string length does not mean the number of characters, it means the number of bytes after encoding. A string encoded in UTF-8 could exceed the maximum length. Additionally the last byte of the string feature is reserved for a null-byte to indicate the end of the string.
- Returns:
The number of ASCII characters the Feature can store.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- set(val: str)
Set current value of type str.
- Parameters:
val – The str value to set.
- Raises:
VmbFeatureError – If access rights are not sufficient.
VmbFeatureError – If value exceeds the maximum string length.
VmbFeatureError – If executed within a registered change_handler.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.EnumFeature
The EnumFeature is a feature where only
EnumEntry
values are allowed. All possible values of an EnumFeature can be queried through the Feature itself.- get() EnumEntry
Get current feature value of type EnumEntry.
- Returns:
Feature value of type EnumEntry.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_all_entries() Tuple[EnumEntry, ...]
Get a set of all possible EnumEntries of this feature.
Note
It is possible that not all EnumEntries returned by this area have currently valid values. See also
get_available_entries()
- get_available_entries() Tuple[EnumEntry, ...]
Get a set of all currently available EnumEntries of this feature.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_entry(val_or_name: int | str) EnumEntry
Get a specific EnumEntry.
- Parameters:
val_or_name – Look up EnumEntry either by its name or its associated value.
- Returns:
EnumEntry associated with Argument
val_or_name
.- Raises:
TypeError – If
int_or_name
is not of typeint
or typestr
.VmbFeatureError – If no EnumEntry is associated with
val_or_name
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- set(val: int | str | EnumEntry)
Set current feature value.
- Parameters:
val – The value to set. Can be
int
, orstr
, orEnumEntry
.- Raises:
VmbFeatureError – If val is of type
int
orstr
and does not match anEnumEntry
.VmbFeatureError – If access rights are not sufficient.
VmbFeatureError – If executed within a registered change_handler.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.EnumEntry
An EnumEntry represents a single value of an EnumFeature. An EnumEntry is a one-to-one association between a
str
and anint
.- as_tuple() Tuple[str, int]
Get EnumEntry in
str
andint
representation
- is_available() bool
Query if the EnumEntry can currently be used as a value.
- Returns:
True
if the EnumEntry can be used as a value, otherwiseFalse
.
- class vmbpy.CommandFeature
The CommandFeature is a feature that can perform some kind of operation such as saving a user set.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_done() bool
Test if a feature execution is done.
- Returns:
True
if feature was fully executed.False
if the feature is still being executed.- Raises:
VmbFeatureError – If access rights are not sufficient.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- run()
Execute command feature.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.RawFeature
The RawFeature is a feature represented by sequence of bytes.
- get() bytes
Get current value as a sequence of bytes
- Returns:
Current value.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- get_access_mode() Tuple[bool, bool]
Get features current access mode.
- Returns:
A pair of bool. In the first bool is
True
, read access on this Feature is granted. If the second bool isTrue
write access on this Feature is granted.
- get_category() str
Get Feature category, e.g. ‘/Discovery’
- get_description() str
Long feature description.
- get_display_name() str
Get lengthy Feature name e.g. ‘Discovery Interface Event’
- get_flags() Tuple[FeatureFlags, ...]
Get a set of FeatureFlags, e.g.
(FeatureFlags.Read, FeatureFlags.Write)
- get_name() str
Get Feature Name, e.g. ‘DiscoveryInterfaceEvent’
- get_polling_time() int
Predefined Polling Time for volatile features.
- get_representation() str
Representation of a numeric feature.
- get_sfnc_namespace() str
Namespace of this feature
- get_tooltip() str
Short Feature description.
- get_type() Type[_BaseFeature]
Get Feature Type, e.g.
IntFeature
- get_unit() str
Get unit of this Feature, e.g. ‘dB’ on Feature ‘GainAutoMax’
- get_visibility() FeatureVisibility
UI visibility of this feature
- has_selected_features() bool
Indicates if this feature selects other features.
- is_readable() bool
Is read access on this Features granted?
- Returns:
True
if read access is allowed on this feature.False
is returned if read access is not allowed.
- is_streamable() bool
Indicates if a feature can be stored in /loaded from a file.
- is_writeable() bool
Is write access on this Feature granted?
- Returns:
True
if write access is allowed on this feature.False
is returned if write access is not allowed.
- length() int
Get length of byte sequence representing the value.
- Returns:
Length of current value.
- Raises:
VmbFeatureError – If access rights are not sufficient.
- register_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Register Callable on the Feature.
The Callable will be executed as soon as the Feature value changes. The first parameter on a registered handler will be called with the changed feature itself. The methods returns early if a given handler is already registered.
- Parameters:
handler – The Callable that should be executed on change.
- Raises:
TypeError – If parameters do not match their type hint.
- set(buf: bytes)
Set current value as a sequence of bytes.
- Parameters:
val – The value to set.
- Raises:
VmbFeatureError – If access rights are not sufficient.
VmbFeatureError – If executed within a registered change_handler.
- unregister_all_change_handlers()
Remove all registered change handlers.
- unregister_change_handler(handler: Callable[[IntFeature | FloatFeature | StringFeature | BoolFeature | EnumFeature | CommandFeature | RawFeature], None])
Remove registered Callable from the Feature.
Removes a previously registered
handler
from this Feature. In case thehandler
that should be removed was never added in the first place, the method returns silently.- Parameters:
handler – The Callable that should be removed.
- Raises:
TypeError – If parameters do not match their type hint.
- class vmbpy.FeatureVisibility
Enumeration specifying UI feature visibility.
- Unknown = 0
Feature visibility is not known
- Beginner = 1
Feature is visible in feature list (beginner level)
- Expert = 2
Feature is visible in feature list (expert level)
- Guru = 3
Feature is visible in feature list (guru level)
- Invisible = 4
Feature is not visible in feature list
Enums relating to load/save feature functionality
- class vmbpy.PersistType
Persistence Type for camera configuration storing and loading.
- All = 0
Save all features to XML, including look-up tables (if possible)
- Streamable = 1
Save only features marked as streamable, excluding look-up tables
- NoLUT = 2
Save all features except look-up tables
- class vmbpy.ModulePersistFlags
Parameters determining the operation mode of VmbSettingsSave and VmbSettingsLoad.
- None_ = 0
Persist/Load features for no module
- TransportLayer = 1
Persist/Load the transport layer features
- Interface = 2
Persist/Load the interface features
- RemoteDevice = 4
Persist/Load the remote device features
- LocalDevice = 8
Persist/Load the local device features
- Streams = 16
Persist/Load the features of stream modules
- All = 255
Persist/Load features for all modules