TaskController 2.2.23
A light-weight UI that serves as the task/parameter front-end.
Loading...
Searching...
No Matches
Miscellaneous Helpers

Includes miscellaneous helper functions that don't fit into the other categories. This group contains utility functions, data structures, or algorithms used throughout the controller application for various purposes. More...

Functions

const char * snprintf_float_buffer (double value)
 Converts a double value to a string using snprintf.
 
const char * snprintf_uint16_buffer (uint16_t value)
 Converts a uint16_t value to a string using snprintf.
 
const char * snprintf_uint_buffer (unsigned int value)
 Converts an unsigned integer value to a string using snprintf.
 
const char * snprintf_int16_buffer (int16_t value)
 Converts a short signed integer (int16_t) value to a string using snprintf.
 
const char * idToString (ControlID id)
 Converts a ControlID enumeration value to its corresponding string representation.
 
const char * paramToString (ValueParameters *value, CalibrationData *calData, ControlID id)
 Converts a parameter value to a string representation based on the control ID.
 
void stringToParam (TaskParameters *parameters, CalibrationData *calData, ControlID id, const char *value)
 Converts a string to the correct value for the field of TaskParameters linked with a given control ID.
 

Detailed Description

Includes miscellaneous helper functions that don't fit into the other categories. This group contains utility functions, data structures, or algorithms used throughout the controller application for various purposes.

Function Documentation

◆ idToString()

const char * idToString ( ControlID id)

Converts a ControlID enumeration value to its corresponding string representation.

This function returns a string representation of the given ControlID enumeration value. The string representation truncates the leading "ID_" part of the enumeration but retains the rest.

Parameters
idThe ControlID enumeration value to convert.
Returns
A string representation of the given ControlID enumeration value.

◆ paramToString()

const char * paramToString ( ValueParameters * value,
CalibrationData * calData,
ControlID id )

Converts a parameter value to a string representation based on the control ID.

This function converts the value of the specified parameter associated with the control ID to a string representation and returns it. The control ID determines which parameter value to convert to a string.

Parameters
valuePointer to the ValueParameters structure containing the parameter values.
calDataPointer to the CalibrationData structure for storing calibration parameters.
idThe control ID representing the parameter whose value needs to be converted.
Returns
A string representation of the parameter value corresponding to the control ID.

◆ snprintf_float_buffer()

const char * snprintf_float_buffer ( double value)

Converts a double value to a string using snprintf.

This function converts the specified double value to a string using the snprintf function and returns the resulting string. The string is stored in a static buffer, so it should not be modified or freed by the caller.

Parameters
valueThe double value to convert to a string.
Returns
A string representation of the double value.

◆ snprintf_int16_buffer()

const char * snprintf_int16_buffer ( int16_t value)

Converts a short signed integer (int16_t) value to a string using snprintf.

This function converts the specified int16_t value to a string using the snprintf function and returns the resulting string. The string is stored in a static buffer, so it should not be modified or freed by the caller.

Parameters
valueThe int16_t value to convert to a string.
Returns
A string representation of the double value.

◆ snprintf_uint16_buffer()

const char * snprintf_uint16_buffer ( uint16_t value)

Converts a uint16_t value to a string using snprintf.

This function converts the specified uint16_t value to a string using the snprintf function and returns the resulting string. The string is stored in a static buffer, so it should not be modified or freed by the caller.

Parameters
valueThe uint16_t value to convert to a string.
Returns
A string representation of the double value.

◆ snprintf_uint_buffer()

const char * snprintf_uint_buffer ( unsigned int value)

Converts an unsigned integer value to a string using snprintf.

This function converts the specified unsigned int value to a string using the snprintf function and returns the resulting string. The string is stored in a static buffer, so it should not be modified or freed by the caller.

Parameters
valueThe unsigned int value to convert to a string.
Returns
A string representation of the double value.

◆ stringToParam()

void stringToParam ( TaskParameters * parameters,
CalibrationData * calData,
ControlID id,
const char * value )

Converts a string to the correct value for the field of TaskParameters linked with a given control ID.

This function converts the value of a string to the correct type for the parameter linked with the control ID that is associated with a corresponding UI control.

Parameters
parametersPointer to the TaskParameters structure containing the parameter values.
calDataPointer to the CalibrationData structure for storing calibration parameters.
idThe control ID representing the parameter whose value needs to be converted.
valueThe string buffer containing the data to be assigned to the indicated field or sub-field of parameters.