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
b0273cae
Commit
b0273cae
authored
Mar 15, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Core plugin can determine Sensor pages to show
parent
b7da6015
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
18 deletions
+45
-18
SensorsComponent.qml
src/AutoPilotPlugins/PX4/SensorsComponent.qml
+19
-13
QGCOptions.h
src/api/QGCOptions.h
+26
-5
No files found.
src/AutoPilotPlugins/PX4/SensorsComponent.qml
View file @
b0273cae
...
...
@@ -7,18 +7,18 @@
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.4
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controllers
1.0
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.4
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controllers
1.0
SetupPage
{
id
:
sensorsPage
...
...
@@ -336,6 +336,7 @@ SetupPage {
width
:
parent
.
buttonWidth
text
:
qsTr
(
"
Compass
"
)
indicatorGreen
:
cal_mag0_id
.
value
!=
0
visible
:
QGroundControl
.
corePlugin
.
options
.
showSensorCalibrationCompass
onClicked
:
{
preCalibrationDialogType
=
"
compass
"
...
...
@@ -349,6 +350,7 @@ SetupPage {
width
:
parent
.
buttonWidth
text
:
qsTr
(
"
Gyroscope
"
)
indicatorGreen
:
cal_gyro0_id
.
value
!=
0
visible
:
QGroundControl
.
corePlugin
.
options
.
showSensorCalibrationGyro
onClicked
:
{
preCalibrationDialogType
=
"
gyro
"
...
...
@@ -362,6 +364,7 @@ SetupPage {
width
:
parent
.
buttonWidth
text
:
qsTr
(
"
Accelerometer
"
)
indicatorGreen
:
cal_acc0_id
.
value
!=
0
visible
:
QGroundControl
.
corePlugin
.
options
.
showSensorCalibrationAccel
onClicked
:
{
preCalibrationDialogType
=
"
accel
"
...
...
@@ -376,6 +379,7 @@ SetupPage {
text
:
qsTr
(
"
Level Horizon
"
)
indicatorGreen
:
sens_board_x_off
.
value
!=
0
||
sens_board_y_off
!=
0
|
sens_board_z_off
!=
0
enabled
:
cal_acc0_id
.
value
!=
0
&&
cal_gyro0_id
.
value
!=
0
visible
:
QGroundControl
.
corePlugin
.
options
.
showSensorCalibrationLevel
onClicked
:
{
preCalibrationDialogType
=
"
level
"
...
...
@@ -388,7 +392,7 @@ SetupPage {
id
:
airspeedButton
width
:
parent
.
buttonWidth
text
:
qsTr
(
"
Airspeed
"
)
visible
:
(
controller
.
vehicle
.
fixedWing
||
controller
.
vehicle
.
vtol
)
&&
controller
.
getParameterFact
(
-
1
,
"
CBRK_AIRSPD_CHK
"
).
value
!=
162128
visible
:
(
controller
.
vehicle
.
fixedWing
||
controller
.
vehicle
.
vtol
)
&&
controller
.
getParameterFact
(
-
1
,
"
CBRK_AIRSPD_CHK
"
).
value
!=
162128
&&
QGroundControl
.
corePlugin
.
options
.
showSensorCalibrationAirspeed
indicatorGreen
:
sens_dpres_off
.
value
!=
0
onClicked
:
{
...
...
@@ -410,6 +414,8 @@ SetupPage {
id
:
setOrientationsButton
width
:
parent
.
buttonWidth
text
:
qsTr
(
"
Set Orientations
"
)
visible
:
QGroundControl
.
corePlugin
.
options
.
showSensorCalibrationOrient
onClicked
:
{
setOrientationsDialogShowBoardOrientation
=
true
showDialog
(
setOrientationsDialogComponent
,
qsTr
(
"
Set Orientations
"
),
sensorsPage
.
showDialogDefaultWidth
,
StandardButton
.
Ok
)
...
...
src/api/QGCOptions.h
View file @
b0273cae
...
...
@@ -24,11 +24,16 @@ class QGCOptions : public QObject
public:
QGCOptions
(
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
bool
combineSettingsAndSetup
READ
combineSettingsAndSetup
CONSTANT
)
Q_PROPERTY
(
double
toolbarHeightMultiplier
READ
toolbarHeightMultiplier
CONSTANT
)
Q_PROPERTY
(
bool
enablePlanViewSelector
READ
enablePlanViewSelector
CONSTANT
)
Q_PROPERTY
(
CustomInstrumentWidget
*
instrumentWidget
READ
instrumentWidget
CONSTANT
)
Q_PROPERTY
(
bool
combineSettingsAndSetup
READ
combineSettingsAndSetup
CONSTANT
)
Q_PROPERTY
(
double
toolbarHeightMultiplier
READ
toolbarHeightMultiplier
CONSTANT
)
Q_PROPERTY
(
bool
enablePlanViewSelector
READ
enablePlanViewSelector
CONSTANT
)
Q_PROPERTY
(
CustomInstrumentWidget
*
instrumentWidget
READ
instrumentWidget
CONSTANT
)
Q_PROPERTY
(
bool
showSensorCalibrationCompass
READ
showSensorCalibrationCompass
NOTIFY
showSensorCalibrationCompassChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationGyro
READ
showSensorCalibrationGyro
NOTIFY
showSensorCalibrationGyroChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationAccel
READ
showSensorCalibrationAccel
NOTIFY
showSensorCalibrationAccelChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationLevel
READ
showSensorCalibrationLevel
NOTIFY
showSensorCalibrationLevelChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationAirspeed
READ
showSensorCalibrationAirspeed
NOTIFY
showSensorCalibrationAirspeedChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationOrient
READ
showSensorCalibrationOrient
NOTIFY
showSensorCalibrationOrientChanged
)
/// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)?
/// @return true if QGC should consolidate both menus into one.
...
...
@@ -46,6 +51,22 @@ public:
/// @return An alternate widget (see QGCInstrumentWidget.qml, the default widget)
virtual
CustomInstrumentWidget
*
instrumentWidget
();
/// By returning false you can hide the following sensor calibration pages
bool
showSensorCalibrationCompass
()
const
{
return
true
;
}
bool
showSensorCalibrationGyro
()
const
{
return
true
;
}
bool
showSensorCalibrationAccel
()
const
{
return
true
;
}
bool
showSensorCalibrationLevel
()
const
{
return
true
;
}
bool
showSensorCalibrationAirspeed
()
const
{
return
true
;
}
bool
showSensorCalibrationOrient
()
const
{
return
true
;
}
signals:
void
showSensorCalibrationCompassChanged
(
bool
show
);
void
showSensorCalibrationGyroChanged
(
bool
show
);
void
showSensorCalibrationAccelChanged
(
bool
show
);
void
showSensorCalibrationLevelChanged
(
bool
show
);
void
showSensorCalibrationAirspeedChanged
(
bool
show
);
void
showSensorCalibrationOrientChanged
(
bool
show
);
private:
CustomInstrumentWidget
*
_defaultInstrumentWidget
;
};
...
...
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