Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TC-helper]: Add fallback to maximum working width #530

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,21 @@ namespace isobus
static ProductControlInformation parse_bin(DeviceDescriptorObjectPool &ddop,
std::shared_ptr<task_controller_object::DeviceElementObject> elementObject);

/// @brief Sets the value and presence based on a DDI match.
/// @brief Sets the value and settable flag based on a DDI match for an object.
/// @param[in,out] objectPoolValue The object pool value to set.
/// @param[in] property The device property object.
/// @param[in] object The object to use to update the object pool value.
/// @param[in] ddi The DDI to check against.
static void set_value_from_property(ObjectPoolValue &objectPoolValue,
const std::shared_ptr<task_controller_object::DevicePropertyObject> &property,
DataDescriptionIndex ddi);

/// @brief Sets the settable flag based on a DDI match for process data.
/// @param[in,out] objectPoolValue The object pool value to update.
/// @param[in] processData The device process data object.
/// @param[in] ddi The DDI to check against.
static void set_editable_from_process_data(ObjectPoolValue &objectPoolValue,
const std::shared_ptr<task_controller_object::DeviceProcessDataObject> &processData,
DataDescriptionIndex ddi);
static void set_value_and_editable_from_object(ObjectPoolValue &objectPoolValue,
const std::shared_ptr<task_controller_object::Object> &object,
DataDescriptionIndex ddi);

/// @brief Sets the rate information based on the supplied object if the DDI is known to be a rate DDI.
/// @param rate The rate metadata to update.
/// @param object The object to use to update the product control information.
/// @param ddi The DDI to check against.
static void set_product_control_information_rate(RateMetadata &rate,
const std::shared_ptr<task_controller_object::Object> &object,
std::uint16_t ddi);

/// @brief Sets the max rate field of the product control information based on the supplied object
/// if the DDI is known to be a max rate DDI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef ISOBUS_TASK_CONTROLLER_CLIENT_OBJECTS_HPP
#define ISOBUS_TASK_CONTROLLER_CLIENT_OBJECTS_HPP

#include "isobus/utility/data_span.hpp"

#include <array>
#include <cstdint>
#include <string>
Expand All @@ -22,11 +24,11 @@ namespace isobus
/// @brief Enumerates the different kinds of DDOP objects
enum class ObjectTypes
{
Device, ///< The root object. Each device shall have one single Device
DeviceElement, ///< Subcomponent of a device. Has multiple sub-types
DeviceProcessData, ///< Contains a single process data variable definition
DeviceProperty, ///< A device property element
DeviceValuePresentation ///< Contains the presentation information to display the value of a DeviceProcessData or DeviceProperty object
Device, ///< The root object. Each device shall have one single Device (DVC)
DeviceElement, ///< Subcomponent of a device. Has multiple sub-types (DET)
DeviceProcessData, ///< Contains a single process data variable definition (DPD)
DeviceProperty, ///< A device property element (DPT)
DeviceValuePresentation ///< Contains the presentation information to display the value of a DeviceProcessData or DeviceProperty object (DVP)
};

/// @brief A base class for a Task Controller Object
Expand Down Expand Up @@ -272,6 +274,10 @@ namespace isobus
/// @returns true if the child object ID was found and removed, otherwise false
bool remove_reference_to_child_object(std::uint16_t childID);

/// @brief Returns a span of the child objects added with `add_reference_to_child_object`.
/// @returns A span of the child object IDs
DataSpan<const std::uint16_t> get_child_object_ids() const;

/// @brief 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.
Expand Down Expand Up @@ -368,6 +374,11 @@ namespace isobus
/// @param[in] properties The new properties bitfield to set
void set_properties_bitfield(std::uint8_t properties);

/// @brief Tests whether a property is set in the properties bitfield
/// @param property The property to test for
/// @returns `true` if the property is set, otherwise `false`
bool has_property(DeviceProcessDataObject::PropertiesBit property);

/// @brief Returns the object's available trigger methods
/// @returns The available trigger methods bitfield for this object
std::uint8_t get_trigger_methods_bitfield() const;
Expand All @@ -376,6 +387,11 @@ namespace isobus
/// @param[in] methods The new trigger methods bitfield to set
void set_trigger_methods_bitfield(std::uint8_t methods);

/// @brief Tests whether a trigger method is set in the trigger methods bitfield
/// @param method The trigger method to test for
/// @returns `true` if the trigger method is set, otherwise `false`
bool has_trigger_method(DeviceProcessDataObject::AvailableTriggerMethods method);

private:
static const std::string tableID; ///< XML element namespace for DeviceProcessData.
std::uint16_t ddi; ///< Identifier of process data variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ namespace isobus
/// @brief Sends a time interval measurement command.
/// The process data value for this command is the time interval for sending the data element
/// specified by the data dictionary identifier.The client has to send the value of this data
/// element to the TC or DL cyclic with this time interval.
/// element to the TC or DL cyclic with this time interval in milliseconds.
/// @param[in] clientControlFunction The control function to send the message to
/// @param[in] dataDescriptionIndex The data description index of the data element to send the command for
/// @param[in] elementNumber The element number of the data element to send the command for
/// @param[in] timeInterval The time interval for sending the data element specified by the data dictionary identifier.
/// @param[in] timeInterval The time interval in milliseconds for sending the data element specified by the data dictionary identifier.
/// @returns true if the message was sent, otherwise false
bool send_time_interval_measurement_command(std::shared_ptr<ControlFunction> clientControlFunction, std::uint16_t dataDescriptionIndex, std::uint16_t elementNumber, std::uint32_t timeInterval) const;

Expand Down
Loading
Loading