Attribute Definitions

AttributeDefinition

class canlib.kvadblib.AttributeDefinition(db, handle, definition=None)[source]

Factory for creating different types of attribute definitions.

This class is also the base class and thus contains all common properties.

property name

Name of attribute definition.

Type

str

property owner

Return attribute owner

Type

AttributeOwner

DefaultDefinition

class canlib.kvadblib.DefaultDefinition(default)

Attribute definition for attributes defined using only default.

property default

Alias for field number 0

EnumDefaultDefinition

class canlib.kvadblib.EnumDefaultDefinition(default, enums)

Attribute definition for enumeration attributes.

Holds a definition using default and key-value pairs.

property default

Alias for field number 0

property enums

Alias for field number 1

EnumDefinition

class canlib.kvadblib.EnumDefinition(db, handle, definition=None)[source]

Definition of an enum attribute.

Parameters
add_enum_definition(enums)[source]

Add enum definitions.

Parameters

enums (dict) – key - value pair(s), example: {‘empty’: 0}

property definition

Return attribute definition

Changed in version 1.6.

Type

EnumDefaultDefinition

FloatDefinition

class canlib.kvadblib.FloatDefinition(db, handle, definition=None)[source]

Definition of a float attribute.

Parameters
  • db (Dbc) – Database that holds attribute definitions

  • definition (MinMaxDefinition) – Min, max and default values

property definition

Attribute definition

Type

MinMaxDefinition

IntegerDefinition

class canlib.kvadblib.IntegerDefinition(db, handle, definition=None)[source]

Definition of an integer attribute.

Parameters
  • db (Dbc) – Database that holds attribute definitions

  • definition (MinMaxDefinition) – Min, max and default values

property definition

Return attribute definition

Type

MinMaxDefinition

HexDefinition

class canlib.kvadblib.HexDefinition(db, handle, definition=None)[source]

Definition of an hex attribute.

Parameters
  • db (Dbc) – Database that holds attribute definitions

  • definition (MinMaxDefinition) – Min, max and default values

New in version 1.20.

MinMaxDefinition

class canlib.kvadblib.MinMaxDefinition(default, min, max)

Attribute definition for attributes defined using default, min and max.

property default

Alias for field number 0

property max

Alias for field number 2

property min

Alias for field number 1

StringDefinition

class canlib.kvadblib.StringDefinition(db, handle, definition=None)[source]

Definition of a string attribute.

Parameters
  • db (Dbc) – Database that holds attribute definitions

  • definition (DefaultDefinition) – default value

property definition

Return attribute definition

Type

DefaultDefinition