Commit 2ba773e7 authored by DonLakeFlyer's avatar DonLakeFlyer

New PageView control in instrument Panel

parent 57225710
......@@ -75,6 +75,7 @@
<file alias="QGroundControl/Controls/MultiRotorMotorDisplay.qml">src/QmlControls/MultiRotorMotorDisplay.qml</file>
<file alias="QGroundControl/Controls/NoMouseThroughRectangle.qml">src/QmlControls/NoMouseThroughRectangle.qml</file>
<file alias="QGroundControl/Controls/OfflineMapButton.qml">src/QmlControls/OfflineMapButton.qml</file>
<file alias="QGroundControl/Controls/PageView.qml">src/QmlControls/PageView.qml</file>
<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/PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file>
......@@ -163,11 +164,7 @@
<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/qmldir">src/FlightMap/qmldir</file>
<file alias="QGroundControl/FlightMap/CameraWidget.qml">src/FlightMap/Widgets/CameraWidget.qml</file>
<file alias="QGroundControl/FlightMap/ValuesWidget.qml">src/FlightMap/Widgets/ValuesWidget.qml</file>
<file alias="QGroundControl/FlightMap/VehicleHealthWidget.qml">src/FlightMap/Widgets/VehicleHealthWidget.qml</file>
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
<file alias="QGroundControl/FlightMap/VibrationWidget.qml">src/FlightMap/Widgets/VibrationWidget.qml</file>
<file alias="QGroundControl/ScreenTools/qmldir">src/QmlControls/QGroundControl.ScreenTools.qmldir</file>
<file alias="QGroundControl/ScreenTools/ScreenTools.qml">src/QmlControls/ScreenTools.qml</file>
<file alias="QmlTest.qml">src/QmlControls/QmlTest.qml</file>
......@@ -189,6 +186,10 @@
<file alias="UdpSettings.qml">src/ui/preferences/UdpSettings.qml</file>
<file alias="VehicleSummary.qml">src/VehicleSetup/VehicleSummary.qml</file>
<file alias="VirtualJoystick.qml">src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="CameraPageWidget.qml">src/FlightMap/Widgets/CameraPageWidget.qml</file>
<file alias="ValuePageWidget.qml">src/FlightMap/Widgets/ValuePageWidget.qml</file>
<file alias="HealthPageWidget.qml">src/FlightMap/Widgets/HealthPageWidget.qml</file>
<file alias="VibrationPageWidget.qml">src/FlightMap/Widgets/VibrationPageWidget.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="MavCmdInfoCommon.json">src/MissionManager/MavCmdInfoCommon.json</file>
......
......@@ -14,41 +14,19 @@ import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
/// Camera controls used in InstrumentSwipeView
QGCFlickable {
id: _root
height: Math.min(maxHeight, column.height)
contentHeight: column.height
flickableDirection: Flickable.VerticalFlick
clip: true
/// Camera page for Instrument Panel PageView
Column {
width: pageWidth
spacing: ScreenTools.defaultFontPixelHeight
property var qgcView
property color textColor
property var maxHeight
property bool showSettingsIcon: false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
MouseArea {
anchors.fill: parent
onClicked: showNextPage()
}
Column {
id: column
width: parent.width
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
color: textColor
text: qsTr("Camera Controls")
}
QGCButton {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Trigger Camera")
onClicked: _activeVehicle.triggerCamera()
enabled: _activeVehicle
}
QGCButton {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Trigger Camera")
onClicked: _activeVehicle.triggerCamera()
enabled: _activeVehicle
}
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
/// Health page for Instrument Panel PageWidget
Column {
width: pageWidth
property bool showSettingsIcon: false
property var _unhealthySensors: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.unhealthySensors : [ ]
QGCLabel {
width: parent.width
horizontalAlignment: Text.AlignHCenter
text: qsTr("All systems healthy")
visible: healthRepeater.count == 0
}
Repeater {
id: healthRepeater
model: _unhealthySensors
Row {
Image {
source: "/qmlimages/Yield.svg"
height: ScreenTools.defaultFontPixelHeight
sourceSize.height: height
fillMode: Image.PreserveAspectFit
}
QGCLabel {
text: modelData
}
}
}
}
......@@ -60,24 +60,6 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
}
Image {
id: gearThingy
anchors.bottomMargin: _topBottomMargin
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
source: qgcPal.globalTheme == QGCPalette.Light ? "/res/gear-black.svg" : "/res/gear-white.svg"
mipmap: true
opacity: 0.5
width: root.height * 0.15
sourceSize.width: width
fillMode: Image.PreserveAspectFit
}
MouseArea {
anchors.fill: parent
onClicked: _valuesWidget.showPicker()
}
Item {
id: _valuesItem
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 4
......@@ -90,17 +72,13 @@ Rectangle {
color: qgcPal.window
}
InstrumentSwipeView {
PageView {
id: _valuesWidget
anchors.margins: 1
anchors.left: parent.left
anchors.right: parent.right
qgcView: root._qgcView
textColor: qgcPal.text
backgroundColor: qgcPal.window
maxHeight: _availableValueHeight
}
}
}
......@@ -7,7 +7,6 @@
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
......@@ -20,16 +19,13 @@ import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
import QGroundControl 1.0
QGCFlickable {
id: _root
height: Math.min(maxHeight, _smallFlow.y + _smallFlow.height)
contentHeight: _smallFlow.y + _smallFlow.height
flickableDirection: Flickable.VerticalFlick
clip: true
/// Value page for InstrumentPanel PageView
Column {
id: _largeColumn
width: pageWidth
spacing: _margins
property var qgcView
property color textColor
property var maxHeight
property bool showSettingsIcon: true
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
property real _margins: ScreenTools.defaultFontPixelWidth / 2
......@@ -40,7 +36,7 @@ QGCFlickable {
id: controller
}
function showPicker() {
function showSettings() {
qgcView.showDialog(propertyPicker, qsTr("Value Widget Setup"), qgcView.showDialogDefaultWidth, StandardButton.Ok)
}
......@@ -53,36 +49,39 @@ QGCFlickable {
return false
}
MouseArea {
anchors.fill: parent
onClicked: showNextPage()
}
Repeater {
model: _activeVehicle ? controller.largeValues : 0
Loader {
sourceComponent: fact ? largeValue : undefined
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
}
} // Repeater - Large
Column {
id: _largeColumn
width: parent.width
spacing: _margins
Flow {
id: _smallFlow
width: parent.width
layoutDirection: Qt.LeftToRight
spacing: _margins
Repeater {
model: _activeVehicle ? controller.largeValues : 0
model: _activeVehicle ? controller.smallValues : 0
Loader {
sourceComponent: fact ? largeValue : undefined
sourceComponent: fact ? smallValue : undefined
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
}
} // Repeater - Large
} // Column - Large
} // Repeater - Small
} // Flow
Component {
id: largeValue
Column {
width: _largeColumn.width
property bool largeValue: _root.listContains(controller.altitudeProperties, fact.name)
property bool largeValue: listContains(controller.altitudeProperties, fact.name)
QGCLabel {
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: textColor
fontSizeMode: Text.HorizontalFit
text: fact.shortDescription + (fact.units ? " (" + fact.units + ")" : "")
}
......@@ -92,34 +91,16 @@ QGCFlickable {
font.pointSize: ScreenTools.mediumFontPointSize * (largeValue ? 1.3 : 1.0)
font.family: largeValue ? ScreenTools.demiboldFontFamily : ScreenTools.normalFontFamily
fontSizeMode: Text.HorizontalFit
color: textColor
text: fact.valueString
}
}
}
Flow {
id: _smallFlow
width: parent.width
anchors.topMargin: _margins
anchors.top: _largeColumn.bottom
layoutDirection: Qt.LeftToRight
spacing: _margins
Repeater {
model: _activeVehicle ? controller.smallValues : 0
Loader {
sourceComponent: fact ? smallValue : undefined
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
}
} // Repeater - Small
} // Flow
Component {
id: smallValue
Column {
width: (_root.width / 2) - (_margins / 2) - 0.1
width: (pageWidth / 2) - (_margins / 2) - 0.1
clip: true
QGCLabel {
......@@ -127,13 +108,11 @@ QGCFlickable {
horizontalAlignment: Text.AlignHCenter
font.pointSize: ScreenTools.isTinyScreen ? ScreenTools.smallFontPointSize * 0.75 : ScreenTools.smallFontPointSize
fontSizeMode: Text.HorizontalFit
color: textColor
text: fact.shortDescription
}
QGCLabel {
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: textColor
fontSizeMode: Text.HorizontalFit
text: fact.enumOrValueString
}
......@@ -142,7 +121,6 @@ QGCFlickable {
horizontalAlignment: Text.AlignHCenter
font.pointSize: ScreenTools.isTinyScreen ? ScreenTools.smallFontPointSize * 0.75 : ScreenTools.smallFontPointSize
fontSizeMode: Text.HorizontalFit
color: textColor
text: fact.units
}
}
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
QGCFlickable {
id: _root
height: Math.min(maxHeight, healthColumn.y + healthColumn.height)
contentHeight: healthColumn.y + healthColumn.height
flickableDirection: Flickable.VerticalFlick
clip: true
property var qgcView
property color textColor
property var maxHeight
property var unhealthySensors: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.unhealthySensors : [ ]
MouseArea {
anchors.fill: parent
onClicked: showNextPage()
}
Column {
id: healthColumn
width: parent.width
QGCLabel {
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: textColor
text: qsTr("Vehicle Health")
}
QGCLabel {
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: textColor
text: qsTr("All systems healthy")
visible: healthRepeater.count == 0
}
Repeater {
id: healthRepeater
model: unhealthySensors
Row {
Image {
source: "/qmlimages/Yield.svg"
height: ScreenTools.defaultFontPixelHeight
sourceSize.height: height
fillMode: Image.PreserveAspectFit
}
QGCLabel {
color: textColor
text: modelData
}
}
}
}
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
import QGroundControl 1.0
Rectangle {
height: barRow.y + barRow.height
width: pageWidth
color: qgcPal.window
property bool showSettingsIcon: false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
property bool _available: _activeVehicle ? !isNaN(_activeVehicle.vibration.xAxis.value) : false
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _barWidth: Math.round(ScreenTools.defaultFontPixelWidth * 3)
readonly property real _barMinimum: 0.0
readonly property real _barMaximum: 90.0
readonly property real _barBadValue: 60.0
QGCPalette { id:qgcPal; colorGroupEnabled: true }
QGCLabel {
id: title
text: qsTr("Vibe")
anchors.horizontalCenter: barRow.horizontalCenter
}
Row {
id: barRow
anchors.margins: _margins
anchors.top: title.bottom
anchors.left: parent.left
spacing: _margins
Column {
ProgressBar {
id: xBar
height: 50
orientation: Qt.Vertical
minimumValue: _barMinimum
maximumValue: _barMaximum
value: _activeVehicle ? _activeVehicle.vibration.xAxis.value : 0
}
QGCLabel {
id: xBarLabel
text: "X"
anchors.horizontalCenter: xBar.horizontalCenter
}
}
Column {
ProgressBar {
id: yBar
height: 50
orientation: Qt.Vertical
minimumValue: _barMinimum
maximumValue: _barMaximum
value: _activeVehicle ? _activeVehicle.vibration.yAxis.value : 0
}
QGCLabel {
anchors.horizontalCenter: yBar.horizontalCenter
text: "Y"
}
}
Column {
ProgressBar {
id: zBar
height: 50
orientation: Qt.Vertical
minimumValue: _barMinimum
maximumValue: _barMaximum
value: _activeVehicle ? _activeVehicle.vibration.zAxis.value : 0
}
QGCLabel {
anchors.horizontalCenter: zBar.horizontalCenter
text: "Z"
}
}
} // Row
// Max vibe indication line at 60
Rectangle {
anchors.topMargin: xBar.height * (1.0 - ((_barBadValue - _barMinimum) / (_barMaximum - _barMinimum)))
anchors.top: barRow.top
anchors.left: barRow.left
anchors.right: barRow.right
width: barRow.width
height: 1
color: "red"
}
QGCLabel {
id: clipLabel
anchors.margins: _margins
anchors.left: barRow.right
anchors.right: parent.right
text: qsTr("Clip count")
horizontalAlignment: Text.AlignHCenter
}
Column {
id: clipColumn
anchors.top: barRow.top
anchors.horizontalCenter: clipLabel.horizontalCenter
QGCLabel {
text: qsTr("Accel 1: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount1.valueString : "")
}
QGCLabel {
text: qsTr("Accel 2: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount2.valueString : "")
}
QGCLabel {
text: qsTr("Accel 3: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount3.valueString : "")
}
}
// Not available overlay
Rectangle {
anchors.fill: parent
color: qgcPal.window
opacity: 0.75
visible: !_available
QGCLabel {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: qsTr("Not Available")
}
}
} // Item
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
import QGroundControl 1.0
QGCFlickable {
id: _root
height: Math.min(maxHeight, innerItem.height)
contentHeight: innerItem.height
flickableDirection: Flickable.VerticalFlick
clip: true
property color textColor
property color backgroundColor
property var maxHeight
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _barWidth: Math.round(ScreenTools.defaultFontPixelWidth * 3)
readonly property real _barMinimum: 0.0
readonly property real _barMaximum: 90.0
readonly property real _barBadValue: 60.0
QGCPalette { id:qgcPal; colorGroupEnabled: true }
MouseArea {
anchors.fill: parent
onClicked: showNextPage()
}
Item {
id: innerItem
width: parent.width
height: barRow.y + barRow.height
QGCLabel {
id: title
color: textColor
text: qsTr("Vibe")
anchors.horizontalCenter: barRow.horizontalCenter
}
Row {
id: barRow
anchors.margins: _margins
anchors.top: title.bottom
anchors.left: parent.left
spacing: _margins
Column {
ProgressBar {
id: xBar
height: 50
orientation: Qt.Vertical
minimumValue: _barMinimum
maximumValue: _barMaximum
value: _activeVehicle ? _activeVehicle.vibration.xAxis.value : 0
}
QGCLabel {
id: xBarLabel
color: textColor
text: "X"
anchors.horizontalCenter: xBar.horizontalCenter
}
}
Column {
ProgressBar {
id: yBar
height: 50
orientation: Qt.Vertical
minimumValue: _barMinimum
maximumValue: _barMaximum
value: _activeVehicle ? _activeVehicle.vibration.yAxis.value : 0
}
QGCLabel {
anchors.horizontalCenter: yBar.horizontalCenter
color: textColor
text: "Y"
}
}
Column {
ProgressBar {
id: zBar
height: 50
orientation: Qt.Vertical
minimumValue: _barMinimum
maximumValue: _barMaximum
value: _activeVehicle ? _activeVehicle.vibration.zAxis.value : 0
}
QGCLabel {
anchors.horizontalCenter: zBar.horizontalCenter
color: textColor
text: "Z"
}
}
} // Row
// Max vibe indication line at 60
Rectangle {
anchors.topMargin: xBar.height * (1.0 - ((_barBadValue - _barMinimum) / (_barMaximum - _barMinimum)))
anchors.top: barRow.top
anchors.left: barRow.left
anchors.right: barRow.right
width: barRow.width
height: 1
color: "red"
}
QGCLabel {
id: clipLabel
anchors.margins: _margins
anchors.left: barRow.right
anchors.right: parent.right
color: textColor
text: qsTr("Clip count")
horizontalAlignment: Text.AlignHCenter
}
Column {
id: clipColumn
anchors.top: barRow.top
anchors.horizontalCenter: clipLabel.horizontalCenter
QGCLabel {
text: qsTr("Accel 1: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount1.valueString : "")
color: textColor
}
QGCLabel {
text: qsTr("Accel 2: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount2.valueString : "")
color: textColor
}
QGCLabel {
text: qsTr("Accel 3: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount3.valueString : "")
color: textColor
}
}
// Not available overlay
Rectangle {
anchors.fill: parent
color: backgroundColor
opacity: 0.75
visible: _activeVehicle ? isNaN(_activeVehicle.vibration.xAxis.value) : false