78 unsigned short toValue(
float temperature) const noexcept;
119 unsigned short _invalidValue;
131 return (value == _invalidValue) ?
INVALID_TEMPERATURE :
static_cast<float>(value) / _factor + _offset;
139 return (value ==
static_cast<float>(_invalidValue)) ?
INVALID_TEMPERATURE : value / _factor + _offset;
144 return (temperature <=
INVALID_TEMPERATURE) ? _invalidValue :
static_cast<unsigned short>((temperature - _offset) * _factor);
154 return value != _invalidValue;
164 return _invalidValue;
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Contains an enum representing the different temperature precisions and constants denoting invalid tem...
bool isValueValid(unsigned short value) noexcept
Checks if an internal value is valid.
Definition TemperatureConverter.h:152
OTC_SDK_API TemperatureConverter() noexcept
Constructor.
TemperaturePrecision getPrecision() const noexcept
Returns the temperature precision.
Definition TemperatureConverter.h:124
unsigned short toValue(float temperature) const noexcept
Converts a temperature in °C to an internal value.
Definition TemperatureConverter.h:142
OTC_SDK_API void setPrecision(TemperaturePrecision precision) noexcept
Set the temperature precision.
unsigned short getInvalidValue() const noexcept
Returns the value signifying an invalid internal value.
Definition TemperatureConverter.h:162
float getInvalidTemperature() const noexcept
Returns the value signifying an invalid temperature.
Definition TemperatureConverter.h:157
bool isTemperatureValid(float temperature) noexcept
Checks if the given temperature in °C is valid.
Definition TemperatureConverter.h:147
float toTemperature(unsigned short value) const noexcept
Converts an internal value to a temperature in °C.
Definition TemperatureConverter.h:129
Main SDK namespace.
Definition AlarmChannel.h:21
static constexpr float INVALID_TEMPERATURE
All temperatures in °C equal or lower are invalid.
Definition TemperaturePrecision.h:24
TemperaturePrecision
Represents the available temperature precisions.
Definition TemperaturePrecision.h:32