mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 15:55:26 +03:00
One TODO less ...
This commit is contained in:
parent
e0a03f6728
commit
a14848fc7f
5 changed files with 49 additions and 46 deletions
|
@ -636,24 +636,6 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
|||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
float ValToTim(int value)
|
||||
{
|
||||
return ((value < -109 ? 129+value : (value < 7 ? (113+value)*5 : (53+value)*10))/10.0);
|
||||
}
|
||||
|
||||
int TimToVal(float value)
|
||||
{
|
||||
int temp;
|
||||
if (value>60) {
|
||||
temp=136+round((value-60));
|
||||
} else if (value>2) {
|
||||
temp=20+round((value-2.0)*2.0);
|
||||
} else {
|
||||
temp=round(value*10.0);
|
||||
}
|
||||
return (temp-129);
|
||||
}
|
||||
|
||||
void populateCSWCB(QComboBox *b, int value)
|
||||
{
|
||||
int order[] = {
|
||||
|
@ -695,27 +677,6 @@ void populateCSWCB(QComboBox *b, int value)
|
|||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
QString getSignedStr(int value)
|
||||
{
|
||||
return value > 0 ? QString("+%1").arg(value) : QString("%1").arg(value);
|
||||
}
|
||||
|
||||
QString getGVarString(int16_t val, bool sign)
|
||||
{
|
||||
if (val >= -10000 && val <= 10000) {
|
||||
if (sign)
|
||||
return QString("%1%").arg(getSignedStr(val));
|
||||
else
|
||||
return QString("%1%").arg(val);
|
||||
}
|
||||
else {
|
||||
if (val<0)
|
||||
return QObject::tr("-GV%1").arg(-val-10000);
|
||||
else
|
||||
return QObject::tr("GV%1").arg(val-10000);
|
||||
}
|
||||
}
|
||||
|
||||
QString image2qstring(QImage image)
|
||||
{
|
||||
if (image.isNull())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue