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
365c6d71
Commit
365c6d71
authored
Jan 20, 2018
by
Gus Grubba
Browse files
Control on Fly View
Eliminated flight widget "states" Define flight widget top margin (plugin options)
parent
a7ddca45
Changes
9
Hide whitespace changes
Inline
Side-by-side
qgcresources.qrc
View file @
365c6d71
...
...
@@ -176,6 +176,7 @@
</qresource>
<qresource prefix="/airmap">
<file alias="advisory-icon.svg">src/Airmap/images/advisory-icon.svg</file>
<file alias="colapse.svg">src/Airmap/images/colapse.svg</file>
<file alias="expand.svg">src/Airmap/images/expand.svg</file>
<file alias="pencil.svg">src/Airmap/images/pencil.svg</file>
</qresource>
...
...
src/Airmap/AirspaceControl.qml
View file @
365c6d71
...
...
@@ -18,7 +18,8 @@ Item {
width
:
parent
.
width
height
:
colapsed
?
colapsedRect
.
height
:
expandedRect
.
height
property
var
colapsed
:
true
property
bool
colapsed
:
true
property
bool
showColapse
:
true
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
*
0.5
readonly
property
color
_colorOrange
:
"
#d75e0d
"
...
...
@@ -125,6 +126,22 @@ Item {
}
}
}
QGCColoredImage
{
width
:
height
height
:
ScreenTools
.
defaultFontPixelWidth
*
2.5
sourceSize.height
:
height
source
:
"
qrc:/airmap/colapse.svg
"
color
:
_colorWhite
visible
:
showColapse
anchors.right
:
parent
.
right
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.verticalCenter
:
parent
.
verticalCenter
MouseArea
{
anchors.fill
:
parent
enabled
:
showColapse
onClicked
:
colapsed
=
true
}
}
}
//-- Contents (Brown Box)
Rectangle
{
...
...
src/Airmap/images/colapse.svg
0 → 100644
View file @
365c6d71
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"72px"
height=
"36px"
viewBox=
"0 0 72 36"
style=
"enable-background:new 0 0 72 36;"
xml:space=
"preserve"
>
<style
type=
"text/css"
>
.st0{fill:none;stroke:#FFFFFF;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<polyline
class=
"st0"
points=
"3.6,34 36,1.6 68.4,34 "
/>
</svg>
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
365c6d71
...
...
@@ -15,19 +15,21 @@ import QtLocation 5.3
import
QtPositioning
5.3
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
FlightMap
1.0
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
FlightMap
1.0
import
QGroundControl
.
Airmap
1.0
Item
{
id
:
_r
oot
id
:
widgetR
oot
property
var
qgcView
property
bool
useLightColors
property
var
missionController
property
bool
showValues
:
true
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
...
...
@@ -51,28 +53,14 @@ Item {
if
(
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
)
{
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_RIGHT
:
instrumentsLoader
.
state
=
"
topMode
"
break
;
case
CustomInstrumentWidget.POS_BOTTOM_RIGHT
:
instrumentsLoader
.
state
=
"
bottomMode
"
break
;
case
CustomInstrumentWidget.POS_CENTER_RIGHT
:
default
:
instrumentsLoader
.
state
=
"
centerMode
"
break
;
}
}
else
{
// Note: We currently show alternate instruments all the time. This is a trial change for daily builds.
// Leaving non-alternate code in for now in case the trial fails.
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
?
"
centerMode
"
:
"
topMode
"
}
}
}
else
{
...
...
@@ -130,43 +118,30 @@ Item {
text
:
"
The vehicle has failed a pre-arm check. In order to arm the vehicle, resolve the failure or disable the arming check via the Safety tab on the Vehicle Setup page.
"
}
}
//-- Instrument Panel
Loader
{
id
:
instrumentsLoader
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
Column
{
id
:
instrumentsColumn
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
anchors.top
:
parent
.
top
anchors.topMargin
:
QGroundControl
.
corePlugin
.
options
.
instrumentWidget
.
widgetTopMargin
+
(
ScreenTools
.
defaultFontPixelHeight
*
0.5
)
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.right
:
parent
.
right
z
:
QGroundControl
.
zOrderWidgets
property
var
qgcView
:
_root
.
qgcView
property
real
maxHeight
:
parent
.
height
-
(
anchors
.
margins
*
2
)
states
:
[
State
{
name
:
"
topMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.verticalCenter
:
undefined
anchors.bottom
:
undefined
anchors.top
:
_root
?
_root
.
top
:
undefined
}
},
State
{
name
:
"
centerMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.bottom
:
undefined
anchors.verticalCenter
:
_root
?
_root
.
verticalCenter
:
undefined
}
},
State
{
name
:
"
bottomMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.verticalCenter
:
undefined
anchors.bottom
:
_root
?
_root
.
bottom
:
undefined
}
//-------------------------------------------------------
// Airmap Airspace Control
AirspaceControl
{
id
:
airspaceControl
width
:
getPreferredInstrumentWidth
()
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
onColapsedChanged
:
{
widgetRoot
.
showValues
=
colapsed
}
]
}
//-------------------------------------------------------
//-- Instrument Panel
Loader
{
id
:
instrumentsLoader
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
property
var
qgcView
:
widgetRoot
.
qgcView
property
real
maxHeight
:
widgetRoot
?
widgetRoot
.
height
-
instrumentsColumn
.
y
-
airspaceControl
.
height
-
(
ScreenTools
.
defaultFontPixelHeight
*
4
)
:
0
}
}
}
src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
View file @
365c6d71
...
...
@@ -66,6 +66,7 @@ Rectangle {
anchors.top
:
parent
.
bottom
width
:
parent
.
width
height
:
_valuesWidget
.
height
visible
:
widgetRoot
.
showValues
Rectangle
{
anchors.fill
:
_valuesWidget
...
...
src/PlanView/PlanView.qml
View file @
365c6d71
...
...
@@ -512,8 +512,9 @@ QGCView {
//-------------------------------------------------------
// Airmap Airspace Control
AirspaceControl
{
id
:
airspaceControl
width
:
parent
.
width
id
:
airspaceControl
width
:
parent
.
width
showColapse
:
false
onColapsedChanged
:
{
if
(
!
airspaceControl
.
colasped
)
{
planControlColapsed
=
true
...
...
src/QGCPalette.cc
View file @
365c6d71
...
...
@@ -73,7 +73,7 @@ void QGCPalette::_buildMap(void)
DECLARE_QGC_COLOR
(
alertBackground
,
"#eecc44"
,
"#eecc44"
,
"#eecc44"
,
"#eecc44"
)
DECLARE_QGC_COLOR
(
alertBorder
,
"#808080"
,
"#808080"
,
"#808080"
,
"#808080"
)
DECLARE_QGC_COLOR
(
alertText
,
"#000000"
,
"#000000"
,
"#000000"
,
"#000000"
)
DECLARE_QGC_COLOR
(
missionItemEditor
,
"#585858"
,
"#
a39fd3
"
,
"#585858"
,
"#
4e4480
"
)
DECLARE_QGC_COLOR
(
missionItemEditor
,
"#585858"
,
"#
dbfef8
"
,
"#585858"
,
"#
585d83
"
)
// Colors are not affecting by theming
DECLARE_QGC_COLOR
(
mapWidgetBorderLight
,
"#ffffff"
,
"#ffffff"
,
"#ffffff"
,
"#ffffff"
)
...
...
src/QmlControls/PageView.qml
View file @
365c6d71
...
...
@@ -10,6 +10,7 @@ Rectangle {
id
:
_root
height
:
pageFlickable
.
y
+
pageFlickable
.
height
+
_margins
color
:
qgcPal
.
window
radius
:
ScreenTools
.
defaultFontPixelWidth
*
0.5
property
var
qgcView
///< QGCView to use for showing dialogs
property
real
maxHeight
///< Maximum height that should be taken, smaller than this is ok
...
...
src/api/QGCOptions.h
View file @
365c6d71
...
...
@@ -121,18 +121,11 @@ class CustomInstrumentWidget : public QObject
{
Q_OBJECT
public:
//-- Widget Position
enum
Pos
{
POS_TOP_RIGHT
=
0
,
POS_CENTER_RIGHT
=
1
,
POS_BOTTOM_RIGHT
=
2
,
};
Q_ENUMS
(
Pos
)
CustomInstrumentWidget
(
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
QUrl
source
READ
source
CONSTANT
)
Q_PROPERTY
(
Pos
widget
Position
READ
widgetPosition
NOTIFY
widget
Positio
nChanged
)
Q_PROPERTY
(
double
widget
TopMargin
READ
widgetTopMargin
NOTIFY
widget
TopMargi
nChanged
)
virtual
QUrl
source
()
{
return
QUrl
();
}
virtual
Pos
widget
Positio
n
()
{
return
POS_CENTER_RIGHT
;
}
virtual
double
widget
TopMargi
n
()
{
return
0.0
;
}
signals:
void
widget
Positio
nChanged
();
void
widget
TopMargi
nChanged
();
};
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