AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
isobus::task_controller_object::DeviceElementObject Class Reference

DeviceElementObject is the object definition of the XML element DeviceElement. The attribute Type specifies the type of this particular element definition. More...

#include <isobus_task_controller_client_objects.hpp>

Inheritance diagram for isobus::task_controller_object::DeviceElementObject:
[legend]
Collaboration diagram for isobus::task_controller_object::DeviceElementObject:
[legend]

Public Types

enum class  Type : std::uint8_t {
  Device = 1 , Function = 2 , Bin = 3 , Section = 4 ,
  Unit = 5 , Connector = 6 , NavigationReference = 7
}
 Enumerates the types of device element object. More...
 

Public Member Functions

 DeviceElementObject (std::string deviceElementDesignator, std::uint16_t deviceElementNumber, std::uint16_t parentObjectID, Type deviceEelementType, std::uint16_t uniqueID)
 Constructor for a DeviceElementObject.
 
 ~DeviceElementObject () override=default
 Destructor for a DeviceElementObject.
 
std::string get_table_id () const override
 Returns the XML namespace for the object.
 
ObjectTypes get_object_type () const override
 Returns the object type.
 
std::vector< std::uint8_t > get_binary_object () const override
 Returns the binary representation of the TC object, or an empty vector if object is invalid.
 
std::uint16_t get_element_number () const
 Returns the element number.
 
void set_element_number (std::uint16_t newElementNumber)
 Update the object's element number to a new value.
 
std::uint16_t get_parent_object () const
 Returns the parent object ID.
 
void set_parent_object (std::uint16_t parentObjectID)
 Updates the object ID associated to this object's parent object.
 
Type get_type () const
 Returns the type of the element object.
 
void add_reference_to_child_object (std::uint16_t childID)
 This function can be called to add an object as a child of this object.
 
bool remove_reference_to_child_object (std::uint16_t childID)
 Removes a child object reference from this object.
 
std::uint16_t get_number_child_objects () const
 Returns the number of child objects added with add_reference_to_child_object.
 
std::uint16_t get_child_object_id (std::size_t index)
 Returns a child object ID by index.
 
- Public Member Functions inherited from isobus::task_controller_object::Object
 Object (std::string objectDesignator, std::uint16_t uniqueID)
 Constructor for the TC object base class.
 
virtual ~Object ()=default
 Destructor for a TC Object.
 
std::string get_designator () const
 Returns the Descriptive text for this object, UTF-8 encoded, 32 characters max.
 
void set_designator (const std::string &newDesignator)
 Updates the designator to a new value.
 
std::uint16_t get_object_id () const
 Returns the object ID of the object.
 
void set_object_id (std::uint16_t id)
 Updates the object ID of the object to a new value.
 

Private Attributes

std::vector< std::uint16_t > referenceList
 List of references to DeviceProcessDataObjects or DevicePropertyObjects.
 
std::uint16_t elementNumber
 Element number for process data variable addressing.
 
std::uint16_t parentObject
 Object ID of parent DeviceElementObject or DeviceObject in order to establish a hierarchical order of DeviceElements.
 
Type elementType
 See the comments on Type or ISO11783-10 table A.2.
 

Static Private Attributes

static const std::string tableID = "DET"
 XML element namespace for DeviceElement.
 

Additional Inherited Members

- Static Public Attributes inherited from isobus::task_controller_object::Object
static constexpr std::uint16_t MAX_OBJECT_ID = 65534
 The max allowable "valid" object ID.
 
static constexpr std::size_t MAX_DESIGNATOR_LENGTH = 128
 Defines the max length of a designator (in bytes)
 
static constexpr std::size_t MAX_DESIGNATOR_LEGACY_LENGTH = 32
 Defines the max length of a designator (in bytes) for TCs older than version 4.
 
- Protected Attributes inherited from isobus::task_controller_object::Object
std::string designator
 UTF-8 Descriptive text to identify this object. Max length of 32.
 
std::uint16_t objectID
 Unique object ID in the DDOP.
 

Detailed Description

DeviceElementObject is the object definition of the XML element DeviceElement. The attribute Type specifies the type of this particular element definition.

Referable Child Objects: DeviceProcessDataObject, DevicePropertyObject

Definition at line 203 of file isobus_task_controller_client_objects.hpp.

Member Enumeration Documentation

◆ Type

Enumerates the types of device element object.

Enumerator
Device 

The device descriptor object pool shall have one device element of type device.

Function 

This device element type can be used as a generic device element to define individually accessible components of a device like valves or sensors.

Bin 

This is, for instance, the tank of a sprayer or the bin of a seeder.

Section 

This is, for instance, the section of a spray boom, seed toolbar, or planter toolbar.

Unit 

This device element type is, for example, used for spray boom nozzles, seeder openers, or planter row units.

Connector 

This device element type specifies the mounting/connection position of the device.

NavigationReference 

This device element type defines the navigation reference position for navigation devices such as GPS receivers.

Definition at line 207 of file isobus_task_controller_client_objects.hpp.

Constructor & Destructor Documentation

◆ DeviceElementObject()

isobus::task_controller_object::DeviceElementObject::DeviceElementObject ( std::string deviceElementDesignator,
std::uint16_t deviceElementNumber,
std::uint16_t parentObjectID,
Type deviceEelementType,
std::uint16_t uniqueID )

Constructor for a DeviceElementObject.

Parameters
[in]deviceElementDesignatorDescriptive text for the object, UTF-8, 32-128 chars max depending on TC version
[in]deviceElementNumberThe Element number for process data variable addressing
[in]parentObjectIDObject ID of parent DeviceElementObject or DeviceObject in order to establish a hierarchical order of DeviceElements
[in]deviceEelementTypeThe type of element, such as "device" or "bin"
[in]uniqueIDThe object ID of the object. Must be unique in the DDOP.

Definition at line 222 of file isobus_task_controller_client_objects.cpp.

Member Function Documentation

◆ add_reference_to_child_object()

void isobus::task_controller_object::DeviceElementObject::add_reference_to_child_object ( std::uint16_t childID)

This function can be called to add an object as a child of this object.

Note
You should only add Device or Device Element objects as children of this object
Parameters
[in]childIDThe object ID of the child to reference from this object

Definition at line 303 of file isobus_task_controller_client_objects.cpp.

◆ get_binary_object()

std::vector< std::uint8_t > isobus::task_controller_object::DeviceElementObject::get_binary_object ( ) const
overridevirtual

Returns the binary representation of the TC object, or an empty vector if object is invalid.

Returns
The binary representation of the TC object, or an empty vector if object is invalid

Implements isobus::task_controller_object::Object.

Definition at line 244 of file isobus_task_controller_client_objects.cpp.

Here is the call graph for this function:

◆ get_child_object_id()

std::uint16_t isobus::task_controller_object::DeviceElementObject::get_child_object_id ( std::size_t index)

Returns a child object ID by index.

Parameters
[in]indexThe index of the child object ID to return
Returns
Child object ID by index, or NULL_OBJECT_ID if the index is out of range

Definition at line 326 of file isobus_task_controller_client_objects.cpp.

Here is the call graph for this function:

◆ get_element_number()

std::uint16_t isobus::task_controller_object::DeviceElementObject::get_element_number ( ) const

Returns the element number.

Returns
The element number

Definition at line 278 of file isobus_task_controller_client_objects.cpp.

◆ get_number_child_objects()

std::uint16_t isobus::task_controller_object::DeviceElementObject::get_number_child_objects ( ) const

Returns the number of child objects added with add_reference_to_child_object.

Note
The maximum number of child objects is technically 65535 because the serialized form of the value uses a 16-bit integer to store the count.
Returns
The number of child objects added with add_reference_to_child_object

Definition at line 321 of file isobus_task_controller_client_objects.cpp.

Here is the caller graph for this function:

◆ get_object_type()

ObjectTypes isobus::task_controller_object::DeviceElementObject::get_object_type ( ) const
overridevirtual

Returns the object type.

Returns
The object type for this object (Object::DeviceElement)

Implements isobus::task_controller_object::Object.

Definition at line 239 of file isobus_task_controller_client_objects.cpp.

◆ get_parent_object()

std::uint16_t isobus::task_controller_object::DeviceElementObject::get_parent_object ( ) const

Returns the parent object ID.

Returns
The parent object ID

Definition at line 288 of file isobus_task_controller_client_objects.cpp.

◆ get_table_id()

std::string isobus::task_controller_object::DeviceElementObject::get_table_id ( ) const
overridevirtual

Returns the XML namespace for the object.

Returns
The string "DET", the XML namespace for the DeviceElementObject

Implements isobus::task_controller_object::Object.

Definition at line 234 of file isobus_task_controller_client_objects.cpp.

◆ get_type()

DeviceElementObject::Type isobus::task_controller_object::DeviceElementObject::get_type ( ) const

Returns the type of the element object.

Returns
The type of the element object

Definition at line 298 of file isobus_task_controller_client_objects.cpp.

◆ remove_reference_to_child_object()

bool isobus::task_controller_object::DeviceElementObject::remove_reference_to_child_object ( std::uint16_t childID)

Removes a child object reference from this object.

Parameters
[in]childIDAn object ID associated to a child object to remove.
Returns
true if the child object ID was found and removed, otherwise false

Definition at line 308 of file isobus_task_controller_client_objects.cpp.

◆ set_element_number()

void isobus::task_controller_object::DeviceElementObject::set_element_number ( std::uint16_t newElementNumber)

Update the object's element number to a new value.

Parameters
[in]newElementNumberThe element number to set

Definition at line 283 of file isobus_task_controller_client_objects.cpp.

◆ set_parent_object()

void isobus::task_controller_object::DeviceElementObject::set_parent_object ( std::uint16_t parentObjectID)

Updates the object ID associated to this object's parent object.

Parameters
[in]parentObjectIDThe object ID to set as the parent to this object

Definition at line 293 of file isobus_task_controller_client_objects.cpp.

Member Data Documentation

◆ elementNumber

std::uint16_t isobus::task_controller_object::DeviceElementObject::elementNumber
private

Element number for process data variable addressing.

Definition at line 289 of file isobus_task_controller_client_objects.hpp.

◆ elementType

Type isobus::task_controller_object::DeviceElementObject::elementType
private

See the comments on Type or ISO11783-10 table A.2.

Definition at line 291 of file isobus_task_controller_client_objects.hpp.

◆ parentObject

std::uint16_t isobus::task_controller_object::DeviceElementObject::parentObject
private

Object ID of parent DeviceElementObject or DeviceObject in order to establish a hierarchical order of DeviceElements.

Definition at line 290 of file isobus_task_controller_client_objects.hpp.

◆ referenceList

std::vector<std::uint16_t> isobus::task_controller_object::DeviceElementObject::referenceList
private

List of references to DeviceProcessDataObjects or DevicePropertyObjects.

Definition at line 288 of file isobus_task_controller_client_objects.hpp.

◆ tableID

const std::string isobus::task_controller_object::DeviceElementObject::tableID = "DET"
staticprivate

XML element namespace for DeviceElement.

Definition at line 287 of file isobus_task_controller_client_objects.hpp.


The documentation for this class was generated from the following files: