9#ifndef ISOBUS_TASK_CONTROLLER_CLIENT_OBJECTS_HPP
10#define ISOBUS_TASK_CONTROLLER_CLIENT_OBJECTS_HPP
20 namespace task_controller_object
39 Object(std::string objectDesignator, std::uint16_t uniqueID);
101 std::string deviceSoftwareVersion,
102 std::string deviceSerialNumber,
103 std::string deviceStructureLabel,
104 std::array<std::uint8_t, 7> deviceLocalizationLabel,
105 std::vector<std::uint8_t> deviceExtendedStructureLabel,
106 std::uint64_t clientIsoNAME,
107 bool shouldUseExtendedStructureLabel);
194 std::array<std::uint8_t, task_controller_object::DeviceObject::MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH>
localizationLabel;
225 std::uint16_t deviceElementNumber,
226 std::uint16_t parentObjectID,
227 Type deviceEelementType,
228 std::uint16_t uniqueID);
326 std::uint16_t processDataDDI,
327 std::uint16_t deviceValuePresentationObjectID,
328 std::uint8_t processDataProperties,
329 std::uint8_t processDataTriggerMethods,
330 std::uint16_t uniqueID);
353 void set_ddi(std::uint16_t newDDI);
400 std::int32_t propertyValue,
401 std::uint16_t propertyDDI,
402 std::uint16_t valuePresentationObject,
403 std::uint16_t uniqueID);
434 void set_ddi(std::uint16_t newDDI);
465 std::int32_t offsetValue,
467 std::uint8_t numberDecimals,
468 std::uint16_t uniqueID);
DeviceElementObject is the object definition of the XML element DeviceElement. The attribute Type spe...
~DeviceElementObject() override=default
Destructor for a DeviceElementObject.
std::string get_table_id() const override
Returns the XML namespace for the object.
void set_element_number(std::uint16_t newElementNumber)
Update the object's element number to a new value.
ObjectTypes get_object_type() const override
Returns the object type.
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...
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.
std::uint16_t get_number_child_objects() const
Returns the number of child objects added with add_reference_to_child_object.
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.
bool remove_reference_to_child_object(std::uint16_t childID)
Removes a child object reference from this object.
std::uint16_t get_element_number() const
Returns the element number.
std::uint16_t get_parent_object() const
Returns the parent object ID.
DeviceElementObject(std::string deviceElementDesignator, std::uint16_t deviceElementNumber, std::uint16_t parentObjectID, Type deviceEelementType, std::uint16_t uniqueID)
Constructor for a DeviceElementObject.
std::uint16_t get_child_object_id(std::size_t index)
Returns a child object ID by index.
Type get_type() const
Returns the type of the element object.
static const std::string tableID
XML element namespace for DeviceElement.
std::vector< std::uint16_t > referenceList
List of references to DeviceProcessDataObjects or DevicePropertyObjects.
Type elementType
See the comments on Type or ISO11783-10 table A.2.
void set_parent_object(std::uint16_t parentObjectID)
Updates the object ID associated to this object's parent object.
Type
Enumerates the types of device element object.
@ Unit
This device element type is, for example, used for spray boom nozzles, seeder openers,...
@ Bin
This is, for instance, the tank of a sprayer or the bin of a seeder.
@ Function
This device element type can be used as a generic device element to define individually accessible co...
@ NavigationReference
This device element type defines the navigation reference position for navigation devices such as GPS...
@ Section
This is, for instance, the section of a spray boom, seed toolbar, or planter toolbar.
@ Device
The device descriptor object pool shall have one device element of type device.
@ Connector
This device element type specifies the mounting/connection position of the device.
Each device shall have one single DeviceObject in its device descriptor object pool....
~DeviceObject() override=default
Destructor for a DeviceObject.
DeviceObject(std::string deviceDesignator, std::string deviceSoftwareVersion, std::string deviceSerialNumber, std::string deviceStructureLabel, std::array< std::uint8_t, 7 > deviceLocalizationLabel, std::vector< std::uint8_t > deviceExtendedStructureLabel, std::uint64_t clientIsoNAME, bool shouldUseExtendedStructureLabel)
Constructor for a DeviceObject.
std::string get_serial_number() const
Returns the serial number for the device.
std::string softwareVersion
Software version of the device.
std::array< std::uint8_t, 7 > get_localization_label() const
Returns the localization label for this DDOP.
void set_localization_label(std::array< std::uint8_t, 7 > label)
Changes the localization label to a new value.
void set_structure_label(const std::string &label)
Sets the device structure label to a new value.
void set_serial_number(const std::string &serial)
Sets the serial number for the device as reported in the DDOP.
std::vector< std::uint8_t > extendedStructureLabel
Continuation of the Label given by Device to identify the Device descriptor Structure.
void set_software_version(const std::string &version)
Sets the software version for the device, as reported in the DDOP.
std::string serialNumber
Device and manufacturer-specific serial number of the Device.
ObjectTypes get_object_type() const override
Returns the object type.
std::uint64_t get_iso_name() const
Returns the ISO NAME associated with this DDOP.
void set_extended_structure_label(const std::vector< std::uint8_t > &label)
Sets the extended structure label to a new value. Only used for TCs with version 4+.
std::vector< std::uint8_t > get_extended_structure_label() const
Returns the extended structure label (if applicable)
std::string structureLabel
Label given by device to identify the device descriptor structure.
bool useExtendedStructureLabel
Tells the device if it should generate binary info using the extended structure label or ignore it.
std::string get_structure_label() const
Returns the structure label for this DDOP.
std::string get_software_version() const
Returns the software version of the device.
std::array< std::uint8_t, task_controller_object::DeviceObject::MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH > localizationLabel
Label given by device to identify the device descriptor localization.
static constexpr std::size_t MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH
Defines the max length of the device structure label and device localization label (in bytes)
bool get_use_extended_structure_label() const
Returns if the class will append the extended structure label to its serialized form.
static const std::string tableID
XML element namespace for device.
void set_iso_name(std::uint64_t name)
Changes the stored ISO NAME to a new value.
std::uint64_t NAME
The NAME of client device as defined in ISO 11783-5. MUST match your address claim.
std::string get_table_id() const override
Returns the XML namespace for the object.
void set_use_extended_structure_label(bool shouldUseExtendedStructureLabel)
Sets the class' behavior for dealing with the extended structure label.
static constexpr std::size_t MAX_EXTENDED_STRUCTURE_LABEL_LENGTH
Defines the max length of the device extended structure label (in bytes)
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.
The DeviceProcessDataObject is the object definition of the XML element DeviceProcessData....
ObjectTypes get_object_type() const override
Returns the object type.
void set_ddi(std::uint16_t newDDI)
Updates the DDI associated to this DPD object.
std::uint8_t triggerMethodsBitfield
A bitset defined in A.4.1 to A.4.5.
DeviceProcessDataObject(std::string processDataDesignator, std::uint16_t processDataDDI, std::uint16_t deviceValuePresentationObjectID, std::uint8_t processDataProperties, std::uint8_t processDataTriggerMethods, std::uint16_t uniqueID)
Constructor for a DeviceProcessDataObject.
std::string get_table_id() const override
Returns the XML element namespace for DeviceProcess-Data.
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::uint8_t propertiesBitfield
A bitset of properties for this object.
PropertiesBit
Enumerates the properties in the properties bitset of this object.
@ Settable
if this object is settable
@ MemberOfDefaultSet
member of default set
@ ControlSource
Version 4, mutually exclusive with bit 2.
std::uint8_t get_trigger_methods_bitfield() const
Returns the object's available trigger methods.
std::uint16_t get_device_value_presentation_object_id() const
Returns Object identifier of the DeviceValuePresentation-Object for this object, or the null ID.
void set_trigger_methods_bitfield(std::uint8_t methods)
Updates the object's available trigger methods bitfield to a new value.
void set_device_value_presentation_object_id(std::uint16_t id)
Updates the object ID to use as an associated presentation for this object.
std::uint16_t deviceValuePresentationObject
Object identifier of DeviceValuePresentation-Object.
std::uint8_t get_properties_bitfield() const
Returns the object's properties bitfield.
AvailableTriggerMethods
Enumerates the trigger methods that can be set in the available trigger bitset of this object.
@ DistanceInterval
The device can provide these device process data based on a distance interval.
@ TimeInterval
The device can provide these device process data based on a time interval.
@ ThresholdLimits
The device can provide these device process data based on a surpassing of the value threshold.
@ Total
These device process data are a total.
@ OnChange
The device can provide these device process data when its value changes.
std::uint16_t get_ddi() const
Returns the DDI.
void set_properties_bitfield(std::uint8_t properties)
Updates the properties bitfield to a new value.
~DeviceProcessDataObject() override=default
Destructor for a DeviceProcessDataObject.
std::uint16_t ddi
Identifier of process data variable.
static const std::string tableID
XML element namespace for DeviceProcessData.
DevicePropertyObject is the object definition of the XML element DeviceProperty. Each object contains...
~DevicePropertyObject() override=default
Destructor for a DevicePropertyObject.
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::string get_table_id() const override
Returns the XML element namespace for DeviceProperty.
ObjectTypes get_object_type() const override
Returns the object type.
void set_device_value_presentation_object_id(std::uint16_t id)
Updates the object ID to use as an associated presentation for this object.
DevicePropertyObject(std::string propertyDesignator, std::int32_t propertyValue, std::uint16_t propertyDDI, std::uint16_t valuePresentationObject, std::uint16_t uniqueID)
Constructor for a DevicePropertyObject.
void set_ddi(std::uint16_t newDDI)
Updates the DDI associated with this DPT object to a new value.
std::uint16_t get_device_value_presentation_object_id() const
Returns the object identifier of an associated DeviceValuePresentationObject.
std::uint16_t deviceValuePresentationObject
Object identifier of DeviceValuePresentationObject.
std::int32_t get_value() const
Returns the property's value.
void set_value(std::int32_t newValue)
Sets the property value.
std::uint16_t get_ddi() const
Returns the DDI for this object.
static const std::string tableID
XML element namespace for DeviceProperty.
std::int32_t value
The value of the property.
std::uint16_t ddi
Identifier of property (DDI) according to definitions in Annex B and ISO 11783 - 11.
This object contains the presentation information to display the value of a DeviceProcessData or Devi...
std::int32_t get_offset() const
Returns the offset that is applied to the value for presentation.
std::string get_table_id() const override
Returns the XML element namespace for DeviceValuePresentation.
void set_number_of_decimals(std::uint8_t decimals)
Sets the number of decimals to show when presenting objects associated with this presentation.
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.
float get_scale() const
Returns the scale that is applied to the value for presentation.
DeviceValuePresentationObject(std::string unitDesignator, std::int32_t offsetValue, float scaleFactor, std::uint8_t numberDecimals, std::uint16_t uniqueID)
The constructor for a DeviceValuePresentationObject.
void set_offset(std::int32_t newOffset)
Sets the offset that is applied to the value for presentation.
float scale
Scale to be applied to the value for presentation.
std::int32_t offset
Offset to be applied to the value for presentation.
void set_scale(float newScale)
Sets the scale which will be applied to the value for presentation.
std::uint8_t get_number_of_decimals() const
Returns the number of decimals shown after the decimal point.
~DeviceValuePresentationObject() override=default
Destructor for a DeviceValuePresentationObject.
static const std::string tableID
XML element namespace for DeviceValuePresentation.
std::uint8_t numberOfDecimals
Specify number of decimals to display after the decimal point.
ObjectTypes get_object_type() const override
Returns the object type.
A base class for a Task Controller Object.
static constexpr std::size_t MAX_DESIGNATOR_LEGACY_LENGTH
Defines the max length of a designator (in bytes) for TCs older than version 4.
static constexpr std::size_t MAX_DESIGNATOR_LENGTH
Defines the max length of a designator (in bytes)
virtual std::vector< std::uint8_t > get_binary_object() const =0
Returns the binary representation of the TC object, or an empty vector if object is invalid.
void set_designator(const std::string &newDesignator)
Updates the designator to a new value.
void set_object_id(std::uint16_t id)
Updates the object ID of the object to a new value.
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.
static constexpr std::uint16_t MAX_OBJECT_ID
The max allowable "valid" object ID.
std::uint16_t get_object_id() const
Returns the object ID of the object.
virtual ObjectTypes get_object_type() const =0
Returns the derived TC object type fot the 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.
Object(std::string objectDesignator, std::uint16_t uniqueID)
Constructor for the TC object base class.
virtual std::string get_table_id() const =0
Returns the XML namespace for the object.
ObjectTypes
Enumerates the different kinds of DDOP objects.
@ DeviceProperty
A device property element.
@ DeviceProcessData
Contains a single process data variable definition.
@ DeviceElement
Subcomponent of a device. Has multiple sub-types.
@ DeviceValuePresentation
Contains the presentation information to display the value of a DeviceProcessData or DeviceProperty o...
@ Device
The root object. Each device shall have one single Device.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...