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
dd4de906
Commit
dd4de906
authored
Feb 17, 2017
by
Gus Grubba
Browse files
Move instrument widgets off to a loader.
parent
e4fddb3f
Changes
10
Hide whitespace changes
Inline
Side-by-side
qgroundcontrol.qrc
View file @
dd4de906
...
@@ -125,8 +125,8 @@
...
@@ -125,8 +125,8 @@
<file alias="QGroundControl/FlightMap/QGCAttitudeHUD.qml">src/FlightMap/Widgets/QGCAttitudeHUD.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeHUD.qml">src/FlightMap/Widgets/QGCAttitudeHUD.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeWidget.qml">src/FlightMap/Widgets/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeWidget.qml">src/FlightMap/Widgets/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCCompassWidget.qml">src/FlightMap/Widgets/QGCCompassWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCCompassWidget.qml">src/FlightMap/Widgets/QGCCompassWidget.qml</file>
<file alias="
QGroundControl/FlightMap/
QGCInstrumentWidget.qml">src/FlightMap/Widgets/QGCInstrumentWidget.qml</file>
<file alias="QGCInstrumentWidget.qml">src/FlightMap/Widgets/QGCInstrumentWidget.qml</file>
<file alias="
QGroundControl/FlightMap/
QGCInstrumentWidgetAlternate.qml">src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml</file>
<file alias="QGCInstrumentWidgetAlternate.qml">src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml</file>
<file alias="QGroundControl/FlightMap/QGCMapPolygonControls.qml">src/MissionEditor/QGCMapPolygonControls.qml</file>
<file alias="QGroundControl/FlightMap/QGCMapPolygonControls.qml">src/MissionEditor/QGCMapPolygonControls.qml</file>
<file alias="QGroundControl/FlightMap/QGCPitchIndicator.qml">src/FlightMap/Widgets/QGCPitchIndicator.qml</file>
<file alias="QGroundControl/FlightMap/QGCPitchIndicator.qml">src/FlightMap/Widgets/QGCPitchIndicator.qml</file>
<file alias="QGroundControl/FlightMap/QGCVideoBackground.qml">src/FlightMap/QGCVideoBackground.qml</file>
<file alias="QGroundControl/FlightMap/QGCVideoBackground.qml">src/FlightMap/QGCVideoBackground.qml</file>
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
dd4de906
...
@@ -33,25 +33,14 @@ QGCView {
...
@@ -33,25 +33,14 @@ QGCView {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
property
bool
activeVehicleJoystickEnabled
:
_activeVehicle
?
_activeVehicle
.
joystickEnabled
:
false
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_mainIsMap
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_mainIsMapKey
,
true
)
:
true
property
bool
_mainIsMap
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_mainIsMapKey
,
true
)
:
true
property
bool
_isPipVisible
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_PIPVisibleKey
,
true
)
:
false
property
bool
_isPipVisible
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_PIPVisibleKey
,
true
)
:
false
property
real
_savedZoomLevel
:
0
property
real
_roll
:
_activeVehicle
?
_activeVehicle
.
roll
.
value
:
_defaultRoll
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_pitch
:
_activeVehicle
?
_activeVehicle
.
pitch
.
value
:
_defaultPitch
property
real
_pipSize
:
mainWindow
.
width
*
0.2
property
real
_heading
:
_activeVehicle
?
_activeVehicle
.
heading
.
value
:
_defaultHeading
property
Fact
_emptyFact
:
Fact
{
}
property
Fact
_groundSpeedFact
:
_activeVehicle
?
_activeVehicle
.
groundSpeed
:
_emptyFact
property
Fact
_airSpeedFact
:
_activeVehicle
?
_activeVehicle
.
airSpeed
:
_emptyFact
property
bool
activeVehicleJoystickEnabled
:
_activeVehicle
?
_activeVehicle
.
joystickEnabled
:
false
property
real
_savedZoomLevel
:
0
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
pipSize
:
mainWindow
.
width
*
0.2
readonly
property
bool
isBackgroundDark
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
readonly
property
bool
isBackgroundDark
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
readonly
property
real
_defaultRoll
:
0
readonly
property
real
_defaultRoll
:
0
...
@@ -136,8 +125,8 @@ QGCView {
...
@@ -136,8 +125,8 @@ QGCView {
anchors.left
:
_panel
.
left
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
anchors.bottom
:
_panel
.
bottom
visible
:
_mainIsMap
||
_isPipVisible
visible
:
_mainIsMap
||
_isPipVisible
width
:
_mainIsMap
?
_panel
.
width
:
pipSize
width
:
_mainIsMap
?
_panel
.
width
:
_
pipSize
height
:
_mainIsMap
?
_panel
.
height
:
pipSize
*
(
9
/
16
)
height
:
_mainIsMap
?
_panel
.
height
:
_
pipSize
*
(
9
/
16
)
states
:
[
states
:
[
State
{
State
{
name
:
"
pipMode
"
name
:
"
pipMode
"
...
@@ -166,8 +155,8 @@ QGCView {
...
@@ -166,8 +155,8 @@ QGCView {
Item
{
Item
{
id
:
_flightVideo
id
:
_flightVideo
z
:
_mainIsMap
?
_panel
.
z
+
2
:
_panel
.
z
+
1
z
:
_mainIsMap
?
_panel
.
z
+
2
:
_panel
.
z
+
1
width
:
!
_mainIsMap
?
_panel
.
width
:
pipSize
width
:
!
_mainIsMap
?
_panel
.
width
:
_
pipSize
height
:
!
_mainIsMap
?
_panel
.
height
:
pipSize
*
(
9
/
16
)
height
:
!
_mainIsMap
?
_panel
.
height
:
_
pipSize
*
(
9
/
16
)
anchors.left
:
_panel
.
left
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
anchors.bottom
:
_panel
.
bottom
visible
:
QGroundControl
.
videoManager
.
hasVideo
&&
(
!
_mainIsMap
||
_isPipVisible
)
visible
:
QGroundControl
.
videoManager
.
hasVideo
&&
(
!
_mainIsMap
||
_isPipVisible
)
...
@@ -204,8 +193,8 @@ QGCView {
...
@@ -204,8 +193,8 @@ QGCView {
QGCPipable
{
QGCPipable
{
id
:
_flightVideoPipControl
id
:
_flightVideoPipControl
z
:
_flightVideo
.
z
+
3
z
:
_flightVideo
.
z
+
3
width
:
pipSize
width
:
_
pipSize
height
:
pipSize
*
(
9
/
16
)
height
:
_
pipSize
*
(
9
/
16
)
anchors.left
:
_panel
.
left
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
anchors.bottom
:
_panel
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
...
...
src/FlightDisplay/FlightDisplayViewVideo.qml
View file @
dd4de906
...
@@ -45,8 +45,8 @@ Item {
...
@@ -45,8 +45,8 @@ Item {
QGCAttitudeHUD {
QGCAttitudeHUD {
id: attitudeHUD
id: attitudeHUD
visible: !_mainIsMap
visible: !_mainIsMap
rollAngle: _
roll
rollAngle: _
activeVehicle ? _activeVehicle.roll.value : 0
pitchAngle: _
pitch
pitchAngle: _
activeVehicle ? _activeVehicle.pitch.value : 0
width: ScreenTools.defaultFontPixelHeight * (30)
width: ScreenTools.defaultFontPixelHeight * (30)
height: ScreenTools.defaultFontPixelHeight * (30)
height: ScreenTools.defaultFontPixelHeight * (30)
active: QGroundControl.multiVehicleManager.activeVehicleAvailable
active: QGroundControl.multiVehicleManager.activeVehicleAvailable
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
dd4de906
...
@@ -25,22 +25,21 @@ import QGroundControl.FlightMap 1.0
...
@@ -25,22 +25,21 @@ import QGroundControl.FlightMap 1.0
Item
{
Item
{
id
:
_root
id
:
_root
property
alias
guidedModeBar
:
_guidedModeBar
property
alias
guidedModeBar
:
_guidedModeBar
property
bool
gotoEnabled
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
property
bool
gotoEnabled
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
property
var
qgcView
property
var
qgcView
property
bool
isBackgroundDark
property
bool
isBackgroundDark
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
property
bool
_lightWidgetBorders
:
_isSatellite
property
bool
_lightWidgetBorders
:
_isSatellite
property
bool
_useAlternateInstruments
:
QGroundControl
.
virtualTabletJoystick
||
ScreenTools
.
isTinyScreen
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
isBackgroundDark
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
isBackgroundDark
}
QGCPalette
{
id
:
qgcPal
}
QGCPalette
{
id
:
qgcPal
}
function
get
Gadge
tWidth
()
{
function
get
PreferredInstrumen
tWidth
()
{
if
(
ScreenTools
.
isMobile
)
{
if
(
ScreenTools
.
isMobile
)
{
return
ScreenTools
.
isTinyScreen
?
mainWindow
.
width
*
0.2
:
mainWindow
.
width
*
0.15
return
ScreenTools
.
isTinyScreen
?
mainWindow
.
width
*
0.2
:
mainWindow
.
width
*
0.15
}
}
...
@@ -48,6 +47,28 @@ Item {
...
@@ -48,6 +47,28 @@ Item {
return
Math
.
min
(
w
,
200
)
return
Math
.
min
(
w
,
200
)
}
}
function
_setInstrumentWidget
()
{
var
useAlternateInstruments
=
QGroundControl
.
virtualTabletJoystick
||
ScreenTools
.
isTinyScreen
if
(
useAlternateInstruments
)
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidgetAlternate.qml
"
instrumentsLoader
.
state
=
"
topMode
"
}
else
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidget.qml
"
instrumentsLoader
.
state
=
"
centerMode
"
}
}
Connections
{
target
:
QGroundControl
onVirtualTabletJoystickChanged
:
{
_setInstrumentWidget
()
}
}
Component.onCompleted
:
{
_setInstrumentWidget
()
}
//-- Map warnings
//-- Map warnings
Column
{
Column
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
@@ -74,54 +95,33 @@ Item {
...
@@ -74,54 +95,33 @@ Item {
}
}
//-- Instrument Panel
//-- Instrument Panel
QGCInstrumentWidget
{
Loader
{
id
:
instrumentGadget
id
:
instrumentsLoader
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.right
:
altitudeSlider
.
visible
?
altitudeSlider
.
left
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
!
_useAlternateInstruments
size
:
getGadgetWidth
()
heading
:
_heading
rollAngle
:
_roll
pitchAngle
:
_pitch
groundSpeedFact
:
_groundSpeedFact
airSpeedFact
:
_airSpeedFact
lightBorders
:
_lightWidgetBorders
z
:
QGroundControl
.
zOrderWidgets
qgcView
:
_root
.
qgcView
maxHeight
:
parent
.
height
-
(
anchors
.
margins
*
2
)
}
QGCInstrumentWidgetAlternate
{
id
:
instrumentGadgetAlternate
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.top
:
parent
.
top
anchors.right
:
altitudeSlider
.
visible
?
altitudeSlider
.
left
:
parent
.
right
anchors.right
:
altitudeSlider
.
visible
?
altitudeSlider
.
left
:
parent
.
right
visible
:
_useAlternateInstruments
width
:
ScreenTools
.
isTinyScreen
?
getGadgetWidth
()
*
1.5
:
getGadgetWidth
()
heading
:
_heading
rollAngle
:
_roll
pitchAngle
:
_pitch
groundSpeedFact
:
_groundSpeedFact
airSpeedFact
:
_airSpeedFact
lightBorders
:
_lightWidgetBorders
qgcView
:
_root
.
qgcView
maxHeight
:
parent
.
height
-
(
anchors
.
margins
*
2
)
z
:
QGroundControl
.
zOrderWidgets
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.top
:
_root
?
_root
.
top
:
undefined
}
},
State
{
name
:
"
centerMode
"
AnchorChanges
{
target
:
instrumentsLoader
anchors.top
:
undefined
anchors.verticalCenter
:
_root
?
_root
.
verticalCenter
:
undefined
}
}
]
}
}
/*
ValuesWidget {
anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.top: instrumentGadgetAlternate.bottom
anchors.horizontalCenter: instrumentGadgetAlternate.horizontalCenter
width: getGadgetWidth()
qgcView: _root.qgcView
textColor: _isSatellite ? "white" : "black"
visible: _useAlternateInstruments
maxHeight: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.y - y : parent.height - anchors.margins - y
}*/
//-- Guided mode buttons
//-- Guided mode buttons
Rectangle
{
Rectangle
{
id
:
_guidedModeBar
id
:
_guidedModeBar
...
@@ -131,7 +131,7 @@ Item {
...
@@ -131,7 +131,7 @@ Item {
width
:
guidedModeColumn
.
width
+
(
_margins
*
2
)
width
:
guidedModeColumn
.
width
+
(
_margins
*
2
)
height
:
guidedModeColumn
.
height
+
(
_margins
*
2
)
height
:
guidedModeColumn
.
height
+
(
_margins
*
2
)
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
color
:
_
lightWidgetBorders
?
Qt
.
rgba
(
qgcPal
.
mapWidgetBorderLight
.
r
,
qgcPal
.
mapWidgetBorderLight
.
g
,
qgcPal
.
mapWidgetBorderLight
.
b
,
0.8
)
:
Qt
.
rgba
(
qgcPal
.
mapWidgetBorderDark
.
r
,
qgcPal
.
mapWidgetBorderDark
.
g
,
qgcPal
.
mapWidgetBorderDark
.
b
,
0.75
)
color
:
_
isSatellite
?
Qt
.
rgba
(
qgcPal
.
mapWidgetBorderLight
.
r
,
qgcPal
.
mapWidgetBorderLight
.
g
,
qgcPal
.
mapWidgetBorderLight
.
b
,
0.8
)
:
Qt
.
rgba
(
qgcPal
.
mapWidgetBorderDark
.
r
,
qgcPal
.
mapWidgetBorderDark
.
g
,
qgcPal
.
mapWidgetBorderDark
.
b
,
0.75
)
visible
:
_activeVehicle
visible
:
_activeVehicle
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
state
:
"
Shown
"
state
:
"
Shown
"
...
@@ -303,7 +303,7 @@ Item {
...
@@ -303,7 +303,7 @@ Item {
QGCLabel
{
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
color
:
_
lightWidgetBorders
?
qgcPal
.
mapWidgetBorderDark
:
qgcPal
.
mapWidgetBorderLight
color
:
_
isSatellite
?
qgcPal
.
mapWidgetBorderDark
:
qgcPal
.
mapWidgetBorderLight
text
:
"
Click in map to move vehicle
"
text
:
"
Click in map to move vehicle
"
visible
:
gotoEnabled
visible
:
gotoEnabled
}
}
...
...
src/FlightDisplay/MultiVehicleList.qml
View file @
dd4de906
...
@@ -52,15 +52,12 @@ QGCListView {
...
@@ -52,15 +52,12 @@ QGCListView {
QGCCompassWidget
{
QGCCompassWidget
{
size
:
_widgetHeight
size
:
_widgetHeight
heading
:
_vehicle
.
heading
.
rawValue
vehicle
:
_vehicle
vehicle
:
_vehicle
}
}
QGCAttitudeWidget
{
QGCAttitudeWidget
{
size
:
_widgetHeight
size
:
_widgetHeight
active
:
true
vehicle
:
_vehicle
rollAngle
:
_vehicle
.
roll
.
rawValue
pitchAngle
:
_vehicle
.
pitch
.
rawValue
}
}
}
}
...
...
src/FlightMap/Widgets/QGCAttitudeWidget.qml
View file @
dd4de906
...
@@ -17,22 +17,18 @@
...
@@ -17,22 +17,18 @@
import
QtQuick
2.4
import
QtQuick
2.4
import
QtGraphicalEffects
1.0
import
QtGraphicalEffects
1.0
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
Item
{
Item
{
id
:
root
id
:
root
property
bool
active
:
false
///< true: actively connected to data provider, false: show inactive control
property
real
rollAngle
:
_defaultRollAngle
property
real
pitchAngle
:
_defaultPitchAngle
property
bool
showPitch
:
true
property
bool
showPitch
:
true
property
var
vehicle
:
null
property
real
size
property
real
size
readonly
property
real
_defaultRollAngle
:
0
property
real
_rollAngle
:
vehicle
?
vehicle
.
roll
.
rawValue
:
0
readonly
property
real
_defaultPitchAngle
:
0
property
real
_pitchAngle
:
vehicle
?
vehicle
.
pitch
.
rawValue
:
0
property
real
_rollAngle
:
active
?
rollAngle
:
_defaultRollAngle
property
real
_pitchAngle
:
active
?
pitchAngle
:
_defaultPitchAngle
width
:
size
width
:
size
height
:
size
height
:
size
...
...
src/FlightMap/Widgets/QGCCompassWidget.qml
View file @
dd4de906
...
@@ -25,12 +25,12 @@ Item {
...
@@ -25,12 +25,12 @@ Item {
id
:
root
id
:
root
property
real
size
:
_defaultSize
property
real
size
:
_defaultSize
property
real
heading
:
0
property
var
vehicle
:
null
property
var
vehicle
:
null
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
10
)
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
10
)
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
size
/
_defaultSize
)
*
0.5
:
size
/
_defaultSize
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
size
/
_defaultSize
)
*
0.5
:
size
/
_defaultSize
property
int
_fontSize
:
ScreenTools
.
defaultFontPointSize
*
_sizeRatio
property
int
_fontSize
:
ScreenTools
.
defaultFontPointSize
*
_sizeRatio
property
real
_heading
:
vehicle
?
vehicle
.
heading
.
rawValue
:
0
width
:
size
width
:
size
height
:
size
height
:
size
...
@@ -58,7 +58,7 @@ Item {
...
@@ -58,7 +58,7 @@ Item {
transform
:
Rotation
{
transform
:
Rotation
{
origin.x
:
pointer
.
width
/
2
origin.x
:
pointer
.
width
/
2
origin.y
:
pointer
.
height
/
2
origin.y
:
pointer
.
height
/
2
angle
:
heading
angle
:
_
heading
}
}
}
}
...
@@ -79,7 +79,7 @@ Item {
...
@@ -79,7 +79,7 @@ Item {
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.65
)
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.65
)
QGCLabel
{
QGCLabel
{
text
:
vehicle
?
heading
.
toFixed
(
0
)
:
qsTr
(
"
OFF
"
)
text
:
vehicle
?
_
heading
.
toFixed
(
0
)
:
qsTr
(
"
OFF
"
)
font.family
:
vehicle
?
ScreenTools
.
demiboldFontFamily
:
ScreenTools
.
normalFontFamily
font.family
:
vehicle
?
ScreenTools
.
demiboldFontFamily
:
ScreenTools
.
normalFontFamily
font.pointSize
:
_fontSize
<
8
?
8
:
_fontSize
;
font.pointSize
:
_fontSize
<
8
?
8
:
_fontSize
;
color
:
"
white
"
color
:
"
white
"
...
...
src/FlightMap/Widgets/QGCInstrumentWidget.qml
View file @
dd4de906
...
@@ -26,27 +26,15 @@ import QGroundControl.Palette 1.0
...
@@ -26,27 +26,15 @@ import QGroundControl.Palette 1.0
Item
{
Item
{
id
:
instrumentPanel
id
:
instrumentPanel
height
:
instrumentColumn
.
y
+
instrumentColumn
.
height
+
_topBottomMargin
height
:
instrumentColumn
.
y
+
instrumentColumn
.
height
+
_topBottomMargin
width
:
size
width
:
getPreferredInstrumentWidth
()
property
alias
heading
:
compass
.
heading
property
alias
rollAngle
:
attitudeWidget
.
rollAngle
property
alias
pitchAngle
:
attitudeWidget
.
pitchAngle
property
real
size
:
_defaultSize
property
bool
lightBorders
:
true
property
bool
active
:
false
property
var
qgcView
property
real
maxHeight
property
Fact
_emptyFact
:
Fact
{
}
property
Fact
groundSpeedFact
:
_emptyFact
property
Fact
airSpeedFact
:
_emptyFact
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
9
)
property
var
_qgcView
:
qgcView
property
real
_maxHeight
:
maxHeight
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
9
)
property
color
_backgroundColor
:
qgcPal
.
window
property
color
_backgroundColor
:
qgcPal
.
window
property
real
_spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.33
property
real
_spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.33
property
real
_topBottomMargin
:
(
size
*
0.05
)
/
2
property
real
_topBottomMargin
:
(
width
*
0.05
)
/
2
property
real
_availableValueHeight
:
maxHeight
-
(
attitudeWidget
.
height
+
_spacer1
.
height
+
_spacer2
.
height
+
(
_spacing
*
4
))
-
(
_showCompass
?
compass
.
height
:
0
)
property
real
_availableValueHeight
:
_
maxHeight
-
(
attitudeWidget
.
height
+
_spacer1
.
height
+
_spacer2
.
height
+
(
_spacing
*
4
))
-
(
_showCompass
?
compass
.
height
:
0
)
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
readonly
property
bool
_showCompass
:
true
// !ScreenTools.isShortScreen
readonly
property
bool
_showCompass
:
true
// !ScreenTools.isShortScreen
...
@@ -57,10 +45,10 @@ Item {
...
@@ -57,10 +45,10 @@ Item {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
height
:
(
_showCompass
?
instrumentColumn
.
height
:
attitudeWidget
.
height
)
+
(
_topBottomMargin
*
2
)
height
:
(
_showCompass
?
instrumentColumn
.
height
:
attitudeWidget
.
height
)
+
(
_topBottomMargin
*
2
)
radius
:
size
/
2
radius
:
width
/
2
color
:
_backgroundColor
color
:
_backgroundColor
border.width
:
1
border.width
:
1
border.color
:
lightBorders
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
border.color
:
_isSatellite
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
}
}
MouseArea
{
MouseArea
{
...
@@ -83,7 +71,7 @@ Item {
...
@@ -83,7 +71,7 @@ Item {
QGCAttitudeWidget
{
QGCAttitudeWidget
{
id
:
attitudeWidget
id
:
attitudeWidget
size
:
parent
.
width
*
0.95
size
:
parent
.
width
*
0.95
activ
e
:
instrumentPanel
.
activ
e
vehicl
e
:
_activeVehicl
e
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
...
@@ -131,7 +119,7 @@ Item {
...
@@ -131,7 +119,7 @@ Item {
anchors.margins
:
1
anchors.margins
:
1
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
qgcView
:
instrumentPanel
.
qgcView
qgcView
:
instrumentPanel
.
_
qgcView
textColor
:
qgcPal
.
text
textColor
:
qgcPal
.
text
backgroundColor
:
_backgroundColor
backgroundColor
:
_backgroundColor
maxHeight
:
_availableValueHeight
maxHeight
:
_availableValueHeight
...
...
src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
View file @
dd4de906
...
@@ -20,38 +20,24 @@ import QGroundControl.Palette 1.0
...
@@ -20,38 +20,24 @@ import QGroundControl.Palette 1.0
/// Instrument panel shown when virtual thumbsticks are visible
/// Instrument panel shown when virtual thumbsticks are visible
Rectangle
{
Rectangle
{
id
:
root
id
:
root
width
:
ScreenTools
.
isTinyScreen
?
getPreferredInstrumentWidth
()
*
1.5
:
getPreferredInstrumentWidth
()
height
:
_outerRadius
*
2
height
:
_outerRadius
*
2
radius
:
_outerRadius
radius
:
_outerRadius
color
:
qgcPal
.
window
color
:
qgcPal
.
window
border.width
:
1
border.width
:
1
border.color
:
lightBorders
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
border.color
:
_isSatellite
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
property
alias
heading
:
compass
.
heading
property
real
_innerRadius
:
(
width
-
(
_topBottomMargin
*
3
))
/
4
property
alias
rollAngle
:
attitude
.
rollAngle
property
real
_outerRadius
:
_innerRadius
+
_topBottomMargin
property
alias
pitchAngle
:
attitude
.
pitchAngle
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
9
)
property
real
size
:
_defaultSize
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
width
/
_defaultSize
)
*
0.5
:
width
/
_defaultSize
property
bool
active
:
false
property
real
_bigFontSize
:
ScreenTools
.
defaultFontPointSize
*
2.5
*
_sizeRatio
property
bool
lightBorders
:
true
property
real
_normalFontSize
:
ScreenTools
.
defaultFontPointSize
*
1.5
*
_sizeRatio
property
var
qgcView
property
real
_labelFontSize
:
ScreenTools
.
defaultFontPointSize
*
0.75
*
_sizeRatio
property
real
maxHeight
property
real
_spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.33
property
real
_topBottomMargin
:
(
width
*
0.05
)
/
2
property
Fact
_emptyFact
:
Fact
{
}
property
Fact
groundSpeedFact
:
_emptyFact
property
Fact
airSpeedFact
:
_emptyFact
property
Fact
altitudeFact
:
_emptyFact
property
real
_innerRadius
:
(
width
-
(
_topBottomMargin
*
3
))
/
4
property
real
_outerRadius
:
_innerRadius
+
_topBottomMargin
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
9
)
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
size
/
_defaultSize
)
*
0.5
:
size
/
_defaultSize
property
real
_bigFontSize
:
ScreenTools
.
defaultFontPointSize
*
2.5
*
_sizeRatio
property
real
_normalFontSize
:
ScreenTools
.
defaultFontPointSize
*
1.5
*
_sizeRatio
property
real
_labelFontSize
:
ScreenTools
.
defaultFontPointSize
*
0.75
*
_sizeRatio
property
real
_spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.33
property
real
_topBottomMargin
:
(
size
*
0.05
)
/
2
property
real
_availableValueHeight
:
maxHeight
-
(
root
.
height
+
_valuesItem
.
anchors
.
topMargin
)
property
real
_availableValueHeight
:
maxHeight
-
(
root
.
height
+
_valuesItem
.
anchors
.
topMargin
)
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
QGCPalette
{
id
:
qgcPal
}
QGCPalette
{
id
:
qgcPal
}
...
@@ -60,7 +46,7 @@ Rectangle {
...
@@ -60,7 +46,7 @@ Rectangle {
anchors.leftMargin
:
_topBottomMargin
anchors.leftMargin
:
_topBottomMargin
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
size
:
_innerRadius
*
2
size
:
_innerRadius
*
2
activ
e
:
root
.
activ
e
vehicl
e
:
_activeVehicl
e
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
...
@@ -69,7 +55,7 @@ Rectangle {
...
@@ -69,7 +55,7 @@ Rectangle {
anchors.leftMargin
:
_spacing
anchors.leftMargin
:
_spacing
anchors.left
:
attitude
.
right
anchors.left
:
attitude
.
right
size
:
_innerRadius
*
2
size
:
_innerRadius
*
2
vehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
vehicle
:
_
activeVehicle
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
...
...
src/FlightMap/qmldir
View file @
dd4de906
...
@@ -14,8 +14,6 @@ QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
...
@@ -14,8 +14,6 @@ QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml
QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCCompassWidget 1.0 QGCCompassWidget.qml
QGCCompassWidget 1.0 QGCCompassWidget.qml
QGCInstrumentWidget 1.0 QGCInstrumentWidget.qml
QGCInstrumentWidgetAlternate 1.0 QGCInstrumentWidgetAlternate.qml
QGCPitchIndicator 1.0 QGCPitchIndicator.qml
QGCPitchIndicator 1.0 QGCPitchIndicator.qml
QGCSlider 1.0 QGCSlider.qml
QGCSlider 1.0 QGCSlider.qml
ValuesWidget 1.0 ValuesWidget.qml
ValuesWidget 1.0 ValuesWidget.qml
...
...
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