supla-device
Loading...
Searching...
No Matches
Supla::Html::CustomParameterTemplate< T > Class Template Reference

This HTML Element provides numeric input in config mode. More...

#include <custom_parameter.h>

Inheritance diagram for Supla::Html::CustomParameterTemplate< T >:
Collaboration diagram for Supla::Html::CustomParameterTemplate< T >:

Public Member Functions

 CustomParameterTemplate (const char *paramTag, const char *paramLabel, T defaultValue=static_cast< T >(0), T minValue=std::numeric_limits< T >::lowest(), T maxValue=std::numeric_limits< T >::max(), uint8_t decimalPlaces=0)
 
void send (Supla::WebSender *sender) override
 
bool handleResponse (const char *key, const char *value) override
 
getParameterValue ()
 
void setParameterValue (T newValue)
 
- Public Member Functions inherited from Supla::HtmlElement
HtmlElementnext ()
 
 HtmlElement (HtmlSection section=HTML_SECTION_FORM)
 
virtual void onProcessingEnd ()
 

Protected Member Functions

int32_t encodeValue (T value) const
 
decodeValue (int32_t value) const
 
void setStoredValue (int32_t newValue, bool saveToConfig)
 

Static Protected Member Functions

static uint8_t sanitizeDecimalPlaces (uint8_t requestedDecimalPlaces)
 
static int32_t getScaleFactor (uint8_t decimalPlaces)
 
static int32_t clampToInt32 (long double value)
 

Protected Attributes

int32_t parameterValue = 0
 
char * tag = nullptr
 
char * label = nullptr
 
int32_t minStoredValue = 0
 
int32_t maxStoredValue = 0
 
uint8_t decimalPlaces = 0
 
- Protected Attributes inherited from Supla::HtmlElement
HtmlElementnextPtr = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from Supla::HtmlElement
static HtmlElementbegin ()
 
static HtmlElementlast ()
 
static const char * selected (bool isSelected)
 
static const char * checked (bool isChecked)
 
- Public Attributes inherited from Supla::HtmlElement
HtmlSection section
 
- Static Protected Attributes inherited from Supla::HtmlElement
static HtmlElementfirstPtr = nullptr
 

Detailed Description

template<typename T>
class Supla::Html::CustomParameterTemplate< T >

This HTML Element provides numeric input in config mode.

Value is always stored in Supla::Storage::Config as int32_t. For floating point types decimalPlaces defines storage scale and HTML step.

Member Function Documentation

◆ handleResponse()

template<typename T >
bool Supla::Html::CustomParameterTemplate< T >::handleResponse ( const char * key,
const char * value )
overridevirtual

Reimplemented from Supla::HtmlElement.

◆ send()

template<typename T >
void Supla::Html::CustomParameterTemplate< T >::send ( Supla::WebSender * sender)
overridevirtual

Implements Supla::HtmlElement.


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