Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7e337668
Commit
7e337668
authored
Feb 11, 2011
by
lm
Browse files
Working on proper battery status reading
parent
415baa2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/uas/UAS.cc
View file @
7e337668
...
...
@@ -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"
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment