Torc  0.1
torctemperatureinput.cpp
Go to the documentation of this file.
1 /* Class TorcInput
2 *
3 * Copyright (C) Mark Kendall 2014-18
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 // Torc
21 #include "torctemperatureinput.h"
22 
23 TorcTemperatureInput::TorcTemperatureInput(double Value, double RangeMinimum, double RangeMaximum,
24  const QString &ModelId, const QVariantMap &Details)
25  : TorcInput(TorcInput::Temperature, Value, RangeMinimum, RangeMaximum, ModelId, Details)
26 {
27 }
28 
30 {
31  return QStringList() << tr("Constant Temp");
32 }
33 
35 {
37 }
38 
40 {
41  SetValid(true);
43 }
44 
46 {
47  return (Value * 1.8) + 32.0;
48 }
49 
51 {
52  return (Value - 32.0) / 1.8;
53 }
static double FahrenheitToCelsius(double Value)
void Start(void) override
void SetValid(bool Valid) final
Definition: torcinput.cpp:143
static double CelsiusToFahrenheit(double Value)
QStringList GetDescription(void) override
TorcInput::Type GetType(void) override
TorcTemperatureInput(double Value, double RangeMinimum, double RangeMaximum, const QString &ModelId, const QVariantMap &Details)
virtual void Start(void) override
Definition: torcinput.cpp:65