Newer
Older
readOnly: false
rootQgcView: _qgcView
Valentin Platzgummer
committed
onClicked: _wimaPlaner.currentPolygonIndex = index
Valentin Platzgummer
committed
_wimaPlaner.removeArea(removeIndex)
}
}
}
}
//-------------------------------------------------------
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
// Mission Item Editor
Item {
id: missionItemEditor
anchors.left: parent.left
anchors.right: parent.right
anchors.top: rightControls.bottom
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5
anchors.bottom: parent.bottom
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 0.25
visible: _editingLayer == _layerMission && !planControlColapsed
QGCListView {
id: missionItemEditorListView
anchors.fill: parent
spacing: ScreenTools.defaultFontPixelHeight / 4
orientation: ListView.Vertical
model: _missionController.visualItems
cacheBuffer: Math.max(height * 2, 0)
clip: true
currentIndex: _missionController.currentPlanViewIndex
highlightMoveDuration: 250
visible: _editingLayer == _layerMission && !planControlColapsed
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
delegate: MissionItemEditor {
map: editorMap
masterController: _planMasterController
missionItem: object
width: parent.width
readOnly: false
rootQgcView: _qgcView
onClicked: _missionController.setCurrentPlanViewIndex(object.sequenceNumber, false)
onRemove: {
var removeIndex = index
_missionController.removeMissionItem(removeIndex)
if (removeIndex >= _missionController.visualItems.count) {
removeIndex--
}
_missionController.setCurrentPlanViewIndex(removeIndex, true)
}
onInsertWaypoint: insertSimpleMissionItem(editorMap.center, index)
onInsertComplexItem: insertComplexMissionItem(complexItemName, editorMap.center, index)
}
}
}
}
MapScale {
id: mapScale
anchors.margins: ScreenTools.defaultFontPixelHeight * (0.66)
anchors.bottom: waypointValuesDisplay.visible ? waypointValuesDisplay.top : parent.bottom
anchors.left: parent.left
mapControl: editorMap
visible: _toolStripBottom < y
}
MissionItemStatus {
id: waypointValuesDisplay
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 7
maxWidth: parent.width - rightPanel.width - x
anchors.bottom: parent.bottom
missionItems: _missionController.visualItems
visible: _editingLayer === _layerMission && (_toolStripBottom + mapScale.height) < y && QGroundControl.corePlugin.options.showMissionStatus
}
}
Component {
id: syncLoadFromVehicleOverwrite
QGCViewMessage {
id: syncLoadFromVehicleCheck
message: qsTr("You have unsaved/unsent changes. Loading from the Vehicle will lose these changes. Are you sure you want to load from the Vehicle?")
function accept() {
hideDialog()
masterController.loadFromVehicle()
}
}
}
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
Component {
id: syncLoadFromFileOverwrite
QGCViewMessage {
id: syncLoadFromVehicleCheck
message: qsTr("You have unsaved/unsent changes. Loading from a file will lose these changes. Are you sure you want to load from a file?")
function accept() {
hideDialog()
masterController.loadFromSelectedFile()
}
}
}
Component {
id: removeAllPromptDialog
QGCViewMessage {
message: qsTr("Are you sure you want to remove all items and create a new plan? ") +
(_planMasterController.offline ? "" : qsTr("This will also remove all items from the vehicle."))
function accept() {
if (_planMasterController.offline) {
masterController.removeAll()
} else {
masterController.removeAllFromVehicle()
}
hideDialog()
}
}
}
Component {
id: wimaRemoveAllPromptDialog
QGCViewMessage {
message: qsTr("Are you sure you want to remove all items and create a Wima mission? ")
function accept() {
Valentin Platzgummer
committed
wimaPlaner.removeAll();
Component {
id: clearVehicleMissionDialog
QGCViewMessage {
message: qsTr("Are you sure you want to remove all mission items and clear the mission from the vehicle?")
masterController.removeAllFromVehicle()
hideDialog()
}
}
}
//- ToolStrip DropPanel Components
Component {
id: centerMapDropPanel
CenterMapDropPanel {
map: editorMap
fitFunctions: mapFitFunctions
}
}
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
Component {
id: patternDropPanel
ColumnLayout {
spacing: ScreenTools.defaultFontPixelWidth * 0.5
QGCLabel { text: qsTr("Create complex pattern:") }
Repeater {
model: _missionController.complexMissionItemNames
QGCButton {
text: modelData
Layout.fillWidth: true
onClicked: {
addComplexItem(modelData)
dropPanel.hide()
}
}
}
Rectangle {
width: parent.width * 0.8
height: 1
color: qgcPal.text
opacity: 0.5
Layout.fillWidth: true
Layout.columnSpan: 2
}
QGCButton {
text: qsTr("Load KML/SHP...")
Layout.fillWidth: true
enabled: !masterController.syncInProgress
onClicked: {
masterController.loadShapeFromSelectedFile()
dropPanel.hide()
}
}
} // Column
}
Component {
id: syncDropPanel
Column {
id: columnHolder
spacing: _margin
property string _overwriteText: qsTr("Mission overwrite")
QGCLabel {
width: sendSaveGrid.width
wrapMode: Text.WordWrap
text: "unsaved changes not yet implemented"
/*masterController.dirty ?
(_activeVehicle ?
qsTr("You have unsaved changes. You should upload to your vehicle, or save to a file:") :
qsTr("You have unsaved changes.")
) :
}
GridLayout {
id: sendSaveGrid
columns: 2
anchors.margins: _margin
rowSpacing: _margin
columnSpacing: ScreenTools.defaultFontPixelWidth
QGCButton {
text: qsTr("New")
enabled: _wimaVisualItems.count >= 1 || _missionController.visualItems.count > 1
_qgcView.showDialog(wimaRemoveAllPromptDialog, qsTr("New Plan"), _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
text: qsTr("Open")
enabled: true//!masterController.syncInProgress
Valentin Platzgummer
committed
wimaPlaner.loadFromSelectedFile()
text: qsTr("Save ")
Valentin Platzgummer
committed
enabled: wimaPlaner.currentFile !== ""
Valentin Platzgummer
committed
wimaPlaner.saveToCurrent()
console.log("saveing to: ", wimaPlaner.currentFile)
}
}
QGCButton {
text: qsTr("Save As...")
Layout.fillWidth: true
enabled: _wimaVisualItems.count >= 1
Valentin Platzgummer
committed
wimaPlaner.saveToSelectedFile()
Layout.columnSpan: 2
enabled: !masterController.syncInProgress && _visualItems.count > 1
onClicked: {
// First point does not count
if (_visualItems.count < 2) {
_qgcView.showDialog(noItemForKML, qsTr("KML"), _qgcView.showDialogDefaultWidth, StandardButton.Cancel)
return
}
dropPanel.hide()
masterController.saveKmlToSelectedFile()
}
Rectangle {
width: parent.width * 0.8
height: 1
color: qgcPal.text
opacity: 0.5
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
Layout.fillWidth: true
Layout.columnSpan: 2
}
QGCButton {
text: qsTr("Upload")
enabled: !masterController.offline && !masterController.syncInProgress && _visualItems.count > 1
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: {
dropPanel.hide()
masterController.upload()
}
}
QGCButton {
text: qsTr("Download")
Layout.fillWidth: true
enabled: !masterController.offline && !masterController.syncInProgress
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: {
dropPanel.hide()
if (masterController.dirty) {
_qgcView.showDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} else {
masterController.loadFromVehicle()
}
}
}
QGCButton {
text: qsTr("Clear Vehicle Mission")
Layout.fillWidth: true
Layout.columnSpan: 2
enabled: !masterController.offline && !masterController.syncInProgress
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: {
dropPanel.hide()
_qgcView.showDialog(clearVehicleMissionDialog, text, _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
}
}
}
}
}
Rectangle {
id: debugMessageWindow
anchors.bottom: parent.bottom
width: parent.width*0.7
x: (parent.width-width)/2
height: 150
color: "green"
z:100
QGCListView {
anchors.fill: parent
Valentin Platzgummer
committed
model: wimaPlaner.visualItems
delegate: Rectangle{
height: 15
color: "lightsteelblue"
radius: 1
Text {