AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
isobus_virtual_terminal_client_update_helper.hpp
Go to the documentation of this file.
1//================================================================================================
8//================================================================================================
9
10#ifndef ISOBUS_VIRTUAL_TERMINAL_CLIENT_UPDATE_HELPER_HPP
11#define ISOBUS_VIRTUAL_TERMINAL_CLIENT_UPDATE_HELPER_HPP
12
15
16namespace isobus
17{
20 {
21 public:
24 explicit VirtualTerminalClientUpdateHelper(std::shared_ptr<VirtualTerminalClient> client);
25
28
33 bool set_numeric_value(std::uint16_t objectId, std::uint32_t value);
34
39 bool increase_numeric_value(std::uint16_t objectId, std::uint32_t step = 1);
40
45 bool decrease_numeric_value(std::uint16_t objectId, std::uint32_t step = 1);
46
52 void set_callback_validate_numeric_value(const std::function<bool(std::uint16_t, std::uint32_t)> &callback);
53
58 bool set_active_data_or_alarm_mask(std::uint16_t workingSetId, std::uint16_t dataOrAlarmMaskId);
59
65 bool set_active_soft_key_mask(VirtualTerminalClient::MaskType maskType, std::uint16_t maskId, std::uint16_t softKeyMaskId);
66
75 bool set_attribute(std::uint16_t objectId, std::uint8_t attribute, std::uint32_t value);
76
77 private:
81
82 std::shared_ptr<VirtualTerminalClient> vtClient;
83
84 std::function<bool(std::uint16_t, std::uint32_t)> callbackValidateNumericValue;
85 EventCallbackHandle numericValueChangeEventHandle;
86 };
87} // namespace isobus
88
89#endif // ISOBUS_VIRTUAL_TERMINAL_CLIENT_UPDATE_HELPER_HPP
A helper class to update and track the state of an active working set.
std::shared_ptr< ControlFunction > client
The control function of the virtual terminal client to track.
A helper class to update and track the state of an active working set.
bool set_active_soft_key_mask(VirtualTerminalClient::MaskType maskType, std::uint16_t maskId, std::uint16_t softKeyMaskId)
Sets the active soft key mask.
bool decrease_numeric_value(std::uint16_t objectId, std::uint32_t step=1)
Decreases the numeric value of a tracked object.
void process_numeric_value_change_event(const VirtualTerminalClient::VTChangeNumericValueEvent &event)
Processes a numeric value change event.
EventCallbackHandle numericValueChangeEventHandle
Holds the handle to the numeric value change event listener.
std::shared_ptr< VirtualTerminalClient > vtClient
Holds the vt client.
bool increase_numeric_value(std::uint16_t objectId, std::uint32_t step=1)
Increases the numeric value of a tracked object.
VirtualTerminalClientUpdateHelper(std::shared_ptr< VirtualTerminalClient > client)
The constructor of class to help update the state of an active working set.
~VirtualTerminalClientUpdateHelper()
The destructor of class to unregister event listeners.
std::function< bool(std::uint16_t, std::uint32_t)> callbackValidateNumericValue
Holds the callback function to validate a numeric value change.
void set_callback_validate_numeric_value(const std::function< bool(std::uint16_t, std::uint32_t)> &callback)
Register a callback function to validate a numeric value change of a tracked object....
bool set_attribute(std::uint16_t objectId, std::uint8_t attribute, std::uint32_t value)
Sets the value of an attribute of a tracked object.
bool set_active_data_or_alarm_mask(std::uint16_t workingSetId, std::uint16_t dataOrAlarmMaskId)
Sets the active data/alarm mask.
bool set_numeric_value(std::uint16_t objectId, std::uint32_t value)
Sets the numeric value of a tracked object.
A class to manage a client connection to a ISOBUS virtual terminal display.
A helper class to track the state of an active working set.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
A struct for storing information of a VT change numeric value event.