diff --git a/custom-example/qgroundcontrol.qrc b/custom-example/qgroundcontrol.qrc index 1bf64ae9462..e0f65f7aefb 100644 --- a/custom-example/qgroundcontrol.qrc +++ b/custom-example/qgroundcontrol.qrc @@ -11,7 +11,6 @@ ../src/UI/toolbar/RCRSSIIndicator.qml ../src/UI/toolbar/RemoteIDIndicator.qml ../src/UI/toolbar/TelemetryRSSIIndicator.qml - ../src/UI/toolbar/VTOLModeIndicator.qml ../src/UI/toolbar/APMSupportForwardingIndicator.qml ../src/UI/toolbar/GimbalIndicator.qml @@ -39,7 +38,6 @@ ../src/UI/preferences/RemoteIDSettings.qml ../src/AutoPilotPlugins/Common/ESP8266Component.qml ../src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml - ../src/UI/ExitWithErrorWindow.qml ../src/VehicleSetup/FirmwareUpgrade.qml ../src/FlightDisplay/QGCVideoBackground.qml ../src/FlightDisplay/FlightDisplayViewDummy.qml @@ -84,7 +82,6 @@ ../src/QmlControls/AltModeDialog.qml ../src/QmlControls/AxisMonitor.qml ../src/UI/toolbar/BatteryIndicator.qml - ../src/UI/toolbar/BatteryIndicatorContentItem.qml ../src/PlanView/CameraCalcCamera.qml ../src/PlanView/CameraCalcGrid.qml ../src/PlanView/CameraSection.qml @@ -100,7 +97,6 @@ ../src/FirstRunPromptDialogs/FirstRunPrompt.qml ../src/QmlControls/FileButton.qml ../src/UI/toolbar/FlightModeIndicator.qml - ../src/QmlControls/FlightModeDropdown.qml ../src/QmlControls/FlightModeMenu.qml ../src/PlanView/FWLandingPatternMapVisual.qml ../src/UI/toolbar/GPSIndicator.qml @@ -131,8 +127,6 @@ ../src/QmlControls/MissionItemIndexLabel.qml ../src/PlanView/MissionItemMapVisual.qml ../src/PlanView/MissionItemStatus.qml - ../src/QmlControls/ModeSwitchDisplay.qml - ../src/QmlControls/MultiRotorMotorDisplay.qml ../src/QmlControls/OfflineMapButton.qml ../src/QtLocationPlugin/QMLControl/OfflineMapEditor.qml ../src/UI/preferences/OfflineMapInfo.qml @@ -274,14 +268,11 @@ ../src/FlightMap/MapScale.qml ../src/FlightMap/MapItems/MissionItemIndicator.qml ../src/FlightMap/MapItems/MissionItemIndicatorDrag.qml - ../src/FlightMap/MapItems/MissionItemView.qml ../src/FlightMap/MapItems/MissionLineView.qml ../src/FlightMap/Widgets/PhotoVideoControl.qml ../src/FlightMap/MapItems/PlanMapItems.qml - ../src/FlightMap/MapItems/PolygonEditor.qml ../src/FlightMap/MapItems/ProximityRadarMapView.qml ../src/FlightMap/Widgets/QGCArtificialHorizon.qml - ../src/FlightMap/Widgets/QGCAttitudeHUD.qml ../src/FlightMap/Widgets/QGCAttitudeWidget.qml ../src/FlightMap/Widgets/QGCCompassWidget.qml ../src/FlightMap/Widgets/QGCPitchIndicator.qml diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 17419754262..dd64f5fdfbe 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -11,7 +11,6 @@ src/UI/toolbar/RCRSSIIndicator.qml src/UI/toolbar/RemoteIDIndicator.qml src/UI/toolbar/TelemetryRSSIIndicator.qml - src/UI/toolbar/VTOLModeIndicator.qml src/UI/toolbar/APMSupportForwardingIndicator.qml src/UI/toolbar/GimbalIndicator.qml @@ -39,7 +38,6 @@ src/UI/preferences/RemoteIDSettings.qml src/AutoPilotPlugins/Common/ESP8266Component.qml src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml - src/UI/ExitWithErrorWindow.qml src/VehicleSetup/FirmwareUpgrade.qml src/FlightDisplay/QGCVideoBackground.qml src/FlightDisplay/FlightDisplayViewDummy.qml @@ -84,7 +82,6 @@ src/QmlControls/AltModeDialog.qml src/QmlControls/AxisMonitor.qml src/UI/toolbar/BatteryIndicator.qml - src/UI/toolbar/BatteryIndicatorContentItem.qml src/PlanView/CameraCalcCamera.qml src/PlanView/CameraCalcGrid.qml src/PlanView/CameraSection.qml @@ -100,7 +97,6 @@ src/FirstRunPromptDialogs/FirstRunPrompt.qml src/QmlControls/FileButton.qml src/UI/toolbar/FlightModeIndicator.qml - src/QmlControls/FlightModeDropdown.qml src/QmlControls/FlightModeMenu.qml src/PlanView/FWLandingPatternMapVisual.qml src/UI/toolbar/GPSIndicator.qml @@ -131,8 +127,6 @@ src/QmlControls/MissionItemIndexLabel.qml src/PlanView/MissionItemMapVisual.qml src/PlanView/MissionItemStatus.qml - src/QmlControls/ModeSwitchDisplay.qml - src/QmlControls/MultiRotorMotorDisplay.qml src/QmlControls/OfflineMapButton.qml src/QtLocationPlugin/QMLControl/OfflineMapEditor.qml src/UI/preferences/OfflineMapInfo.qml @@ -278,14 +272,11 @@ src/FlightMap/MapScale.qml src/FlightMap/MapItems/MissionItemIndicator.qml src/FlightMap/MapItems/MissionItemIndicatorDrag.qml - src/FlightMap/MapItems/MissionItemView.qml src/FlightMap/MapItems/MissionLineView.qml src/FlightMap/Widgets/PhotoVideoControl.qml src/FlightMap/MapItems/PlanMapItems.qml - src/FlightMap/MapItems/PolygonEditor.qml src/FlightMap/MapItems/ProximityRadarMapView.qml src/FlightMap/Widgets/QGCArtificialHorizon.qml - src/FlightMap/Widgets/QGCAttitudeHUD.qml src/FlightMap/Widgets/QGCAttitudeWidget.qml src/FlightMap/Widgets/QGCCompassWidget.qml src/FlightMap/Widgets/QGCPitchIndicator.qml diff --git a/src/FlightMap/MapItems/MissionItemView.qml b/src/FlightMap/MapItems/MissionItemView.qml deleted file mode 100644 index 144fd4aa1f1..00000000000 --- a/src/FlightMap/MapItems/MissionItemView.qml +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - - -import QtQuick -import QtQuick.Controls -import QtQuick.Dialogs -import QtLocation -import QtPositioning - -import QGroundControl -import QGroundControl.FlightMap -import QGroundControl.Controls - -/// The MissionItemView control is used to add Mission Item Indicators to a FlightMap. -MapItemView { - id: _root - - delegate: MissionItemIndicator { - id: itemIndicator - coordinate: object.coordinate - visible: object.specifiesCoordinate - z: QGroundControl.zOrderMapItems - missionItem: object - sequenceNumber: object.sequenceNumber - onClicked: { - parent._retaskSequence = object.sequenceNumber - parent.flightWidgets.guidedModeBar.confirmAction(parent.flightWidgets.guidedModeBar.confirmRetask) - } - // These are the non-coordinate child mission items attached to this item - Row { - anchors.top: parent.top - anchors.left: parent.right - Repeater { - model: object.childItems - delegate: MissionItemIndexLabel { - label: object.abbreviation - checked: object.isCurrentItem - z: 2 - } - } - } - } -} diff --git a/src/FlightMap/MapItems/PolygonEditor.qml b/src/FlightMap/MapItems/PolygonEditor.qml deleted file mode 100644 index ba09d851a32..00000000000 --- a/src/FlightMap/MapItems/PolygonEditor.qml +++ /dev/null @@ -1,356 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick -import QtLocation - -import QGroundControl -import QGroundControl.ScreenTools -import QGroundControl.Controls - - -/// Polygon drawing item. Add to your control and call methods to get support for polygon drawing and adjustment. -Item { - id: _root - - // These properties must be provided by the consumer - property var map ///< Map control - property var callbackObject ///< Callback item - - // These properties can be queried by the consumer - property bool drawingPolygon: false - property bool adjustingPolygon: false - property bool polygonReady: _currentPolygon ? _currentPolygon.path.length > 2 : false ///< true: enough points have been captured to create a closed polygon - - property var _helpLabel ///< Dynamically added help label component - property var _newPolygon ///< Dynamically added polygon which represents all polygon points including the one currently being drawn - property var _currentPolygon ///< Dynamically added polygon which represents the currently completed polygon - property var _nextPointLine ///< Dynamically added line which goes from last polygon point to the new one being drawn - property var _mobileSegment ///< Dynamically added line between first and second polygon point for mobile - property var _mobilePoint ///< Dynamically added point showing first polygon point on mobile - property var _mouseArea ///< Dynamically added MouseArea which handles all clicking and mouse movement - property var _vertexDragList: [ ] ///< Dynamically added vertex drag points - property bool _mobile: ScreenTools.isMobile - - /// Begin capturing a new polygon - /// polygonCaptureStarted will be signalled through callbackObject - function startCapturePolygon() { - _helpLabel = helpLabelComponent.createObject (map) - _newPolygon = newPolygonComponent.createObject (map) - _currentPolygon = currentPolygonComponent.createObject(map) - _nextPointLine = nextPointComponent.createObject (map) - _mobileSegment = mobileSegmentComponent.createObject (map) - _mobilePoint = mobilePointComponent.createObject (map) - _mouseArea = mouseAreaComponent.createObject (map) - - map.addMapItem(_newPolygon) - map.addMapItem(_currentPolygon) - map.addMapItem(_nextPointLine) - map.addMapItem(_mobileSegment) - map.addMapItem(_mobilePoint) - - drawingPolygon = true - callbackObject.polygonCaptureStarted() - } - - /// Finish capturing the polygon - /// polygonCaptureFinished will be signalled through callbackObject - /// @return true: polygon completed, false: not enough points to complete polygon - function finishCapturePolygon() { - if (!polygonReady) { - return false - } - var polygonPath = _currentPolygon.path - _cancelCapturePolygon() - callbackObject.polygonCaptureFinished(polygonPath) - return true - } - - function startAdjustPolygon(vertexCoordinates) { - adjustingPolygon = true - for (var i=0; i { - if (mouse.button == Qt.LeftButton) { - justClicked = true - if (_newPolygon.path.length > 2) { - // Make sure the new line doesn't intersect the existing polygon - var lastSegment = _newPolygon.path.length - 2 - var newLineA = map.fromCoordinate(_newPolygon.path[lastSegment], false /* clipToViewPort */) - var newLineB = map.fromCoordinate(_newPolygon.path[lastSegment+1], false /* clipToViewPort */) - for (var i=0; i { - if (ScreenTools.isMobile) { - // We don't track mouse drag on mobile - return - } - if (_newPolygon.path.length) { - var dragCoordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */) - var polygonPath = _newPolygon.path - if (justClicked){ - // Add new drag coordinate - polygonPath.push(dragCoordinate) - justClicked = false - } - - // Update drag line - _nextPointLine.path = [ _newPolygon.path[_newPolygon.path.length - 2], dragCoordinate ] - - polygonPath[_newPolygon.path.length - 1] = dragCoordinate - _newPolygon.path = polygonPath - } - } - } - } - - /// Polygon being drawn, including new point - Component { - id: newPolygonComponent - - MapPolygon { - color: "blue" - opacity: 0.5 - visible: path.length > 2 - } - } - - /// Current complete polygon - Component { - id: currentPolygonComponent - - MapPolygon { - color: 'green' - opacity: 0.5 - visible: polygonReady - } - } - - /// First line segment to show on mobile - Component { - id: mobileSegmentComponent - - MapPolyline { - line.color: "green" - line.width: 3 - visible: false - } - } - - /// First line segment to show on mobile - Component { - id: mobilePointComponent - - MapQuickItem { - anchorPoint.x: rect.width / 2 - anchorPoint.y: rect.height / 2 - visible: false - - sourceItem: Rectangle { - id: rect - width: ScreenTools.defaultFontPixelHeight - height: width - color: "green" - } - } - } - - /// Next line for polygon - Component { - id: nextPointComponent - - MapPolyline { - line.color: "green" - line.width: 3 - } - } -} diff --git a/src/FlightMap/Widgets/CompassRing.qml b/src/FlightMap/Widgets/CompassRing.qml deleted file mode 100644 index 9bbe4ae3571..00000000000 --- a/src/FlightMap/Widgets/CompassRing.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick - -import QGroundControl.Controls -import QGroundControl.ScreenTools -import QGroundControl.Vehicle - -Item { - property real size: _defaultSize - property var vehicle: null - - property real _defaultSize: ScreenTools.defaultFontPixelHeight * (10) - property real _sizeRatio: ScreenTools.isTinyScreen ? (size / _defaultSize) * 0.5 : size / _defaultSize - property int _fontSize: ScreenTools.defaultFontPointSize * _sizeRatio - property real _heading: vehicle ? vehicle.heading.rawValue : 0 - - width: size - height: size - - Rectangle { - id: borderRect - anchors.fill: parent - radius: width / 2 - color: "black" - } - - Item { - id: instrument - anchors.fill: parent - visible: false - - Image { - id: pointer - source: "/qmlimages/attitudePointer.svg" - mipmap: true - fillMode: Image.PreserveAspectFit - anchors.leftMargin: _pointerMargin - anchors.rightMargin: _pointerMargin - anchors.topMargin: _pointerMargin - anchors.bottomMargin: _pointerMargin - anchors.fill: parent - sourceSize.height: parent.height - - transform: Rotation { - origin.x: pointer.width / 2 - origin.y: pointer.height / 2 - angle: _heading - } - - readonly property real _pointerMargin: -10 - } - - Image { - source: "/qmlimages/compassInstrumentDial.svg" - mipmap: true - fillMode: Image.PreserveAspectFit - anchors.fill: parent - sourceSize.height: parent.height - } - } - - Rectangle { - id: mask - anchors.fill: instrument - radius: width / 2 - color: "black" - visible: false - } - - OpacityMask { - anchors.fill: instrument - source: instrument - maskSource: mask - } - -} diff --git a/src/FlightMap/Widgets/QGCAttitudeHUD.qml b/src/FlightMap/Widgets/QGCAttitudeHUD.qml deleted file mode 100644 index 482952661b2..00000000000 --- a/src/FlightMap/Widgets/QGCAttitudeHUD.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - - -/** - * @file - * @brief QGC Attitude Widget - * @author Gus Grubba - */ - -import QtQuick -import QGroundControl.ScreenTools - -Item { - id: root - - property bool active: false ///< true: actively connected to data provider, false: show inactive control - property real rollAngle : _defaultRollAngle - property real pitchAngle: _defaultPitchAngle - property bool showPitch: true - - readonly property real _defaultRollAngle: 0 - readonly property real _defaultPitchAngle: 0 - - property real _rollAngle: active ? rollAngle : _defaultRollAngle - property real _pitchAngle: active ? pitchAngle : _defaultPitchAngle - - anchors.centerIn: parent - - Image { - id: rollDial - anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter } - source: "/qmlimages/rollDialWhite.svg" - mipmap: true - width: parent.width - sourceSize.width: width - fillMode: Image.PreserveAspectFit - transform: Rotation { - origin.x: rollDial.width / 2 - origin.y: rollDial.height - angle: -_rollAngle - } - } - - Image { - id: pointer - anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter } - source: "/qmlimages/rollPointerWhite.svg" - mipmap: true - width: rollDial.width - sourceSize.width: width - fillMode: Image.PreserveAspectFit - } - - Image { - id: crossHair - anchors.centerIn: parent - source: "/qmlimages/crossHair.svg" - mipmap: true - width: parent.width - sourceSize.width: width - fillMode: Image.PreserveAspectFit - } - - QGCPitchIndicator { - id: pitchIndicator - anchors.verticalCenter: parent.verticalCenter - visible: showPitch - pitchAngle: _pitchAngle - rollAngle: _rollAngle - color: Qt.rgba(0,0,0,0) - size: ScreenTools.defaultFontPixelHeight * (10) - } -} diff --git a/src/FlightMap/Widgets/QGCWaypointEditor.qml b/src/FlightMap/Widgets/QGCWaypointEditor.qml deleted file mode 100644 index a5505b295ce..00000000000 --- a/src/FlightMap/Widgets/QGCWaypointEditor.qml +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2016 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - - -/** - * @file - * @brief QGC Waypoint Editor - * @author Gus Grubba - */ - -import QtQuick - -import QGroundControl.Palette - -Rectangle { - QGCPalette { id: qgcPal; colorGroupEnabled: true } - id: root - color: qgcPal.window - -} diff --git a/src/QmlControls/FlightModeDropdown.qml b/src/QmlControls/FlightModeDropdown.qml deleted file mode 100644 index b18576df4dd..00000000000 --- a/src/QmlControls/FlightModeDropdown.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick - -import QGroundControl.Controls -import QGroundControl.ScreenTools - -Item { - width: flightModeLabel.visible ? flightModeLabel.width : flightModeCombo.width - height: flightModeLabel.visible ? flightModeLabel.height : flightModeCombo.height - - property var activeVehicle ///< Vehicle to show flight modes for - - property int _maxFMCharLength: 10 ///< Maximum number of chars in a flight mode - property string flightMode: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display") - - onActiveVehicleChanged: _activeVehicleChanged() - - onFlightModeChanged: { - if (flightModeCombo.visible) { - flightModeCombo.currentIndex = flightModeCombo.find(flightMode) - } - } - - Component.onCompleted: _activeVehicleChanged() - - function _activeVehicleChanged() { - if (activeVehicle.flightModeSetAvailable) { - var maxFMChars = 0 - for (var i=0; i { activeVehicle.flightMode = textAt(index) } - } -} diff --git a/src/QmlControls/HackAndroidFileDialog.qml b/src/QmlControls/HackAndroidFileDialog.qml deleted file mode 100644 index 3759cd40cf0..00000000000 --- a/src/QmlControls/HackAndroidFileDialog.qml +++ /dev/null @@ -1,17 +0,0 @@ -import QtQuick -import QtQuick.Dialogs - -// On Qt 5.9 android versions there is the following bug: https://bugreports.qt.io/browse/QTBUG-61424 -// This prevents FileDialog from being used. So we have a temp hack workaround for it which just no-ops -// the FileDialog fallback mechanism on android 5.9 builds. - -Item { - property var folder - property var nameFilters - property var title - property var selectMultiple - property var selectFolder - - signal accepted - signal rejected -} diff --git a/src/QmlControls/ModeSwitchDisplay.qml b/src/QmlControls/ModeSwitchDisplay.qml deleted file mode 100644 index ef38ea5e43d..00000000000 --- a/src/QmlControls/ModeSwitchDisplay.qml +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - - -import QtQuick -import QtQuick.Controls - -import QGroundControl.Palette -import QGroundControl.ScreenTools - -Rectangle { - property string flightModeName ///< User visible name for this flight mode - property string flightModeDescription - property real rcValue ///< Current rcValue to show in Monitor display, range: 0.0 - 1.0 - property int modeChannelIndex ///< Index into channel list for this mode - property bool modeChannelEnabled ///< true: Channel combo box is enabled - property bool modeSelected ///< true: This mode is currently selected - property real thresholdValue ///< Treshold setting for this mode, show in Threshold display, range 0.0 - 1.0 - property bool thresholdDragEnabled ///< true: Threshold value indicator can be dragged to modify value - - anchors.leftMargin: ScreenTools.defaultFontPixelWidth - anchors.rightMargin: ScreenTools.defaultFontPixelWidth - anchors.left: parent.left - anchors.right: parent.right - height: column.height + (ScreenTools.defaultFontPixelWidth * 2) - color: _qgcPal.window - - signal modeChannelIndexSelected(int index) - - QGCPalette { id: _qgcPal; colorGroupEnabled: enabled } - - Item { - anchors.margins: ScreenTools.defaultFontPixelWidth - anchors.fill: parent - - Column { - id: column - width: parent.width - spacing: ScreenTools.defaultFontPixelHeight / 4 - - Row { - width: parent.width - spacing: ScreenTools.defaultFontPixelWidth - - Rectangle { - width: modeLabel.width - height: channelCombo.height - color: modeSelected ? _qgcPal.buttonHighlight : _qgcPal.button - - QGCLabel { - id: modeLabel - width: ScreenTools.defaultFontPixelWidth * 18 - anchors.top: parent.top - anchors.bottom: parent.bottom - color: modeSelected ? _qgcPal.buttonHighlightText : _qgcPal.text - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - text: flightModeName - } - } - - QGCComboBox { - id: channelCombo - width: ScreenTools.defaultFontPixelWidth * 15 - model: controller.channelListModel - currentIndex: modeChannelIndex - enabled: modeChannelEnabled - - onActivated: (index) => { modeChannelIndexSelected(index) } - } - - QGCLabel { - width: parent.width - x - wrapMode: Text.WordWrap - text: flightModeDescription - visible: !ScreenTools.isTinyScreen - } - } - - Row { - width: parent.width - spacing: ScreenTools.defaultFontPixelWidth * 2 - - QGCLabel { - id: monitorLabel - height: ScreenTools.defaultFontPixelHeight - verticalAlignment: Text.AlignVCenter - text: qsTr("Monitor:") - } - - Item { - height: ScreenTools.defaultFontPixelHeight - width: parent.width - x - - // Won't be able to pull these properties, need to reference parent. - property int __lastRcValue: 1500 - readonly property int __rcValueMaxJitter: 2 - - // Bar - Rectangle { - id: bar - anchors.verticalCenter: parent.verticalCenter - width: parent.width - height: parent.height / 2 - color: _qgcPal.windowShadeDark - } - - // RC Indicator - Rectangle { - anchors.verticalCenter: parent.verticalCenter - width: parent.height * 0.75 - height: width - x: (parent.width * rcValue) - (width / 2) - radius: width / 2 - color: _qgcPal.text - } - } // Item - } - - Row { - width: parent.width - spacing: ScreenTools.defaultFontPixelWidth * 2 - - QGCLabel { - id: thresholdLabel - height: ScreenTools.defaultFontPixelHeight - verticalAlignment: Text.AlignVCenter - text: qsTr("Threshold:") - } - - Item { - id: thresholdContainer - height: ScreenTools.defaultFontPixelHeight - width: parent.width - x - - // Bar - Rectangle { - anchors.verticalCenter: parent.verticalCenter - width: parent.width - height: parent.height / 2 - color: _qgcPal.windowShadeDark - } - - // Threshold Indicator - Rectangle { - id: thresholdIndicator - anchors.verticalCenter: parent.verticalCenter - width: parent.height * 0.75 - height: width - x: (parent.width * thresholdValue) - (width / 2) - radius: width / 2 - color: thresholdDragEnabled ? _qgcPal.buttonHighlight : _qgcPal.text - - Drag.active: thresholdDrag.drag.active - Drag.hotSpot.x: width / 2 - Drag.hotSpot.y: height / 2 - - MouseArea { - id: thresholdDrag - anchors.fill: parent - cursorShape: Qt.SizeHorCursor - drag.target: thresholdDragEnabled ? parent : null - drag.minimumX: - (width / 2) - drag.maximumX: thresholdContainer.width - (width / 2) - drag.axis: Drag.XAxis - - property bool dragActive: drag.active - - onDragActiveChanged: { - if (!drag.active) { - thresholdValue = (thresholdIndicator.x + (thresholdIndicator.width / 2)) / thresholdContainer.width - } - } - } - } - } // Item - } // Row - } // Column - } // Item -} // Rectangle diff --git a/src/QmlControls/MultiRotorMotorDisplay.qml b/src/QmlControls/MultiRotorMotorDisplay.qml deleted file mode 100644 index cb3ae58dc19..00000000000 --- a/src/QmlControls/MultiRotorMotorDisplay.qml +++ /dev/null @@ -1,182 +0,0 @@ -import QtQuick - -import QGroundControl.Palette -import QGroundControl.ScreenTools - -Item { - id: motorRoot - - property int motorCount: 4 // Number of motors on vehicle - property bool xConfig: true // true: X configuration, false: Plus configuration - property bool coaxial: true // true: motors on top bottom of same arm, false: motors only on top of arm - - property bool _unsupportedConfig: motorCount == 3 || (motorCount == 6 && coaxial) // Tricopters NYI - property var _qgcPal: QGCPalette { colorGroupEnabled: enabled } - property real _rotorRadius: motorRoot.height / 8 - property int _motorsPerSide: motorCount / (coaxial ? 2 : 1) - - readonly property string _cwColor: "#15ce15" // Green - readonly property string _ccwColor: "#1283e0" // Blue - readonly property var _motorColors4Plus: [ _ccwColor, _cwColor ] - readonly property var _motorColors4X: [ _cwColor, _ccwColor ] - readonly property var _motorColors6: [ _cwColor, _ccwColor ] - readonly property var _motorColors8: [ _cwColor, _ccwColor ] - readonly property var _motorColors4Top: [ _cwColor, _ccwColor ] - readonly property var _motorColors4Bottom: [ _ccwColor, _cwColor ] - - readonly property var _motorNumbers4Plus: [ 1, 4, 2, 3 ] - readonly property var _motorNumbers4X: [ 4, 2, 3, 1 ] - readonly property var _motorNumbers6Plus: [ 6, 2, 3, 5, 1, 4 ] - readonly property var _motorNumbers6X: [ 1, 4, 6, 2, 3, 5 ] - readonly property var _motorNumbers8: [ 8, 4, 2, 6, 7, 5, 1, 3 ] - readonly property var _motorNumbers4Top: [ 4, 3, 2, 1 ] - readonly property var _motorNumbers4Bottom: [ 7, 8, 5, 6 ] - - Component.onCompleted: { - if (coaxial) { - topMotors.motorNumbers = _motorNumbers4Top - bottomMotors.motorNumbers = _motorNumbers4Bottom - } else { - switch (motorCount) { - case 4: - topMotors.motorNumbers = xConfig ? _motorNumbers4X : _motorNumbers4Plus - topMotors.motorColors = xConfig ? _motorColors4X : _motorColors4Plus - break - case 6: - topMotors.motorNumbers = xConfig ? _motorNumbers6X : _motorNumbers6Plus - topMotors.motorColors = _motorColors6 - break - default: - case 8: - topMotors.motorNumbers = _motorNumbers8 - topMotors.motorColors = _motorColors8 - break - } - bottomMotors.motorNumbers = _motorNumbers8 - } - } - - Component { - id: motorDisplayComponent - - Repeater { - id: motorRepeater - model: _motorsPerSide - - Item { - x: motorRepeater.width / 2 + _armXCenter - rotor.radius - y: motorRepeater.height / 2 + _armYCenter - rotor.radius - width: _rotorRadius * 2 - height: _rotorRadius * 2 - - property real _armOffsetRadians: ((2 * Math.PI) / _motorsPerSide) - property real _armOffsetIndexRadians: (_armOffsetRadians * index) + ((xConfig && _motorsPerSide != 6) || (!xConfig && _motorsPerSide == 6) ? _armOffsetRadians / 2 : 0) - property real _armLength: (motorRepeater.height / 2) - (_rotorRadius * (xConfig && _motorsPerSide == 4 ? 0 : 1)) - property real _armXCenter: Math.cos(_armOffsetIndexRadians) * _armLength // adjacent = cos * hypotenuse - property real _armYCenter: Math.sin(_armOffsetIndexRadians) * _armLength // opposite = sin * hypotenuse - - Rectangle { - id: rotor - anchors.fill: parent - radius: _rotorRadius - color: motorColors[index & 1] - opacity: topCoaxial ? 0.65 : 1.0 - border.color: topCoaxial ? "black" : color - antialiasing: true - readonly property bool topCoaxial: topMotors && coaxial - //-- Top Directional Arrow - QGCColoredImage { - color: _qgcPal.globalTheme === QGCPalette.Light ? "black" : "white" - height: parent.height * 0.2 - width: height - sourceSize.height: height - mipmap: true - fillMode: Image.PreserveAspectFit - source: (index & 1) ? "/qmlimages/ArrowCW.svg" : "/qmlimages/ArrowCCW.svg" - anchors.top: parent.top - anchors.topMargin: height * -0.5 - anchors.horizontalCenter: parent.horizontalCenter - } - //-- Bottom Directional Arrow - QGCColoredImage { - color: _qgcPal.globalTheme === QGCPalette.Light ? "black" : "white" - height: parent.height * 0.2 - width: height - sourceSize.height: height - mipmap: true - fillMode: Image.PreserveAspectFit - source: (index & 1) ? "/qmlimages/ArrowCCW.svg" : "/qmlimages/ArrowCW.svg" - anchors.bottom: parent.bottom - anchors.bottomMargin: height * -0.5 - anchors.horizontalCenter: parent.horizontalCenter - } - transform: [ - Rotation { - origin.x: rotor.width / 2 - origin.y: rotor.height / 2 - angle: (index & 1) ? 45 : -45 - }] - } - - Rectangle { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - width: radius * 2 - height: radius * 2 - radius: ScreenTools.defaultFontPixelHeight * 0.666 - color: Qt.rgba(1,1,1,1) - border.color: Qt.rgba(0,0,0,0.75) - antialiasing: true - - QGCLabel { - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - text: motorNumbers[index] - color: parent.border.color - } - } - } // Item - } // Repeater - } // Component - MotorDisplayComponent - - Item { - anchors.fill: parent - visible: !_unsupportedConfig - - Loader { - id: bottomMotors - anchors.topMargin: ScreenTools.defaultFontPixelHeight - anchors.fill: parent - sourceComponent: motorDisplayComponent - visible: coaxial - - property bool topMotors: false - property var motorNumbers: _motorNumbers8 - property var motorColors: _motorColors4Bottom - } - - Loader { - id: topMotors - anchors.fill: parent - anchors.bottomMargin: coaxial ? ScreenTools.defaultFontPixelHeight : 0 - sourceComponent: motorDisplayComponent - - property bool topMotors: true - property var motorNumbers: _motorNumbers8 - property var motorColors: _motorColors4Top - } - - QGCColoredImage { - color: _qgcPal.text - height: parent.height * 0.5 - width: height * 0.55 - sourceSize.height: height - mipmap: true - fillMode: Image.PreserveAspectFit - source: "/qmlimages/ArrowDirection.svg" - anchors.centerIn: parent - } - - } // Item -} // Item diff --git a/src/QmlControls/QGroundControl/Controls/qmldir b/src/QmlControls/QGroundControl/Controls/qmldir index e9315938a57..142d5eb1061 100644 --- a/src/QmlControls/QGroundControl/Controls/qmldir +++ b/src/QmlControls/QGroundControl/Controls/qmldir @@ -1,15 +1,14 @@ Module QGroundControl.Controls +AltModeDialog 1.0 AltModeDialog.qml AnalyzePage 1.0 AnalyzePage.qml +APMSubMotorDisplay 1.0 APMSubMotorDisplay.qml AppMessages 1.0 AppMessages.qml -AltModeDialog 1.0 AltModeDialog.qml +AutotuneUI 1.0 AutotuneUI.qml AxisMonitor 1.0 AxisMonitor.qml BatteryIndicator 1.0 BatteryIndicator.qml -BatteryIndicatorContentItem 1.0 BatteryIndicatorContentItem.qml CameraCalcCamera 1.0 CameraCalcCamera.qml CameraCalcGrid 1.0 CameraCalcGrid.qml -ContentAreaCalc 1.0 ContentAreaCalc.qml -APMSubMotorDisplay 1.0 APMSubMotorDisplay.qml CameraSection 1.0 CameraSection.qml ClickableColor 1.0 ClickableColor.qml DeadMouseArea 1.0 DeadMouseArea.qml @@ -19,42 +18,37 @@ EditPositionDialog 1.0 EditPositionDialog.qml ExclusiveGroupItem 1.0 ExclusiveGroupItem.qml FactSlider 1.0 FactSlider.qml FactSliderPanel 1.0 FactSliderPanel.qml -FirstRunPrompt 1.0 FirstRunPrompt.qml FileButton 1.0 FileButton.qml +FirstRunPrompt 1.0 FirstRunPrompt.qml FlightModeIndicator 1.0 FlightModeIndicator.qml -FlightModeDropdown 1.0 FlightModeDropdown.qml FlightModeMenu 1.0 FlightModeMenu.qml +FlightModeMenuIndicator 1.0 FlightModeMenuIndicator.qml GeoFenceEditor 1.0 GeoFenceEditor.qml GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml GPSIndicator 1.0 GPSIndicator.qml GPSIndicatorPage 1.0 GPSIndicatorPage.qml -HackFileDialog 1.0 HackFileDialog.qml HeightIndicator 1.0 HeightIndicator.qml HorizontalFactValueGrid 1.0 HorizontalFactValueGrid.qml IndicatorButton 1.0 IndicatorButton.qml -LabelledButton 1.0 LabelledButton.qml -LabelledComboBox 1.0 LabelledComboBox.qml -LabelledLabel 1.0 LabelledLabel.qml -SelectableControl 1.0 SelectableControl.qml -SettingsGroupLayout 1.0 SettingsGroupLayout.qml +InstrumentValueEditDialog 1.0 InstrumentValueEditDialog.qml InstrumentValueLabel 1.0 InstrumentValueLabel.qml InstrumentValueValue 1.0 InstrumentValueValue.qml -InstrumentValueEditDialog 1.0 InstrumentValueEditDialog.qml JoystickThumbPad 1.0 JoystickThumbPad.qml KMLOrSHPFileDialog 1.0 KMLOrSHPFileDialog.qml +LabelledButton 1.0 LabelledButton.qml +LabelledComboBox 1.0 LabelledComboBox.qml +LabelledLabel 1.0 LabelledLabel.qml LogReplayStatusBar 1.0 LogReplayStatusBar.qml MainStatusIndicator 1.0 MainStatusIndicator.qml -FlightModeMenuIndicator 1.0 FlightModeMenuIndicator.qml MainStatusIndicatorOfflinePage 1.0 MainStatusIndicatorOfflinePage.qml MainWindowSavedState 1.0 MainWindowSavedState.qml +MAVLinkChart 1.0 MAVLinkChart.qml MAVLinkMessageButton 1.0 MAVLinkMessageButton.qml MissionCommandDialog 1.0 MissionCommandDialog.qml MissionItemEditor 1.0 MissionItemEditor.qml MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml MissionItemMapVisual 1.0 MissionItemMapVisual.qml MissionItemStatus 1.0 MissionItemStatus.qml -ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml -MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml OfflineMapButton 1.0 OfflineMapButton.qml OfflineMapEditor 1.0 OfflineMapEditor.qml OfflineMapInfo 1.0 OfflineMapInfo.qml @@ -62,16 +56,18 @@ ParameterDiffDialog 1.0 ParameterDiffDialog.qml ParameterEditor 1.0 ParameterEditor.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml PIDTuning 1.0 PIDTuning.qml +PipState 1.0 PipState.qml +PipView 1.0 PipView.qml PlanEditToolbar 1.0 PlanEditToolbar.qml PreFlightCheckButton 1.0 PreFlightCheckButton.qml PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml +PreFlightCheckList 1.0 PreFlightCheckList.qml PreFlightCheckModel 1.0 PreFlightCheckModel.qml QGCButton 1.0 QGCButton.qml -QGCColumnButton 1.0 QGCColumnButton.qml -AutotuneUI 1.0 AutotuneUI.qml QGCCheckBox 1.0 QGCCheckBox.qml QGCCheckBoxSlider 1.0 QGCCheckBoxSlider.qml QGCColoredImage 1.0 QGCColoredImage.qml +QGCColumnButton 1.0 QGCColumnButton.qml QGCComboBox 1.0 QGCComboBox.qml QGCDynamicObjectManager 1.0 QGCDynamicObjectManager.qml QGCFileDialog 1.0 QGCFileDialog.qml @@ -88,10 +84,9 @@ QGCMenuSeparator 1.0 QGCMenuSeparator.qml QGCMouseArea 1.0 QGCMouseArea.qml QGCMovableItem 1.0 QGCMovableItem.qml QGCOptionsComboBox 1.0 QGCOptionsComboBox.qml -PipView 1.0 PipView.qml -PipState 1.0 PipState.qml QGCPopupDialog 1.0 QGCPopupDialog.qml QGCRadioButton 1.0 QGCRadioButton.qml +QGCRoundButton 1.0 QGCRoundButton.qml QGCSimpleMessageDialog 1.0 QGCSimpleMessageDialog.qml QGCSlider 1.0 QGCSlider.qml QGCSwitch 1.0 QGCSwitch.qml @@ -106,8 +101,9 @@ RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml RCChannelMonitor 1.0 RCChannelMonitor.qml RCToParamDialog 1.0 RCToParamDialog.qml RemoteIDIndicatorPage 1.0 RemoteIDIndicatorPage.qml -QCRoundButton 1.0 QGCRoundButton.qml SectionHeader 1.0 SectionHeader.qml +SelectableControl 1.0 SelectableControl.qml +SettingsGroupLayout 1.0 SettingsGroupLayout.qml SetupPage 1.0 SetupPage.qml SignalStrength 1.0 SignalStrength.qml SimpleItemMapVisuals 1.0 SimpleItemMapVisuals.qml @@ -116,14 +112,13 @@ SubMenuButton 1.0 SubMenuButton.qml SurveyMapVisuals 1.0 SurveyMapVisuals.qml TerrainStatus 1.0 TerrainStatus.qml ToolIndicatorPage 1.0 ToolIndicatorPage.qml +ToolStrip 1.0 ToolStrip.qml +ToolStripHoverButton 1.0 ToolStripHoverButton.qml TransectStyleComplexItemEditor 1.0 TransectStyleComplexItemEditor.qml TransectStyleComplexItemStats 1.0 TransectStyleComplexItemStats.qml TransectStyleComplexItemTabBar 1.0 TransectStyleComplexItemTabBar.qml TransectStyleComplexItemTerrainFollow 1.0 TransectStyleComplexItemTerrainFollow.qml TransectStyleMapVisuals 1.0 TransectStyleMapVisuals.qml -ToolStrip 1.0 ToolStrip.qml -ToolStripHoverButton 1.0 ToolStripHoverButton.qml ValueSlider 1.0 ValueSlider.qml VehicleRotationCal 1.0 VehicleRotationCal.qml VehicleSummaryRow 1.0 VehicleSummaryRow.qml -MAVLinkChart 1.0 MAVLinkChart.qml diff --git a/src/QmlControls/QGroundControl/FactControls/qmldir b/src/QmlControls/QGroundControl/FactControls/qmldir index e176873ca17..cff672d7012 100644 --- a/src/QmlControls/QGroundControl/FactControls/qmldir +++ b/src/QmlControls/QGroundControl/FactControls/qmldir @@ -9,7 +9,7 @@ FactLabel 1.0 FactLabel.qml FactTextField 1.0 FactTextField.qml FactTextFieldGrid 1.0 FactTextFieldGrid.qml FactTextFieldRow 1.0 FactTextFieldRow.qml -FactValueSlider 1.0 FactValueSlider.qml FactTextFieldSlider 1.0 FactTextFieldSlider.qml +FactValueSlider 1.0 FactValueSlider.qml LabelledFactComboBox 1.0 LabelledFactComboBox.qml LabelledFactTextField 1.0 LabelledFactTextField.qml diff --git a/src/QmlControls/QGroundControl/FlightDisplay/qmldir b/src/QmlControls/QGroundControl/FlightDisplay/qmldir index bdcf895001f..888f82ab0f1 100644 --- a/src/QmlControls/QGroundControl/FlightDisplay/qmldir +++ b/src/QmlControls/QGroundControl/FlightDisplay/qmldir @@ -1,9 +1,12 @@ Module QGroundControl.FlightDisplay CustomGuidedActionsController 1.0 CustomGuidedActionsController.qml +FlightDisplayViewGStreamer 1.0 FlightDisplayViewGStreamer.qml +FlightDisplayViewQtMultimedia 1.0 FlightDisplayViewQtMultimedia.qml FlyView 1.0 FlyView.qml FlyViewBottomRightRowLayout 1.0 FlyViewBottomRightRowLayout.qml FlyViewCustomLayer 1.0 FlyViewCustomLayer.qml +FlyViewInsetViewer 1.0 FlyViewInsetViewer.qml FlyViewInstrumentPanel 1.0 FlyViewInstrumentPanel.qml FlyViewMap 1.0 FlyViewMap.qml FlyViewMissionCompleteDialog 1.0 FlyViewMissionCompleteDialog.qml @@ -15,19 +18,23 @@ FlyViewToolStripActionList 1.0 FlyViewToolStripActionList.qml FlyViewTopRightColumnLayout 1.0 FlyViewTopRightColumnLayout.qml FlyViewVideo 1.0 FlyViewVideo.qml FlyViewWidgetLayer 1.0 FlyViewWidgetLayer.qml -FlyViewInsetViewer 1.0 FlyViewInsetViewer.qml +GripperMenu 1.0 GripperMenu.qml GuidedActionActionList 1.0 GuidedActionActionList.qml GuidedActionConfirm 1.0 GuidedActionConfirm.qml -GuidedActionsController 1.0 GuidedActionsController.qml +GuidedActionGripper 1.0 GuidedActionGripper.qml GuidedActionLand 1.0 GuidedActionLand.qml GuidedActionList 1.0 GuidedActionList.qml GuidedActionPause 1.0 GuidedActionPause.qml GuidedActionRTL 1.0 GuidedActionRTL.qml -GuidedValueSlider 1.0 GuidedValueSlider.qml +GuidedActionsController 1.0 GuidedActionsController.qml GuidedActionTakeoff 1.0 GuidedActionTakeoff.qml -GuidedActionGripper 1.0 GuidedActionGripper.qml GuidedToolStripAction 1.0 GuidedToolStripAction.qml +GuidedValueSlider 1.0 GuidedValueSlider.qml MultiVehicleList 1.0 MultiVehicleList.qml +ObstacleDistanceOverlay 1.0 ObstacleDistanceOverlay.qml +ObstacleDistanceOverlayMap 1.0 ObstacleDistanceOverlayMap.qml +ObstacleDistanceOverlayVideo 1.0 ObstacleDistanceOverlayVideo.qml +OnScreenGimbalController 1.0 OnScreenGimbalController.qml PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml PreFlightRCCheck 1.0 PreFlightRCCheck.qml @@ -35,14 +42,7 @@ PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml ProximityRadarValues 1.0 ProximityRadarValues.qml ProximityRadarVideoView 1.0 ProximityRadarVideoView.qml -TerrainProgress 1.0 TerrainProgress.qml +QGCVideoBackground 1.0 QGCVideoBackground.qml TelemetryValuesBar 1.0 TelemetryValuesBar.qml +TerrainProgress 1.0 TerrainProgress.qml VehicleWarnings 1.0 VehicleWarnings.qml -ObstacleDistanceOverlay 1.0 ObstacleDistanceOverlay.qml -ObstacleDistanceOverlayMap 1.0 ObstacleDistanceOverlayMap.qml -ObstacleDistanceOverlayVideo 1.0 ObstacleDistanceOverlayVideo.qml -GripperMenu 1.0 GripperMenu.qml -OnScreenGimbalController 1.0 OnScreenGimbalController.qml -FlightDisplayViewGStreamer 1.0 FlightDisplayViewGStreamer.qml -FlightDisplayViewQtMultimedia 1.0 FlightDisplayViewQtMultimedia.qml -QGCVideoBackground 1.0 QGCVideoBackground.qml diff --git a/src/QmlControls/QGroundControl/FlightMap/qmldir b/src/QmlControls/QGroundControl/FlightMap/qmldir index 46e1ddac3f2..007b8c04c60 100644 --- a/src/QmlControls/QGroundControl/FlightMap/qmldir +++ b/src/QmlControls/QGroundControl/FlightMap/qmldir @@ -1,7 +1,7 @@ Module QGroundControl.FlightMap # Main view controls -FlightMap 1.0 FlightMap.qml +FlightMap 1.0 FlightMap.qml # Widgets CenterMapDropButton 1.0 CenterMapDropButton.qml @@ -13,7 +13,6 @@ MapLineArrow 1.0 MapLineArrow.qml MapScale 1.0 MapScale.qml PhotoVideoControl 1.0 PhotoVideoControl.qml QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml -QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml QGCCompassWidget 1.0 QGCCompassWidget.qml QGCPitchIndicator 1.0 QGCPitchIndicator.qml @@ -23,10 +22,8 @@ CameraTriggerIndicator 1.0 CameraTriggerIndicator.qml CustomMapItems 1.0 CustomMapItems.qml MissionItemIndicator 1.0 MissionItemIndicator.qml MissionItemIndicatorDrag 1.0 MissionItemIndicatorDrag.qml -MissionItemView 1.0 MissionItemView.qml MissionLineView 1.0 MissionLineView.qml PlanMapItems 1.0 PlanMapItems.qml -PolygonEditor 1.0 PolygonEditor.qml ProximityRadarMapView 1.0 ProximityRadarMapView.qml QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml diff --git a/src/QmlControls/QGroundControl/UTMSP/qmldir b/src/QmlControls/QGroundControl/UTMSP/qmldir index a3ed2d38b10..6392905e061 100644 --- a/src/QmlControls/QGroundControl/UTMSP/qmldir +++ b/src/QmlControls/QGroundControl/UTMSP/qmldir @@ -1,11 +1,11 @@ Module QGroundControl.UTMSP -UTMSPAdapterEditor 1.0 UTMSPAdapterEditor.qml -UTMSPMapVisuals 1.0 UTMSPMapVisuals.qml UTMSPActivationStatusBar 1.0 UTMSPActivationStatusBar.qml +UTMSPAdapterEditor 1.0 UTMSPAdapterEditor.qml +UTMSPFlightStatusIndicator 1.0 UTMSPFlightStatusIndicator.qml UTMSPMapPolygonVisuals 1.0 UTMSPMapPolygonVisuals.qml +UTMSPMapVisuals 1.0 UTMSPMapVisuals.qml UTMSPNotificationSlider 1.0 UTMSPNotificationSlider.qml -UTMSPFlightStatusIndicator 1.0 UTMSPFlightStatusIndicator.qml singleton UTMSPStateStorage 1.0 UTMSPStateStorage.qml diff --git a/src/QmlControls/Viewer3D/Models3D/qmldir b/src/QmlControls/Viewer3D/Models3D/qmldir index 676a187da37..d5a13edd846 100644 --- a/src/QmlControls/Viewer3D/Models3D/qmldir +++ b/src/QmlControls/Viewer3D/Models3D/qmldir @@ -1,7 +1,7 @@ Module Viewer3D.Models3D -Viewer3DModel 1.0 Viewer3DModel.qml CameraLightModel 1.0 CameraLightModel.qml -Waypoint3DModel 1.0 Waypoint3DModel.qml Line3D 1.0 Line3D.qml -Viewer3DVehicleItems 1.0 Viewer3DVehicleItems.qml +Viewer3DModel 1.0 Viewer3DModel.qml +Viewer3DVehicleItems 1.0 Viewer3DVehicleItems.qml +Waypoint3DModel 1.0 Waypoint3DModel.qml diff --git a/src/QtLocationPlugin/CMakeLists.txt b/src/QtLocationPlugin/CMakeLists.txt index 34ff89b4602..8a301ccfe24 100644 --- a/src/QtLocationPlugin/CMakeLists.txt +++ b/src/QtLocationPlugin/CMakeLists.txt @@ -78,14 +78,12 @@ target_precompile_headers(QGCLocation ) -set_source_files_properties(QMLControl/OfflineMap.qml PROPERTIES QT_RESOURCE_ALIAS OfflineMap.qml) set_source_files_properties(QMLControl/OfflineMapEditor.qml PROPERTIES QT_RESOURCE_ALIAS OfflineMapEditor.qml) # qt_add_qml_module(QGCLocation # URI QGroundControl.QGCLocation # VERSION 1.0 # QML_FILES -# QMLControl/OfflineMap.qml # QMLControl/OfflineMapEditor.qml # OUTPUT_TARGETS QGCLocation_targets # IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml deleted file mode 100644 index 2055d54d657..00000000000 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ /dev/null @@ -1,1312 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import QtQuick.Dialogs -import QtQuick.Controls -import QtLocation -import QtPositioning - -import QGroundControl -import QGroundControl.Controls -import QGroundControl.ScreenTools -import QGroundControl.Palette -import QGroundControl.FlightMap -import QGroundControl.QGCMapEngineManager -import QGroundControl.FactSystem -import QGroundControl.FactControls - -Item { - id: offlineMapView - anchors.fill: parent - - property var _currentSelection: null - - property string mapKey: "lastMapType" - - property var _settingsManager: QGroundControl.settingsManager - property var _settings: _settingsManager ? _settingsManager.offlineMapsSettings : null - property var _fmSettings: _settingsManager ? _settingsManager.flightMapSettings : null - property var _appSettings: _settingsManager.appSettings - property Fact _mapboxFact: _settingsManager ? _settingsManager.appSettings.mapboxToken : null - property Fact _mapboxAccountFact: _settingsManager ? _settingsManager.appSettings.mapboxAccount : null - property Fact _mapboxStyleFact: _settingsManager ? _settingsManager.appSettings.mapboxStyle : null - property Fact _esriFact: _settingsManager ? _settingsManager.appSettings.esriToken : null - property Fact _customURLFact: _settingsManager ? _settingsManager.appSettings.customURL : null - property Fact _vworldFact: _settingsManager ? _settingsManager.appSettings.vworldToken : null - - property string mapType: _fmSettings ? (_fmSettings.mapProvider.value + " " + _fmSettings.mapType.value) : "" - property bool isMapInteractive: false - property var savedCenter: undefined - property real savedZoom: 3 - property string savedMapType: "" - property bool _showPreview: true - property bool _defaultSet: offlineMapView && offlineMapView._currentSelection && offlineMapView._currentSelection.defaultSet - property real _margins: ScreenTools.defaultFontPixelWidth * 0.5 - property real _buttonSize: ScreenTools.defaultFontPixelWidth * 12 - property real _bigButtonSize: ScreenTools.defaultFontPixelWidth * 16 - - property bool _saveRealEstate: ScreenTools.isTinyScreen || ScreenTools.isShortScreen - property real _adjustableFontPointSize: _saveRealEstate ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize - - property var _mapAdjustedColor: _map.isSatelliteMap ? "white" : "black" - property bool _tooManyTiles: QGroundControl.mapEngineManager.tileCount > _maxTilesForDownload - - readonly property real minZoomLevel: 1 - readonly property real maxZoomLevel: 20 - readonly property real sliderTouchArea: ScreenTools.defaultFontPixelWidth * (ScreenTools.isTinyScreen ? 5 : (ScreenTools.isMobile ? 6 : 3)) - - readonly property int _maxTilesForDownload: _settings ? _settings.maxTilesForDownload.rawValue : 0 - - QGCPalette { id: qgcPal } - - Component.onCompleted: { - QGroundControl.mapEngineManager.loadTileSets() - updateMap() - savedCenter = _map.toCoordinate(Qt.point(_map.width / 2, _map.height / 2), false /* clipToViewPort */) - } - - Connections { - target: QGroundControl.mapEngineManager - onTileSetsChanged: { - setName.text = QGroundControl.mapEngineManager.getUniqueName() - } - onErrorMessageChanged: { - errorDialog.visible = true - } - } - - function handleChanges() { - if(isMapInteractive) { - var xl = 0 - var yl = 0 - var xr = _map.width.toFixed(0) - 1 // Must be within boundaries of visible map - var yr = _map.height.toFixed(0) - 1 // Must be within boundaries of visible map - var c0 = _map.toCoordinate(Qt.point(xl, yl), false /* clipToViewPort */) - var c1 = _map.toCoordinate(Qt.point(xr, yr), false /* clipToViewPort */) - QGroundControl.mapEngineManager.updateForCurrentView(c0.longitude, c0.latitude, c1.longitude, c1.latitude, sliderMinZoom.value, sliderMaxZoom.value, mapType) - } - } - - function updateMap() { - for (var i = 0; i < _map.supportedMapTypes.length; i++) { - if (mapType === _map.supportedMapTypes[i].name) { - _map.activeMapType = _map.supportedMapTypes[i] - handleChanges() - return - } - } - } - - function addNewSet() { - isMapInteractive = true - mapType = _fmSettings.mapProvider.value + " " + _fmSettings.mapType.value - resetMapToDefaults() - handleChanges() - _map.visible = true - _tileSetList.visible = false - infoView.visible = false - _exporTiles.visible = false - addNewSetView.visible = true - } - - function showList() { - _exporTiles.visible = false - isMapInteractive = false - _map.visible = false - _tileSetList.visible = true - infoView.visible = false - addNewSetView.visible = false - QGroundControl.mapEngineManager.resetAction(); - } - - function showExport() { - isMapInteractive = false - _map.visible = false - _tileSetList.visible = false - infoView.visible = false - addNewSetView.visible = false - _exporTiles.visible = true - } - - function showInfo() { - isMapInteractive = false - if(_currentSelection && !offlineMapView._currentSelection.deleting) { - enterInfoView() - } else - showList() - } - - function toRadian(deg) { - return deg * Math.PI / 180 - } - - function toDegree(rad) { - return rad * 180 / Math.PI - } - - function midPoint(lat1, lat2, lon1, lon2) { - var dLon = toRadian(lon2 - lon1); - lat1 = toRadian(lat1); - lat2 = toRadian(lat2); - lon1 = toRadian(lon1); - var Bx = Math.cos(lat2) * Math.cos(dLon); - var By = Math.cos(lat2) * Math.sin(dLon); - var lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), Math.sqrt((Math.cos(lat1) + Bx) * (Math.cos(lat1) + Bx) + By * By)); - var lon3 = lon1 + Math.atan2(By, Math.cos(lat1) + Bx); - return QtPositioning.coordinate(toDegree(lat3), toDegree(lon3)) - } - - function enterInfoView() { - _map.visible = true - isMapInteractive = false - savedCenter = _map.toCoordinate(Qt.point(_map.width / 2, _map.height / 2), false /* clipToViewPort */) - savedZoom = _map.zoomLevel - savedMapType = mapType - if(!offlineMapView._currentSelection.defaultSet) { - mapType = offlineMapView._currentSelection.mapTypeStr - _map.center = midPoint(offlineMapView._currentSelection.topleftLat, offlineMapView._currentSelection.bottomRightLat, offlineMapView._currentSelection.topleftLon, offlineMapView._currentSelection.bottomRightLon) - //-- Delineate Set Region - var x0 = offlineMapView._currentSelection.topleftLon - var x1 = offlineMapView._currentSelection.bottomRightLon - var y0 = offlineMapView._currentSelection.topleftLat - var y1 = offlineMapView._currentSelection.bottomRightLat - mapBoundary.topLeft = QtPositioning.coordinate(y0, x0) - mapBoundary.bottomRight = QtPositioning.coordinate(y1, x1) - mapBoundary.visible = true - // Some times, for whatever reason, the bounding box is correct (around ETH for instance), but the rectangle is drawn across the planet. - // When that happens, the "_map.fitViewportToMapItems()" below makes the map to zoom to the entire earth. - //console.log("Map boundary: " + mapBoundary.topLeft + " " + mapBoundary.bottomRight) - _map.fitViewportToMapItems() - } - _tileSetList.visible = false - addNewSetView.visible = false - infoView.visible = true - } - - function leaveInfoView() { - mapBoundary.visible = false - _map.center = savedCenter - _map.zoomLevel = savedZoom - mapType = savedMapType - } - - function resetMapToDefaults() { - _map.center = QGroundControl.flightMapPosition - _map.zoomLevel = QGroundControl.flightMapZoom - } - - onMapTypeChanged: { - updateMap() - if(isMapInteractive) { - QGroundControl.mapEngineManager.saveSetting(mapKey, mapType) - } - } - - QGCFileDialog { - id: fileDialog - folder: QGroundControl.settingsManager.appSettings.missionSavePath - nameFilters: [ qsTr("Tile Sets (*.%1)").arg(defaultSuffix) ] - defaultSuffix: _appSettings.tilesetFileExtension - - onAcceptedForSave: (file) => { - if (QGroundControl.mapEngineManager.exportSets(file)) { - exportToDiskProgress.open() - } else { - showList() - } - close() - } - - onAcceptedForLoad: (file) => { - if(!QGroundControl.mapEngineManager.importSets(file)) { - showList(); - } - close() - } - } - - MessageDialog { - id: errorDialog - visible: false - text: QGroundControl.mapEngineManager.errorMessage - //icon: StandardIcon.Critical - buttons: MessageDialog.Ok - title: qsTr("Error Message") - onButtonClicked: function (button, role) { - switch (button) { - case MessageDialog.Yes: - errorDialog.visible = false - break; - } - } - } - - Component { - id: optionsDialogComponent - - QGCPopupDialog { - title: qsTr("Offline Maps Options") - buttons: Dialog.Save | Dialog.Cancel - - onAccepted: { - QGroundControl.mapEngineManager.maxDiskCache = parseInt(maxCacheSize.text) - QGroundControl.mapEngineManager.maxMemCache = parseInt(maxCacheMemSize.text) - } - - Column { - spacing: ScreenTools.defaultFontPixelHeight / 2 - - QGCLabel { text: qsTr("Max Cache Disk Size (MB):") } - - QGCTextField { - id: maxCacheSize - maximumLength: 6 - inputMethodHints: Qt.ImhDigitsOnly - validator: IntValidator {bottom: 1; top: 262144;} - text: QGroundControl.mapEngineManager.maxDiskCache - } - - Item { width: 1; height: 1 } - - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("Max Cache Memory Size (MB):") - } - - QGCTextField { - id: maxCacheMemSize - maximumLength: 4 - inputMethodHints: Qt.ImhDigitsOnly - validator: IntValidator {bottom: 1; top: 1024;} - text: QGroundControl.mapEngineManager.maxMemCache - } - - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - font.pointSize: _adjustableFontPointSize - text: qsTr("Memory cache changes require a restart to take effect.") - } - - Item { width: 1; height: 1; visible: _mapboxFact ? _mapboxFact.visible : false } - QGCLabel { text: qsTr("Mapbox Access Token"); visible: _mapboxFact ? _mapboxFact.visible : false } - FactTextField { - fact: _mapboxFact - visible: _mapboxFact ? _mapboxFact.visible : false - maximumLength: 256 - width: ScreenTools.defaultFontPixelWidth * 30 - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("To enable Mapbox maps, enter your access token.") - visible: _mapboxFact ? _mapboxFact.visible : false - font.pointSize: _adjustableFontPointSize - } - - Item { width: 1; height: 1; visible: _mapboxAccountFact ? _mapboxAccountFact.visible : false } - QGCLabel { text: qsTr("Mapbox User Name"); visible: _mapboxAccountFact ? _mapboxAccountFact.visible : false } - FactTextField { - fact: _mapboxAccountFact - visible: _mapboxAccountFact ? _mapboxAccountFact.visible : false - maximumLength: 256 - width: ScreenTools.defaultFontPixelWidth * 30 - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("To enable custom Mapbox styles, enter your account name.") - visible: _mapboxAccountFact ? _mapboxAccountFact.visible : false - font.pointSize: _adjustableFontPointSize - } - - Item { width: 1; height: 1; visible: _mapboxStyleFact ? _mapboxStyleFact.visible : false } - QGCLabel { text: qsTr("Mapbox Style ID"); visible: _mapboxStyleFact ? _mapboxStyleFact.visible : false } - FactTextField { - fact: _mapboxStyleFact - visible: _mapboxStyleFact ? _mapboxStyleFact.visible : false - maximumLength: 256 - width: ScreenTools.defaultFontPixelWidth * 30 - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("To enable custom Mapbox styles, enter your style ID.") - visible: _mapboxStyleFact ? _mapboxStyleFact.visible : false - font.pointSize: _adjustableFontPointSize - } - - Item { width: 1; height: 1; visible: _esriFact ? _esriFact.visible : false } - QGCLabel { text: qsTr("Esri Access Token"); visible: _esriFact ? _esriFact.visible : false } - FactTextField { - fact: _esriFact - visible: _esriFact ? _esriFact.visible : false - maximumLength: 256 - width: ScreenTools.defaultFontPixelWidth * 30 - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("To enable Esri maps, enter your access token.") - visible: _esriFact ? _esriFact.visible : false - font.pointSize: _adjustableFontPointSize - } - - Item { width: 1; height: 1; visible: _vworldFact ? _vworldFact.visible : false } - QGCLabel { text: qsTr("VWorld Access Token"); visible: _vworldFact ? _vworldFact.visible : false } - FactTextField { - fact: _vworldFact - visible: _vworldFact ? _vworldFact.visible : false - maximumLength: 256 - width: ScreenTools.defaultFontPixelWidth * 30 - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("To enable VWorld maps, enter your access token.") - visible: _vworldFact ? _vworldFact.visible : false - font.pointSize: _adjustableFontPointSize - } - - Item { width: 1; height: 1; visible: _customURLFact ? _customURLFact.visible : false } - QGCLabel { text: qsTr("Custom Map URL"); visible: _customURLFact ? _customURLFact.visible : false } - FactTextField { - fact: _customURLFact - visible: _customURLFact ? _customURLFact.visible : false - maximumLength: 256 - width: ScreenTools.defaultFontPixelWidth * 30 - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("URL with {x} {y} {z} or {zoom} substitutions") - visible: _customURLFact ? _customURLFact.visible : false - font.pointSize: _adjustableFontPointSize - } - } - } - } // Component - optionsDialogComponent - - Component { - id: deleteConfirmationDialogComponent - QGCSimpleMessageDialog { - title: qsTr("Confirm Delete") - text: offlineMapView._currentSelection.defaultSet ? - qsTr("This will delete all tiles INCLUDING the tile sets you have created yourself.\n\nIs this really what you want?") : - qsTr("Delete %1 and all its tiles.\n\nIs this really what you want?").arg(offlineMapView._currentSelection.name) - buttons: Dialog.Yes | Dialog.No - - onAccepted: { - QGroundControl.mapEngineManager.deleteTileSet(offlineMapView._currentSelection) - leaveInfoView() - showList() - } - } - } - - Item { - anchors.fill: parent - - FlightMap { - id: _map - anchors.fill: parent - visible: false - allowGCSLocationCenter: true - allowVehicleLocationCenter: false - mapName: "OfflineMap" - - property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1 - - MapRectangle { - id: mapBoundary - border.width: 2 - border.color: "red" - color: Qt.rgba(1,0,0,0.05) - smooth: true - antialiasing: true - } - - Component.onCompleted: resetMapToDefaults() - - onCenterChanged: handleChanges() - onZoomLevelChanged: handleChanges() - onWidthChanged: handleChanges() - onHeightChanged: handleChanges() - - MapScale { - anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2 - anchors.bottomMargin: anchors.leftMargin - anchors.left: parent.left - anchors.bottom: parent.bottom - mapControl: _map - buttonsOnLeft: true - } - - //----------------------------------------------------------------- - //-- Show Set Info - Rectangle { - id: infoView - anchors.margins: ScreenTools.defaultFontPixelHeight - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - width: tileInfoColumn.width + (ScreenTools.defaultFontPixelWidth * 2) - height: tileInfoColumn.height + (ScreenTools.defaultFontPixelHeight * 2) - color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85) - radius: ScreenTools.defaultFontPixelWidth * 0.5 - visible: false - - property bool _extraButton: { - if(!offlineMapView._currentSelection) - return false; - var curSel = offlineMapView._currentSelection; - return !_defaultSet && ((!curSel.complete && !curSel.downloading) || (!curSel.complete && curSel.downloading)); - } - - property real _labelWidth: ScreenTools.defaultFontPixelWidth * 10 - property real _valueWidth: ScreenTools.defaultFontPixelWidth * 14 - Column { - id: tileInfoColumn - anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 - spacing: ScreenTools.defaultFontPixelHeight * 0.5 - anchors.centerIn: parent - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: offlineMapView._currentSelection ? offlineMapView._currentSelection.name : "" - font.pointSize: _saveRealEstate ? ScreenTools.defaultFontPointSize : ScreenTools.mediumFontPointSize - horizontalAlignment: Text.AlignHCenter - visible: _defaultSet - } - QGCTextField { - id: editSetName - anchors.left: parent.left - anchors.right: parent.right - visible: !_defaultSet - text: offlineMapView._currentSelection ? offlineMapView._currentSelection.name : "" - } - QGCLabel { - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: { - if(offlineMapView._currentSelection) { - if(offlineMapView._currentSelection.defaultSet) - return qsTr("System Wide Tile Cache"); - else - return "(" + offlineMapView._currentSelection.mapTypeStr + ")" - } else - return ""; - } - horizontalAlignment: Text.AlignHCenter - } - //-- Tile Sets - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: !_defaultSet && mapType !== QGroundControl.elevationProviderName - QGCLabel { text: qsTr("Zoom Levels:"); width: infoView._labelWidth; } - QGCLabel { text: offlineMapView._currentSelection ? (offlineMapView._currentSelection.minZoom + " - " + offlineMapView._currentSelection.maxZoom) : ""; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: !_defaultSet - QGCLabel { text: qsTr("Total:"); width: infoView._labelWidth; } - QGCLabel { text: (offlineMapView._currentSelection ? offlineMapView._currentSelection.totalTileCountStr : "") + " (" + (offlineMapView._currentSelection ? offlineMapView._currentSelection.totalTilesSizeStr : "") + ")"; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: offlineMapView && offlineMapView._currentSelection && !_defaultSet && offlineMapView._currentSelection.uniqueTileCount > 0 - QGCLabel { text: qsTr("Unique:"); width: infoView._labelWidth; } - QGCLabel { text: (offlineMapView._currentSelection ? offlineMapView._currentSelection.uniqueTileCountStr : "") + " (" + (offlineMapView._currentSelection ? offlineMapView._currentSelection.uniqueTileSizeStr : "") + ")"; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: offlineMapView && offlineMapView._currentSelection && !_defaultSet && !offlineMapView._currentSelection.complete - QGCLabel { text: qsTr("Downloaded:"); width: infoView._labelWidth; } - QGCLabel { text: (offlineMapView._currentSelection ? offlineMapView._currentSelection.savedTileCountStr : "") + " (" + (offlineMapView._currentSelection ? offlineMapView._currentSelection.savedTileSizeStr : "") + ")"; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: offlineMapView && offlineMapView._currentSelection && !_defaultSet && !offlineMapView._currentSelection.complete && offlineMapView._currentSelection.errorCount > 0 - QGCLabel { text: qsTr("Error Count:"); width: infoView._labelWidth; } - QGCLabel { text: offlineMapView._currentSelection ? offlineMapView._currentSelection.errorCountStr : ""; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - //-- Default Tile Set - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: _defaultSet - QGCLabel { text: qsTr("Size:"); width: infoView._labelWidth; } - QGCLabel { text: offlineMapView._currentSelection ? offlineMapView._currentSelection.savedTileSizeStr : ""; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - visible: _defaultSet - QGCLabel { text: qsTr("Tile Count:"); width: infoView._labelWidth; } - QGCLabel { text: offlineMapView._currentSelection ? offlineMapView._currentSelection.savedTileCountStr : ""; horizontalAlignment: Text.AlignRight; width: infoView._valueWidth; } - } - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - QGCButton { - text: qsTr("Resume Download") - visible: offlineMapView._currentSelection && offlineMapView._currentSelection && !_defaultSet && (!offlineMapView._currentSelection.complete && !offlineMapView._currentSelection.downloading) - width: ScreenTools.defaultFontPixelWidth * 16 - onClicked: { - if(offlineMapView._currentSelection) - offlineMapView._currentSelection.resumeDownloadTask() - } - } - QGCButton { - text: qsTr("Cancel Download") - visible: offlineMapView._currentSelection && offlineMapView._currentSelection && !_defaultSet && (!offlineMapView._currentSelection.complete && offlineMapView._currentSelection.downloading) - width: ScreenTools.defaultFontPixelWidth * 16 - onClicked: { - if(offlineMapView._currentSelection) - offlineMapView._currentSelection.cancelDownloadTask() - } - } - QGCButton { - text: qsTr("Delete") - width: ScreenTools.defaultFontPixelWidth * (infoView._extraButton ? 6 : 10) - onClicked: deleteConfirmationDialogComponent.createObject(mainWindow).open() - enabled: offlineMapView._currentSelection ? (offlineMapView._currentSelection.savedTileSize > 0) : false - } - QGCButton { - text: qsTr("Ok") - width: ScreenTools.defaultFontPixelWidth * (infoView._extraButton ? 6 : 10) - visible: !_defaultSet - enabled: editSetName.text !== "" - onClicked: { - if(editSetName.text !== _currentSelection.name) { - QGroundControl.mapEngineManager.renameTileSet(_currentSelection, editSetName.text) - } - leaveInfoView() - showList() - } - } - QGCButton { - text: _defaultSet ? qsTr("Close") : qsTr("Cancel") - width: ScreenTools.defaultFontPixelWidth * (infoView._extraButton ? 6 : 10) - onClicked: { - leaveInfoView() - showList() - } - } - } - } - } // Rectangle - infoView - - //----------------------------------------------------------------- - //-- Add new set - Item { - id: addNewSetView - anchors.fill: parent - visible: false - - Column { - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: _margins - anchors.left: parent.left - spacing: _margins - - QGCButton { - text: qsTr("Show zoom previews") - visible: !_showPreview - onClicked: _showPreview = !_showPreview - } - - Map { - id: minZoomPreview - width: addNewSetView.width / 4 - height: addNewSetView.height / 4 - center: _map.center - activeMapType: _map.activeMapType - zoomLevel: sliderMinZoom.value - visible: _showPreview - - property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1 - - plugin: Plugin { name: "QGroundControl" } - - MapScale { - anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2 - anchors.bottomMargin: anchors.leftMargin - anchors.left: parent.left - anchors.bottom: parent.bottom - mapControl: parent - zoomButtonsVisible: false - } - - Rectangle { - anchors.fill: parent - border.color: _mapAdjustedColor - color: "transparent" - - QGCMapLabel { - anchors.centerIn: parent - map: minZoomPreview - text: qsTr("Min Zoom: %1").arg(sliderMinZoom.value) - } - MouseArea { - anchors.fill: parent - onClicked: _showPreview = false - } - } - } // Map - - Map { - id: maxZoomPreview - width: minZoomPreview.width - height: minZoomPreview.height - center: _map.center - activeMapType: _map.activeMapType - zoomLevel: sliderMaxZoom.value - visible: _showPreview - - property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1 - - plugin: Plugin { name: "QGroundControl" } - - MapScale { - anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2 - anchors.bottomMargin: anchors.leftMargin - anchors.left: parent.left - anchors.bottom: parent.bottom - mapControl: parent - zoomButtonsVisible: false - } - - Rectangle { - anchors.fill: parent - border.color: _mapAdjustedColor - color: "transparent" - - QGCMapLabel { - anchors.centerIn: parent - map: maxZoomPreview - text: qsTr("Max Zoom: %1").arg(sliderMaxZoom.value) - } - MouseArea { - anchors.fill: parent - onClicked: _showPreview = false - } - } - } // Map - } - } // Item - Add new set view - - CenterMapDropButton { - topMargin: 0 - anchors.margins: _margins - anchors.left: map.left - anchors.top: map.top - map: _map - showMission: false - showAllItems: false - visible: addNewSetView.visible - } - } // Map - - //-- Add new set dialog - Rectangle { - anchors.margins: ScreenTools.defaultFontPixelWidth - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - visible: addNewSetView.visible - width: ScreenTools.defaultFontPixelWidth * (ScreenTools.isTinyScreen ? 24 : 28) - height: Math.min(parent.height - (anchors.margins * 2), addNewSetFlickable.y + addNewSetColumn.height + addNewSetLabel.anchors.margins) - color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85) - radius: ScreenTools.defaultFontPixelWidth * 0.5 - - //-- Eat mouse events - DeadMouseArea { - anchors.fill: parent - } - - QGCLabel { - id: addNewSetLabel - anchors.margins: ScreenTools.defaultFontPixelHeight / 2 - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap - text: qsTr("Add New Set") - font.pointSize: _saveRealEstate ? ScreenTools.defaultFontPointSize : ScreenTools.mediumFontPointSize - horizontalAlignment: Text.AlignHCenter - } - - QGCFlickable { - id: addNewSetFlickable - anchors.leftMargin: ScreenTools.defaultFontPixelWidth - anchors.rightMargin: anchors.leftMargin - anchors.topMargin: ScreenTools.defaultFontPixelWidth / 3 - anchors.bottomMargin: anchors.topMargin - anchors.top: addNewSetLabel.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - clip: true - contentHeight: addNewSetColumn.height - - Column { - id: addNewSetColumn - anchors.left: parent.left - anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelHeight * (ScreenTools.isTinyScreen ? 0.25 : 0.5) - - Column { - spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25 - anchors.left: parent.left - anchors.right: parent.right - QGCLabel { text: qsTr("Name:") } - QGCTextField { - id: setName - anchors.left: parent.left - anchors.right: parent.right - } - } - - Column { - spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25 - anchors.left: parent.left - anchors.right: parent.right - QGCLabel { - text: qsTr("Map type:") - visible: !_saveRealEstate - } - QGCComboBox { - id: mapCombo - anchors.left: parent.left - anchors.right: parent.right - model: QGroundControl.mapEngineManager.mapList - onActivated: (index) => { - mapType = textAt(index) - } - Component.onCompleted: { - var index = mapCombo.find(mapType) - if (index === -1) { - console.warn("Active map name not in combo", mapType) - } else { - mapCombo.currentIndex = index - } - } - } - QGCCheckBox { - anchors.left: parent.left - anchors.right: parent.right - text: qsTr("Fetch elevation data") - checked: QGroundControl.mapEngineManager.fetchElevation - onClicked: { - QGroundControl.mapEngineManager.fetchElevation = checked - handleChanges() - } - } - } - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - height: zoomColumn.height + ScreenTools.defaultFontPixelHeight * 0.5 - color: qgcPal.window - border.color: qgcPal.text - radius: ScreenTools.defaultFontPixelWidth * 0.5 - - Column { - id: zoomColumn - spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.5 - anchors.margins: ScreenTools.defaultFontPixelHeight * 0.25 - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - - QGCLabel { - text: qsTr("Min/Max Zoom Levels") - font.pointSize: _adjustableFontPointSize - anchors.horizontalCenter: parent.horizontalCenter - } - - Slider { - id: sliderMinZoom - anchors.left: parent.left - anchors.right: parent.right - height: sliderTouchArea * 1.25 - from: minZoomLevel - to: maxZoomLevel - stepSize: 1 - live: true - property bool _updateSetting: false - Component.onCompleted: { - sliderMinZoom.value = _settings.minZoomLevelDownload.rawValue - _updateSetting = true - } - onValueChanged: { - if(sliderMinZoom.value > sliderMaxZoom.value) { - sliderMaxZoom.value = sliderMinZoom.value - } - if (_updateSetting) { - // Don't update setting until after Component.onCompleted since bad values come through before that - _settings.minZoomLevelDownload.rawValue = value - } - handleChanges() - } - handle: Rectangle { - x: sliderMinZoom.leftPadding + sliderMinZoom.visualPosition * (sliderMinZoom.availableWidth - width) - y: sliderMinZoom.topPadding + sliderMinZoom.availableHeight * 0.5 - height * 0.5 - implicitWidth: sliderTouchArea - implicitHeight: sliderTouchArea - radius: sliderTouchArea * 0.5 - color: qgcPal.button - border.width: 1 - border.color: qgcPal.buttonText - Label { - text: sliderMinZoom.value - anchors.centerIn: parent - font.family: ScreenTools.normalFontFamily - font.pointSize: ScreenTools.smallFontPointSize - color: qgcPal.buttonText - } - } - } // Slider - min zoom - - Slider { - id: sliderMaxZoom - anchors.left: parent.left - anchors.right: parent.right - height: sliderTouchArea * 1.25 - from: minZoomLevel - to: maxZoomLevel - stepSize: 1 - live: true - property bool _updateSetting: false - Component.onCompleted: { - sliderMaxZoom.value = _settings.maxZoomLevelDownload.rawValue - _updateSetting = true - } - onValueChanged: { - if(sliderMaxZoom.value < sliderMinZoom.value) { - sliderMinZoom.value = sliderMaxZoom.value - } - if (_updateSetting) { - // Don't update setting until after Component.onCompleted since bad values come through before that - _settings.maxZoomLevelDownload.rawValue = value - } - handleChanges() - } - handle: Rectangle { - x: sliderMaxZoom.leftPadding + sliderMaxZoom.visualPosition * (sliderMaxZoom.availableWidth - width) - y: sliderMaxZoom.topPadding + sliderMaxZoom.availableHeight * 0.5 - height * 0.5 - implicitWidth: sliderTouchArea - implicitHeight: sliderTouchArea - radius: sliderTouchArea * 0.5 - color: qgcPal.button - border.width: 1 - border.color: qgcPal.buttonText - Label { - text: sliderMaxZoom.value - anchors.centerIn: parent - font.family: ScreenTools.normalFontFamily - font.pointSize: ScreenTools.smallFontPointSize - color: qgcPal.buttonText - } - } - } // Slider - max zoom - - GridLayout { - columns: 2 - rowSpacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.5 - QGCLabel { - text: qsTr("Tile Count:") - font.pointSize: _adjustableFontPointSize - } - QGCLabel { - text: QGroundControl.mapEngineManager.tileCountStr - font.pointSize: _adjustableFontPointSize - } - - QGCLabel { - text: qsTr("Est Size:") - font.pointSize: _adjustableFontPointSize - } - QGCLabel { - text: QGroundControl.mapEngineManager.tileSizeStr - font.pointSize: _adjustableFontPointSize - } - } - } // Column - Zoom info - } // Rectangle - Zoom info - - QGCLabel { - text: qsTr("Too many tiles") - visible: _tooManyTiles - color: qgcPal.warningText - anchors.horizontalCenter: parent.horizontalCenter - } - - Row { - id: addButtonRow - spacing: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - QGCButton { - text: qsTr("Download") - width: (addNewSetColumn.width * 0.5) - (addButtonRow.spacing * 0.5) - enabled: !_tooManyTiles && setName.text.length > 0 - onClicked: { - if(QGroundControl.mapEngineManager.findName(setName.text)) { - duplicateName.visible = true - } else { - QGroundControl.mapEngineManager.startDownload(setName.text, mapType); - showList() - } - } - } - QGCButton { - text: qsTr("Cancel") - width: (addNewSetColumn.width * 0.5) - (addButtonRow.spacing * 0.5) - onClicked: { - showList() - } - } - } - - } // Column - } // QGCFlickable - } // Rectangle - Add new set dialog - - QGCFlickable { - id: _tileSetList - clip: true - anchors.margins: ScreenTools.defaultFontPixelWidth - anchors.top: parent.top - anchors.bottom: _listButtonRow.top - anchors.left: parent.left - anchors.right: parent.right - contentHeight: _cacheList.height - ButtonGroup { - id: buttonGroup - buttons: _cacheList.children - } - Column { - id: _cacheList - width: Math.min(_tileSetList.width, (ScreenTools.defaultFontPixelWidth * 50).toFixed(0)) - spacing: ScreenTools.defaultFontPixelHeight * 0.5 - anchors.horizontalCenter: parent.horizontalCenter - OfflineMapButton { - id: firstButton - text: qsTr("Add New Set") - width: _cacheList.width - height: ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 3 : 2) - currentSet: _currentSelection - onClicked: { - offlineMapView._currentSelection = null - checked = true - addNewSet() - } - } - QGCLabel { text: QGroundControl.mapEngineManager.tileSets.count } - - Repeater { - id: repeater - model: QGroundControl.mapEngineManager.tileSets - - delegate: OfflineMapButton { - text: object.name - size: object.downloadStatus - tiles: object.totalTileCount - complete: object.complete - width: firstButton.width - height: ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 3 : 2) - currentSet: _currentSelection - tileSet: object - onClicked: { - offlineMapView._currentSelection = object - checked = true - showInfo() - } - } - } - } - } - Row { - id: _listButtonRow - visible: _tileSetList.visible - spacing: _margins - anchors.bottom: parent.bottom - anchors.margins: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - QGCButton { - text: qsTr("Import") - width: _buttonSize - visible: QGroundControl.corePlugin.options.showOfflineMapImport - onClicked: { - QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone - importDialog.open() - } - } - QGCButton { - text: qsTr("Export") - width: _buttonSize - visible: QGroundControl.corePlugin.options.showOfflineMapExport - onClicked: showExport() - } - QGCButton { - text: qsTr("Options") - width: _buttonSize - onClicked: optionsDialogComponent.createObject(mainWindow).open() - } - } - - //-- Export Tile Sets - QGCFlickable { - id: _exporTiles - clip: true - visible: false - anchors.margins: ScreenTools.defaultFontPixelWidth - anchors.top: parent.top - anchors.bottom: _exportButtonRow.top - anchors.left: parent.left - anchors.right: parent.right - contentHeight: _exportList.height - Column { - id: _exportList - width: Math.min(_exporTiles.width, (ScreenTools.defaultFontPixelWidth * 50).toFixed(0)) - spacing: ScreenTools.defaultFontPixelHeight * 0.5 - anchors.horizontalCenter: parent.horizontalCenter - QGCLabel { - text: qsTr("Select Tile Sets to Export") - font.pointSize: ScreenTools.mediumFontPointSize - } - Item { width: 1; height: ScreenTools.defaultFontPixelHeight; } - Repeater { - model: QGroundControl.mapEngineManager.tileSets - delegate: QGCCheckBox { - text: object.name - checked: object.selected - onClicked: object.selected = checked - Connections { - // This connection should theoretically not be needed since the `checked: object.selected` binding should work. - // But for some reason when the user clicks the check box taht binding breaks. Which in turns causes - // Select All/None to update the internal state but check box visible state is out of sync - target: object - onSelectedChanged: checked = object.selected - } - } - } - } - } - Row { - id: _exportButtonRow - visible: _exporTiles.visible - spacing: _margins - anchors.bottom: parent.bottom - anchors.margins: ScreenTools.defaultFontPixelWidth - anchors.horizontalCenter: parent.horizontalCenter - QGCButton { - text: qsTr("Select All") - width: _bigButtonSize - onClicked: QGroundControl.mapEngineManager.selectAll() - } - QGCButton { - text: qsTr("Select None") - width: _bigButtonSize - onClicked: QGroundControl.mapEngineManager.selectNone() - } - QGCButton { - text: qsTr("Export") - width: _bigButtonSize - enabled: QGroundControl.mapEngineManager.selectedCount > 0 - onClicked: { - fileDialog.title = qsTr("Export Tile Set") - fileDialog.openForSave() - } - } - QGCButton { - text: qsTr("Cancel") - width: _bigButtonSize - onClicked: showList() - } - } - } - - Popup { - id: exportToDiskProgress - width: mainWindow.width * 0.666 - height: mainWindow.height * 0.333 - modal: true - focus: true - parent: Overlay.overlay - x: Math.round((mainWindow.width - width) * 0.5) - y: Math.round((mainWindow.height - height) * 0.5) - closePolicy: Popup.NoAutoClose - background: Rectangle { - anchors.fill: parent - color: qgcPal.windowShadeDark - border.color: qgcPal.text - radius: ScreenTools.defaultFontPixelWidth - } - Column { - id: exportCol - spacing: ScreenTools.defaultFontPixelHeight - width: parent.width - anchors.centerIn: parent - QGCLabel { - text: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting ? qsTr("Tile Set Export Progress") : qsTr("Tile Set Export Completed") - font.bold: true - font.pointSize: ScreenTools.mediumFontPointSize - anchors.horizontalCenter: parent.horizontalCenter - } - ProgressBar { - width: parent.width * 0.45 - from: 0 - to: 100 - value: QGroundControl.mapEngineManager.actionProgress - anchors.horizontalCenter: parent.horizontalCenter - } - BusyIndicator { - visible: QGroundControl.mapEngineManager ? QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting : false - running: QGroundControl.mapEngineManager ? QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting : false - width: exportCloseButton.height - height: exportCloseButton.height - anchors.horizontalCenter: parent.horizontalCenter - } - QGCButton { - id: exportCloseButton - text: qsTr("Close") - width: _buttonSize - visible: !QGroundControl.mapEngineManager.exporting - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - exportToDiskProgress.close() - } - } - } - } - - Popup { - id: importDialog - width: mainWindow.width * 0.666 - height: importCol.height * 1.5 - modal: true - focus: true - parent: Overlay.overlay - x: Math.round((mainWindow.width - width) * 0.5) - y: Math.round((mainWindow.height - height) * 0.5) - closePolicy: Popup.NoAutoClose - background: Rectangle { - anchors.fill: parent - color: qgcPal.windowShadeDark - border.color: qgcPal.text - radius: ScreenTools.defaultFontPixelWidth - } - Column { - id: importCol - spacing: ScreenTools.defaultFontPixelHeight - width: parent.width - anchors.centerIn: parent - QGCLabel { - text: { - if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone) { - return qsTr("Map Tile Set Import"); - } else if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting) { - return qsTr("Map Tile Set import Progress"); - } else { - return qsTr("Map Tile Set import Completed"); - } - } - font.bold: true - font.pointSize: ScreenTools.mediumFontPointSize - anchors.horizontalCenter: parent.horizontalCenter - } - ProgressBar { - width: parent.width * 0.45 - from: 0 - to: 100 - visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting - value: QGroundControl.mapEngineManager.actionProgress - anchors.horizontalCenter: parent.horizontalCenter - } - BusyIndicator { - visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting - running: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting - width: ScreenTools.defaultFontPixelWidth * 2 - height: width - anchors.horizontalCenter: parent.horizontalCenter - } - Column { - id: mapSetButtons - spacing: ScreenTools.defaultFontPixelHeight - width: ScreenTools.defaultFontPixelWidth * 24 - anchors.horizontalCenter: parent.horizontalCenter - QGCRadioButton { - text: qsTr("Append to existing set") - checked: !QGroundControl.mapEngineManager.importReplace - onClicked: QGroundControl.mapEngineManager.importReplace = !checked - visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone - } - QGCRadioButton { - text: qsTr("Replace existing set") - checked: QGroundControl.mapEngineManager.importReplace - onClicked: QGroundControl.mapEngineManager.importReplace = checked - visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone - } - } - QGCButton { - text: qsTr("Close") - width: _bigButtonSize * 1.25 - visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionDone - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - showList(); - importDialog.close() - } - } - Row { - spacing: _margins - visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone - anchors.horizontalCenter: parent.horizontalCenter - QGCButton { - text: qsTr("Import") - width: _bigButtonSize * 1.25 - onClicked: { - importDialog.close() - fileDialog.title = qsTr("import Tile") - fileDialog.openForLoad() - } - } - QGCButton { - text: qsTr("Cancel") - width: _bigButtonSize * 1.25 - onClicked: { - showList(); - importDialog.close() - } - } - } - } - } -} diff --git a/src/UI/ExitWithErrorWindow.qml b/src/UI/ExitWithErrorWindow.qml deleted file mode 100644 index 9cd4511cc83..00000000000 --- a/src/UI/ExitWithErrorWindow.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Dialogs -import QtQuick.Layouts -import QtQuick.Window - -ApplicationWindow { - id: errorWindow - minimumWidth: messageArea.width + 60 - minimumHeight: messageArea.height + 60 - width: messageArea.width + 60 - height: messageArea.height + 60 - visible: true - - //------------------------------------------------------------------------- - //-- Main, full window background (Fly View) - background: Item { - id: rootBackground - anchors.fill: parent - Rectangle { - anchors.fill: parent - color: "#000000" - } - } - - Column { - id: messageArea - spacing: 20 - anchors.centerIn: parent - Label { - width: 600 - text: errorMessage - color: "#eecc44" - wrapMode: Text.WordWrap - anchors.horizontalCenter: parent.horizontalCenter - } - Button { - text: qsTr("Close") - highlighted: true - onClicked: errorWindow.close() - anchors.horizontalCenter: parent.horizontalCenter - } - } - -} diff --git a/src/UI/toolbar/BatteryIndicatorContentItem.qml b/src/UI/toolbar/BatteryIndicatorContentItem.qml deleted file mode 100644 index 3acf4776f26..00000000000 --- a/src/UI/toolbar/BatteryIndicatorContentItem.qml +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick -import QtQuick.Layouts - -import QGroundControl -import QGroundControl.Controls -import QGroundControl.MultiVehicleManager -import QGroundControl.ScreenTools -import QGroundControl.Palette -import QGroundControl.FactSystem -import QGroundControl.FactControls -import MAVLink - -// This is the contentItem portion of the ToolIndicatorPage for the Battery toolbar item. -// It works for both PX4 and APM firmware. - -ColumnLayout { - id: mainLayout - spacing: ScreenTools.defaultFontPixelHeight - - property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle - - Component { - id: batteryValuesAvailableComponent - - QtObject { - property bool functionAvailable: battery.function.rawValue !== MAVLink.MAV_BATTERY_FUNCTION_UNKNOWN - property bool showFunction: functionAvailable && battery.function.rawValue != MAVLink.MAV_BATTERY_FUNCTION_ALL - property bool temperatureAvailable: !isNaN(battery.temperature.rawValue) - property bool currentAvailable: !isNaN(battery.current.rawValue) - property bool mahConsumedAvailable: !isNaN(battery.mahConsumed.rawValue) - property bool timeRemainingAvailable: !isNaN(battery.timeRemaining.rawValue) - property bool chargeStateAvailable: battery.chargeState.rawValue !== MAVLink.MAV_BATTERY_CHARGE_STATE_UNDEFINED - } - } - - QGCLabel { - Layout.alignment: Qt.AlignCenter - text: qsTr("Battery Status") - font.bold: true - } - - RowLayout { - spacing: ScreenTools.defaultFontPixelWidth - - ColumnLayout { - Repeater { - id: col1Repeater - model: _activeVehicle ? _activeVehicle.batteries : 0 - - ColumnLayout { - spacing: 0 - - property var batteryValuesAvailable: nameAvailableLoader.item - - Loader { - id: nameAvailableLoader - sourceComponent: batteryValuesAvailableComponent - - property var battery: object - } - - QGCLabel { text: qsTr("Battery %1").arg(object.id.rawValue); visible: col1Repeater.count !== 1 } - QGCLabel { text: qsTr("Charge State"); visible: batteryValuesAvailable.chargeStateAvailable } - QGCLabel { text: qsTr("Remaining"); visible: batteryValuesAvailable.timeRemainingAvailable } - QGCLabel { text: qsTr("Remaining") } - QGCLabel { text: qsTr("Voltage") } - QGCLabel { text: qsTr("Consumed"); visible: batteryValuesAvailable.mahConsumedAvailable } - QGCLabel { text: qsTr("Temperature"); visible: batteryValuesAvailable.temperatureAvailable } - QGCLabel { text: qsTr("Function"); visible: batteryValuesAvailable.showFunction } - } - } - } - - ColumnLayout { - Repeater { - id: col2Repeater - model: _activeVehicle ? _activeVehicle.batteries : 0 - - ColumnLayout { - spacing: 0 - - property var batteryValuesAvailable: valueAvailableLoader.item - - Loader { - id: valueAvailableLoader - sourceComponent: batteryValuesAvailableComponent - - property var battery: object - } - - QGCLabel { text: ""; visible: col2Repeater.count !== 1 } - QGCLabel { text: object.chargeState.enumStringValue; visible: batteryValuesAvailable.chargeStateAvailable } - QGCLabel { text: object.timeRemainingStr.value; visible: batteryValuesAvailable.timeRemainingAvailable } - QGCLabel { text: object.percentRemaining.valueString + " " + object.percentRemaining.units } - QGCLabel { text: object.voltage.valueString + " " + object.voltage.units } - QGCLabel { text: object.mahConsumed.valueString + " " + object.mahConsumed.units; visible: batteryValuesAvailable.mahConsumedAvailable } - QGCLabel { text: object.temperature.valueString + " " + object.temperature.units; visible: batteryValuesAvailable.temperatureAvailable } - QGCLabel { text: object.function.enumStringValue; visible: batteryValuesAvailable.showFunction } - } - } - } - } -} diff --git a/src/UI/toolbar/VTOLModeIndicator.qml b/src/UI/toolbar/VTOLModeIndicator.qml deleted file mode 100644 index e601a49f37c..00000000000 --- a/src/UI/toolbar/VTOLModeIndicator.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2020 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -import QGroundControl -import QGroundControl.Controls -import QGroundControl.MultiVehicleManager -import QGroundControl.ScreenTools -import QGroundControl.Palette - -//------------------------------------------------------------------------- -//-- VTOL Mode Indicator -QGCComboBox { - anchors.verticalCenter: parent.verticalCenter - alternateText: _fwdFlight ? qsTr("VTOL: FW") : qsTr("VTOL: MR") - model: [ qsTr("VTOL: Multi-Rotor"), qsTr("VTOL: Fixed Wing") ] - font.pointSize: ScreenTools.mediumFontPointSize - currentIndex: -1 - sizeToContents: true - - property bool showIndicator: _activeVehicle.vtol && _activeVehicle.px4Firmware - - property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle - property bool _fwdFlight: _activeVehicle.vtolInFwdFlight - - onActivated: (index) => { - if (index == 0) { - if (_fwdFlight) { - mainWindow.vtolTransitionToMRFlightRequest() - } - } else { - if (!_fwdFlight) { - mainWindow.vtolTransitionToFwdFlightRequest() - } - } - currentIndex = -1 - } -}