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
764e22c9
Commit
764e22c9
authored
Aug 08, 2013
by
tstellanova
Browse files
fix setting of current mav in QGCConfigView
parent
6e84f136
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ui/QGCConfigView.cc
View file @
764e22c9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
QGCConfigView
::
QGCConfigView
(
QWidget
*
parent
)
:
QGCConfigView
::
QGCConfigView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
QWidget
(
parent
),
ui
(
new
Ui
::
QGCConfigView
),
ui
(
new
Ui
::
QGCConfigView
),
currUAS
(
NULL
)
mav
(
NULL
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
...
@@ -26,7 +26,7 @@ QGCConfigView::~QGCConfigView()
...
@@ -26,7 +26,7 @@ QGCConfigView::~QGCConfigView()
void
QGCConfigView
::
activeUASChanged
(
UASInterface
*
uas
)
void
QGCConfigView
::
activeUASChanged
(
UASInterface
*
uas
)
{
{
if
(
currUAS
==
uas
)
if
(
mav
==
uas
)
return
;
return
;
//remove all child widgets since they could contain stale data
//remove all child widgets since they could contain stale data
...
@@ -41,11 +41,13 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
...
@@ -41,11 +41,13 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
}
}
}
}
if
(
NULL
!=
uas
)
{
mav
=
uas
;
if
(
NULL
!=
mav
)
{
ui
->
gridLayout
->
removeWidget
(
ui
->
waitingLabel
);
ui
->
gridLayout
->
removeWidget
(
ui
->
waitingLabel
);
ui
->
waitingLabel
->
setVisible
(
false
);
ui
->
waitingLabel
->
setVisible
(
false
);
switch
(
uas
->
getAutopilotType
())
{
int
autopilotType
=
mav
->
getAutopilotType
();
switch
(
autopilotType
)
{
case
MAV_AUTOPILOT_PX4
:
case
MAV_AUTOPILOT_PX4
:
ui
->
gridLayout
->
addWidget
(
new
QGCPX4VehicleConfig
());
ui
->
gridLayout
->
addWidget
(
new
QGCPX4VehicleConfig
());
break
;
break
;
...
...
src/ui/QGCConfigView.h
View file @
764e22c9
...
@@ -21,7 +21,7 @@ public slots:
...
@@ -21,7 +21,7 @@ public slots:
private:
private:
Ui
::
QGCConfigView
*
ui
;
Ui
::
QGCConfigView
*
ui
;
UASInterface
*
currUAS
;
UASInterface
*
mav
;
};
};
...
...
src/ui/QGCPX4VehicleConfig.cc
View file @
764e22c9
...
@@ -941,6 +941,7 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
...
@@ -941,6 +941,7 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
// Do not write the RC type, as these values depend on this
// Do not write the RC type, as these values depend on this
// active onboard parameter
// active onboard parameter
//TODO consolidate RC param sending in the UAS comms mgr
for
(
unsigned
int
i
=
0
;
i
<
chanCount
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
chanCount
;
++
i
)
{
{
//qDebug() << "SENDING" << minTpl.arg(i+1) << rcMin[i];
//qDebug() << "SENDING" << minTpl.arg(i+1) << rcMin[i];
...
@@ -975,7 +976,9 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
...
@@ -975,7 +976,9 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
void
QGCPX4VehicleConfig
::
requestCalibrationRC
()
void
QGCPX4VehicleConfig
::
requestCalibrationRC
()
{
{
if
(
!
mav
)
return
;
if
(
!
mav
)
{
return
;
}
QString
minTpl
(
"RC%1_MIN"
);
QString
minTpl
(
"RC%1_MIN"
);
QString
maxTpl
(
"RC%1_MAX"
);
QString
maxTpl
(
"RC%1_MAX"
);
...
@@ -985,15 +988,15 @@ void QGCPX4VehicleConfig::requestCalibrationRC()
...
@@ -985,15 +988,15 @@ void QGCPX4VehicleConfig::requestCalibrationRC()
// Do not request the RC type, as these values depend on this
// Do not request the RC type, as these values depend on this
// active onboard parameter
// active onboard parameter
for
(
unsigned
int
i
=
0
;
i
<
chanMax
;
++
i
)
for
(
unsigned
int
i
=
1
;
i
<
(
chanMax
+
1
)
;
++
i
)
{
{
qDebug
()
<<
"Request RC "
<<
i
;
mav
->
requestParameter
(
0
,
minTpl
.
arg
(
i
+
1
));
mav
->
requestParameter
(
0
,
minTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
trimTpl
.
arg
(
i
+
1
));
mav
->
requestParameter
(
0
,
trimTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
maxTpl
.
arg
(
i
+
1
));
mav
->
requestParameter
(
0
,
maxTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
revTpl
.
arg
(
i
+
1
));
mav
->
requestParameter
(
0
,
revTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
QGC
::
SLEEP
::
usleep
(
5000
);
}
}
}
}
...
...
src/ui/QGCVehicleConfig.cc
View file @
764e22c9
...
@@ -937,6 +937,7 @@ void QGCVehicleConfig::writeCalibrationRC()
...
@@ -937,6 +937,7 @@ void QGCVehicleConfig::writeCalibrationRC()
// Do not write the RC type, as these values depend on this
// Do not write the RC type, as these values depend on this
// active onboard parameter
// active onboard parameter
//TODO consolidate RC param sending in the UAS comms mgr
for
(
unsigned
int
i
=
0
;
i
<
chanCount
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
chanCount
;
++
i
)
{
{
//qDebug() << "SENDING" << minTpl.arg(i+1) << rcMin[i];
//qDebug() << "SENDING" << minTpl.arg(i+1) << rcMin[i];
...
...
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