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
30af7f8d
Unverified
Commit
30af7f8d
authored
Mar 06, 2018
by
Gus Grubba
Committed by
GitHub
Mar 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6180 from mavlink/flightWidget
Flight Widget
parents
ffe6813b
6d636fd3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
14 deletions
+80
-14
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+18
-2
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+55
-8
QGCOptions.h
src/api/QGCOptions.h
+7
-4
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
30af7f8d
...
...
@@ -93,6 +93,20 @@ QGCView {
QGroundControl
.
saveBoolGlobalSetting
(
_PIPVisibleKey
,
state
)
}
function
isInstrumentRight
()
{
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
)
{
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
.
toString
().
length
)
{
switch
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetPosition
)
{
case
CustomInstrumentWidget.POS_TOP_LEFT
:
case
CustomInstrumentWidget.POS_BOTTOM_LEFT
:
case
CustomInstrumentWidget.POS_CENTER_LEFT
:
return
false
;
}
}
}
return
true
;
}
PlanMasterController
{
id
:
masterController
Component.onCompleted
:
start
(
false
/* editMode */
)
...
...
@@ -446,8 +460,10 @@ QGCView {
ToolStrip
{
visible
:
(
_activeVehicle
?
_activeVehicle
.
guidedModeSupported
:
true
)
&&
!
QGroundControl
.
videoManager
.
fullScreen
id
:
toolStrip
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
_panel
.
left
anchors.leftMargin
:
isInstrumentRight
()
?
ScreenTools
.
defaultFontPixelWidth
:
undefined
anchors.left
:
isInstrumentRight
()
?
_panel
.
left
:
undefined
anchors.rightMargin
:
isInstrumentRight
()
?
undefined
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
isInstrumentRight
()
?
undefined
:
_panel
.
right
anchors.topMargin
:
ScreenTools
.
toolbarHeight
+
(
_margins
*
2
)
anchors.top
:
_panel
.
top
z
:
_panel
.
z
+
4
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
30af7f8d
...
...
@@ -52,15 +52,24 @@ Item {
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
.
toString
().
length
)
{
instrumentsLoader
.
source
=
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
source
switch
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetPosition
)
{
case
CustomInstrumentWidget.POS_TOP_LEFT
:
instrumentsLoader
.
state
=
"
topLeftMode
"
break
;
case
CustomInstrumentWidget.POS_BOTTOM_LEFT
:
instrumentsLoader
.
state
=
"
bottomLeftMode
"
break
;
case
CustomInstrumentWidget.POS_CENTER_LEFT
:
instrumentsLoader
.
state
=
"
centerLeftMode
"
break
;
case
CustomInstrumentWidget.POS_TOP_RIGHT
:
instrumentsLoader
.
state
=
"
topMode
"
instrumentsLoader
.
state
=
"
top
Right
Mode
"
break
;
case
CustomInstrumentWidget.POS_BOTTOM_RIGHT
:
instrumentsLoader
.
state
=
"
bottomMode
"
instrumentsLoader
.
state
=
"
bottom
Right
Mode
"
break
;
case
CustomInstrumentWidget.POS_CENTER_RIGHT
:
default
:
instrumentsLoader
.
state
=
"
centerMode
"
instrumentsLoader
.
state
=
"
center
Right
Mode
"
break
;
}
}
else
{
...
...
@@ -69,10 +78,9 @@ Item {
var
useAlternateInstruments
=
true
//QGroundControl.settingsManager.appSettings.virtualJoystick.value || ScreenTools.isTinyScreen
if
(
useAlternateInstruments
)
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidgetAlternate.qml
"
instrumentsLoader
.
state
=
"
topMode
"
}
else
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidget.qml
"
instrumentsLoader
.
state
=
QGroundControl
.
settingsManager
.
appSettings
.
showLargeCompass
.
value
===
1
?
"
center
Mode
"
:
"
top
Mode
"
instrumentsLoader
.
state
=
QGroundControl
.
settingsManager
.
appSettings
.
showLargeCompass
.
value
===
1
?
"
center
RightMode
"
:
"
topRight
Mode
"
}
}
}
else
{
...
...
@@ -141,30 +149,69 @@ Item {
property
real
maxHeight
:
parent
.
height
-
(
anchors
.
margins
*
2
)
states
:
[
State
{
name
:
"
topMode
"
name
:
"
topRightMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.verticalCenter
:
undefined
anchors.bottom
:
undefined
anchors.top
:
_root
?
_root
.
top
:
undefined
anchors.right
:
_root
?
_root
.
right
:
undefined
anchors.left
:
undefined
}
},
State
{
name
:
"
centerRightMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.bottom
:
undefined
anchors.verticalCenter
:
_root
?
_root
.
verticalCenter
:
undefined
anchors.right
:
_root
?
_root
.
right
:
undefined
anchors.left
:
undefined
}
},
State
{
name
:
"
bottomRightMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.verticalCenter
:
undefined
anchors.bottom
:
_root
?
_root
.
bottom
:
undefined
anchors.right
:
_root
?
_root
.
right
:
undefined
anchors.left
:
undefined
}
},
State
{
name
:
"
topLeftMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.verticalCenter
:
undefined
anchors.bottom
:
undefined
anchors.top
:
_root
?
_root
.
top
:
undefined
anchors.right
:
undefined
anchors.left
:
_root
?
_root
.
left
:
undefined
}
},
State
{
name
:
"
centerMode
"
name
:
"
center
Left
Mode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.bottom
:
undefined
anchors.verticalCenter
:
_root
?
_root
.
verticalCenter
:
undefined
anchors.right
:
undefined
anchors.left
:
_root
?
_root
.
left
:
undefined
}
},
State
{
name
:
"
bottomMode
"
name
:
"
bottom
Left
Mode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.verticalCenter
:
undefined
anchors.bottom
:
_root
?
_root
.
bottom
:
undefined
anchors.right
:
undefined
anchors.left
:
_root
?
_root
.
left
:
undefined
}
}
]
...
...
src/api/QGCOptions.h
View file @
30af7f8d
...
...
@@ -123,16 +123,19 @@ class CustomInstrumentWidget : public QObject
public:
//-- Widget Position
enum
Pos
{
POS_TOP_RIGHT
=
0
,
POS_CENTER_RIGHT
=
1
,
POS_BOTTOM_RIGHT
=
2
,
POS_TOP_RIGHT
,
POS_CENTER_RIGHT
,
POS_BOTTOM_RIGHT
,
POS_TOP_LEFT
,
POS_CENTER_LEFT
,
POS_BOTTOM_LEFT
};
Q_ENUMS
(
Pos
)
CustomInstrumentWidget
(
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
QUrl
source
READ
source
CONSTANT
)
Q_PROPERTY
(
Pos
widgetPosition
READ
widgetPosition
NOTIFY
widgetPositionChanged
)
virtual
QUrl
source
()
{
return
QUrl
();
}
virtual
Pos
widgetPosition
()
{
return
POS_
CENTER
_RIGHT
;
}
virtual
Pos
widgetPosition
()
{
return
POS_
TOP
_RIGHT
;
}
signals:
void
widgetPositionChanged
();
};
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