15 DeviceDescriptorObjectPoolHelper::ObjectPoolValue::operator bool()
const
37 return ((rateActual.dataDictionaryIdentifier !=
static_cast<std::uint16_t
>(DataDescriptionIndex::Reserved)) ||
38 (rateDefault.dataDictionaryIdentifier !=
static_cast<std::uint16_t
>(DataDescriptionIndex::Reserved)) ||
39 (rateMaximum.dataDictionaryIdentifier !=
static_cast<std::uint16_t
>(DataDescriptionIndex::Reserved)) ||
40 (rateMinimum.dataDictionaryIdentifier !=
static_cast<std::uint16_t
>(DataDescriptionIndex::Reserved)) ||
41 (rateSetpoint.dataDictionaryIdentifier !=
static_cast<std::uint16_t
>(DataDescriptionIndex::Reserved)));
50 LOG_ERROR(
"[DDOP Helper]: No objects in the pool.");
55 for (std::uint16_t i = 0; i < ddop.
size(); i++)
59 if ((
nullptr != deviceObject) &&
63 bool foundFunction =
false;
64 std::shared_ptr<task_controller_object::DeviceElementObject> deviceElementObject;
67 for (std::uint16_t j = 0; j < ddop.
size(); j++)
71 if ((
nullptr != currentElementObject) &&
73 (std::static_pointer_cast<task_controller_object::DeviceElementObject>(currentElementObject)->get_parent_object() == deviceObject->get_object_id()))
75 deviceElementObject = std::static_pointer_cast<task_controller_object::DeviceElementObject>(currentElementObject);
78 for (std::uint16_t k = 0; k < ddop.
size(); k++)
82 if ((
nullptr != potentialFunction) &&
84 (std::static_pointer_cast<task_controller_object::DeviceElementObject>(potentialFunction)->get_parent_object() == currentElementObject->get_object_id()) &&
87 parse_element(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(potentialFunction), retVal);
95 if (!foundFunction && (
nullptr != deviceElementObject))
103 for (std::uint16_t k = 0; k < ddop.
size(); k++)
107 if ((
nullptr != potentialBin) &&
109 (std::static_pointer_cast<task_controller_object::DeviceElementObject>(potentialBin)->get_parent_object() == deviceElementObject->get_object_id()) &&
112 auto binInfo =
parse_bin(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(potentialBin));
114 if (binInfo.is_valid() && !retVal.
booms.empty())
116 retVal.
booms[0].rates.push_back(binInfo);
124 LOG_ERROR(
"[DDOP Helper]: No device object in the pool.");
129 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject,
133 boomToPopulate.
elementNumber = elementObject->get_element_number();
139 for (std::uint16_t i = 0; i < ddop.
size(); i++)
143 if ((
nullptr != element) &&
145 (std::static_pointer_cast<task_controller_object::DeviceElementObject>(element)->get_parent_object() == elementObject->get_object_id()))
149 boomToPopulate.
subBooms.push_back(
parse_sub_boom(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(element)));
153 auto binInfo =
parse_bin(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(element));
155 if (binInfo.is_valid())
157 boomToPopulate.
rates.push_back(binInfo);
164 if (boomToPopulate.
subBooms.empty())
167 for (std::uint16_t i = 0; i < ddop.
size(); i++)
171 if ((
nullptr != section) &&
174 (std::static_pointer_cast<task_controller_object::DeviceElementObject>(section)->get_parent_object() == elementObject->get_object_id()))
176 boomToPopulate.
sections.push_back(
parse_section(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(section)));
181 for (std::uint16_t i = 0; i < elementObject->get_number_child_objects(); i++)
185 if (
nullptr != child)
189 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(child);
196 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(child);
204 auto binInfo =
parse_bin(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(child));
206 if (binInfo.is_valid())
208 boomToPopulate.
rates.push_back(binInfo);
218 implementToPopulate.
booms.push_back(boomToPopulate);
222 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject)
226 for (std::uint16_t i = 0; i < elementObject->get_number_child_objects(); i++)
228 auto sectionChildObject = ddop.
get_object_by_id(elementObject->get_child_object_id(i));
230 if (
nullptr != sectionChildObject)
234 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(sectionChildObject);
242 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(sectionChildObject);
251 auto binInfo =
parse_bin(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(sectionChildObject));
253 if (binInfo.is_valid())
255 retVal.
rates.push_back(binInfo);
265 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject)
272 for (std::uint16_t i = 0; i < ddop.
size(); i++)
276 if ((
nullptr != section) &&
279 (std::static_pointer_cast<task_controller_object::DeviceElementObject>(section)->get_parent_object() == elementObject->get_object_id()))
281 retVal.
sections.push_back(
parse_section(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(section)));
286 for (std::uint16_t i = 0; i < elementObject->get_number_child_objects(); i++)
288 auto childObject = ddop.
get_object_by_id(elementObject->get_child_object_id(i));
290 if (
nullptr != childObject)
294 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(childObject);
302 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(childObject);
311 auto binInfo =
parse_bin(ddop, std::static_pointer_cast<task_controller_object::DeviceElementObject>(childObject));
313 if (binInfo.is_valid())
315 retVal.
rates.push_back(binInfo);
324 std::shared_ptr<task_controller_object::DeviceElementObject> elementObject)
333 for (std::uint16_t i = 0; i < elementObject->get_number_child_objects(); i++)
337 if (
nullptr !=
object)
341 std::uint16_t ddi = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(
object)->get_ddi();
350 std::uint16_t ddi = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(
object)->get_ddi();
364 const std::shared_ptr<task_controller_object::DevicePropertyObject> &property,
367 if (property->get_ddi() ==
static_cast<std::uint16_t
>(ddi))
369 objectPoolValue.
value =
property->get_value();
375 const std::shared_ptr<task_controller_object::DeviceProcessDataObject> &processData,
378 if (processData->get_ddi() ==
static_cast<std::uint16_t
>(ddi))
385 const std::shared_ptr<task_controller_object::Object> &
object,
409 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(
object);
411 if (ddi == processData->get_ddi())
420 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(
object);
422 if (ddi == property->get_ddi())
439 const std::shared_ptr<task_controller_object::Object> &
object,
463 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(
object);
465 if (ddi == processData->get_ddi())
474 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(
object);
476 if (ddi == property->get_ddi())
493 const std::shared_ptr<task_controller_object::Object> &
object,
512 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(
object);
514 if (ddi == processData->get_ddi())
523 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(
object);
525 if (ddi == property->get_ddi())
542 const std::shared_ptr<task_controller_object::Object> &
object,
566 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(
object);
568 if (ddi == processData->get_ddi())
577 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(
object);
579 if (ddi == property->get_ddi())
596 const std::shared_ptr<task_controller_object::Object> &
object,
620 auto processData = std::static_pointer_cast<task_controller_object::DeviceProcessDataObject>(
object);
622 if (ddi == processData->get_ddi())
631 auto property = std::static_pointer_cast<task_controller_object::DevicePropertyObject>(
object);
633 if (ddi == property->get_ddi())
A class that acts as a logging sink. The intent is that someone could make their own derived class of...
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-.
std::vector< SubBoom > subBooms
The sub booms of the boom.
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...
std::vector< Section > sections
The sections of the boom.
A helper class that describes an implement based on its DDOP.
std::vector< Boom > booms
The booms of the implement.
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.
bool isValuePresent
Stores if the value has ever been set.
std::int32_t value
The value being wrapped by this object.
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-.
ObjectPoolValue width_mm
The width of the section in mm.
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 width_mm
The width of the sub boom in mm.
std::vector< Section > sections
The sections of the sub boom.
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 a device descriptor object pool.
std::shared_ptr< task_controller_object::Object > get_object_by_index(std::uint16_t index)
Gets an object from the DDOP by index based on object creation.
std::shared_ptr< task_controller_object::Object > get_object_by_id(std::uint16_t objectID)
Gets an object from the DDOP that corresponds to a certain object ID.
std::uint16_t size() const
Returns the number of objects in the DDOP.
@ 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...
@ Section
This is, for instance, the section of a spray boom, seed toolbar, or planter toolbar.
@ Settable
if this object is settable
Defines helpers for getting commonly needed information out of a DDOP. These are provided so that you...
@ DeviceProperty
A device property element.
@ DeviceProcessData
Contains a single process data variable definition.
@ DeviceElement
Subcomponent of a device. Has multiple sub-types.
@ 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...
DataDescriptionIndex
Enumerates a subset of standard ISOBUS DDIs.
@ SetpointVolumePerAreaApplicationRate
Setpoint Application Rate specified as volume per area.
@ SetpointMassPerTimeApplicationRate
Setpoint Application Rate specified as mass per time.
@ MinimumCountPerAreaApplicationRate
Minimum Application Rate specified as count per area.
@ MinimumApplicationRateOfAmmonium
Minimum application rate of Ammonium specified as a mass per area.
@ MaximumVolumePerAreaApplicationRate
Maximum Application Rate specified as volume per area.
@ SetpointVolumePerMassApplicationRate
Setpoint Application Rate specified as volume per mass.
@ DefaultMassPerTimeApplicationRate
Default Application Rate specified as mass per time.
@ MaximumCountPerTimeApplicationRate
Maximum Application Rate specified as count per time.
@ MinimumMassPerTimeApplicationRate
Minimum Application Rate specified as mass per time.
@ MinimumCountPerTimeApplicationRate
Minimum Application Rate specified as count per time.
@ DefaultMassPerAreaApplicationRate
Default Application Rate specified as mass per area.
@ SetpointSpacingApplicationRate
Setpoint Application Rate specified as distance: e.g. seed spacing of a precision seeder.
@ SetpointVolumePerTimeApplicationRate
Setpoint Application Rate specified as volume per time.
@ ActualVolumePerMassApplicationRate
Actual Application Rate specified as volume per mass.
@ ActualApplicationRateOfNitrogen
Actual application rate of nitrogen specified as a mass per area.
@ MinimumApplicationRateOfPotassium
Minimum application rate of potassium specified as a mass per area.
@ DefaultVolumePerVolumeApplicationRate
Default Application Rate specified as volume per volume.
@ MaximumVolumePerVolumeApplicationRate
Maximum Application Rate specified as volume per volume.
@ MinimumVolumePerVolumeApplicationRate
Minimum Application Rate specified as volume per volume.
@ ActualRevolutionsPerTime
Actual Revolutions specified as count per time.
@ MaximumRevolutionsPerTime
Maximum Revolutions specified as count per time.
@ MaximumSpacingApplicationRate
Maximum Application Rate specified as distance: e.g. seed spacing of a precision seeder.
@ SetpointVolumePerVolumeApplicationRate
Setpoint Application Rate specified as volume per volume.
@ ActualApplicationRateOfAmmonium
Actual application rate of Ammonium specified as a mass per area.
@ DefaultVolumePerTimeApplicationRate
Default Application Rate specified as volume per time.
@ DeviceElementOffsetZ
Z direction offset of a DeviceElement relative to a Device.
@ DefaultRevolutionsPerTime
Default Revolutions specified as count per time.
@ MaximumVolumePerTimeApplicationRate
Maximum Application Rate specified as volume per time.
@ ActualMassPerMassApplicationRate
Actual Application Rate specified as mass per mass.
@ MaximumApplicationRateOfAmmonium
Maximum application rate of Ammonium specified as a mass per area.
@ SetpointCountPerAreaApplicationRate
Setpoint Application Rate specified as count per area.
@ ActualSpacingApplicationRate
Actual Application Rate specified as distance: e.g. seed spacing of a precision seeder.
@ MinimumApplicationRateOfNitrogen
Minimum application rate of nitrogen specified as a mass per area.
@ SetpointMassPerAreaApplicationRate
Setpoint Application Rate specified as mass per area.
@ MaximumApplicationRateOfDryMatter
Maximum application rate of dry matter expressed as percentage.
@ SetpointApplicationRateOfDryMatter
Setpoint application rate of dry matter expressed as percentage.
@ ActualCountPerTimeApplicationRate
Actual Application Rate specified as count per time.
@ ActualWorkingWidth
Actual Working Width of Device Element.
@ MinimumRevolutionsPerTime
Minimum Revolutions specified as count per time.
@ MaximumApplicationRateOfPotassium
Maximum application rate of potassium specified as a mass per area.
@ MaximumCountPerAreaApplicationRate
Maximum Application Rate specified as count per area.
@ DefaultVolumePerAreaApplicationRate
Default Application Rate specified as volume per area.
@ MaximumMassPerMassApplicationRate
Maximum Application Rate specified as mass per mass.
@ SetpointMassPerMassApplicationRate
Setpoint Application Rate specified as mass per mass.
@ DefaultSpacingApplicationRate
Default Application Rate specified as distance: e.g. seed spacing of a precision seeder.
@ MinimumMassPerMassApplicationRate
Minimum Application Rate specified as mass per mass.
@ DeviceElementOffsetY
Y direction offset of a DeviceElement relative to a Device.
@ MinimumMassPerAreaApplicationRate
Minimum Application Rate specified as mass per area.
@ ActualVolumePerAreaApplicationRate
Actual Application Rate specified as volume per area.
@ SetpointApplicationRateOfNitrogen
Setpoint application rate of nitrogen specified as a mass per area.
@ ActualMassPerTimeApplicationRate
Actual Application Rate specified as mass per time.
@ MinimumSpacingApplicationRate
Minimum Application Rate specified as distance: e.g. seed spacing of a precision seeder.
@ ActualVolumePerTimeApplicationRate
Actual Application Rate specified as volume per time.
@ MaximumVolumePerMassApplicationRate
Maximum Application Rate specified as volume per mass.
@ DefaultCountPerTimeApplicationRate
Default Application Rate specified as count per time.
@ MinimumApplicationRateOfDryMatter
Minimum application rate of dry matter expressed as percentage.
@ MinimumVolumePerMassApplicationRate
Minimum Application Rate specified as volume per mass.
@ MinimumVolumePerTimeApplicationRate
Minimum Application Rate specified as volume per time.
@ ActualApplicationRateOfDryMatter
Actual application rate of dry matter expressed as percentage.
@ SetpointApplicationRateOfPhosphor
Setpoint application rate of phosphor specified as a mass per area.
@ SetpointApplicationRateOfAmmonium
Setpoint application rate of Ammonium specified as a mass per area.
@ MinimumApplicationRateOfPhosphor
Minimum application rate of phosphor specified as a mass per area.
@ ActualApplicationRateOfPhosphor
Actual application rate of phosphor specified as a mass per area.
@ SetpointCountPerTimeApplicationRate
Setpoint Application Rate specified as count per time.
@ ActualVolumePerVolumeApplicationRate
Actual Application Rate specified as volume per volume.
@ ActualMassPerAreaApplicationRate
Actual Application Rate specified as mass per area.
@ DefaultCountPerAreaApplicationRate
Default Application Rate specified as count per area.
@ MaximumMassPerTimeApplicationRate
Maximum Application Rate specified as mass per time.
@ DefaultMassPerMassApplicationRate
Default Application Rate specified as mass per mass.
@ DeviceElementOffsetX
X direction offset of a DeviceElement relative to a Device.
@ MaximumMassPerAreaApplicationRate
Maximum Application Rate specified as mass per area.
@ ActualCountPerAreaApplicationRate
Actual Application Rate specified as count per area.
@ SetpointRevolutionsSpecifiedAsCountPerTime
Setpoint Revolutions specified as count per time.
@ MaximumApplicationRateOfPhosphor
Maximum application rate of phosphor specified as a mass per area.
@ ActualApplicationRateOfPotassium
Actual application rate of potassium specified as a mass per area.
@ MaximumApplicationRateOfNitrogen
Maximum application rate of nitrogen specified as a mass per area.
@ DefaultVolumePerMassApplicationRate
Default Application Rate specified as volume per mass.
@ MinimumVolumePerAreaApplicationRate
Minimum Application Rate specified as volume per area.
@ SetpointApplicationRateOfPotassium
Setpoint application rate of potassium specified as a mass per area.