37 QML_VALUE_TYPE(temperature)
49 result.m_temperatureInDegreeKelvin = temperatureInDegreeCelsius+273.15;
62 result.m_temperatureInDegreeKelvin = (temperatureInDegreeFarenheit - 32.0)*5.0/9.0 + 273.15;
75 result.m_temperatureInDegreeKelvin = temperatureInDegreeKelvin;
83 [[nodiscard]] Q_INVOKABLE
bool isFinite()
const
85 return std::isfinite(m_temperatureInDegreeKelvin);
102 return m_temperatureInDegreeKelvin-273.15;
111 return (m_temperatureInDegreeKelvin - 273.15)*9.0/5.0 + 32.0;
120 return m_temperatureInDegreeKelvin;
126 double m_temperatureInDegreeKelvin{ NAN };
Convenience class for temperature computations.
Q_INVOKABLE bool isFinite() const
Checks if the temperature is valid.
Q_INVOKABLE double toDegreeKelvin() const
Convert to degree Kelvin.
Q_INVOKABLE std::partial_ordering operator<=>(const Units::Temperature &rhs) const =default
Comparison.
static constexpr auto fromDegreeCelsius(double temperatureInDegreeCelsius) -> Temperature
Constructs a temperature.
static constexpr auto fromDegreeKelvin(double temperatureInDegreeKelvin) -> Temperature
Constructs a temperature.
static constexpr auto fromDegreeFarenheit(double temperatureInDegreeFarenheit) -> Temperature
Constructs a temperature.
Q_INVOKABLE double toDegreeCelsius() const
Convert to degree Celsius.
Q_INVOKABLE double toDegreeFarenheit() const
Convert to degree Farenheit.
Conversion between units used in aviation.