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
e1161ae0
Commit
e1161ae0
authored
Apr 11, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling Plan View
parent
355b8064
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
179 additions
and
183 deletions
+179
-183
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-1
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+11
-7
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+7
-10
MapFitFunctions.qml
src/FlightMap/Widgets/MapFitFunctions.qml
+1
-0
PlanToolBar.qml
src/PlanView/PlanToolBar.qml
+24
-60
PlanView.qml
src/PlanView/PlanView.qml
+47
-69
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+0
-1
QGCOptions.cc
src/api/QGCOptions.cc
+6
-0
QGCOptions.h
src/api/QGCOptions.h
+3
-0
MainQmlWindow.qml
src/ui/MainQmlWindow.qml
+72
-30
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+7
-5
No files found.
qgroundcontrol.qrc
View file @
e1161ae0
...
...
@@ -19,6 +19,7 @@
<qresource prefix="/qml">
<file alias="CorridorScanEditor.qml">src/PlanView/CorridorScanEditor.qml</file>
<file alias="QGCViewDialogContainer.qml">src/QmlControls/QGCViewDialogContainer.qml</file>
<file alias="PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file>
<file alias="QGroundControl/Controls/CameraCalc.qml">src/PlanView/CameraCalc.qml</file>
<file alias="QGroundControl/Controls/CorridorScanMapVisual.qml">src/PlanView/CorridorScanMapVisual.qml</file>
<file alias="QGroundControl/Controls/EditPositionDialog.qml">src/QmlControls/EditPositionDialog.qml</file>
...
...
@@ -88,7 +89,6 @@
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file>
<file alias="QGroundControl/Controls/PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckList.qml">src/QmlControls/PreFlightCheckList.qml</file>
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
e1161ae0
...
...
@@ -33,16 +33,19 @@ import QGroundControl.Vehicle 1.0
Item
{
PlanMasterController
{
id
:
planMasterController
Component.onCompleted
:
start
(
true
/* flyView */
)
id
:
_planController
Component.onCompleted
:
{
start
(
true
/* flyView */
)
mainWindow
.
planMasterControllerView
=
_planController
}
}
property
alias
guidedController
:
guidedActionsController
property
bool
activeVehicleJoystickEnabled
:
activeVehicle
?
activeVehicle
.
joystickEnabled
:
false
property
var
_missionController
:
planMaster
Controller
.
missionController
property
var
_geoFenceController
:
planMaster
Controller
.
geoFenceController
property
var
_rallyPointController
:
planMaster
Controller
.
rallyPointController
property
var
_missionController
:
_plan
Controller
.
missionController
property
var
_geoFenceController
:
_plan
Controller
.
geoFenceController
property
var
_rallyPointController
:
_plan
Controller
.
rallyPointController
property
bool
_mainIsMap
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_mainIsMapKey
,
true
)
:
true
property
bool
_isPipVisible
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_PIPVisibleKey
,
true
)
:
false
property
bool
_useChecklist
:
QGroundControl
.
settingsManager
.
appSettings
.
useChecklist
.
rawValue
...
...
@@ -195,14 +198,14 @@ Item {
Layout.fillWidth
:
true
text
:
qsTr
(
"
%1 Images Taken
"
).
arg
(
activeVehicle
.
cameraTriggerPoints
.
count
)
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
activeVehicle
.
cameraTriggerPoints
.
count
!=
0
visible
:
activeVehicle
.
cameraTriggerPoints
.
count
!=
=
0
}
QGCButton
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
Remove plan from vehicle
"
)
onClicked
:
{
planMaster
Controller
.
removeAllFromVehicle
()
_plan
Controller
.
removeAllFromVehicle
()
hideDialog
()
}
}
...
...
@@ -334,6 +337,7 @@ Item {
id
:
_flightMap
anchors.fill
:
parent
guidedActionsController
:
_guidedController
missionController
:
_planController
flightWidgets
:
flightDisplayViewWidgets
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
multiVehicleView
:
!
singleVehicleView
.
checked
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
e1161ae0
...
...
@@ -39,12 +39,12 @@ FlightMap {
property
var
flightWidgets
property
var
rightPanelWidth
property
var
multiVehicleView
///< true: multi-vehicle view, false: single vehicle view
property
var
missionController
property
rect
centerViewport
:
Qt
.
rect
(
0
,
0
,
width
,
height
)
property
var
_missionController
:
planMasterController
.
missionController
property
var
_geoFenceController
:
planMasterController
.
geoFenceController
property
var
_rallyPointController
:
planMasterController
.
rallyPointController
property
var
_geoFenceController
:
missionController
.
geoFenceController
property
var
_rallyPointController
:
missionController
.
rallyPointController
property
var
_activeVehicleCoordinate
:
activeVehicle
?
activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
property
real
_toolButtonTopMargin
:
parent
.
height
-
mainWindow
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
/
2
)
property
bool
_airspaceEnabled
:
QGroundControl
.
airmapSupported
?
(
QGroundControl
.
settingsManager
.
airMapSettings
.
enableAirMap
.
rawValue
&&
QGroundControl
.
airspaceManager
.
connected
):
false
...
...
@@ -145,7 +145,6 @@ FlightMap {
id
:
panRecenterTimer
interval
:
10000
running
:
false
onTriggered
:
{
_disableVehicleTracking
=
false
updateMapToVehiclePosition
()
...
...
@@ -163,10 +162,9 @@ FlightMap {
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
isSatelliteMap
}
Connections
{
target
:
_missionController
target
:
missionController
onNewItemsFromVehicle
:
{
var
visualItems
=
_
missionController
.
visualItems
var
visualItems
=
missionController
.
visualItems
if
(
visualItems
&&
visualItems
.
count
!==
1
)
{
mapFitFunctions
.
fitMapViewportToMissionItems
()
firstVehiclePositionReceived
=
true
...
...
@@ -182,13 +180,13 @@ FlightMap {
id
:
mapFitFunctions
// The name for this id cannot be changed without breaking references outside of this code. Beware!
map
:
_flightMap
usePlannedHomePosition
:
false
property
real
leftToolWidth
:
toolStrip
.
x
+
toolStrip
.
width
planMasterController
:
missionController
property
real
leftToolWidth
:
toolStrip
.
x
+
toolStrip
.
width
}
// Add trajectory points to the map
MapItemView
{
model
:
_mainIsMap
?
activeVehicle
?
activeVehicle
.
trajectoryPoints
:
0
:
0
delegate
:
MapPolyline
{
line.width
:
3
line.color
:
"
red
"
...
...
@@ -203,7 +201,6 @@ FlightMap {
// Add the vehicles to the map
MapItemView
{
model
:
QGroundControl
.
multiVehicleManager
.
vehicles
delegate
:
VehicleMapItem
{
vehicle
:
object
coordinate
:
object
.
coordinate
...
...
src/FlightMap/Widgets/MapFitFunctions.qml
View file @
e1161ae0
...
...
@@ -17,6 +17,7 @@ import QGroundControl.FlightMap 1.0
Item
{
property
var
map
property
bool
usePlannedHomePosition
///< true: planned home position used for calculations, false: vehicle home position use for calculations
property
var
planMasterController
property
var
_missionController
:
planMasterController
.
missionController
property
var
_geoFenceController
:
planMasterController
.
geoFenceController
...
...
src/PlanView/PlanToolBar.qml
View file @
e1161ae0
...
...
@@ -12,32 +12,23 @@ import QGroundControl.Palette 1.0
// Toolbar for Plan View
Rectangle
{
id
:
_root
height
:
ScreenTools
.
toolbarHeight
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
z
:
toolBar
.
z
+
1
color
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
Qt
.
rgba
(
1
,
1
,
1
,
0.8
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
visible
:
false
anchors.bottomMargin
:
1
signal
showFlyView
property
var
_planMasterController
:
mainWindow
.
planMasterController
property
var
_currentMissionItem
:
mainWindow
.
currentMissionItem
///< Mission item to display status for
property
var
planMasterController
property
var
currentMissionItem
///< Mission item to display status for
property
var
missionItems
:
_controllerValid
?
_planMasterController
.
missionController
.
visualItems
:
undefined
property
real
missionDistance
:
_controllerValid
?
_planMasterController
.
missionController
.
missionDistance
:
NaN
property
real
missionTime
:
_controllerValid
?
_planMasterController
.
missionController
.
missionTime
:
NaN
property
real
missionMaxTelemetry
:
_controllerValid
?
_planMasterController
.
missionController
.
missionMaxTelemetry
:
NaN
property
bool
missionDirty
:
_controllerValid
?
_planMasterController
.
missionController
.
dirty
:
false
property
var
missionItems
:
_controllerValid
?
planMasterController
.
missionController
.
visualItems
:
undefined
property
real
missionDistance
:
_controllerValid
?
planMasterController
.
missionController
.
missionDistance
:
NaN
property
real
missionTime
:
_controllerValid
?
planMasterController
.
missionController
.
missionTime
:
NaN
property
real
missionMaxTelemetry
:
_controllerValid
?
planMasterController
.
missionController
.
missionMaxTelemetry
:
NaN
property
bool
missionDirty
:
_controllerValid
?
planMasterController
.
missionController
.
dirty
:
false
property
bool
_controllerValid
:
_planMasterController
!==
undefined
property
bool
_controllerOffline
:
_controllerValid
?
_planMasterController
.
offline
:
true
property
var
_controllerDirty
:
_controllerValid
?
_planMasterController
.
dirty
:
false
property
var
_controllerSyncInProgress
:
_controllerValid
?
_planMasterController
.
syncInProgress
:
false
property
bool
_controllerValid
:
planMasterController
!==
undefined
property
bool
_controllerOffline
:
_controllerValid
?
planMasterController
.
offline
:
true
property
var
_controllerDirty
:
_controllerValid
?
planMasterController
.
dirty
:
false
property
var
_controllerSyncInProgress
:
_controllerValid
?
planMasterController
.
syncInProgress
:
false
property
bool
_statusValid
:
currentMissionItem
!==
undefined
property
bool
_statusValid
:
_currentMissionItem
!==
undefined
property
bool
_missionValid
:
missionItems
!==
undefined
property
real
_dataFontSize
:
ScreenTools
.
defaultFontPointSize
...
...
@@ -46,20 +37,20 @@ Rectangle {
property
real
_smallValueWidth
:
ScreenTools
.
defaultFontPixelWidth
*
3
property
real
_labelToValueSpacing
:
ScreenTools
.
defaultFontPixelWidth
property
real
_rowSpacing
:
ScreenTools
.
isMobile
?
1
:
0
property
real
_distance
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
distance
:
NaN
property
real
_altDifference
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
altDifference
:
NaN
property
real
_gradient
:
_statusValid
&&
currentMissionItem
&&
currentMissionItem
.
distance
>
0
?
Math
.
atan
(
currentMissionItem
.
altDifference
/
currentMissionItem
.
distance
)
:
NaN
property
real
_distance
:
_statusValid
&&
_currentMissionItem
?
_
currentMissionItem
.
distance
:
NaN
property
real
_altDifference
:
_statusValid
&&
_currentMissionItem
?
_
currentMissionItem
.
altDifference
:
NaN
property
real
_gradient
:
_statusValid
&&
_currentMissionItem
&&
_currentMissionItem
.
distance
>
0
?
Math
.
atan
(
_currentMissionItem
.
altDifference
/
_
currentMissionItem
.
distance
)
:
NaN
property
real
_gradientPercent
:
isNaN
(
_gradient
)
?
NaN
:
_gradient
*
100
property
real
_azimuth
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
azimuth
:
NaN
property
real
_heading
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
missionVehicleYaw
:
NaN
property
real
_azimuth
:
_statusValid
&&
_currentMissionItem
?
_
currentMissionItem
.
azimuth
:
NaN
property
real
_heading
:
_statusValid
&&
_currentMissionItem
?
_
currentMissionItem
.
missionVehicleYaw
:
NaN
property
real
_missionDistance
:
_missionValid
?
missionDistance
:
NaN
property
real
_missionMaxTelemetry
:
_missionValid
?
missionMaxTelemetry
:
NaN
property
real
_missionTime
:
_missionValid
?
missionTime
:
NaN
property
int
_batteryChangePoint
:
_controllerValid
?
planMasterController
.
missionController
.
batteryChangePoint
:
-
1
property
int
_batteriesRequired
:
_controllerValid
?
planMasterController
.
missionController
.
batteriesRequired
:
-
1
property
int
_batteryChangePoint
:
_controllerValid
?
_
planMasterController
.
missionController
.
batteryChangePoint
:
-
1
property
int
_batteriesRequired
:
_controllerValid
?
_
planMasterController
.
missionController
.
batteriesRequired
:
-
1
property
bool
_batteryInfoAvailable
:
_batteryChangePoint
>=
0
||
_batteriesRequired
>=
0
property
real
_controllerProgressPct
:
_controllerValid
?
planMasterController
.
missionController
.
progressPct
:
0
property
bool
_syncInProgress
:
_controllerValid
?
planMasterController
.
missionController
.
syncInProgress
:
false
property
real
_controllerProgressPct
:
_controllerValid
?
_
planMasterController
.
missionController
.
progressPct
:
0
property
bool
_syncInProgress
:
_controllerValid
?
_
planMasterController
.
missionController
.
syncInProgress
:
false
property
string
_distanceText
:
isNaN
(
_distance
)
?
"
-.-
"
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_distance
).
toFixed
(
1
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
property
string
_altDifferenceText
:
isNaN
(
_altDifference
)
?
"
-.-
"
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_altDifference
).
toFixed
(
1
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
...
...
@@ -73,8 +64,6 @@ Rectangle {
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
QGCPalette
{
id
:
qgcPal
}
function
getMissionTime
()
{
if
(
isNaN
(
_missionTime
))
{
return
"
00:00:00
"
...
...
@@ -88,28 +77,6 @@ Rectangle {
anchors.fill
:
parent
}
//-- The reason for this Row to be here is so the Logo (Home) button is in the same
// location as the one in the main toolbar.
Row
{
id
:
logoRow
anchors.bottomMargin
:
1
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
QGCToolBarButton
{
id
:
settingsButton
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
"
/qmlimages/PaperPlane.svg
"
logo
:
true
checked
:
false
onClicked
:
{
checked
=
false
showFlyView
()
}
}
}
// Progress bar
on_ControllerProgressPctChanged
:
{
...
...
@@ -134,10 +101,7 @@ Rectangle {
QGCLabel
{
id
:
uploadCompleteText
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.left
:
logoRow
.
right
anchors.right
:
uploadButton
.
left
anchors.fill
:
parent
font.pointSize
:
ScreenTools
.
largeFontPointSize
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
...
...
@@ -151,7 +115,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
anchors.leftMargin
:
_margins
anchors.rightMargin
:
_margins
anchors.left
:
logoRow
.
righ
t
anchors.left
:
parent
.
lef
t
anchors.right
:
uploadButton
.
visible
?
uploadButton
.
left
:
parent
.
right
columnSpacing
:
0
columns
:
3
...
...
@@ -288,7 +252,7 @@ Rectangle {
enabled
:
!
_controllerSyncInProgress
visible
:
!
_controllerOffline
&&
!
_controllerSyncInProgress
&&
!
uploadCompleteText
.
visible
primary
:
_controllerDirty
onClicked
:
planMasterController
.
upload
()
onClicked
:
_
planMasterController
.
upload
()
PropertyAnimation
on
opacity
{
easing.type
:
Easing
.
OutQuart
...
...
src/PlanView/PlanView.qml
View file @
e1161ae0
This diff is collapsed.
Click to expand it.
src/QmlControls/QGroundControl.Controls.qmldir
View file @
e1161ae0
...
...
@@ -33,7 +33,6 @@ PageView 1.0 PageView.qml
ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PIDTuning 1.0 PIDTuning.qml
PlanToolBar 1.0 PlanToolBar.qml
PreFlightCheckButton 1.0 PreFlightCheckButton.qml
PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml
PreFlightCheckList 1.0 PreFlightCheckList.qml
...
...
src/api/QGCOptions.cc
View file @
e1161ae0
...
...
@@ -36,6 +36,12 @@ QGCOptions::mainToolbarIndicatorsUrl() const
return
QUrl
(
QStringLiteral
(
"qrc:/toolbar/MainToolBarIndicators.qml"
));
}
QUrl
QGCOptions
::
planToolbarIndicatorsUrl
()
const
{
return
QUrl
(
QStringLiteral
(
"PlanToolBar.qml"
));
}
CustomInstrumentWidget
::
CustomInstrumentWidget
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
src/api/QGCOptions.h
View file @
e1161ae0
...
...
@@ -30,6 +30,7 @@ public:
Q_PROPERTY
(
CustomInstrumentWidget
*
instrumentWidget
READ
instrumentWidget
CONSTANT
)
Q_PROPERTY
(
QUrl
flyViewOverlay
READ
flyViewOverlay
CONSTANT
)
Q_PROPERTY
(
QUrl
mainToolbarIndicatorsUrl
READ
mainToolbarIndicatorsUrl
CONSTANT
)
Q_PROPERTY
(
QUrl
planToolbarIndicatorsUrl
READ
planToolbarIndicatorsUrl
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
)
...
...
@@ -80,6 +81,8 @@ public:
virtual
QUrl
flyViewOverlay
()
const
{
return
QUrl
();
}
/// Allows replacing the toolbar container
virtual
QUrl
mainToolbarIndicatorsUrl
()
const
;
/// Allows replacing the Plan View toolbar container
virtual
QUrl
planToolbarIndicatorsUrl
()
const
;
/// By returning false you can hide the following sensor calibration pages
virtual
bool
showSensorCalibrationCompass
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationGyro
()
const
{
return
true
;
}
...
...
src/ui/MainQmlWindow.qml
View file @
e1161ae0
...
...
@@ -27,27 +27,29 @@ ApplicationWindow {
height
:
768
visible
:
true
Component.onCompleted
:
{
toolbarIndicators
.
source
=
_mainToolbarIndicators
}
readonly
property
real
_topBottomMargins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
string
_mainToolbarIndicators
:
QGroundControl
.
corePlugin
.
options
.
mainToolbarIndicatorsUrl
readonly
property
string
_settingsViewSource
:
"
AppSettings.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
readonly
property
string
_planViewSource
:
"
PlanView.qml
"
readonly
property
string
_analyzeViewSource
:
!
ScreenTools
.
isMobile
?
"
AnalyzeView.qml
"
:
"
MavlinkConsolePage.qml
"
readonly
property
real
_topBottomMargins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
string
_mainToolbarIndicators
:
QGroundControl
.
corePlugin
.
options
.
mainToolbarIndicatorsUrl
readonly
property
string
_planToolbarIndicators
:
QGroundControl
.
corePlugin
.
options
.
planToolbarIndicatorsUrl
readonly
property
string
_settingsViewSource
:
"
AppSettings.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
readonly
property
string
_planViewSource
:
"
PlanView.qml
"
readonly
property
string
_analyzeViewSource
:
!
ScreenTools
.
isMobile
?
"
AnalyzeView.qml
"
:
"
MavlinkConsolePage.qml
"
//-------------------------------------------------------------------------
//-- Global Scope Variables
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
communicationLost
:
activeVehicle
?
activeVehicle
.
connectionLost
:
false
property
string
formatedMessage
:
activeVehicle
?
activeVehicle
.
formatedMessage
:
""
property
real
availableHeight
:
mainWindow
.
height
-
mainWindow
.
header
.
height
readonly
property
string
navButtonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
24
readonly
property
real
defaultTextHeight
:
ScreenTools
.
defaultFontPixelHeight
readonly
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixelWidth
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
communicationLost
:
activeVehicle
?
activeVehicle
.
connectionLost
:
false
property
string
formatedMessage
:
activeVehicle
?
activeVehicle
.
formatedMessage
:
""
property
real
availableHeight
:
mainWindow
.
height
-
mainWindow
.
header
.
height
property
var
currentPlanMissionItem
:
null
property
var
planMasterControllerPlan
:
null
property
var
planMasterControllerView
:
null
readonly
property
string
navButtonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
24
readonly
property
real
defaultTextHeight
:
ScreenTools
.
defaultFontPixelHeight
readonly
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixelWidth
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
...
...
@@ -74,8 +76,14 @@ ApplicationWindow {
enableToolbar
()
drawer
.
close
()
if
(
isPlanView
)
{
rootBackground
.
visible
=
false
planViewLoader
.
visible
=
true
if
(
toolbarIndicators
.
source
!==
_planToolbarIndicators
)
{
toolbarIndicators
.
source
=
_planToolbarIndicators
}
}
else
{
rootBackground
.
visible
=
true
planViewLoader
.
visible
=
false
if
(
toolbarIndicators
.
source
!==
_mainToolbarIndicators
)
{
toolbarIndicators
.
source
=
_mainToolbarIndicators
}
...
...
@@ -190,13 +198,6 @@ ApplicationWindow {
property
bool
_forceClose
:
false
onClosing
:
{
if
(
!
_forceClose
)
{
activeConnectionsCloseDialog
.
check
()
close
.
accepted
=
false
}
}
function
reallyClose
()
{
_forceClose
=
true
mainWindow
.
close
()
...
...
@@ -242,16 +243,59 @@ ApplicationWindow {
}
//-------------------------------------------------------------------------
//-- Main, full window background
//-- Check for unsaved missions
onClosing
:
{
if
(
!
_forceClose
)
{
unsavedMissionCloseDialog
.
check
()
close
.
accepted
=
false
}
}
MessageDialog
{
id
:
unsavedMissionCloseDialog
title
:
qsTr
(
"
%1 close
"
).
arg
(
QGroundControl
.
appName
)
text
:
qsTr
(
"
You have a mission edit in progress which has not been saved/sent. If you close you will lose changes. Are you sure you want to close?
"
)
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
activeConnectionsCloseDialog
.
check
()
function
check
()
{
if
(
planViewLoader
.
item
&&
planViewLoader
.
item
.
dirty
)
{
unsavedMissionCloseDialog
.
open
()
}
else
{
activeConnectionsCloseDialog
.
check
()
}
}
}
//-------------------------------------------------------------------------
//-- Main, full window background (Fly View)
background
:
Item
{
id
:
rootBackground
anchors.fill
:
parent
FlightDisplayView
{
id
:
flightView
anchors.fill
:
parent
//-----------------------------------------------------------------
//-- Loader helper for any child, no matter how deep can display an
// element on top of the video window.
Loader
{
id
:
rootVideoLoader
anchors.centerIn
:
parent
}
}
}
//-------------------------------------------------------------------------
//-- Plan View
Loader
{
id
:
planViewLoader
anchors.fill
:
parent
visible
:
false
source
:
"
PlanView.qml
"
}
//-------------------------------------------------------------------------
//-- Global Indicator Bar
header
:
ToolBar
{
...
...
@@ -262,6 +306,7 @@ ApplicationWindow {
}
RowLayout
{
anchors.fill
:
parent
spacing
:
0
Rectangle
{
height
:
parent
.
height
width
:
height
...
...
@@ -286,13 +331,10 @@ ApplicationWindow {
}
}
}
Item
{
height
:
1
width
:
ScreenTools
.
defaultFontPixelWidth
*
2
}
Loader
{
id
:
toolbarIndicators
height
:
parent
.
height
source
:
_mainToolbarIndicators
Layout.fillWidth
:
true
}
}
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
e1161ae0
...
...
@@ -74,11 +74,13 @@ Item {
//-------------------------------------------------------------------------
//-- Toolbar Indicators
Row
{
id
:
indicatorRow
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
visible
:
activeVehicle
&&
!
communicationLost
id
:
indicatorRow
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
2
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
visible
:
activeVehicle
&&
!
communicationLost
//---------------------------------------------------------------------
//-- Vehicle Selector
...
...
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