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
8f9d30cf
Commit
8f9d30cf
authored
Aug 08, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move requestCalibrationRC into commsmgr
parent
7b9f9806
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
44 deletions
+44
-44
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+31
-0
UASParameterCommsMgr.h
src/uas/UASParameterCommsMgr.h
+3
-0
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+5
-23
QGCVehicleConfig.cc
src/ui/QGCVehicleConfig.cc
+5
-21
No files found.
src/uas/UASParameterCommsMgr.cc
View file @
8f9d30cf
...
...
@@ -5,6 +5,8 @@
#include "QGCUASParamManager.h"
#include "UASInterface.h"
#define RC_CAL_CHAN_MAX 8
UASParameterCommsMgr
::
UASParameterCommsMgr
(
QObject
*
parent
,
UASInterface
*
uas
)
:
QObject
(
parent
),
mav
(
uas
),
...
...
@@ -212,6 +214,35 @@ void UASParameterCommsMgr::requestParameterUpdate(int component, const QString&
}
}
void
UASParameterCommsMgr
::
requestRcCalibrationParamsUpdate
()
{
if
(
!
transmissionListMode
)
{
QString
minTpl
(
"RC%1_MIN"
);
QString
maxTpl
(
"RC%1_MAX"
);
QString
trimTpl
(
"RC%1_TRIM"
);
QString
revTpl
(
"RC%1_REV"
);
// Do not request the RC type, as these values depend on this
// active onboard parameter
for
(
unsigned
int
i
=
1
;
i
<
(
RC_CAL_CHAN_MAX
+
1
);
++
i
)
{
qDebug
()
<<
"Request RC "
<<
i
;
mav
->
requestParameter
(
0
,
minTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
trimTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
maxTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
revTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
}
}
else
{
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"Ignoring requestRcCalibrationParamsUpdate because we're receiving params list"
;
}
}
/**
* @param component the subsystem which has the parameter
* @param parameterName name of the parameter, as delivered by the system
...
...
src/uas/UASParameterCommsMgr.h
View file @
8f9d30cf
...
...
@@ -68,6 +68,9 @@ public slots:
/** @brief Request a single parameter update by name */
virtual
void
requestParameterUpdate
(
int
component
,
const
QString
&
parameter
);
/** @brief Request an update of RC parameters */
virtual
void
requestRcCalibrationParamsUpdate
();
virtual
void
receivedParameterUpdate
(
int
uas
,
int
compId
,
int
paramCount
,
int
paramId
,
QString
paramName
,
QVariant
value
);
//protected slots:
...
...
src/ui/QGCPX4VehicleConfig.cc
View file @
8f9d30cf
...
...
@@ -13,9 +13,11 @@
#include <QMessageBox>
#include "QGCPX4VehicleConfig.h"
#include "UASManager.h"
#include "QGC.h"
#include "QGCToolWidget.h"
#include "UASManager.h"
#include "UASParameterCommsMgr.h"
#include "ui_QGCPX4VehicleConfig.h"
...
...
@@ -976,28 +978,8 @@ void QGCPX4VehicleConfig::writeCalibrationRC()
void
QGCPX4VehicleConfig
::
requestCalibrationRC
()
{
if
(
!
mav
)
{
return
;
}
QString
minTpl
(
"RC%1_MIN"
);
QString
maxTpl
(
"RC%1_MAX"
);
QString
trimTpl
(
"RC%1_TRIM"
);
QString
revTpl
(
"RC%1_REV"
);
// Do not request the RC type, as these values depend on this
// active onboard parameter
for
(
unsigned
int
i
=
1
;
i
<
(
chanMax
+
1
);
++
i
)
{
qDebug
()
<<
"Request RC "
<<
i
;
mav
->
requestParameter
(
0
,
minTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
trimTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
maxTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
revTpl
.
arg
(
i
));
QGC
::
SLEEP
::
usleep
(
5000
);
if
(
mav
)
{
mav
->
getParamCommsMgr
()
->
requestRcCalibrationParamsUpdate
();
}
}
...
...
src/ui/QGCVehicleConfig.cc
View file @
8f9d30cf
...
...
@@ -13,9 +13,11 @@
#include <QMessageBox>
#include "QGCVehicleConfig.h"
#include "UASManager.h"
#include "QGC.h"
#include "QGCToolWidget.h"
#include "UASManager.h"
#include "UASParameterCommsMgr.h"
#include "ui_QGCVehicleConfig.h"
QGCVehicleConfig
::
QGCVehicleConfig
(
QWidget
*
parent
)
:
...
...
@@ -972,26 +974,8 @@ void QGCVehicleConfig::writeCalibrationRC()
void
QGCVehicleConfig
::
requestCalibrationRC
()
{
if
(
!
mav
)
return
;
QString
minTpl
(
"RC%1_MIN"
);
QString
maxTpl
(
"RC%1_MAX"
);
QString
trimTpl
(
"RC%1_TRIM"
);
QString
revTpl
(
"RC%1_REV"
);
// Do not request the RC type, as these values depend on this
// active onboard parameter
for
(
unsigned
int
i
=
0
;
i
<
chanMax
;
++
i
)
{
mav
->
requestParameter
(
0
,
minTpl
.
arg
(
i
+
1
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
trimTpl
.
arg
(
i
+
1
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
maxTpl
.
arg
(
i
+
1
));
QGC
::
SLEEP
::
usleep
(
5000
);
mav
->
requestParameter
(
0
,
revTpl
.
arg
(
i
+
1
));
QGC
::
SLEEP
::
usleep
(
5000
);
if
(
mav
)
{
mav
->
getParamCommsMgr
()
->
requestRcCalibrationParamsUpdate
();
}
}
...
...
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