@ -34,29 +34,25 @@ import QGroundControl.Controls 1.0
@@ -34,29 +34,25 @@ import QGroundControl.Controls 1.0
import QGroundControl . ScreenTools 1.0
import QGroundControl . MultiVehicleManager 1.0
Rectangle {
id: topLevel
color: palette . window
z: zOrder / / z O r d e r c o m e s f r o m t h e L o a d e r i n M a i n W i n d o w . q m l
Item {
z: zOrder / / z O r d e r c o m e s f r o m t h e L o a d e r i n M a i n W i n d o w . q m l
QGCPalette { id: palette ; colorGroupEnabled: true }
QGCPalette { id: qgcPal ; colorGroupEnabled: true }
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
readonly property real defaultTextWidth: _textMeasure . contentWidth
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
property string _messagePanelText : "missing message panel text"
property bool _fullParameterVehicleAvailable : multiVehicleManager . parameterReadyVehicleAvailable && ! multiVehicleManager . activeVehicle . missingParameters
function showSummaryPanel ( )
{
if ( fullParameterVehicleAvailable ) {
if ( _fullParameterVehicleAvailable ) {
panelLoader . source = "VehicleSummary.qml" ;
} else if ( multiVehicleManager . parameterReadyVehicleAvailable ) {
panelLoader . sourceComponent = missingParametersVehicleSummaryComponent
@ -69,7 +65,7 @@ Rectangle {
@@ -69,7 +65,7 @@ Rectangle {
{
if ( ! ScreenTools . isMobile ) {
if ( multiVehicleManager . activeVehicleAvailable && multiVehicleManager . activeVehicle . armed ) {
messagePanelText = armedVehicleText
_ messagePanelText = _ armedVehicleText
panelLoader . sourceComponent = messagePanelComponent
} else {
panelLoader . source = "FirmwareUpgrade.qml" ;
@ -80,7 +76,7 @@ Rectangle {
@@ -80,7 +76,7 @@ Rectangle {
function showJoystickPanel ( )
{
if ( multiVehicleManager . activeVehicleAvailable && multiVehicleManager . activeVehicle . armed ) {
messagePanelText = armedVehicleText
_ messagePanelText = _ armedVehicleText
panelLoader . sourceComponent = messagePanelComponent
} else {
panelLoader . source = "JoystickConfig.qml" ;
@ -95,11 +91,11 @@ Rectangle {
@@ -95,11 +91,11 @@ Rectangle {
function showVehicleComponentPanel ( vehicleComponent )
{
if ( multiVehicleManager . activeVehicle . armed ) {
messagePanelText = armedVehicleText
_ messagePanelText = _ armedVehicleText
panelLoader . sourceComponent = messagePanelComponent
} else {
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
} else {
panelLoader . source = vehicleComponent . setupSource
@ -122,20 +118,20 @@ Rectangle {
@@ -122,20 +118,20 @@ Rectangle {
id: disconnectedVehicleSummaryComponent
Rectangle {
color: palette . windowShade
color: qgcPal . windowShade
QGCLabel {
anchors.margins: defaultTextWidth * 2
anchors.margins: _ defaultTextWidth * 2
anchors.fill: parent
verticalAlignment: Text . AlignVCenter
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
font.pixelSize: ScreenTools . mediumFontPixelSize
text: "Welcome to QGroundControl. " +
"QGroundControl supports any <font color=\"orange\"><a href=\"http://www.qgroundcontrol.org/mavlink/start\">mavlink</a></font> enabled vehicle. " +
"If you are using the <font color=\"orange\"><a href=\"https://pixhawk.org/choice\">PX4 Flight Stack</a></font>, you also get full support for setting up and calibrating your vehicle. " +
"Otherwise you will only get support for flying a vehicle which has been setup and calibrated using other means. " +
"Use the Connect button above to connect to your vehicle."
"QGroundControl supports any <font color=\"orange\"><a href=\"http://www.qgroundcontrol.org/mavlink/start\">mavlink</a></font> enabled vehicle. " +
"If you are using the <font color=\"orange\"><a href=\"https://pixhawk.org/choice\">PX4 Flight Stack</a></font>, you also get full support for setting up and calibrating your vehicle. " +
"Otherwise you will only get support for flying a vehicle which has been setup and calibrated using other means. " +
"Use the Connect button above to connect to your vehicle."
onLinkActivated: Qt . openUrlExternally ( link )
}
@ -146,17 +142,17 @@ Rectangle {
@@ -146,17 +142,17 @@ Rectangle {
id: missingParametersVehicleSummaryComponent
Rectangle {
color: palette . windowShade
color: qgcPal . windowShade
QGCLabel {
anchors.margins: defaultTextWidth * 2
anchors.margins: _ defaultTextWidth * 2
anchors.fill: parent
verticalAlignment: Text . AlignVCenter
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
font.pixelSize: ScreenTools . mediumFontPixelSize
text: "You are currently connected to a vehicle, but that vehicle did not return back the full parameter list. " +
"Because of this the full set of vehicle setup options are not available."
"Because of this the full set of vehicle setup options are not available."
onLinkActivated: Qt . openUrlExternally ( link )
}
@ -168,98 +164,126 @@ Rectangle {
@@ -168,98 +164,126 @@ Rectangle {
Item {
QGCLabel {
anchors.margins: defaultTextWidth * 2
anchors.margins: _ defaultTextWidth * 2
anchors.fill: parent
verticalAlignment: Text . AlignVCenter
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
font.pixelSize: ScreenTools . mediumFontPixelSize
text: messagePanelText
text: _ messagePanelText
}
}
}
Flickable {
id: buttonFlickable
width: buttonWidth
height: parent . height
contentWidth: buttonWidth
contentHeight: buttonColumn . height
flickableDirection: Flickable . VerticalFlick
Column {
id: buttonColumn
width: buttonWidth
SubMenuButton {
id: summaryButton
width: buttonWidth
imageResource: "/qmlimages/VehicleSummaryIcon.png"
setupIndicator: false
exclusiveGroup: setupButtonGroup
text: "SUMMARY"
onClicked: showSummaryPanel ( )
}
SubMenuButton {
id: firmwareButton
width: buttonWidth
imageResource: "/qmlimages/FirmwareUpgradeIcon.png"
setupIndicator: false
exclusiveGroup: setupButtonGroup
visible: ! ScreenTools . isMobile
text: "FIRMWARE"
onClicked: showFirmwarePanel ( )
}
SubMenuButton {
id: joystickButton
width: buttonWidth
setupIndicator: true
setupComplete: joystickManager . activeJoystick ? joystickManager.activeJoystick.calibrated : false
exclusiveGroup: setupButtonGroup
visible: fullParameterVehicleAvailable && joystickManager . joysticks . length != 0
text: "JOYSTICK"
onClicked: showJoystickPanel ( )
}
Repeater {
model: fullParameterVehicleAvailable ? multiVehicleManager.activeVehicle.autopilot.vehicleComponents : 0
SubMenuButton {
width: buttonWidth
imageResource: modelData . iconResource
setupIndicator: modelData . requiresSetup
setupComplete: modelData . setupComplete
exclusiveGroup: setupButtonGroup
text: modelData . name . toUpperCase ( )
onClicked: showVehicleComponentPanel ( modelData )
}
}
SubMenuButton {
width: buttonWidth
setupIndicator: false
exclusiveGroup: setupButtonGroup
visible: multiVehicleManager . parameterReadyVehicleAvailable
text: "PARAMETERS"
Rectangle {
/ / a n c h o r s . m a r g i n s : _ d e f a u l t T e x t H e i g h t * 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"
}
onClicked: showParametersPanel ( )
Rectangle {
anchors.topMargin: _margin
anchors.top: title . bottom
anchors.bottom: parent . bottom
anchors.left: parent . left
anchors.right: parent . right
color: qgcPal . windowShade
Flickable {
id: buttonFlickable
width: _buttonWidth
height: parent . height
contentWidth: _buttonWidth
contentHeight: buttonColumn . height
flickableDirection: Flickable . VerticalFlick
Column {
id: buttonColumn
width: _buttonWidth
spacing: _defaultTextHeight / 2
SubMenuButton {
id: summaryButton
width: _buttonWidth
imageResource: "/qmlimages/VehicleSummaryIcon.png"
setupIndicator: false
exclusiveGroup: setupButtonGroup
text: "SUMMARY"
onClicked: showSummaryPanel ( )
}
SubMenuButton {
id: firmwareButton
width: _buttonWidth
imageResource: "/qmlimages/FirmwareUpgradeIcon.png"
setupIndicator: false
exclusiveGroup: setupButtonGroup
visible: ! ScreenTools . isMobile
text: "FIRMWARE"
onClicked: showFirmwarePanel ( )
}
SubMenuButton {
id: joystickButton
width: _buttonWidth
setupIndicator: true
setupComplete: joystickManager . activeJoystick ? joystickManager.activeJoystick.calibrated : false
exclusiveGroup: setupButtonGroup
visible: _fullParameterVehicleAvailable && joystickManager . joysticks . length != 0
text: "JOYSTICK"
onClicked: showJoystickPanel ( )
}
Repeater {
model: _fullParameterVehicleAvailable ? multiVehicleManager.activeVehicle.autopilot.vehicleComponents : 0
SubMenuButton {
width: _buttonWidth
imageResource: modelData . iconResource
setupIndicator: modelData . requiresSetup
setupComplete: modelData . setupComplete
exclusiveGroup: setupButtonGroup
text: modelData . name . toUpperCase ( )
onClicked: showVehicleComponentPanel ( modelData )
}
}
SubMenuButton {
width: _buttonWidth
setupIndicator: false
exclusiveGroup: setupButtonGroup
visible: multiVehicleManager . parameterReadyVehicleAvailable
text: "PARAMETERS"
onClicked: showParametersPanel ( )
}
} / / C o l u m n
} / / F l i c k a b l e
Loader {
id: panelLoader
anchors.leftMargin: _defaultTextWidth
anchors.rightMargin: _defaultTextWidth
anchors.left: buttonFlickable . right
anchors.right: parent . right
anchors.top: parent . top
anchors.bottom: parent . bottom
}
} / / C o l u m n
} / / F l i c k a b l e
Loader {
id: panelLoader
anchors.leftMargin: defaultTextWidth
anchors.rightMargin: defaultTextWidth
anchors.left: buttonFlickable . right
anchors.right: parent . right
anchors.top: parent . top
anchors.bottom: parent . bottom
}
}
}