Unverified Commit a1cf6a3b authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8013 from DonLakeFlyer/CreatePlan

Plan: Create Plan
parents 6282fe56 134ccd28
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<file alias="pipHide.svg">src/FlightMap/Images/pipHide.svg</file> <file alias="pipHide.svg">src/FlightMap/Images/pipHide.svg</file>
<file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file> <file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file>
<file alias="Plan.svg">src/ui/toolbar/Images/Plan.svg</file> <file alias="Plan.svg">src/ui/toolbar/Images/Plan.svg</file>
<file alias="PlanCreator/CustomPlanCreator.png">src/MissionManager/CustomPlanCreator.png</file> <file alias="PlanCreator/BlankPlanCreator.png">src/MissionManager/BlankPlanCreator.png</file>
<file alias="PlanCreator/CorridorScanPlanCreator.png">src/MissionManager/CorridorScanPlanCreator.png</file> <file alias="PlanCreator/CorridorScanPlanCreator.png">src/MissionManager/CorridorScanPlanCreator.png</file>
<file alias="PlanCreator/StructureScanPlanCreator.png">src/MissionManager/StructureScanPlanCreator.png</file> <file alias="PlanCreator/StructureScanPlanCreator.png">src/MissionManager/StructureScanPlanCreator.png</file>
<file alias="PlanCreator/SurveyPlanCreator.png">src/MissionManager/SurveyPlanCreator.png</file> <file alias="PlanCreator/SurveyPlanCreator.png">src/MissionManager/SurveyPlanCreator.png</file>
......
...@@ -592,7 +592,7 @@ HEADERS += \ ...@@ -592,7 +592,7 @@ HEADERS += \
src/MissionManager/ComplexMissionItem.h \ src/MissionManager/ComplexMissionItem.h \
src/MissionManager/CorridorScanComplexItem.h \ src/MissionManager/CorridorScanComplexItem.h \
src/MissionManager/CorridorScanPlanCreator.h \ src/MissionManager/CorridorScanPlanCreator.h \
src/MissionManager/CustomPlanCreator.h \ src/MissionManager/BlankPlanCreator.h \
src/MissionManager/FixedWingLandingComplexItem.h \ src/MissionManager/FixedWingLandingComplexItem.h \
src/MissionManager/GeoFenceController.h \ src/MissionManager/GeoFenceController.h \
src/MissionManager/GeoFenceManager.h \ src/MissionManager/GeoFenceManager.h \
...@@ -823,7 +823,7 @@ SOURCES += \ ...@@ -823,7 +823,7 @@ SOURCES += \
src/MissionManager/ComplexMissionItem.cc \ src/MissionManager/ComplexMissionItem.cc \
src/MissionManager/CorridorScanComplexItem.cc \ src/MissionManager/CorridorScanComplexItem.cc \
src/MissionManager/CorridorScanPlanCreator.cc \ src/MissionManager/CorridorScanPlanCreator.cc \
src/MissionManager/CustomPlanCreator.cc \ src/MissionManager/BlankPlanCreator.cc \
src/MissionManager/FixedWingLandingComplexItem.cc \ src/MissionManager/FixedWingLandingComplexItem.cc \
src/MissionManager/GeoFenceController.cc \ src/MissionManager/GeoFenceController.cc \
src/MissionManager/GeoFenceManager.cc \ src/MissionManager/GeoFenceManager.cc \
......
...@@ -102,7 +102,6 @@ ...@@ -102,7 +102,6 @@
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file> <file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file> <file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file>
<file alias="QGroundControl/Controls/PlanEditToolbar.qml">src/PlanView/PlanEditToolbar.qml</file> <file alias="QGroundControl/Controls/PlanEditToolbar.qml">src/PlanView/PlanEditToolbar.qml</file>
<file alias="QGroundControl/Controls/PlanStartOverlay.qml">src/PlanView/PlanStartOverlay.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file> <file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file> <file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckModel.qml">src/QmlControls/PreFlightCheckModel.qml</file> <file alias="QGroundControl/Controls/PreFlightCheckModel.qml">src/QmlControls/PreFlightCheckModel.qml</file>
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "BlankPlanCreator.h"
#include "PlanMasterController.h"
#include "MissionSettingsItem.h"
#include "FixedWingLandingComplexItem.h"
BlankPlanCreator::BlankPlanCreator(PlanMasterController* planMasterController, QObject* parent)
: PlanCreator(planMasterController, tr("Blank"), QStringLiteral("/qmlimages/PlanCreator/BlankPlanCreator.png"), parent)
{
}
void BlankPlanCreator::createPlan(const QGeoCoordinate& /*mapCenterCoord*/)
{
_planMasterController->removeAll();
}
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
#include "PlanCreator.h" #include "PlanCreator.h"
class CustomPlanCreator : public PlanCreator class BlankPlanCreator : public PlanCreator
{ {
Q_OBJECT Q_OBJECT
public: public:
CustomPlanCreator(PlanMasterController* planMasterController, QObject* parent = nullptr); BlankPlanCreator(PlanMasterController* planMasterController, QObject* parent = nullptr);
Q_INVOKABLE void createPlan(const QGeoCoordinate& mapCenterCoord) final; Q_INVOKABLE void createPlan(const QGeoCoordinate& mapCenterCoord) final;
}; };
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "CustomPlanCreator.h"
#include "PlanMasterController.h"
#include "MissionSettingsItem.h"
#include "FixedWingLandingComplexItem.h"
CustomPlanCreator::CustomPlanCreator(PlanMasterController* planMasterController, QObject* parent)
: PlanCreator(planMasterController, tr("Custom"), QStringLiteral("/qmlimages/PlanCreator/CustomPlanCreator.png"), parent)
{
}
void CustomPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord)
{
_planMasterController->removeAll();
VisualMissionItem* takeoffItem = _missionController->insertSimpleMissionItem(mapCenterCoord, -1);
takeoffItem->setWizardMode(true);
_missionController->insertSimpleMissionItem(mapCenterCoord.atDistanceAndAzimuth(50, 135), -1);
_missionController->insertSimpleMissionItem(mapCenterCoord.atDistanceAndAzimuth(50, -135),-1);
if (_planMasterController->managerVehicle()->fixedWing()) {
FixedWingLandingComplexItem* landingItem = qobject_cast<FixedWingLandingComplexItem*>(_missionController->insertComplexMissionItem(MissionController::patternFWLandingName, mapCenterCoord, -1));
landingItem->setWizardMode(true);
landingItem->setLoiterDragAngleOnly(true);
} else {
MissionSettingsItem* settingsItem = _missionController->visualItems()->value<MissionSettingsItem*>(0);
settingsItem->setMissionEndRTL(true);
}
_missionController->setCurrentPlanViewIndex(takeoffItem->sequenceNumber(), true);
}
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "SurveyPlanCreator.h" #include "SurveyPlanCreator.h"
#include "StructureScanPlanCreator.h" #include "StructureScanPlanCreator.h"
#include "CorridorScanPlanCreator.h" #include "CorridorScanPlanCreator.h"
#include "CustomPlanCreator.h" #include "BlankPlanCreator.h"
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
#include "AirspaceFlightPlanProvider.h" #include "AirspaceFlightPlanProvider.h"
#endif #endif
...@@ -601,19 +601,19 @@ void PlanMasterController::_updatePlanCreatorsList(void) ...@@ -601,19 +601,19 @@ void PlanMasterController::_updatePlanCreatorsList(void)
if (!_flyView) { if (!_flyView) {
if (!_planCreators) { if (!_planCreators) {
_planCreators = new QmlObjectListModel(this); _planCreators = new QmlObjectListModel(this);
_planCreators->append(new BlankPlanCreator(this, this));
_planCreators->append(new SurveyPlanCreator(this, this)); _planCreators->append(new SurveyPlanCreator(this, this));
_planCreators->append(new CorridorScanPlanCreator(this, this)); _planCreators->append(new CorridorScanPlanCreator(this, this));
_planCreators->append(new CustomPlanCreator(this, this));
emit planCreatorsChanged(_planCreators); emit planCreatorsChanged(_planCreators);
} }
if (_managerVehicle->fixedWing()) { if (_managerVehicle->fixedWing()) {
if (_planCreators->count() == 4) { if (_planCreators->count() == 4) {
_planCreators->removeAt(_planCreators->count() - 2); _planCreators->removeAt(_planCreators->count() - 1);
} }
} else { } else {
if (_planCreators->count() != 4) { if (_planCreators->count() != 4) {
_planCreators->insert(_planCreators->count() - 1, new StructureScanPlanCreator(this, this)); _planCreators->append(new StructureScanPlanCreator(this, this));
} }
} }
} }
......
...@@ -24,6 +24,8 @@ Column { ...@@ -24,6 +24,8 @@ Column {
SectionHeader { SectionHeader {
id: cameraSectionHeader id: cameraSectionHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Camera") text: qsTr("Camera")
checked: false checked: false
} }
......
...@@ -125,6 +125,8 @@ Rectangle { ...@@ -125,6 +125,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: corridorHeader id: corridorHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Corridor") text: qsTr("Corridor")
} }
...@@ -183,6 +185,8 @@ Rectangle { ...@@ -183,6 +185,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: terrainHeader id: terrainHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Terrain") text: qsTr("Terrain")
checked: missionItem.followTerrain checked: missionItem.followTerrain
} }
...@@ -229,6 +233,8 @@ Rectangle { ...@@ -229,6 +233,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: statsHeader id: statsHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Statistics") text: qsTr("Statistics")
} }
......
...@@ -53,6 +53,8 @@ Rectangle { ...@@ -53,6 +53,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: loiterPointSection id: loiterPointSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Loiter point") text: qsTr("Loiter point")
} }
...@@ -102,6 +104,8 @@ Rectangle { ...@@ -102,6 +104,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: landingPointSection id: landingPointSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Landing point") text: qsTr("Landing point")
} }
...@@ -182,6 +186,8 @@ Rectangle { ...@@ -182,6 +186,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: cameraSection id: cameraSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Camera") text: qsTr("Camera")
visible: _showCameraSection visible: _showCameraSection
} }
......
...@@ -111,6 +111,8 @@ QGCFlickable { ...@@ -111,6 +111,8 @@ QGCFlickable {
SectionHeader { SectionHeader {
id: insertSection id: insertSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Insert GeoFence") text: qsTr("Insert GeoFence")
} }
...@@ -140,6 +142,8 @@ QGCFlickable { ...@@ -140,6 +142,8 @@ QGCFlickable {
SectionHeader { SectionHeader {
id: polygonSection id: polygonSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Polygon Fences") text: qsTr("Polygon Fences")
} }
...@@ -213,6 +217,8 @@ QGCFlickable { ...@@ -213,6 +217,8 @@ QGCFlickable {
SectionHeader { SectionHeader {
id: circleSection id: circleSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Circular Fences") text: qsTr("Circular Fences")
} }
...@@ -303,6 +309,8 @@ QGCFlickable { ...@@ -303,6 +309,8 @@ QGCFlickable {
SectionHeader { SectionHeader {
id: breachReturnSection id: breachReturnSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Breach Return Point") text: qsTr("Breach Return Point")
} }
......
...@@ -109,6 +109,8 @@ Rectangle { ...@@ -109,6 +109,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: missionEndHeader id: missionEndHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Mission End") text: qsTr("Mission End")
checked: true checked: true
} }
...@@ -129,6 +131,8 @@ Rectangle { ...@@ -129,6 +131,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: vehicleInfoSectionHeader id: vehicleInfoSectionHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Vehicle Info") text: qsTr("Vehicle Info")
visible: _offlineEditing && !_waypointsOnlyMode visible: _offlineEditing && !_waypointsOnlyMode
checked: false checked: false
...@@ -193,6 +197,8 @@ Rectangle { ...@@ -193,6 +197,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: plannedHomePositionSection id: plannedHomePositionSection
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Planned Home Position") text: qsTr("Planned Home Position")
visible: !_vehicleHasHomePosition visible: !_vehicleHasHomePosition
checked: false checked: false
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
Item {
id: _root
property var planMasterController
property var mapControl
property real _radius: ScreenTools.defaultFontPixelWidth / 2
property real _margins: ScreenTools.defaultFontPixelWidth
function _mapCenter() {
var centerPoint = Qt.point(mapControl.centerViewport.left + (mapControl.centerViewport.width / 2), mapControl.centerViewport.top + (mapControl.centerViewport.height / 2))
return mapControl.toCoordinate(centerPoint, false /* clipToViewPort */)
}
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
Rectangle {
anchors.fill: parent
radius: _radius
color: "white"
opacity: 0.75
}
// Close Icon
QGCColoredImage {
anchors.margins: ScreenTools.defaultFontPixelWidth / 2
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.defaultFontPixelHeight
height: width
sourceSize.height: width
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
color: "black"
QGCMouseArea {
fillItem: parent
onClicked: _root.visible = false
}
}
QGCLabel {
id: title
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
text: qsTr("Create Plan")
color: "black"
}
QGCFlickable {
id: flickable
anchors.margins: _margins
anchors.top: title.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
contentHeight: creatorFlow.height
contentWidth: creatorFlow.width
Flow {
id: creatorFlow
width: flickable.width
spacing: _margins
Repeater {
model: _planMasterController.planCreators
Rectangle {
id: button
width: ScreenTools.defaultFontPixelHeight * 10
height: width
color: button.pressed || button.highlighted ? qgcPal.buttonHighlight : qgcPal.button
property bool highlighted: mouseArea.containsMouse
property bool pressed: mouseArea.pressed
Image {
anchors.margins: _margins
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
source: object.imageResource
fillMode: Image.PreserveAspectFit
mipmap: true
}
QGCLabel {
anchors.margins: _margins
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
text: object.name
color: button.pressed || button.highlighted ? qgcPal.buttonHighlightText : qgcPal.buttonText
}
QGCMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
preventStealing: true
onClicked: { object.createPlan(_mapCenter()); _root.visible = false }
}
}
}
}
}
}
...@@ -28,6 +28,7 @@ import QGroundControl.Airspace 1.0 ...@@ -28,6 +28,7 @@ import QGroundControl.Airspace 1.0
import QGroundControl.Airmap 1.0 import QGroundControl.Airmap 1.0
Item { Item {
id: _root
property bool planControlColapsed: false property bool planControlColapsed: false
...@@ -110,6 +111,12 @@ Item { ...@@ -110,6 +111,12 @@ Item {
} }
} }
onVisibleChanged: {
if (visible && !_planMasterController.containsItems) {
toolStrip.simulateClick(toolStrip.fileButtonIndex)
}
}
Connections { Connections {
target: _appSettings ? _appSettings.defaultMissionItemAltitude : null target: _appSettings ? _appSettings.defaultMissionItemAltitude : null
onRawValueChanged: { onRawValueChanged: {
...@@ -476,18 +483,6 @@ Item { ...@@ -476,18 +483,6 @@ Item {
} }
} }
PlanStartOverlay {
id: startOverlay
x: editorMap.centerViewport.left
y: editorMap.centerViewport.top
width: editorMap.centerViewport.width
height: editorMap.centerViewport.height
z: QGroundControl.zOrderMapItems + 2
visible: !_planMasterController.containsItems
planMasterController: _planMasterController
mapControl: editorMap
}
// Add the mission item visuals to the map // Add the mission item visuals to the map
Repeater { Repeater {
model: _editingLayer == _layerMission ? _missionController.visualItems : undefined model: _editingLayer == _layerMission ? _missionController.visualItems : undefined
...@@ -609,6 +604,8 @@ Item { ...@@ -609,6 +604,8 @@ Item {
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
maxHeight: mapScale.y - toolStrip.y maxHeight: mapScale.y - toolStrip.y
property int fileButtonIndex: 1
property bool _isRally: _editingLayer == _layerRallyPoints property bool _isRally: _editingLayer == _layerRallyPoints
model: [ model: [
...@@ -939,19 +936,14 @@ Item { ...@@ -939,19 +936,14 @@ Item {
} }
} }
property var createPlanRemoveAllPromptDialogMapCenter
property var createPlanRemoveAllPromptDialogPlanCreator
Component { Component {
id: removeAllPromptDialog id: createPlanRemoveAllPromptDialog
QGCViewMessage { QGCViewMessage {
message: qsTr("Are you sure you want to remove all items and create a new plan? ") + message: qsTr("Are you sure you want to remove current plan and create a new plan? ")
(_planMasterController.offline ? "" : qsTr("This will also remove all items from the vehicle."))
function accept() { function accept() {
if (_planMasterController.offline) { createPlanRemoveAllPromptDialogPlanCreator.createPlan(createPlanRemoveAllPromptDialogMapCenter)
_planMasterController.removeAll()
} else {
_planMasterController.removeAllFromVehicle()
}
_missionController.setCurrentPlanViewIndex(0, true)
startOverlay.visible = true
hideDialog() hideDialog()
} }
} }
...@@ -964,7 +956,6 @@ Item { ...@@ -964,7 +956,6 @@ Item {
function accept() { function accept() {
_planMasterController.removeAllFromVehicle() _planMasterController.removeAllFromVehicle()
_missionController.setCurrentPlanViewIndex(0, true) _missionController.setCurrentPlanViewIndex(0, true)
startOverlay.visible = true
hideDialog() hideDialog()
} }
} }
...@@ -1027,42 +1018,115 @@ Item { ...@@ -1027,42 +1018,115 @@ Item {
Component { Component {
id: syncDropPanel id: syncDropPanel
Column { ColumnLayout {
id: columnHolder id: columnHolder
spacing: _margin spacing: _margin
property string _overwriteText: (_editingLayer == _layerMission) ? qsTr("Mission overwrite") : ((_editingLayer == _layerGeoFence) ? qsTr("GeoFence overwrite") : qsTr("Rally Points overwrite")) property string _overwriteText: (_editingLayer == _layerMission) ? qsTr("Mission overwrite") : ((_editingLayer == _layerGeoFence) ? qsTr("GeoFence overwrite") : qsTr("Rally Points overwrite"))
QGCLabel { QGCLabel {
width: sendSaveGrid.width id: unsavedChangedLabel
Layout.fillWidth: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: _planMasterController.dirty ? text: activeVehicle ?
(activeVehicle ? qsTr("You have unsaved changes. You should upload to your vehicle, or save to a file.") :
qsTr("You have unsaved changes. You should upload to your vehicle, or save to a file:") :
qsTr("You have unsaved changes.") qsTr("You have unsaved changes.")
) : visible: _planMasterController.dirty
qsTr("Plan File:") }
SectionHeader {
id: createSection
Layout.fillWidth: true
text: qsTr("Create Plan")
showSpacer: false
} }
GridLayout { GridLayout {
id: sendSaveGrid
columns: 2 columns: 2
anchors.margins: _margin columnSpacing: _margin
rowSpacing: _margin
Layout.fillWidth: true
visible: createSection.visible
Repeater {
model: _planMasterController.planCreators
Rectangle {
id: button
width: ScreenTools.defaultFontPixelHeight * 7
height: planCreatorNameLabel.y + planCreatorNameLabel.height
color: button.pressed || button.highlighted ? qgcPal.buttonHighlight : qgcPal.button
property bool highlighted: mouseArea.containsMouse
property bool pressed: mouseArea.pressed
Image {
id: planCreatorImage
anchors.left: parent.left
anchors.right: parent.right
source: object.imageResource
sourceSize.width: width
fillMode: Image.PreserveAspectFit
mipmap: true
}
QGCLabel {
id: planCreatorNameLabel
anchors.top: planCreatorImage.bottom
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
text: object.name
color: button.pressed || button.highlighted ? qgcPal.buttonHighlightText : qgcPal.buttonText
}
QGCMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
preventStealing: true
onClicked: {
if (_planMasterController.containsItems) {
createPlanRemoveAllPromptDialogMapCenter = _mapCenter()
createPlanRemoveAllPromptDialogPlanCreator = object
mainWindow.showComponentDialog(createPlanRemoveAllPromptDialog, qsTr("Create Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
} else {
object.createPlan(_mapCenter())
}
dropPanel.hide()
}
function _mapCenter() {
var centerPoint = Qt.point(editorMap.centerViewport.left + (editorMap.centerViewport.width / 2), editorMap.centerViewport.top + (editorMap.centerViewport.height / 2))
return editorMap.toCoordinate(centerPoint, false /* clipToViewPort */)
}
}
}
}
}
SectionHeader {
id: storageSection
Layout.fillWidth: true
text: qsTr("Storage")
}
GridLayout {
columns: 3
rowSpacing: _margin rowSpacing: _margin
columnSpacing: ScreenTools.defaultFontPixelWidth columnSpacing: ScreenTools.defaultFontPixelWidth
visible: storageSection.visible
QGCButton { /*QGCButton {
text: qsTr("New...") text: qsTr("New...")
Layout.fillWidth: true Layout.fillWidth: true
onClicked: { onClicked: {
dropPanel.hide() dropPanel.hide()
if (_planMasterController.containsItems) { if (_planMasterController.containsItems) {
mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
} else {
startOverlay.visible = true
}
} }
} }
}*/
QGCButton { QGCButton {
text: qsTr("Open...") text: qsTr("Open...")
...@@ -1103,8 +1167,9 @@ Item { ...@@ -1103,8 +1167,9 @@ Item {
} }
QGCButton { QGCButton {
Layout.columnSpan: 3
Layout.fillWidth: true
text: qsTr("Save Mission Waypoints As KML...") text: qsTr("Save Mission Waypoints As KML...")
Layout.columnSpan: 2
enabled: !_planMasterController.syncInProgress && _visualItems.count > 1 enabled: !_planMasterController.syncInProgress && _visualItems.count > 1
onClicked: { onClicked: {
// First point does not count // First point does not count
...@@ -1116,17 +1181,19 @@ Item { ...@@ -1116,17 +1181,19 @@ Item {
_planMasterController.saveKmlToSelectedFile() _planMasterController.saveKmlToSelectedFile()
} }
} }
}
Rectangle { SectionHeader {
width: parent.width * 0.8 id: vehicleSection
height: 1
color: qgcPal.text
opacity: 0.5
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2 text: qsTr("Vehicle")
} }
RowLayout {
Layout.fillWidth: true
spacing: _margin
visible: vehicleSection.visible
QGCButton { QGCButton {
text: qsTr("Upload") text: qsTr("Upload")
Layout.fillWidth: true Layout.fillWidth: true
...@@ -1154,7 +1221,7 @@ Item { ...@@ -1154,7 +1221,7 @@ Item {
} }
QGCButton { QGCButton {
text: qsTr("Clear Vehicle Mission") text: qsTr("Clear")
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2 Layout.columnSpan: 2
enabled: !_planMasterController.offline && !_planMasterController.syncInProgress enabled: !_planMasterController.offline && !_planMasterController.syncInProgress
...@@ -1164,8 +1231,9 @@ Item { ...@@ -1164,8 +1231,9 @@ Item {
mainWindow.showComponentDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) mainWindow.showComponentDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} }
} }
} }
} }
} }
} }
...@@ -131,6 +131,8 @@ Rectangle { ...@@ -131,6 +131,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: scanHeader id: scanHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Scan") text: qsTr("Scan")
} }
...@@ -201,6 +203,8 @@ Rectangle { ...@@ -201,6 +203,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: statsHeader id: statsHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Statistics") text: qsTr("Statistics")
} }
......
...@@ -125,6 +125,8 @@ Rectangle { ...@@ -125,6 +125,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: transectsHeader id: transectsHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Transects") text: qsTr("Transects")
} }
...@@ -234,6 +236,8 @@ Rectangle { ...@@ -234,6 +236,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: terrainHeader id: terrainHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Terrain") text: qsTr("Terrain")
checked: missionItem.followTerrain checked: missionItem.followTerrain
} }
...@@ -281,6 +285,8 @@ Rectangle { ...@@ -281,6 +285,8 @@ Rectangle {
SectionHeader { SectionHeader {
id: statsHeader id: statsHeader
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Statistics") text: qsTr("Statistics")
} }
...@@ -357,8 +363,6 @@ Rectangle { ...@@ -357,8 +363,6 @@ Rectangle {
SectionHeader { SectionHeader {
id: presectsTransectsHeader id: presectsTransectsHeader
anchors.left: undefined
anchors.right: undefined
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Transects") text: qsTr("Transects")
} }
...@@ -401,8 +405,6 @@ Rectangle { ...@@ -401,8 +405,6 @@ Rectangle {
SectionHeader { SectionHeader {
id: presetsStatsHeader id: presetsStatsHeader
anchors.left: undefined
anchors.right: undefined
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Statistics") text: qsTr("Statistics")
} }
......
...@@ -174,6 +174,8 @@ Item { ...@@ -174,6 +174,8 @@ Item {
SectionHeader { SectionHeader {
id: categoryHeader id: categoryHeader
anchors.left: parent.left
anchors.right: parent.right
text: category text: category
checked: controller.currentCategory === text checked: controller.currentCategory === text
exclusiveGroup: sectionGroup exclusiveGroup: sectionGroup
......
...@@ -44,6 +44,8 @@ Column { ...@@ -44,6 +44,8 @@ Column {
SectionHeader { SectionHeader {
id: header id: header
anchors.left: parent.left
anchors.right: parent.right
text: name + (passed ? qsTr(" (passed)") : "") text: name + (passed ? qsTr(" (passed)") : "")
} }
......
...@@ -40,7 +40,6 @@ ParameterEditor 1.0 ParameterEditor.qml ...@@ -40,7 +40,6 @@ ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PIDTuning 1.0 PIDTuning.qml PIDTuning 1.0 PIDTuning.qml
PlanEditToolbar 1.0 PlanEditToolbar.qml PlanEditToolbar 1.0 PlanEditToolbar.qml
PlanStartOverlay 1.0 PlanStartOverlay.qml
PreFlightCheckButton 1.0 PreFlightCheckButton.qml PreFlightCheckButton 1.0 PreFlightCheckButton.qml
PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml
PreFlightCheckModel 1.0 PreFlightCheckModel.qml PreFlightCheckModel 1.0 PreFlightCheckModel.qml
......
...@@ -8,8 +8,6 @@ import QGroundControl.Palette 1.0 ...@@ -8,8 +8,6 @@ import QGroundControl.Palette 1.0
FocusScope { FocusScope {
id: _root id: _root
anchors.left: parent.left
anchors.right: parent.right
height: column.height height: column.height
property alias text: label.text property alias text: label.text
......
...@@ -27,6 +27,11 @@ Rectangle { ...@@ -27,6 +27,11 @@ Rectangle {
property AbstractButton lastClickedButton: null property AbstractButton lastClickedButton: null
function simulateClick(buttonIndex) {
toolStripColumn.children[buttonIndex].checked = true
toolStripColumn.children[buttonIndex].clicked()
}
// Ensure we don't get narrower than content // Ensure we don't get narrower than content
property real _idealWidth: (ScreenTools.isMobile ? ScreenTools.minTouchPixels : ScreenTools.defaultFontPixelWidth * 8) + toolStripColumn.anchors.margins * 2 property real _idealWidth: (ScreenTools.isMobile ? ScreenTools.minTouchPixels : ScreenTools.defaultFontPixelWidth * 8) + toolStripColumn.anchors.margins * 2
...@@ -73,7 +78,7 @@ Rectangle { ...@@ -73,7 +78,7 @@ Rectangle {
checked: modelData.checked !== undefined ? modelData.checked : checked checked: modelData.checked !== undefined ? modelData.checked : checked
ButtonGroup.group: buttonGroup ButtonGroup.group: buttonGroup
// Only drop pannel and toggleable are checkable // Only drop panel and toggleable are checkable
checkable: modelData.dropPanelComponent !== undefined || (modelData.toggle !== undefined && modelData.toggle) checkable: modelData.dropPanelComponent !== undefined || (modelData.toggle !== undefined && modelData.toggle)
onClicked: { onClicked: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment