AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
isobus_device_descriptor_object_pool_helpers.hpp
Go to the documentation of this file.
1//================================================================================================
10//================================================================================================
11
12#ifndef ISOBUS_DEVICE_DESCRIPTOR_OBJECT_POOL_HELPERS_HPP
13#define ISOBUS_DEVICE_DESCRIPTOR_OBJECT_POOL_HELPERS_HPP
14
18
19namespace isobus
20{
26 {
27 public:
31 {
32 public:
35 ObjectPoolValue() = default;
36
40 explicit operator bool() const;
41
46 bool exists() const;
47
50 bool editable() const;
51
54 std::int32_t get() const;
55
56 protected:
58
59 std::int32_t value = 0;
60 bool isValuePresent = false;
61 bool isSettable = false;
62 };
63
66 {
67 public:
68 std::uint16_t dataDictionaryIdentifier = static_cast<std::uint16_t>(DataDescriptionIndex::Reserved);
69 std::uint16_t objectID = NULL_OBJECT_ID;
70
71 protected:
73 };
74
92
107
110 {
111 public:
112 std::vector<Section> sections;
113 std::vector<ProductControlInformation> rates;
119 };
120
123 class Boom
124 {
125 public:
126 std::vector<Section> sections;
127 std::vector<SubBoom> subBooms;
128 std::vector<ProductControlInformation> rates;
133 };
134
137 {
138 public:
139 std::vector<Boom> booms;
140 };
141
146
147 private:
153 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject,
154 Implement &implementToPopulate);
155
161 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject);
162
168 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject);
169
175 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject);
176
181 static void set_value_from_property(ObjectPoolValue &objectPoolValue,
182 const std::shared_ptr<task_controller_object::DevicePropertyObject> &property,
184
189 static void set_editable_from_process_data(ObjectPoolValue &objectPoolValue,
190 const std::shared_ptr<task_controller_object::DeviceProcessDataObject> &processData,
192
198 static void set_product_control_information_max_rate(ProductControlInformation &productControlInformation,
199 const std::shared_ptr<task_controller_object::Object> &object,
200 std::uint16_t ddi);
201
207 static void set_product_control_information_min_rate(ProductControlInformation &productControlInformation,
208 const std::shared_ptr<task_controller_object::Object> &object,
209 std::uint16_t ddi);
210
216 static void set_product_control_information_default_rate(ProductControlInformation &productControlInformation,
217 const std::shared_ptr<task_controller_object::Object> &object,
218 std::uint16_t ddi);
219
226 const std::shared_ptr<task_controller_object::Object> &object,
227 std::uint16_t ddi);
228
234 static void set_product_control_information_actual_rate(ProductControlInformation &productControlInformation,
235 const std::shared_ptr<task_controller_object::Object> &object,
236 std::uint16_t ddi);
237 };
238} // namespace isobus
239
240#endif // ISOBUS_DEVICE_DESCRIPTOR_OBJECT_POOL_HELPERS_HPP
General constants used throughout this library.
A helper class that describes a boom This is used to describe a boom, or more generally,...
std::vector< ProductControlInformation > rates
If the boom has rates, this will contain the associated data needed to control the product.
ObjectPoolValue zOffset_mm
The z offset of the sub boom in mm. Z offsets are up+/down-.
ObjectPoolValue xOffset_mm
The x offset of the sub boom in mm. X offsets are fore+/aft-.
ObjectPoolValue yOffset_mm
The y offset of the sub boom in mm. Y offsets are left-/right+.
std::uint16_t elementNumber
The element number of the boom, which can be used to avoid further parsing of the DDOP when issuing c...
A helper class that describes an implement based on its DDOP.
A wrapper for a DDOP value which tells you if the value was actually supplied by the DDOP.
bool exists() const
Returns if this variable exists. A variable exists if it was either provided in the DDOP,...
bool isSettable
Stores if the value can be set, such as on a DPD's value.
std::int32_t get() const
Returns the value. If the value doesn't exist this will return 0.
bool editable() const
Returns if this value is editable. DPDs are editable. DPTs are not.
ObjectPoolValue()=default
Default constructor for ObjectPoolValue which defaults the value to being non-existant and not settab...
A helper class that groups product rate infomation together. A TC server could use this to know quick...
std::uint16_t elementNumber
The element number of the bin, which can be used to avoid further parsing of the DDOP when issuing co...
std::uint16_t dataDictionaryIdentifier
The data dictionary index of the product control rate.
A helper class that describes an individual section of a boom. This is used to describe the sections ...
ObjectPoolValue zOffset_mm
The z offset of the section in mm. Z offsets are up+/down-.
ObjectPoolValue yOffset_mm
The y offset of the section in mm. Y offsets are left-/right+.
std::vector< ProductControlInformation > rates
If the section has rates, this will contain the associated data needed to control the product.
std::uint16_t elementNumber
The element number of the section, which can be used to avoid further parsing of the DDOP when issuin...
ObjectPoolValue xOffset_mm
The x offset of the section in mm. X offsets are fore+/aft-.
A helper class that describes a sub boom (not all devices support this)
ObjectPoolValue xOffset_mm
The x offset of the sub boom in mm. X offsets are fore+/aft-.
std::uint16_t elementNumber
The element number of the sub boom , which can be used to avoid further parsing of the DDOP when issu...
ObjectPoolValue zOffset_mm
The z offset of the sub boom in mm. Z offsets are up+/down-.
ObjectPoolValue yOffset_mm
The y offset of the sub boom in mm. Y offsets are left-/right+.
std::vector< ProductControlInformation > rates
If the sub-boom has rates, this will contain the associated data needed to control the product.
static void set_product_control_information_actual_rate(ProductControlInformation &productControlInformation, const std::shared_ptr< task_controller_object::Object > &object, std::uint16_t ddi)
Sets the actual rate field of the product control information based on the supplied object if the DDI...
static void set_product_control_information_setpoint_rate(ProductControlInformation &productControlInformation, const std::shared_ptr< task_controller_object::Object > &object, std::uint16_t ddi)
Sets the setpoint rate field of the product control information based on the supplied object if the D...
static void set_value_from_property(ObjectPoolValue &objectPoolValue, const std::shared_ptr< task_controller_object::DevicePropertyObject > &property, DataDescriptionIndex ddi)
Sets the value and presence based on a DDI match.
static SubBoom parse_sub_boom(DeviceDescriptorObjectPool &ddop, std::shared_ptr< task_controller_object::DeviceElementObject > elementObject)
Parse a sub boom element of the DDOP.
static void set_product_control_information_min_rate(ProductControlInformation &productControlInformation, const std::shared_ptr< task_controller_object::Object > &object, std::uint16_t ddi)
Sets the minimum rate field of the product control information based on the supplied object if the DD...
static void parse_element(DeviceDescriptorObjectPool &ddop, std::shared_ptr< task_controller_object::DeviceElementObject > elementObject, Implement &implementToPopulate)
Parse an element of the DDOP.
static void set_editable_from_process_data(ObjectPoolValue &objectPoolValue, const std::shared_ptr< task_controller_object::DeviceProcessDataObject > &processData, DataDescriptionIndex ddi)
Sets the settable flag based on a DDI match for process data.
static void set_product_control_information_max_rate(ProductControlInformation &productControlInformation, const std::shared_ptr< task_controller_object::Object > &object, std::uint16_t ddi)
Sets the max rate field of the product control information based on the supplied object if the DDI is...
static ProductControlInformation parse_bin(DeviceDescriptorObjectPool &ddop, std::shared_ptr< task_controller_object::DeviceElementObject > elementObject)
Parses a bin element of the DDOP.
static Section parse_section(DeviceDescriptorObjectPool &ddop, std::shared_ptr< task_controller_object::DeviceElementObject > elementObject)
Parse a section element of the DDOP.
static Implement get_implement_geometry(DeviceDescriptorObjectPool &ddop)
Get the implement description from the DDOP.
static void set_product_control_information_default_rate(ProductControlInformation &productControlInformation, const std::shared_ptr< task_controller_object::Object > &object, std::uint16_t ddi)
Sets the default rate field of the product control information based on the supplied object if the DD...
Defines an interface for creating a Task Controller DDOP.
Defines some standard DDIs. Does not include proprietary DDIs.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
constexpr std::uint16_t NULL_OBJECT_ID
Special ID used to indicate no object.
DataDescriptionIndex
Enumerates a subset of standard ISOBUS DDIs.