Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
8b706b01
Commit
8b706b01
authored
Jul 12, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change so battery monitor config screen properly reads battery voltage now
parent
214607c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
BatteryMonitorConfig.cc
src/ui/configuration/BatteryMonitorConfig.cc
+18
-0
BatteryMonitorConfig.h
src/ui/configuration/BatteryMonitorConfig.h
+2
-0
No files found.
src/ui/configuration/BatteryMonitorConfig.cc
View file @
8b706b01
...
...
@@ -32,6 +32,16 @@ BatteryMonitorConfig::BatteryMonitorConfig(QWidget *parent) : AP2ConfigWidget(pa
}
void
BatteryMonitorConfig
::
activeUASSet
(
UASInterface
*
uas
)
{
if
(
!
uas
)
{
return
;
}
connect
(
uas
,
SIGNAL
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)),
this
,
SLOT
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
double
,
int
)));
AP2ConfigWidget
::
activeUASSet
(
uas
);
}
void
BatteryMonitorConfig
::
calcDividerSet
()
{
if
(
!
m_uas
)
...
...
@@ -222,6 +232,14 @@ void BatteryMonitorConfig::apmVerCurrentIndexChanged(int index)
BatteryMonitorConfig
::~
BatteryMonitorConfig
()
{
}
void
BatteryMonitorConfig
::
batteryChanged
(
UASInterface
*
uas
,
double
voltage
,
double
current
,
double
percent
,
int
seconds
)
{
ui
.
calcVoltsLineEdit
->
setText
(
QString
::
number
(
voltage
,
'f'
,
2
));
if
(
ui
.
measuredVoltsLineEdit
->
text
()
==
""
)
{
ui
.
measuredVoltsLineEdit
->
setText
(
ui
.
calcVoltsLineEdit
->
text
());
}
}
void
BatteryMonitorConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
...
...
src/ui/configuration/BatteryMonitorConfig.h
View file @
8b706b01
...
...
@@ -20,6 +20,8 @@ private slots:
void
calcDividerSet
();
void
ampsPerVoltSet
();
void
batteryCapacitySet
();
void
activeUASSet
(
UASInterface
*
uas
);
void
batteryChanged
(
UASInterface
*
uas
,
double
voltage
,
double
current
,
double
percent
,
int
seconds
);
private:
Ui
::
BatteryMonitorConfig
ui
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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