|
|
@ -34,29 +34,25 @@ import QGroundControl.Controls 1.0 |
|
|
|
import QGroundControl.ScreenTools 1.0 |
|
|
|
import QGroundControl.ScreenTools 1.0 |
|
|
|
import QGroundControl.MultiVehicleManager 1.0 |
|
|
|
import QGroundControl.MultiVehicleManager 1.0 |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
Item { |
|
|
|
id: topLevel |
|
|
|
|
|
|
|
color: palette.window |
|
|
|
|
|
|
|
z: zOrder // zOrder comes from the Loader in MainWindow.qml |
|
|
|
z: zOrder // zOrder comes from the Loader in MainWindow.qml |
|
|
|
|
|
|
|
|
|
|
|
QGCPalette { id: palette; colorGroupEnabled: true } |
|
|
|
QGCPalette { id: qgcPal; colorGroupEnabled: true } |
|
|
|
|
|
|
|
|
|
|
|
ExclusiveGroup { id: setupButtonGroup } |
|
|
|
ExclusiveGroup { id: setupButtonGroup } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { id: _textMeasure; text: "X"; visible: false } |
|
|
|
readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight |
|
|
|
|
|
|
|
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
readonly property real _margin: _defaultTextHeight / 2 |
|
|
|
|
|
|
|
readonly property real _buttonWidth: _defaultTextWidth * 15 |
|
|
|
|
|
|
|
readonly property string _armedVehicleText: "This operation cannot be performed while vehicle is armed." |
|
|
|
|
|
|
|
|
|
|
|
readonly property real defaultTextHeight: _textMeasure.contentHeight |
|
|
|
property string _messagePanelText: "missing message panel text" |
|
|
|
readonly property real defaultTextWidth: _textMeasure.contentWidth |
|
|
|
property bool _fullParameterVehicleAvailable: multiVehicleManager.parameterReadyVehicleAvailable && !multiVehicleManager.activeVehicle.missingParameters |
|
|
|
readonly property real buttonWidth: defaultTextWidth * 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property string messagePanelText: "missing message panel text" |
|
|
|
|
|
|
|
readonly property string armedVehicleText: "This operation cannot be performed while vehicle is armed." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property bool fullParameterVehicleAvailable: multiVehicleManager.parameterReadyVehicleAvailable && !multiVehicleManager.activeVehicle.missingParameters |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showSummaryPanel() |
|
|
|
function showSummaryPanel() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fullParameterVehicleAvailable) { |
|
|
|
if (_fullParameterVehicleAvailable) { |
|
|
|
panelLoader.source = "VehicleSummary.qml"; |
|
|
|
panelLoader.source = "VehicleSummary.qml"; |
|
|
|
} else if (multiVehicleManager.parameterReadyVehicleAvailable) { |
|
|
|
} else if (multiVehicleManager.parameterReadyVehicleAvailable) { |
|
|
|
panelLoader.sourceComponent = missingParametersVehicleSummaryComponent |
|
|
|
panelLoader.sourceComponent = missingParametersVehicleSummaryComponent |
|
|
@ -69,7 +65,7 @@ Rectangle { |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!ScreenTools.isMobile) { |
|
|
|
if (!ScreenTools.isMobile) { |
|
|
|
if (multiVehicleManager.activeVehicleAvailable && multiVehicleManager.activeVehicle.armed) { |
|
|
|
if (multiVehicleManager.activeVehicleAvailable && multiVehicleManager.activeVehicle.armed) { |
|
|
|
messagePanelText = armedVehicleText |
|
|
|
_messagePanelText = _armedVehicleText |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
panelLoader.source = "FirmwareUpgrade.qml"; |
|
|
|
panelLoader.source = "FirmwareUpgrade.qml"; |
|
|
@ -80,7 +76,7 @@ Rectangle { |
|
|
|
function showJoystickPanel() |
|
|
|
function showJoystickPanel() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (multiVehicleManager.activeVehicleAvailable && multiVehicleManager.activeVehicle.armed) { |
|
|
|
if (multiVehicleManager.activeVehicleAvailable && multiVehicleManager.activeVehicle.armed) { |
|
|
|
messagePanelText = armedVehicleText |
|
|
|
_messagePanelText = _armedVehicleText |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
panelLoader.source = "JoystickConfig.qml"; |
|
|
|
panelLoader.source = "JoystickConfig.qml"; |
|
|
@ -95,11 +91,11 @@ Rectangle { |
|
|
|
function showVehicleComponentPanel(vehicleComponent) |
|
|
|
function showVehicleComponentPanel(vehicleComponent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (multiVehicleManager.activeVehicle.armed) { |
|
|
|
if (multiVehicleManager.activeVehicle.armed) { |
|
|
|
messagePanelText = armedVehicleText |
|
|
|
_messagePanelText = _armedVehicleText |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (vehicleComponent.prerequisiteSetup != "") { |
|
|
|
if (vehicleComponent.prerequisiteSetup != "") { |
|
|
|
messagePanelText = vehicleComponent.prerequisiteSetup + " setup must be completed prior to " + vehicleComponent.name + " setup." |
|
|
|
_messagePanelText = vehicleComponent.prerequisiteSetup + " setup must be completed prior to " + vehicleComponent.name + " setup." |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
panelLoader.sourceComponent = messagePanelComponent |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
panelLoader.source = vehicleComponent.setupSource |
|
|
|
panelLoader.source = vehicleComponent.setupSource |
|
|
@ -122,10 +118,10 @@ Rectangle { |
|
|
|
id: disconnectedVehicleSummaryComponent |
|
|
|
id: disconnectedVehicleSummaryComponent |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
Rectangle { |
|
|
|
color: palette.windowShade |
|
|
|
color: qgcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
anchors.margins: defaultTextWidth * 2 |
|
|
|
anchors.margins: _defaultTextWidth * 2 |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
@ -146,10 +142,10 @@ Rectangle { |
|
|
|
id: missingParametersVehicleSummaryComponent |
|
|
|
id: missingParametersVehicleSummaryComponent |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
Rectangle { |
|
|
|
color: palette.windowShade |
|
|
|
color: qgcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
anchors.margins: defaultTextWidth * 2 |
|
|
|
anchors.margins: _defaultTextWidth * 2 |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
@ -168,32 +164,58 @@ Rectangle { |
|
|
|
|
|
|
|
|
|
|
|
Item { |
|
|
|
Item { |
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
anchors.margins: defaultTextWidth * 2 |
|
|
|
anchors.margins: _defaultTextWidth * 2 |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
|
wrapMode: Text.WordWrap |
|
|
|
wrapMode: Text.WordWrap |
|
|
|
font.pixelSize: ScreenTools.mediumFontPixelSize |
|
|
|
font.pixelSize: ScreenTools.mediumFontPixelSize |
|
|
|
text: messagePanelText |
|
|
|
text: _messagePanelText |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
|
|
|
//anchors.margins: _defaultTextHeight * 2 |
|
|
|
|
|
|
|
anchors.fill: parent |
|
|
|
|
|
|
|
color: qgcPal.window |
|
|
|
|
|
|
|
opacity: 0.8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
|
|
|
|
id: title |
|
|
|
|
|
|
|
anchors.topMargin: _margin |
|
|
|
|
|
|
|
anchors.top: parent.top |
|
|
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
|
|
anchors.right: parent.right |
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
|
|
|
|
|
font.pixelSize: ScreenTools.largeFontPixelSize |
|
|
|
|
|
|
|
text: "Vehicle Setup" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
|
|
|
anchors.topMargin: _margin |
|
|
|
|
|
|
|
anchors.top: title.bottom |
|
|
|
|
|
|
|
anchors.bottom: parent.bottom |
|
|
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
|
|
anchors.right: parent.right |
|
|
|
|
|
|
|
color: qgcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
Flickable { |
|
|
|
Flickable { |
|
|
|
id: buttonFlickable |
|
|
|
id: buttonFlickable |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
height: parent.height |
|
|
|
height: parent.height |
|
|
|
contentWidth: buttonWidth |
|
|
|
contentWidth: _buttonWidth |
|
|
|
contentHeight: buttonColumn.height |
|
|
|
contentHeight: buttonColumn.height |
|
|
|
flickableDirection: Flickable.VerticalFlick |
|
|
|
flickableDirection: Flickable.VerticalFlick |
|
|
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
Column { |
|
|
|
id: buttonColumn |
|
|
|
id: buttonColumn |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
|
|
|
|
spacing: _defaultTextHeight / 2 |
|
|
|
|
|
|
|
|
|
|
|
SubMenuButton { |
|
|
|
SubMenuButton { |
|
|
|
id: summaryButton |
|
|
|
id: summaryButton |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
imageResource: "/qmlimages/VehicleSummaryIcon.png" |
|
|
|
imageResource: "/qmlimages/VehicleSummaryIcon.png" |
|
|
|
setupIndicator: false |
|
|
|
setupIndicator: false |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
@ -204,7 +226,7 @@ Rectangle { |
|
|
|
|
|
|
|
|
|
|
|
SubMenuButton { |
|
|
|
SubMenuButton { |
|
|
|
id: firmwareButton |
|
|
|
id: firmwareButton |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
imageResource: "/qmlimages/FirmwareUpgradeIcon.png" |
|
|
|
imageResource: "/qmlimages/FirmwareUpgradeIcon.png" |
|
|
|
setupIndicator: false |
|
|
|
setupIndicator: false |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
@ -216,21 +238,21 @@ Rectangle { |
|
|
|
|
|
|
|
|
|
|
|
SubMenuButton { |
|
|
|
SubMenuButton { |
|
|
|
id: joystickButton |
|
|
|
id: joystickButton |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
setupIndicator: true |
|
|
|
setupIndicator: true |
|
|
|
setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated : false |
|
|
|
setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated : false |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
|
visible: fullParameterVehicleAvailable && joystickManager.joysticks.length != 0 |
|
|
|
visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length != 0 |
|
|
|
text: "JOYSTICK" |
|
|
|
text: "JOYSTICK" |
|
|
|
|
|
|
|
|
|
|
|
onClicked: showJoystickPanel() |
|
|
|
onClicked: showJoystickPanel() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Repeater { |
|
|
|
Repeater { |
|
|
|
model: fullParameterVehicleAvailable ? multiVehicleManager.activeVehicle.autopilot.vehicleComponents : 0 |
|
|
|
model: _fullParameterVehicleAvailable ? multiVehicleManager.activeVehicle.autopilot.vehicleComponents : 0 |
|
|
|
|
|
|
|
|
|
|
|
SubMenuButton { |
|
|
|
SubMenuButton { |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
imageResource: modelData.iconResource |
|
|
|
imageResource: modelData.iconResource |
|
|
|
setupIndicator: modelData.requiresSetup |
|
|
|
setupIndicator: modelData.requiresSetup |
|
|
|
setupComplete: modelData.setupComplete |
|
|
|
setupComplete: modelData.setupComplete |
|
|
@ -242,7 +264,7 @@ Rectangle { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SubMenuButton { |
|
|
|
SubMenuButton { |
|
|
|
width: buttonWidth |
|
|
|
width: _buttonWidth |
|
|
|
setupIndicator: false |
|
|
|
setupIndicator: false |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
|
exclusiveGroup: setupButtonGroup |
|
|
|
visible: multiVehicleManager.parameterReadyVehicleAvailable |
|
|
|
visible: multiVehicleManager.parameterReadyVehicleAvailable |
|
|
@ -255,11 +277,13 @@ Rectangle { |
|
|
|
|
|
|
|
|
|
|
|
Loader { |
|
|
|
Loader { |
|
|
|
id: panelLoader |
|
|
|
id: panelLoader |
|
|
|
anchors.leftMargin: defaultTextWidth |
|
|
|
anchors.leftMargin: _defaultTextWidth |
|
|
|
anchors.rightMargin: defaultTextWidth |
|
|
|
anchors.rightMargin: _defaultTextWidth |
|
|
|
anchors.left: buttonFlickable.right |
|
|
|
anchors.left: buttonFlickable.right |
|
|
|
anchors.right: parent.right |
|
|
|
anchors.right: parent.right |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.bottom: parent.bottom |
|
|
|
anchors.bottom: parent.bottom |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|