22 LOG_ERROR(
"[VTStateHelper] constructor: client is nullptr");
41 LOG_ERROR(
"[VTStateHelper] set_numeric_value: client is nullptr");
46 LOG_WARNING(
"[VTStateHelper] set_numeric_value: objectId %lu not tracked", object_id);
54 bool success =
vtClient->send_change_numeric_value(object_id, value);
91 std::uint32_t targetValue =
event.value;
104 LOG_ERROR(
"[VTStateHelper] set_active_data_or_alarm_mask: client is nullptr");
112 bool success =
vtClient->send_change_active_mask(workingSetId, dataOrAlarmMaskId);
124 LOG_ERROR(
"[VTStateHelper] set_active_soft_key_mask: client is nullptr");
129 LOG_WARNING(
"[VTStateHelper] set_active_soft_key_mask: data/alarm mask '%lu' not tracked", maskId);
137 bool success =
vtClient->send_change_softkey_mask(maskType, maskId, softKeyMaskId);
149 LOG_ERROR(
"[VTStateHelper] set_attribute: client is nullptr");
154 LOG_ERROR(
"[VTStateHelper] set_attribute: objectId %lu not tracked", objectId);
159 LOG_WARNING(
"[VTStateHelper] set_attribute: attribute %lu of objectId %lu not tracked", attribute, objectId);
167 bool success =
vtClient->send_change_attribute(objectId, attribute, value);
A class that acts as a logging sink. The intent is that someone could make their own derived class of...
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.
std::uint16_t activeDataOrAlarmMask
Holds the data/alarm mask currently visible on the server for this client.
std::map< std::uint16_t, std::uint16_t > softKeyMasks
Holds the data/alarms masks with their associated soft keys masks for tracked objects.
std::map< std::uint16_t, std::map< std::uint8_t, std::uint32_t > > attributeStates
std::uint32_t get_numeric_value(std::uint16_t objectId) const
Gets the current numeric value of a tracked object.
std::map< std::uint16_t, std::uint32_t > numericValueStates
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.
MaskType
The types of object pool masks.
A helper class to update and 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.
std::uint16_t objectID
The object ID.
std::uint32_t value
The value.