forked from DanNixon/NeoNextion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINextionNumericalValued.h
50 lines (44 loc) · 1.06 KB
/
INextionNumericalValued.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*! \file */
#ifndef __NEONEXTION_INEXTIONNUMERICALVALUED
#define __NEONEXTION_INEXTIONNUMERICALVALUED
#include "Nextion.h"
#include "INextionWidget.h"
#include "NextionTypes.h"
/*!
* \class INextionNumericalValued
* \brief Interface for widgets that store a numerical value.
*
* Assumes that the numerical value is a property named "val".
*/
class INextionNumericalValued : public virtual INextionWidget
{
public:
/*!
* \copydoc INextionWidget::INextionWidget
*/
INextionNumericalValued(Nextion &nex, uint8_t page, uint8_t component,
const char *name)
: INextionWidget(nex, page, component, name)
{
}
/*!
* \brief Gets the numerical value.
* \return Value
* \see INextionNumericalValued::setValue
*/
uint32_t getValue()
{
return getNumberProperty("val");
}
/*!
* \brief Sets the numerical value.
* \param value Value
* \return True if successful
* \see INextionNumericalValued::getValue
*/
bool setValue(uint32_t value)
{
return setNumberProperty("val", value);
}
};
#endif