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

Groups the data encoded in an ISO "Wheel-based Speed and Distance" message. More...

#include <isobus_speed_distance_messages.hpp>

Public Types

enum class  KeySwitchState : std::uint8_t { Off = 0 , NotOff = 1 , Error = 2 , NotAvailable = 3 }
 Enumerates the key switch states of the tractor or power unit. More...
 
enum class  ImplementStartStopOperations : std::uint8_t { StopDisableImplementOperations = 0 , StartEnableImplementOperations = 1 , Error = 2 , NotAvailable = 3 }
 Enumerates the states of a switch or operator input to start or enable implement operations. More...
 
enum class  OperatorDirectionReversed : std::uint8_t { NotReversed = 0 , Reversed = 1 , Error = 2 , NotAvailable = 3 }
 This parameter indicates whether the reported direction is reversed from the perspective of the operator. More...
 

Public Member Functions

 WheelBasedMachineSpeedData (std::shared_ptr< ControlFunction > sender)
 Constructor for a WheelBasedMachineSpeedData.
 
std::uint32_t get_machine_distance () const
 Returns The distance traveled by a machine as calculated from wheel or tail-shaft speed.
 
bool set_machine_distance (std::uint32_t distance)
 Sets the distance traveled by a machine as calculated from wheel or tail-shaft speed.
 
std::uint16_t get_machine_speed () const
 Returns the value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.
 
bool set_machine_speed (std::uint16_t speed)
 Sets the value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.
 
std::uint8_t get_maximum_time_of_tractor_power () const
 Returns the maximum time (in minutes) of remaining tractor or power-unit-supplied electrical power at the current load.
 
bool set_maximum_time_of_tractor_power (std::uint8_t maxTime)
 Sets the maximum time (in minutes) of remaining tractor or power-unit-supplied electrical power at the current load.
 
MachineDirection get_machine_direction_of_travel () const
 Returns A measured signal indicating either forward or reverse as the direction of travel.
 
bool set_machine_direction_of_travel (MachineDirection direction)
 Sets a measured signal indicating either forward or reverse as the direction of travel.
 
KeySwitchState get_key_switch_state () const
 Returns the key switch state of the tractor or power unit.
 
bool set_key_switch_state (KeySwitchState state)
 Sets the reported key switch state of the tractor or power unit.
 
ImplementStartStopOperations get_implement_start_stop_operations_state () const
 Returns the state of a switch or other operator input to start or enable implement operations.
 
bool set_implement_start_stop_operations_state (ImplementStartStopOperations state)
 Sets the state of a switch or other operator input to start or enable implement operations.
 
OperatorDirectionReversed get_operator_direction_reversed_state () const
 Returns whether the reported direction is reversed from the perspective of the operator.
 
bool set_operator_direction_reversed_state (OperatorDirectionReversed reverseState)
 Sets whether the reported direction is reversed from the perspective of the operator.
 
std::shared_ptr< ControlFunctionget_sender_control_function () const
 Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used to transmit from.
 
void set_timestamp_ms (std::uint32_t timestamp)
 Sets the timestamp for when the message was received or sent.
 
std::uint32_t get_timestamp_ms () const
 Returns the timestamp for when the message was received, in milliseconds.
 

Private Attributes

std::shared_ptr< ControlFunction > const controlFunction
 The CF that is sending the message.
 
std::uint32_t timestamp_ms = 0
 A timestamp for when the message was released in milliseconds.
 
std::uint32_t wheelBasedMachineDistance_mm = 0
 Stores the decoded machine wheel-based distance in millimeters.
 
std::uint16_t wheelBasedMachineSpeed_mm_per_sec = 0
 Stores the decoded wheel-based machine speed in mm/s.
 
std::uint8_t maximumTimeOfTractorPower_min = 0
 Stores the maximum time of remaining tractor or power-unit-supplied electrical power at the current load.
 
MachineDirection machineDirectionState = MachineDirection::NotAvailable
 Stores direction of travel.
 
KeySwitchState keySwitchState = KeySwitchState::NotAvailable
 Stores the key switch state of the tractor or power unit.
 
ImplementStartStopOperations implementStartStopOperationsState = ImplementStartStopOperations::NotAvailable
 Stores the state of a switch or other operator input to start or enable implement operations.
 
OperatorDirectionReversed operatorDirectionReversedState = OperatorDirectionReversed::NotAvailable
 Stores whether the reported direction is reversed from the perspective of the operator.
 

Detailed Description

Groups the data encoded in an ISO "Wheel-based Speed and Distance" message.

Definition at line 56 of file isobus_speed_distance_messages.hpp.

Member Enumeration Documentation

◆ ImplementStartStopOperations

Enumerates the states of a switch or operator input to start or enable implement operations.

Definition at line 69 of file isobus_speed_distance_messages.hpp.

◆ KeySwitchState

Enumerates the key switch states of the tractor or power unit.

Enumerator
Off 

Key is off.

NotOff 

Key is not off (does not always mean that it's on!)

Definition at line 60 of file isobus_speed_distance_messages.hpp.

◆ OperatorDirectionReversed

This parameter indicates whether the reported direction is reversed from the perspective of the operator.

Definition at line 78 of file isobus_speed_distance_messages.hpp.

Constructor & Destructor Documentation

◆ WheelBasedMachineSpeedData()

isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::WheelBasedMachineSpeedData ( std::shared_ptr< ControlFunction > sender)
explicit

Constructor for a WheelBasedMachineSpeedData.

Parameters
[in]senderThe control function that is sending this message

Definition at line 55 of file isobus_speed_distance_messages.cpp.

Member Function Documentation

◆ get_implement_start_stop_operations_state()

SpeedMessagesInterface::WheelBasedMachineSpeedData::ImplementStartStopOperations isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_implement_start_stop_operations_state ( ) const

Returns the state of a switch or other operator input to start or enable implement operations.

The start or enabled state can be the result of the implement being positioned in an operating position. It can be generated by an operator placing a switch to an ON state. Also called "Master ON/OFF" switch.

Returns
The state of a switch or other operator input to start or enable implement operations.

Definition at line 133 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_key_switch_state()

SpeedMessagesInterface::WheelBasedMachineSpeedData::KeySwitchState isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_key_switch_state ( ) const

Returns the key switch state of the tractor or power unit.

Returns
The key switch state of the tractor or power unit.

Definition at line 121 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_direction_of_travel()

SpeedMessagesInterface::MachineDirection isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_machine_direction_of_travel ( ) const

Returns A measured signal indicating either forward or reverse as the direction of travel.

Note
When the speed is zero, this indicates the last travel direction until a different direction is detected or selected and engaged.
Returns
The measured direction of travel for the machine

Definition at line 109 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_distance()

std::uint32_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_machine_distance ( ) const

Returns The distance traveled by a machine as calculated from wheel or tail-shaft speed.

Note
When the distance exceeds 4211081215m the value shall be reset to zero and incremented as additional distance accrues.
Returns
The distance traveled by a machine as calculated from wheel or tail-shaft speed. (millimeters)

Definition at line 60 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_speed()

std::uint16_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_machine_speed ( ) const

Returns the value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.

Returns
The value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.

Definition at line 79 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_maximum_time_of_tractor_power()

std::uint8_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_maximum_time_of_tractor_power ( ) const

Returns the maximum time (in minutes) of remaining tractor or power-unit-supplied electrical power at the current load.

Returns
The maximum time of remaining tractor or power-unit-supplied electrical power at the current load (in minutes)

Definition at line 97 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_operator_direction_reversed_state()

SpeedMessagesInterface::WheelBasedMachineSpeedData::OperatorDirectionReversed isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_operator_direction_reversed_state ( ) const

Returns whether the reported direction is reversed from the perspective of the operator.

Returns
Whether the reported direction is reversed from the perspective of the operator or not

Definition at line 145 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_sender_control_function()

std::shared_ptr< ControlFunction > isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_sender_control_function ( ) const

Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used to transmit from.

Attention
The only way you could get an invalid pointer here is if you register a partner, it sends this message, then you delete the partner and call this function, as that is the only time the stack deletes a control function. That would be abnormal program flow, but at some point the stack will be updated to return a shared or weak pointer instead, but for now please be aware of that limitation. Eventually though the message will time-out normally and you can get a new pointer for the external CF that replaces the deleted partner.
Returns
The control function sending this instance of the guidance system command message

Definition at line 157 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_timestamp_ms()

std::uint32_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::get_timestamp_ms ( ) const

Returns the timestamp for when the message was received, in milliseconds.

Returns
The timestamp for when the message was received, in milliseconds

Definition at line 167 of file isobus_speed_distance_messages.cpp.

◆ set_implement_start_stop_operations_state()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_implement_start_stop_operations_state ( ImplementStartStopOperations state)

Sets the state of a switch or other operator input to start or enable implement operations.

The start or enabled state can be the result of the implement being positioned in an operating position. It can be generated by an operator placing a switch to an ON state. Also called "Master ON/OFF" switch.

Parameters
stateThe state of a switch or other operator input to start or enable implement operations.
Returns
True if the set value was different from the stored value otherwise false

Definition at line 138 of file isobus_speed_distance_messages.cpp.

◆ set_key_switch_state()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_key_switch_state ( KeySwitchState state)

Sets the reported key switch state of the tractor or power unit.

Note
The "Not Off" key switch state does not always mean "On" so use care when using it.
Parameters
stateThe key switch state of the tractor or power unit.
Returns
True if the set value was different from the stored value otherwise false

Definition at line 126 of file isobus_speed_distance_messages.cpp.

◆ set_machine_direction_of_travel()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_machine_direction_of_travel ( MachineDirection direction)

Sets a measured signal indicating either forward or reverse as the direction of travel.

Note
The "Not Off" key switch state does not always mean "On" so use care when using it.
Parameters
directionThe measured direction of travel for the machine
Returns
True if the set value was different from the stored value otherwise false

Definition at line 114 of file isobus_speed_distance_messages.cpp.

◆ set_machine_distance()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_machine_distance ( std::uint32_t distance)

Sets the distance traveled by a machine as calculated from wheel or tail-shaft speed.

Parameters
distanceThe distance traveled by a machine as calculated from wheel or tail-shaft speed. (millimeters)
Returns
True if the set value was different from the stored value otherwise false

Definition at line 72 of file isobus_speed_distance_messages.cpp.

◆ set_machine_speed()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_machine_speed ( std::uint16_t speed)

Sets the value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.

Parameters
speedThe value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.
Returns
True if the set value was different from the stored value otherwise false

Definition at line 90 of file isobus_speed_distance_messages.cpp.

◆ set_maximum_time_of_tractor_power()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_maximum_time_of_tractor_power ( std::uint8_t maxTime)

Sets the maximum time (in minutes) of remaining tractor or power-unit-supplied electrical power at the current load.

Parameters
maxTimeThe maximum time of remaining tractor or power-unit-supplied electrical power at the current load (in minutes)
Returns
True if the set value was different from the stored value otherwise false

Definition at line 102 of file isobus_speed_distance_messages.cpp.

◆ set_operator_direction_reversed_state()

bool isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_operator_direction_reversed_state ( OperatorDirectionReversed reverseState)

Sets whether the reported direction is reversed from the perspective of the operator.

Parameters
reverseStateThe state of whether the reported direction is reversed from the perspective of the operator
Returns
True if the set value was different from the stored value otherwise false

Definition at line 150 of file isobus_speed_distance_messages.cpp.

◆ set_timestamp_ms()

void isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::set_timestamp_ms ( std::uint32_t timestamp)

Sets the timestamp for when the message was received or sent.

Parameters
[in]timestampThe timestamp, in milliseconds, when the message was sent or received

Definition at line 162 of file isobus_speed_distance_messages.cpp.

Member Data Documentation

◆ controlFunction

std::shared_ptr<ControlFunction> const isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::controlFunction
private

The CF that is sending the message.

Definition at line 180 of file isobus_speed_distance_messages.hpp.

◆ implementStartStopOperationsState

ImplementStartStopOperations isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::implementStartStopOperationsState = ImplementStartStopOperations::NotAvailable
private

Stores the state of a switch or other operator input to start or enable implement operations.

Definition at line 187 of file isobus_speed_distance_messages.hpp.

◆ keySwitchState

KeySwitchState isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::keySwitchState = KeySwitchState::NotAvailable
private

Stores the key switch state of the tractor or power unit.

Definition at line 186 of file isobus_speed_distance_messages.hpp.

◆ machineDirectionState

MachineDirection isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::machineDirectionState = MachineDirection::NotAvailable
private

Stores direction of travel.

Definition at line 185 of file isobus_speed_distance_messages.hpp.

◆ maximumTimeOfTractorPower_min

std::uint8_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::maximumTimeOfTractorPower_min = 0
private

Stores the maximum time of remaining tractor or power-unit-supplied electrical power at the current load.

Definition at line 184 of file isobus_speed_distance_messages.hpp.

◆ operatorDirectionReversedState

OperatorDirectionReversed isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::operatorDirectionReversedState = OperatorDirectionReversed::NotAvailable
private

Stores whether the reported direction is reversed from the perspective of the operator.

Definition at line 188 of file isobus_speed_distance_messages.hpp.

◆ timestamp_ms

std::uint32_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::timestamp_ms = 0
private

A timestamp for when the message was released in milliseconds.

Definition at line 181 of file isobus_speed_distance_messages.hpp.

◆ wheelBasedMachineDistance_mm

std::uint32_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::wheelBasedMachineDistance_mm = 0
private

Stores the decoded machine wheel-based distance in millimeters.

Definition at line 182 of file isobus_speed_distance_messages.hpp.

◆ wheelBasedMachineSpeed_mm_per_sec

std::uint16_t isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData::wheelBasedMachineSpeed_mm_per_sec = 0
private

Stores the decoded wheel-based machine speed in mm/s.

Definition at line 183 of file isobus_speed_distance_messages.hpp.


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