Aravis.Device

g Aravis.Device Aravis.Device GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GObject.Object->Aravis.Device Gio.Initable->Aravis.Device

Subclasses:

Aravis.FakeDevice, Aravis.GvDevice, Aravis.UvDevice

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

create_chunk_parser ()

create_stream (callback, *user_data)

dup_available_enumeration_feature_values (feature)

dup_available_enumeration_feature_values_as_display_names (feature)

dup_available_enumeration_feature_values_as_strings (feature)

execute_command (feature)

get_boolean_feature_value (feature)

get_feature (feature)

get_feature_access_mode (feature)

get_float_feature_bounds (feature)

get_float_feature_increment (feature)

get_float_feature_value (feature)

get_genicam ()

get_genicam_xml ()

get_integer_feature_bounds (feature)

get_integer_feature_increment (feature)

get_integer_feature_value (feature)

get_string_feature_value (feature)

is_enumeration_entry_available (feature, entry)

is_feature_available (feature)

is_feature_implemented (feature)

read_memory (address, size, buffer)

read_register (address)

set_access_check_policy (policy)

set_boolean_feature_value (feature, value)

set_features_from_string (string)

set_float_feature_value (feature, value)

set_integer_feature_value (feature, value)

set_range_check_policy (policy)

set_register_cache_policy (policy)

set_string_feature_value (feature, value)

write_memory (address, size, buffer)

write_register (address, value)

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

do_control_lost ()

do_get_genicam ()

do_get_genicam_xml ()

do_read_memory (address, size, buffer)

do_read_register (address)

do_write_memory (address, size, buffer)

do_write_register (address, value)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

control-lost

Signal that the control of the device is lost.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Aravis.Device(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

Yes

Structure:

Aravis.DeviceClass

Aravis.Device is an abstract base class for the control of cameras. It provides an easy access to the camera settings, and to its genicam interface for more advanced uses.

create_chunk_parser()
Returns:

a new Aravis.ChunkParser object, None on error.

Return type:

Aravis.ChunkParser

Create a Aravis.ChunkParser object, to be used for chunk data extraction from Aravis.Buffer.

New in version 0.4.0.

create_stream(callback, *user_data)
Parameters:
Raises:

GLib.Error

Returns:

a new Aravis.Stream.

Return type:

Aravis.Stream

Creates a new Aravis.Stream for video stream handling. See ArvStreamCallback for details regarding the callback function.

New in version 0.8.23.

dup_available_enumeration_feature_values(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

a newly created array of 64 bit integers, which must freed after use using GLib.free, or None on error.

Return type:

[int]

Get all the available values of feature, as integers.

New in version 0.8.0.

dup_available_enumeration_feature_values_as_display_names(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

a newly created array of const strings, to be freed after use using GLib.free, or None on error.

Return type:

[str]

Get display names of all the available entries of feature.

New in version 0.8.0.

dup_available_enumeration_feature_values_as_strings(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

a newly created array of const strings, which must freed after use using GLib.free, or None on error.

Return type:

[str]

Get all the available values of feature, as strings.

New in version 0.8.0.

execute_command(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Execute a genicam command.

New in version 0.8.0.

get_boolean_feature_value(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

feature value

Return type:

value: bool

Get the feature value, or False on error.

New in version 0.8.0.

get_feature(feature)
Parameters:

feature (str) – feature name

Returns:

the genicam node corresponding to the feature name, None if not found.

Return type:

Aravis.GcNode

New in version 0.2.0.

get_feature_access_mode(feature)
Parameters:

feature (str) – feature name

Returns:

The actual feature access mode, which is a combination of ImposedAccessMode property and actual register access mode.

Return type:

Aravis.GcAccessMode

New in version 0.8.22.

get_float_feature_bounds(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

min:

minimum feature value

max:

maximum feature value

Return type:

(min: float, max: float)

Retrieves feature bounds.

New in version 0.8.0.

get_float_feature_increment(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

feature value increment, or GObject.G_MINDOUBLE on error.

Return type:

float

Not all float features have evenly distributed allowed values, which means the returned increment may not reflect the allowed value set.

New in version 0.8.16.

get_float_feature_value(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

the float feature value, 0.0 on error.

Return type:

float

New in version 0.8.0.

get_genicam()
Returns:

the genicam interface.

Return type:

Aravis.Gc

Retrieves the genicam interface of the given device.

New in version 0.2.0.

get_genicam_xml()
Returns:

a pointer to the Genicam XML data, owned by the device.

size:

placeholder for the returned data size (bytes)

Return type:

(str, size: int)

Gets the Genicam XML data stored in the device memory.

New in version 0.2.0.

get_integer_feature_bounds(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

min:

minimum feature value

max:

maximum feature value

Return type:

(min: int, max: int)

Retrieves feature bounds.

New in version 0.8.0.

get_integer_feature_increment(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

feature value increment, or 1 on error.

Return type:

int

Not all integer features have evenly distributed allowed values, which means the returned increment may not reflect the allowed value set.

New in version 0.8.0.

get_integer_feature_value(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

the integer feature value, 0 on error.

Return type:

int

New in version 0.8.0.

get_string_feature_value(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

the string feature value, None on error.

Return type:

str

New in version 0.8.0.

is_enumeration_entry_available(feature, entry)
Parameters:
  • feature (str) – enumeration feature name

  • entry (str) – entry name

Raises:

GLib.Error

Returns:

True if the feature and the feature entry are available

Return type:

bool

New in version 0.8.17.

is_feature_available(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

True if feature is available, False if not or on error.

Return type:

bool

New in version 0.8.0.

is_feature_implemented(feature)
Parameters:

feature (str) – feature name

Raises:

GLib.Error

Returns:

True if feature is implemented, False if not or on error.

Return type:

bool

New in version 0.8.23.

read_memory(address, size, buffer)
Parameters:
  • address (int) – memory address

  • size (int) – number of bytes to read

  • buffer (object or None) – a buffer for the storage of the read data

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Reads size bytes from the device memory.

New in version 0.2.0.

read_register(address)
Parameters:

address (int) – register address

Raises:

GLib.Error

Returns:

True on success.

value:

a placeholder for the read value

Return type:

(bool, value: int)

Reads the value of a device register.

New in version 0.2.0.

set_access_check_policy(policy)
Parameters:

policy (Aravis.AccessCheckPolicy) – access check policy

Sets the feature access check policy. When enabled, before being accessed, the actual read/write access of register is checked using AccessMode properties. On some devices, it helps to avoid forbidden writes to registers that may put the device in a bad state.

Access check is disabled by default.

New in version 0.8.22.

set_boolean_feature_value(feature, value)
Parameters:
  • feature (str) – feature name

  • value (bool) – feature value

Raises:

GLib.Error

Set the value of a boolean feature.

New in version 0.8.0.

set_features_from_string(string)
Parameters:

string (str) – a space separated list of features assignments

Raises:

GLib.Error

Return type:

bool

Set features from a string containing a list of space separated feature assignments or command names. For example:

arv_device_set_features_from_string (device, "Width=256 Height=256 PixelFormat='Mono8' TriggerStart", &error);

New in version 0.8.0.

set_float_feature_value(feature, value)
Parameters:
  • feature (str) – feature name

  • value (float) – new feature value

Raises:

GLib.Error

Set the float feature value.

New in version 0.8.0.

set_integer_feature_value(feature, value)
Parameters:
  • feature (str) – feature name

  • value (int) – new feature value

Raises:

GLib.Error

Set the integer feature value.

New in version 0.8.0.

set_range_check_policy(policy)
Parameters:

policy (Aravis.RangeCheckPolicy) – range check policy

Sets the range check policy. When enabled, before being set, the value of all nodes with an Aravis.GcFloat or Aravis.GcInteger interface will be checked against their Min and Max properties.

Be aware that some camera may have wrong definition of Min and Max, as this check is defined as not mandatory in the Genicam specification. If this is the case, it will not possible to set the value of the features with faulty Min or Max definition. Range check is disabled by default.

New in version 0.8.6.

set_register_cache_policy(policy)
Parameters:

policy (Aravis.RegisterCachePolicy) – cache policy

Sets the register cache policy.

Be aware that some camera may have wrong Cachable properties defined in their Genicam metadata, which may lead to incorrect readouts. Using the debug cache policy, and activating genicam debug output (export ARV_DEBUG=genicam), can help you to check the cache validity. In this mode, every time the cache content is not in sync with the actual register value, a debug message is printed on the console.

New in version 0.8.0.

set_string_feature_value(feature, value)
Parameters:
  • feature (str) – feature name

  • value (str) – new feature value

Raises:

GLib.Error

Set the string feature value.

New in version 0.8.0.

write_memory(address, size, buffer)
Parameters:
  • address (int) – memory address

  • size (int) – size of the returned buffer

  • buffer (object or None) – the buffer read from memory

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Writes size bytes to the device memory.

New in version 0.2.0.

write_register(address, value)
Parameters:
  • address (int) – the register address

  • value (int) – value to write

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Writes value to a device register.

New in version 0.2.0.

do_control_lost() virtual
do_get_genicam() virtual
Returns:

the genicam interface.

Return type:

Aravis.Gc

Retrieves the genicam interface of the given device.

New in version 0.2.0.

do_get_genicam_xml() virtual
Returns:

a pointer to the Genicam XML data, owned by the device.

size:

placeholder for the returned data size (bytes)

Return type:

(str, size: int)

Gets the Genicam XML data stored in the device memory.

New in version 0.2.0.

do_read_memory(address, size, buffer) virtual
Parameters:
  • address (int) – memory address

  • size (int) – number of bytes to read

  • buffer (object or None) – a buffer for the storage of the read data

Returns:

True on success.

Return type:

bool

Reads size bytes from the device memory.

New in version 0.2.0.

do_read_register(address) virtual
Parameters:

address (int) – register address

Returns:

True on success.

value:

a placeholder for the read value

Return type:

(bool, value: int)

Reads the value of a device register.

New in version 0.2.0.

do_write_memory(address, size, buffer) virtual
Parameters:
  • address (int) – memory address

  • size (int) – size of the returned buffer

  • buffer (object or None) – the buffer read from memory

Returns:

True on success.

Return type:

bool

Writes size bytes to the device memory.

New in version 0.2.0.

do_write_register(address, value) virtual
Parameters:
  • address (int) – the register address

  • value (int) – value to write

Returns:

True on success.

Return type:

bool

Writes value to a device register.

New in version 0.2.0.

Signal Details

Aravis.Device.signals.control_lost(device)
Signal Name:

control-lost

Flags:

RUN_LAST

Parameters:

device (Aravis.Device) – The object which received the signal

Signal that the control of the device is lost.

This signal may be emited from a thread different than the main one, so please take care to shared data access from the callback.

New in version 0.2.0.