|
|
|
@ -40,8 +40,9 @@ Item {
@@ -40,8 +40,9 @@ Item {
|
|
|
|
|
|
|
|
|
|
signal reallyClose |
|
|
|
|
|
|
|
|
|
readonly property string _planViewSource: "MissionEditor.qml" |
|
|
|
|
readonly property string _setupViewSource: "SetupView.qml" |
|
|
|
|
readonly property string _planViewSource: "MissionEditor.qml" |
|
|
|
|
readonly property string _setupViewSource: "SetupView.qml" |
|
|
|
|
readonly property string _preferencesSource: "MainWindowLeftPanel.qml" |
|
|
|
|
|
|
|
|
|
QGCPalette { id: qgcPal; colorGroupEnabled: true } |
|
|
|
|
|
|
|
|
@ -68,6 +69,7 @@ Item {
@@ -68,6 +69,7 @@ Item {
|
|
|
|
|
currentPopUp.close() |
|
|
|
|
} |
|
|
|
|
ScreenTools.availableHeight = parent.height - toolBar.height |
|
|
|
|
preferencesPanel.visible = false |
|
|
|
|
flightView.visible = true |
|
|
|
|
setupViewLoader.visible = false |
|
|
|
|
planViewLoader.visible = false |
|
|
|
@ -82,6 +84,7 @@ Item {
@@ -82,6 +84,7 @@ Item {
|
|
|
|
|
planViewLoader.source = _planViewSource |
|
|
|
|
} |
|
|
|
|
ScreenTools.availableHeight = parent.height - toolBar.height |
|
|
|
|
preferencesPanel.visible = false |
|
|
|
|
flightView.visible = false |
|
|
|
|
setupViewLoader.visible = false |
|
|
|
|
planViewLoader.visible = true |
|
|
|
@ -97,12 +100,28 @@ Item {
@@ -97,12 +100,28 @@ Item {
|
|
|
|
|
if (setupViewLoader.source != _setupViewSource) { |
|
|
|
|
setupViewLoader.source = _setupViewSource |
|
|
|
|
} |
|
|
|
|
preferencesPanel.visible = false |
|
|
|
|
flightView.visible = false |
|
|
|
|
setupViewLoader.visible = true |
|
|
|
|
planViewLoader.visible = false |
|
|
|
|
toolBar.checkSetupButton() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function showPreferences() { |
|
|
|
|
if(currentPopUp) { |
|
|
|
|
currentPopUp.close() |
|
|
|
|
} |
|
|
|
|
//-- In preferences view, the full height is available. Set to 0 so it is ignored. |
|
|
|
|
ScreenTools.availableHeight = 0 |
|
|
|
|
if (preferencesPanel.source != _preferencesSource) { |
|
|
|
|
preferencesPanel.source = _preferencesSource |
|
|
|
|
} |
|
|
|
|
flightView.visible = false |
|
|
|
|
setupViewLoader.visible = false |
|
|
|
|
planViewLoader.visible = false |
|
|
|
|
preferencesPanel.visible = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The following are use for unit testing only |
|
|
|
|
|
|
|
|
|
function showSetupFirmware() { |
|
|
|
@ -182,11 +201,9 @@ Item {
@@ -182,11 +201,9 @@ Item {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-- Detect tablet position |
|
|
|
|
Connections { |
|
|
|
|
target: QGroundControl.qgcPositionManger |
|
|
|
|
|
|
|
|
|
onLastPositionUpdated: { |
|
|
|
|
if(valid) { |
|
|
|
|
if(lastPosition.latitude) { |
|
|
|
@ -213,22 +230,6 @@ Item {
@@ -213,22 +230,6 @@ Item {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function showLeftMenu() { |
|
|
|
|
if(!leftPanel.visible) { |
|
|
|
|
leftPanel.visible = true |
|
|
|
|
leftPanel.item.animateShowDialog.start() |
|
|
|
|
} else if(leftPanel.visible && !leftPanel.item.animateShowDialog.running) { |
|
|
|
|
//-- If open, toggle it closed |
|
|
|
|
hideLeftMenu() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function hideLeftMenu() { |
|
|
|
|
if(leftPanel.visible && !leftPanel.item.animateHideDialog.running) { |
|
|
|
|
leftPanel.item.animateHideDialog.start() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function formatMessage(message) { |
|
|
|
|
message = message.replace(new RegExp("<#E>", "g"), "color: #f95e5e; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;"); |
|
|
|
|
message = message.replace(new RegExp("<#I>", "g"), "color: #f9b55e; font: " + (ScreenTools.defaultFontPointSize.toFixed(0) - 1) + "pt monospace;"); |
|
|
|
@ -273,12 +274,17 @@ Item {
@@ -273,12 +274,17 @@ Item {
|
|
|
|
|
|
|
|
|
|
//-- Left Settings Menu |
|
|
|
|
Loader { |
|
|
|
|
id: leftPanel |
|
|
|
|
id: preferencesPanel |
|
|
|
|
anchors.fill: parent |
|
|
|
|
visible: false |
|
|
|
|
z: QGroundControl.zOrderTopMost + 100 |
|
|
|
|
active: visible |
|
|
|
|
source: "MainWindowLeftPanel.qml" |
|
|
|
|
onVisibleChanged: { |
|
|
|
|
console.log("Visible: " + visible) |
|
|
|
|
if(!visible) { |
|
|
|
|
source = "" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//-- Main UI |
|
|
|
@ -290,12 +296,13 @@ Item {
@@ -290,12 +296,13 @@ Item {
|
|
|
|
|
anchors.right: parent.right |
|
|
|
|
anchors.top: parent.top |
|
|
|
|
mainWindow: mainWindow |
|
|
|
|
opaqueBackground: leftPanel.visible |
|
|
|
|
opaqueBackground: preferencesPanel.visible |
|
|
|
|
isBackgroundDark: flightView.isBackgroundDark |
|
|
|
|
z: QGroundControl.zOrderTopMost |
|
|
|
|
onShowSetupView: mainWindow.showSetupView() |
|
|
|
|
onShowPlanView: mainWindow.showPlanView() |
|
|
|
|
onShowFlyView: mainWindow.showFlyView() |
|
|
|
|
onShowPreferences: mainWindow.showPreferences() |
|
|
|
|
Component.onCompleted: { |
|
|
|
|
ScreenTools.availableHeight = parent.height - toolBar.height |
|
|
|
|
} |
|
|
|
|