Commit 7e337668 authored by lm's avatar lm

Working on proper battery status reading

parent 415baa2c
......@@ -1919,7 +1919,14 @@ void UAS::setBatterySpecs(const QString& specs)
QString percent = specs;
percent = percent.remove("%");
float temp = percent.toFloat(&ok);
if (ok) warnLevelPercent = temp;
if (ok)
{
warnLevelPercent = temp;
}
else
{
emit textMessageReceived(0, 0, 0, "Could not set battery options, format is wrong");
}
}
else
{
......@@ -1942,6 +1949,10 @@ void UAS::setBatterySpecs(const QString& specs)
temp = parts.at(2).toFloat(&ok);
if (ok) fullVoltage = temp;
}
else
{
emit textMessageReceived(0, 0, 0, "Could not set battery options, format is wrong");
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment