ModbusSMA
v1.0.0
|
Data and information of one SMA register. More...
#include <Register.hpp>
Public Member Functions | |
Register (uint16_t _reg, std::string _desc, std::string _unit, DataType _type, DataFormat _format, DataAccess _access) | |
Initializes the register. More... | |
uint16_t | reg () const noexcept |
Returns the register (integer). More... | |
std::string | desc () const noexcept |
Returns the register description. More... | |
std::string | unit () const noexcept |
Returns the unit of the register. More... | |
DataType | type () const noexcept |
Returns the data type. More... | |
DataFormat | format () const noexcept |
Returns the data format. More... | |
DataAccess | access () const noexcept |
Returns the access type. More... | |
bool | canRead () const noexcept |
Read? | |
bool | canWrite () const noexcept |
Write? | |
std::vector< uint16_t > | raw () const |
Returns the raw data. More... | |
std::map< uint32_t, std::string > | enums () const |
Returns all parsed enums. More... | |
std::string | value () |
Returns the value of the register as a string. | |
uint64_t | valueUInt () |
Get the value as an unsigned integer. Fixed point number formats are ignored. | |
int64_t | valueInt () |
Get the value as an signed integer. Fixed point number formats are ignored. | |
double | valueDouble () |
Get the value as floating point variable. | |
bool | setRaw (std::vector< uint16_t > _data) |
Sets the new raw data. Returns false if the size differs from the expected size. | |
void | resetData () |
Reset all data to NaN. More... | |
std::vector< uint16_t > | getNaN () |
Generate NaN values for the current data type. | |
uint32_t | size () const noexcept |
The size in 16-bit words of this register (returns 2 for an unknown type) | |
Data and information of one SMA register.
Definition at line 33 of file Register.hpp.
Register::Register | ( | uint16_t | _reg, |
std::string | _desc, | ||
std::string | _unit, | ||
DataType | _type, | ||
DataFormat | _format, | ||
DataAccess | _access | ||
) |
Initializes the register.
_reg | The starting register. |
_desc | Textual desctiption of the register. |
_unit | Unit of the data stored. |
_type | The data type. |
_format | The data format. |
_access | How this register can be accessed. |
Definition at line 48 of file Register.cpp.
|
inlinenoexcept |
Returns the access type.
Definition at line 55 of file Register.hpp.
|
inlinenoexcept |
Returns the register description.
Definition at line 51 of file Register.hpp.
|
inline |
Returns all parsed enums.
Definition at line 61 of file Register.hpp.
|
inlinenoexcept |
Returns the data format.
Definition at line 54 of file Register.hpp.
|
inline |
Returns the raw data.
Definition at line 60 of file Register.hpp.
|
inlinenoexcept |
Returns the register (integer).
Definition at line 50 of file Register.hpp.
|
inline |
Reset all data to NaN.
Definition at line 69 of file Register.hpp.
|
inlinenoexcept |
Returns the data type.
Definition at line 53 of file Register.hpp.
|
inlinenoexcept |
Returns the unit of the register.
Definition at line 52 of file Register.hpp.