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
90d08ee3
Commit
90d08ee3
authored
Feb 27, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Qml based sensor config
Also remove support for old parameter version
parent
c8d3af3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
SensorsComponent.cc
src/AutoPilotPlugins/PX4/SensorsComponent.cc
+18
-20
No files found.
src/AutoPilotPlugins/PX4/SensorsComponent.cc
View file @
90d08ee3
...
...
@@ -25,25 +25,21 @@
/// @author Don Gagne <don@thegagnes.com>
#include "SensorsComponent.h"
#include "QGCPX4SensorCalibration.h"
#include "PX4AutoPilotPlugin.h"
#include "QGCQmlWidgetHolder.h"
#include "SensorsComponentController.h"
// These two list must be kept in sync
/// @brief Parameters which signal a change in setupComplete state
static
const
char
*
triggerParamsV1
[]
=
{
"SENS_MAG_XOFF"
,
"SENS_GYRO_XOFF"
,
"SENS_ACC_XOFF"
,
NULL
};
static
const
char
*
triggerParamsV2
[]
=
{
"CAL_MAG0_ID"
,
"CAL_GYRO0_ID"
,
"CAL_ACC0_ID"
,
NULL
};
static
const
char
*
triggerParamsV1FixedWing
[]
=
{
"SENS_MAG_XOFF"
,
"SENS_GYRO_XOFF"
,
"SENS_ACC_XOFF"
,
"SENS_DPRES_OFF"
,
NULL
};
static
const
char
*
triggerParamsV2FixedWing
[]
=
{
"CAL_MAG0_ID"
,
"CAL_GYRO0_ID"
,
"CAL_ACC0_ID"
,
"SENS_DPRES_OFF"
,
NULL
};
static
const
char
*
triggerParams
[]
=
{
"CAL_MAG0_ID"
,
"CAL_GYRO0_ID"
,
"CAL_ACC0_ID"
,
NULL
};
static
const
char
*
triggerParamsFixedWing
[]
=
{
"CAL_MAG0_ID"
,
"CAL_GYRO0_ID"
,
"CAL_ACC0_ID"
,
"SENS_DPRES_OFF"
,
NULL
};
SensorsComponent
::
SensorsComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Sensors"
))
{
// Determine what set of parameters are available. This is a temporary hack for now. Will need real parameter
// mapping in the future.
QVariant
value
;
_paramsV1
=
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
"SENS_MAG_XOFF"
,
value
);
}
QString
SensorsComponent
::
name
(
void
)
const
...
...
@@ -104,29 +100,31 @@ QString SensorsComponent::setupStateDescription(void) const
const
char
**
SensorsComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
if
(
_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
{
return
_paramsV1
?
triggerParamsV1FixedWing
:
triggerParamsV2FixedWing
;
}
else
{
return
_paramsV1
?
triggerParamsV1
:
triggerParamsV2
;
}
return
_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
?
triggerParamsFixedWing
:
triggerParams
;
}
QStringList
SensorsComponent
::
paramFilterList
(
void
)
const
{
QStringList
list
;
if
(
_paramsV1
)
{
list
<<
"SENS_*"
;
}
else
{
list
<<
"CAL_*"
;
}
list
<<
"SENS_*"
<<
"CAL_*"
;
return
list
;
}
QWidget
*
SensorsComponent
::
setupWidget
(
void
)
const
{
return
new
QGCPX4SensorCalibration
;
QGCQmlWidgetHolder
*
holder
=
new
QGCQmlWidgetHolder
();
Q_CHECK_PTR
(
holder
);
holder
->
setAutoPilot
(
_autopilot
);
SensorsComponentController
*
controller
=
new
SensorsComponentController
(
_autopilot
,
holder
);
holder
->
setContextPropertyObject
(
"controller"
,
controller
);
holder
->
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/SensorsComponent.qml"
));
return
holder
;
}
QUrl
SensorsComponent
::
summaryQmlSource
(
void
)
const
...
...
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