5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
23 #include "radiodata.h"
25 QString
GVarData::unitToString() const
28 case GVAR_UNIT_NUMBER
:
30 case GVAR_UNIT_PERCENT
:
33 return tr("?"); // highlight unknown value
37 QString
GVarData::precToString() const
45 return tr("?.?"); // highlight unknown value
49 QString
GVarData::nameToString(int index
) const
51 return RadioData::getElementName(tr("GV"), index
+ 1, name
);
54 int GVarData::multiplierSet()
56 return (prec
== 0 ? 1 : 10);
59 float GVarData::multiplierGet() const
61 return (prec
== 0 ? 1 : 0.1);
64 void GVarData::setMin(float val
)
66 min
= (val
* multiplierSet()) - GVAR_MIN_VALUE
;
69 void GVarData::setMax(float val
)
71 max
= GVAR_MAX_VALUE
- (val
* multiplierSet());
74 int GVarData::getMin() const
76 return GVAR_MIN_VALUE
+ min
;
79 int GVarData::getMax() const
81 return GVAR_MAX_VALUE
- max
;
84 float GVarData::getMinPrec() const
86 return getMin() * multiplierGet();
89 float GVarData::getMaxPrec() const
91 return getMax() * multiplierGet();