PlanView.qml 46.6 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/
Don Gagne's avatar
Don Gagne committed
9 10


11 12
import QtQuick          2.3
import QtQuick.Controls 1.2
Don Gagne's avatar
Don Gagne committed
13
import QtQuick.Dialogs  1.2
14 15 16
import QtLocation       5.3
import QtPositioning    5.3
import QtQuick.Layouts  1.2
17
import QtQuick.Window   2.2
Don Gagne's avatar
Don Gagne committed
18

19 20 21 22 23 24 25 26 27 28 29
import QGroundControl                   1.0
import QGroundControl.FlightMap         1.0
import QGroundControl.ScreenTools       1.0
import QGroundControl.Controls          1.0
import QGroundControl.FactSystem        1.0
import QGroundControl.FactControls      1.0
import QGroundControl.Palette           1.0
import QGroundControl.Controllers       1.0
import QGroundControl.ShapeFileHelper   1.0
import QGroundControl.Airspace          1.0
import QGroundControl.Airmap            1.0
Don Gagne's avatar
Don Gagne committed
30 31

/// Mission Editor
Don Gagne's avatar
Don Gagne committed
32

33
Item {
34

Gus Grubba's avatar
Gus Grubba committed
35 36
    property bool planControlColapsed: false

37
    readonly property int   _decimalPlaces:             8
Gus Grubba's avatar
Gus Grubba committed
38
    readonly property real  _horizontalMargin:          ScreenTools.defaultFontPixelWidth  * 0.5
39
    readonly property real  _margin:                    ScreenTools.defaultFontPixelHeight * 0.5
Gus Grubba's avatar
Gus Grubba committed
40
    readonly property real  _radius:                    ScreenTools.defaultFontPixelWidth  * 0.5
41
    readonly property real  _rightPanelWidth:           Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
Gus Grubba's avatar
Gus Grubba committed
42
    readonly property real  _toolButtonTopMargin:       ScreenTools.defaultFontPixelHeight * 0.5
43 44
    readonly property var   _defaultVehicleCoordinate:  QtPositioning.coordinate(37.803784, -122.462276)
    readonly property bool  _waypointsOnlyMode:         QGroundControl.corePlugin.options.missionWaypointsOnly
45

Gus Grubba's avatar
Gus Grubba committed
46
    property bool   _airspaceEnabled:                    QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
Gus Grubba's avatar
Gus Grubba committed
47 48 49 50 51 52 53 54
    property var    _missionController:                 _planMasterController.missionController
    property var    _geoFenceController:                _planMasterController.geoFenceController
    property var    _rallyPointController:              _planMasterController.rallyPointController
    property var    _visualItems:                       _missionController.visualItems
    property bool   _lightWidgetBorders:                editorMap.isSatelliteMap
    property bool   _addWaypointOnClick:                false
    property bool   _addROIOnClick:                     false
    property bool   _singleComplexItem:                 _missionController.complexMissionItemNames.length === 1
Gus Grubba's avatar
Gus Grubba committed
55
    property int    _editingLayer:                      bar.currentIndex ? _layers[bar.currentIndex] : _layerMission
Gus Grubba's avatar
Gus Grubba committed
56
    property int    _toolStripBottom:                   toolStrip.height + toolStrip.y
57
    property var    _appSettings:                       QGroundControl.settingsManager.appSettings
58

Gus Grubba's avatar
Gus Grubba committed
59 60
    readonly property var       _layers:                [_layerMission, _layerGeoFence, _layerRallyPoints]

61 62 63 64
    readonly property int       _layerMission:              1
    readonly property int       _layerGeoFence:             2
    readonly property int       _layerRallyPoints:          3
    readonly property string    _armedVehicleUploadPrompt:  qsTr("Vehicle is currently armed. Do you want to upload the mission to the vehicle?")
65

66 67
    function addComplexItem(complexItemName) {
        var coordinate = editorMap.center
68
        coordinate.latitude  = coordinate.latitude.toFixed(_decimalPlaces)
69
        coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
70
        coordinate.altitude  = coordinate.altitude.toFixed(_decimalPlaces)
71
        insertComplexMissionItem(complexItemName, coordinate, _missionController.visualItems.count)
72 73 74
    }

    function insertComplexMissionItem(complexItemName, coordinate, index) {
75
        var sequenceNumber = _missionController.insertComplexMissionItem(complexItemName, coordinate, index)
76
        _missionController.setCurrentPlanViewIndex(sequenceNumber, true)
77 78
    }

79 80
    function insertComplexMissionItemFromKMLOrSHP(complexItemName, file, index) {
        var sequenceNumber = _missionController.insertComplexMissionItemFromKMLOrSHP(complexItemName, file, index)
81 82 83
        _missionController.setCurrentPlanViewIndex(sequenceNumber, true)
    }

84
    function updateAirspace(reset) {
85 86 87 88
        if(_airspaceEnabled) {
            var coordinateNW = editorMap.toCoordinate(Qt.point(0,0), false /* clipToViewPort */)
            var coordinateSE = editorMap.toCoordinate(Qt.point(width,height), false /* clipToViewPort */)
            if(coordinateNW.isValid && coordinateSE.isValid) {
89
                QGroundControl.airspaceManager.setROI(coordinateNW, coordinateSE, true /*planView*/, reset)
90 91 92 93
            }
        }
    }

94 95 96 97 98
    property bool _firstMissionLoadComplete:    false
    property bool _firstFenceLoadComplete:      false
    property bool _firstRallyLoadComplete:      false
    property bool _firstLoadComplete:           false

99
    MapFitFunctions {
100
        id:                         mapFitFunctions  // The name for this id cannot be changed without breaking references outside of this code. Beware!
101 102
        map:                        editorMap
        usePlannedHomePosition:     true
103
        planMasterController:       _planMasterController
104 105
    }

106
    on_AirspaceEnabledChanged: {
107
        if(QGroundControl.airmapSupported) {
108 109
            if(_airspaceEnabled) {
                planControlColapsed = QGroundControl.airspaceManager.airspaceVisible
110
                updateAirspace(true)
111 112 113
            } else {
                planControlColapsed = false
            }
114
        } else {
Gus Grubba's avatar
Gus Grubba committed
115 116 117 118
            planControlColapsed = false
        }
    }

DonLakeFlyer's avatar
DonLakeFlyer committed
119
    Connections {
Gus Grubba's avatar
Gus Grubba committed
120
        target: _appSettings ? _appSettings.defaultMissionItemAltitude : null
DonLakeFlyer's avatar
DonLakeFlyer committed
121 122
        onRawValueChanged: {
            if (_visualItems.count > 1) {
123
                mainWindow.showComponentDialog(applyNewAltitude, qsTr("Apply new alititude"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
DonLakeFlyer's avatar
DonLakeFlyer committed
124 125 126 127 128 129 130 131 132 133
            }
        }
    }

    Component {
        id: applyNewAltitude
        QGCViewMessage {
            message:    qsTr("You have changed the default altitude for mission items. Would you like to apply that altitude to all the items in the current mission?")
            function accept() {
                hideDialog()
134
                _missionController.applyDefaultMissionAltitude()
DonLakeFlyer's avatar
DonLakeFlyer committed
135 136 137 138
            }
        }
    }

139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
    Component {
        id: activeMissionUploadDialogComponent
        QGCViewDialog {
            Column {
                anchors.fill:   parent
                spacing:        ScreenTools.defaultFontPixelHeight
                QGCLabel {
                    width:      parent.width
                    wrapMode:   Text.WordWrap
                    text:       qsTr("Your vehicle is currently flying a mission. In order to upload a new or modified mission the current mission will be paused.")
                }
                QGCLabel {
                    width:      parent.width
                    wrapMode:   Text.WordWrap
                    text:       qsTr("After the mission is uploaded you can adjust the current waypoint and start the mission.")
                }
                QGCButton {
                    text:       qsTr("Pause and Upload")
                    onClicked: {
Gus Grubba's avatar
Gus Grubba committed
158
                        activeVehicle.flightMode = activeVehicle.pauseFlightMode
159
                        _planMasterController.sendToVehicle()
160
                        hideDialog()
161 162 163 164 165 166
                    }
                }
            }
        }
    }

Gus Grubba's avatar
Gus Grubba committed
167
    Connections {
168
        target: QGroundControl.airspaceManager
169
        onAirspaceVisibleChanged: {
170
            planControlColapsed = QGroundControl.airspaceManager.airspaceVisible
Gus Grubba's avatar
Gus Grubba committed
171 172 173
        }
    }

174 175 176 177 178 179 180
    Component {
        id: noItemForKML
        QGCViewMessage {
            message:    qsTr("You need at least one item to create a KML.")
        }
    }

181
    PlanMasterController {
Gus Grubba's avatar
Gus Grubba committed
182
        id: _planMasterController
183

184
        Component.onCompleted: {
185
            _planMasterController.start(false /* flyView */)
186
            _missionController.setCurrentPlanViewIndex(0, true)
Gus Grubba's avatar
Gus Grubba committed
187
            mainWindow.planMasterControllerPlan = _planMasterController
188 189
        }

190
        function waitingOnDataMessage() {
191
            mainWindow.showMessageDialog(qsTr("Unable to Save/Upload"), qsTr("Plan is waiting on terrain data from server for correct altitude values."))
192 193
        }

194
        function upload() {
195 196 197 198
            if (!readyForSaveSend()) {
                waitingOnDataMessage()
                return
            }
Gus Grubba's avatar
Gus Grubba committed
199
            if (activeVehicle && activeVehicle.armed && activeVehicle.flightMode === activeVehicle.missionFlightMode) {
200
                mainWindow.showComponentDialog(activeMissionUploadDialogComponent, qsTr("Plan Upload"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
201
            } else {
202 203
                sendToVehicle()
            }
DonLakeFlyer's avatar
DonLakeFlyer committed
204 205
        }

206
        function loadFromSelectedFile() {
207
            fileDialog.title =          qsTr("Select Plan File")
DonLakeFlyer's avatar
DonLakeFlyer committed
208
            fileDialog.planFiles =      true
209
            fileDialog.selectExisting = true
Gus Grubba's avatar
Gus Grubba committed
210
            fileDialog.nameFilters =    _planMasterController.loadNameFilters
211 212
            fileDialog.fileExtension =  _appSettings.planFileExtension
            fileDialog.fileExtension2 = _appSettings.missionFileExtension
213
            fileDialog.openForLoad()
214 215 216
        }

        function saveToSelectedFile() {
217 218 219 220
            if (!readyForSaveSend()) {
                waitingOnDataMessage()
                return
            }
221
            fileDialog.title =          qsTr("Save Plan")
222
            fileDialog.planFiles =      true
223
            fileDialog.selectExisting = false
Gus Grubba's avatar
Gus Grubba committed
224
            fileDialog.nameFilters =    _planMasterController.saveNameFilters
225 226
            fileDialog.fileExtension =  _appSettings.planFileExtension
            fileDialog.fileExtension2 = _appSettings.missionFileExtension
227
            fileDialog.openForSave()
228 229
        }

230
        function fitViewportToItems() {
231
            mapFitFunctions.fitMapViewportToMissionItems()
232
        }
233

234 235
        function loadShapeFromSelectedFile() {
            fileDialog.title =          qsTr("Load Shape")
236 237
            fileDialog.planFiles =      false
            fileDialog.selectExisting = true
238 239 240
            fileDialog.nameFilters =    ShapeFileHelper.fileDialogKMLOrSHPFilters
            fileDialog.fileExtension =  _appSettings.kmlFileExtension
            fileDialog.fileExtension2 = _appSettings.shpFileExtension
241 242 243
            fileDialog.openForLoad()
        }

244
        function saveKmlToSelectedFile() {
245 246 247 248
            if (!readyForSaveSend()) {
                waitingOnDataMessage()
                return
            }
249
            fileDialog.title =          qsTr("Save KML")
250
            fileDialog.planFiles =      false
251
            fileDialog.selectExisting = false
252 253
            fileDialog.nameFilters =    ShapeFileHelper.fileDialogKMLFilters
            fileDialog.fileExtension =  _appSettings.kmlFileExtension
254
            fileDialog.fileExtension2 = ""
255 256
            fileDialog.openForSave()
        }
257
    }
258

259 260
    Connections {
        target: _missionController
261
        onNewItemsFromVehicle: {
Gus Grubba's avatar
Gus Grubba committed
262
            if (_visualItems && _visualItems.count !== 1) {
263 264
                mapFitFunctions.fitMapViewportToMissionItems()
            }
265
            _missionController.setCurrentPlanViewIndex(0, true)
266 267
        }
    }
268

269 270 271 272
    /// Inserts a new simple mission item
    ///     @param coordinate Location to insert item
    ///     @param index Insert item at this index
    function insertSimpleMissionItem(coordinate, index) {
273
        var sequenceNumber = _missionController.insertSimpleMissionItem(coordinate, index)
274
        _missionController.setCurrentPlanViewIndex(sequenceNumber, true)
275 276
    }

277 278 279 280 281 282 283
    /// Inserts a new ROI mission item
    ///     @param coordinate Location to insert item
    ///     @param index Insert item at this index
    function insertROIMissionItem(coordinate, index) {
        var sequenceNumber = _missionController.insertROIMissionItem(coordinate, index)
        _missionController.setCurrentPlanViewIndex(sequenceNumber, true)
        _addROIOnClick = false
284
        toolStrip.lastClickedButton.checked = false
285 286
    }

287 288
    property int _moveDialogMissionItemIndex

289 290
    QGCFileDialog {
        id:             fileDialog
Gus Grubba's avatar
Gus Grubba committed
291
        folder:         _appSettings ? _appSettings.missionSavePath : ""
292

293 294
        property bool planFiles: true    ///< true: working with plan files, false: working with kml file

295
        onAcceptedForSave: {
296
            if (planFiles) {
Gus Grubba's avatar
Gus Grubba committed
297
                _planMasterController.saveToFile(file)
298
            } else {
Gus Grubba's avatar
Gus Grubba committed
299
                _planMasterController.saveToKml(file)
300
            }
301
            close()
302 303
        }

304
        onAcceptedForLoad: {
305
            if (planFiles) {
Gus Grubba's avatar
Gus Grubba committed
306 307
                _planMasterController.loadFromFile(file)
                _planMasterController.fitViewportToItems()
308 309
                _missionController.setCurrentPlanViewIndex(0, true)
            } else {
310 311
                var retList = ShapeFileHelper.determineShapeType(file)
                if (retList[0] == ShapeFileHelper.Error) {
312
                    mainWindow.showMessageDialog("Error", retList[1])
313
                } else if (retList[0] == ShapeFileHelper.Polygon) {
Gus Grubba's avatar
Gus Grubba committed
314
                     var editVehicle = activeVehicle ? activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
315 316 317 318
                    if (editVehicle.fixedWing) {
                        insertComplexMissionItemFromKMLOrSHP(_missionController.surveyComplexItemName, file, -1)
                    } else {
                        polygonSelectPatternFile = file
319
                        mainWindow.showComponentDialog(patternPolygonSelectDialog, fileDialog.title, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
320
                    }
321 322
                } else if (retList[0] == ShapeFileHelper.Polyline) {
                    insertComplexMissionItemFromKMLOrSHP(_missionController.corridorScanComplexItemName, file, -1)
323 324
                }
            }
325
            close()
326 327 328
        }
    }

329
    property string polygonSelectPatternFile
330
    Component {
331
        id: patternPolygonSelectDialog
332 333 334 335 336 337 338 339
        QGCViewDialog {
            function accept() {
                var complexItemName
                if (surveyRadio.checked) {
                    complexItemName = _missionController.surveyComplexItemName
                } else {
                    complexItemName = _missionController.structureScanComplexItemName
                }
340
                insertComplexMissionItemFromKMLOrSHP(complexItemName, polygonSelectPatternFile, -1)
341 342 343 344 345 346 347 348 349 350
                hideDialog()
            }
            Column {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        ScreenTools.defaultFontPixelHeight
                QGCLabel {
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    wrapMode:       Text.WordWrap
351
                    text:           qsTr("Create which pattern type?")
352 353 354 355 356 357 358 359 360 361 362 363 364
                }
                QGCRadioButton {
                    id:             surveyRadio
                    text:           qsTr("Survey")
                    checked:        true
                }
                QGCRadioButton {
                    text:           qsTr("Structure Scan")
                }
            }
        }
    }

365 366 367 368 369
    Component {
        id: moveDialog
        QGCViewDialog {
            function accept() {
                var toIndex = toCombo.currentIndex
Gus Grubba's avatar
Gus Grubba committed
370
                if (toIndex === 0) {
371 372
                    toIndex = 1
                }
373
                _missionController.moveMissionItem(_moveDialogMissionItemIndex, toIndex)
374 375 376 377 378 379 380 381 382 383 384
                hideDialog()
            }
            Column {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        ScreenTools.defaultFontPixelHeight

                QGCLabel {
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    wrapMode:       Text.WordWrap
385
                    text:           qsTr("Move the selected mission item to the be after following mission item:")
386 387 388 389
                }

                QGCComboBox {
                    id:             toCombo
390
                    model:          _visualItems.count
391 392 393 394 395 396
                    currentIndex:   _moveDialogMissionItemIndex
                }
            }
        }
    }

397
    Item {
Don Gagne's avatar
Don Gagne committed
398
        id:             panel
399
        anchors.fill:   parent
Don Gagne's avatar
Don Gagne committed
400

401
        FlightMap {
402 403 404 405 406
            id:                         editorMap
            anchors.fill:               parent
            mapName:                    "MissionEditor"
            allowGCSLocationCenter:     true
            allowVehicleLocationCenter: true
407
            planView:                   true
Don Gagne's avatar
Don Gagne committed
408

409
            // This is the center rectangle of the map which is not obscured by tools
410
            property rect centerViewport:   Qt.rect(_leftToolWidth, 0, editorMap.width - _leftToolWidth - _rightPanelWidth, editorMap.height - _statusHeight)
411

412 413
            property real _leftToolWidth:   toolStrip.x + toolStrip.width
            property real _statusHeight:    waypointValuesDisplay.visible ? editorMap.height - waypointValuesDisplay.y : 0
414

415
            readonly property real animationDuration: 500
416

417 418
            // Initial map position duplicates Fly view position
            Component.onCompleted: editorMap.center = QGroundControl.flightMapPosition
419

420 421 422 423 424 425
            Behavior on zoomLevel {
                NumberAnimation {
                    duration:       editorMap.animationDuration
                    easing.type:    Easing.InOutQuad
                }
            }
426

427 428
            QGCMapPalette { id: mapPal; lightColors: editorMap.isSatelliteMap }

429 430
            onZoomLevelChanged: updateAirspace(false)
            onCenterChanged:    updateAirspace(false)
431

432 433 434
            MouseArea {
                anchors.fill: parent
                onClicked: {
435 436
                    // Take focus to close any previous editing
                    editorMap.focus = true
437 438 439 440
                    var coordinate = editorMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
                    coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces)
                    coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
                    coordinate.altitude = coordinate.altitude.toFixed(_decimalPlaces)
441

442 443 444
                    switch (_editingLayer) {
                    case _layerMission:
                        if (_addWaypointOnClick) {
445
                            insertSimpleMissionItem(coordinate, _missionController.visualItems.count)
446 447 448
                        } else if (_addROIOnClick) {
                            _addROIOnClick = false
                            insertROIMissionItem(coordinate, _missionController.visualItems.count)
449
                        }
450 451
                        break
                    case _layerRallyPoints:
Gus Grubba's avatar
Gus Grubba committed
452
                        if (_rallyPointController.supported && _addWaypointOnClick) {
453
                            _rallyPointController.addPoint(coordinate)
454
                        }
455
                        break
Don Gagne's avatar
Don Gagne committed
456
                    }
Don Gagne's avatar
Don Gagne committed
457
                }
458
            }
Don Gagne's avatar
Don Gagne committed
459

460 461
            // Add the mission item visuals to the map
            Repeater {
462
                model: _editingLayer == _layerMission ? _missionController.visualItems : undefined
463 464
                delegate: MissionItemMapVisual {
                    map:        editorMap
465
                    onClicked:  _missionController.setCurrentPlanViewIndex(sequenceNumber, false)
466
                    visible:    _editingLayer == _layerMission
467
                }
468
            }
469

470 471
            // Add lines between waypoints
            MissionLineView {
472
                model: _editingLayer == _layerMission ? _missionController.waypointLines : undefined
473
            }
474

475 476 477 478 479 480 481
            // Add the vehicles to the map
            MapItemView {
                model: QGroundControl.multiVehicleManager.vehicles
                delegate:
                    VehicleMapItem {
                    vehicle:        object
                    coordinate:     object.coordinate
482
                    map:            editorMap
483 484
                    size:           ScreenTools.defaultFontPixelHeight * 3
                    z:              QGroundControl.zOrderMapItems - 1
485
                }
486
            }
487

488 489
            GeoFenceMapVisuals {
                map:                    editorMap
490
                myGeoFenceController:   _geoFenceController
491
                interactive:            _editingLayer == _layerGeoFence
492
                homePosition:           _missionController.plannedHomePosition
493 494
                planView:               true
            }
495

496 497
            RallyPointMapVisuals {
                map:                    editorMap
498
                myRallyPointController: _rallyPointController
499 500
                interactive:            _editingLayer == _layerRallyPoints
                planView:               true
501
            }
502

503 504
            // Airspace overlap support
            MapItemView {
505
                model:              _airspaceEnabled && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.circles : []
506 507 508
                delegate: MapCircle {
                    center:         object.center
                    radius:         object.radius
509
                    color:          object.color
Gus Grubba's avatar
Gus Grubba committed
510 511
                    border.color:   object.lineColor
                    border.width:   object.lineWidth
512 513 514 515
                }
            }

            MapItemView {
516
                model:              _airspaceEnabled && QGroundControl.airspaceManager.airspaceVisible ? QGroundControl.airspaceManager.airspaces.polygons : []
517 518
                delegate: MapPolygon {
                    path:           object.polygon
519
                    color:          object.color
Gus Grubba's avatar
Gus Grubba committed
520 521
                    border.color:   object.lineColor
                    border.width:   object.lineWidth
522 523
                }
            }
524
        }
525

526 527
        //-----------------------------------------------------------
        // Left tool strip
Gus Grubba's avatar
Gus Grubba committed
528
        ToolStrip {
529
            id:                 toolStrip
530
            anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
531 532 533 534
            anchors.left:       parent.left
            anchors.topMargin:  ScreenTools.defaultFontPixelHeight * 0.5
            anchors.top:        parent.top
            z:                  QGroundControl.zOrderWidgets
Gus Grubba's avatar
Gus Grubba committed
535
            maxHeight:          mapScale.y - toolStrip.y
536

Gus Grubba's avatar
Gus Grubba committed
537
            property bool _isRally:     _editingLayer == _layerRallyPoints
538

Gus Grubba's avatar
Gus Grubba committed
539 540 541 542 543 544
            model: [
                {
                    name:               qsTr("Fly"),
                    iconSource:         "/qmlimages/PaperPlane.svg",
                    buttonEnabled:      true,
                    buttonVisible:      true,
545
                },
546
                {
Gus Grubba's avatar
Gus Grubba committed
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584
                    name:               qsTr("File"),
                    iconSource:         "/qmlimages/MapSync.svg",
                    buttonEnabled:      !_planMasterController.syncInProgress,
                    buttonVisible:      true,
                    showAlternateIcon:  _planMasterController.dirty,
                    alternateIconSource:"/qmlimages/MapSyncChanged.svg",
                    dropPanelComponent: syncDropPanel
                },
                {
                    name:               _editingLayer == _layerRallyPoints ? qsTr("Rally Point") : qsTr("Waypoint"),
                    iconSource:         "/qmlimages/MapAddMission.svg",
                    buttonEnabled:      true,
                    buttonVisible:      true,
                    toggle:             true,
                    checked:            _addWaypointOnClick
                },
                {
                    name:               qsTr("ROI"),
                    iconSource:         "/qmlimages/MapAddMission.svg",
                    buttonEnabled:      true,
                    buttonVisible:      !_isRally && _waypointsOnlyMode,
                    toggle:             true
                },
                {
                    name:               _singleComplexItem ? _missionController.complexMissionItemNames[0] : qsTr("Pattern"),
                    iconSource:         "/qmlimages/MapDrawShape.svg",
                    buttonEnabled:      true,
                    buttonVisible:      !_isRally,
                    dropPanelComponent: _singleComplexItem ? undefined : patternDropPanel
                },
                {
                    name:               qsTr("Center"),
                    iconSource:         "/qmlimages/MapCenter.svg",
                    buttonEnabled:      true,
                    buttonVisible:      true,
                    dropPanelComponent: centerMapDropPanel
                }
            ]
585

Gus Grubba's avatar
Gus Grubba committed
586 587
            onClicked: {
                switch (index) {
588 589 590 591
                case 0:
                    mainWindow.showFlyView()
                    break;
                case 2:
Gus Grubba's avatar
Gus Grubba committed
592 593 594 595 596 597
                    if(_addWaypointOnClick) {
                        //-- Toggle it off
                        _addWaypointOnClick = false
                        _addROIOnClick = false
                        setChecked(index, false)
                    } else {
598
                        _addWaypointOnClick = checked
599
                        _addROIOnClick = false
Gus Grubba's avatar
Gus Grubba committed
600 601
                    }
                    break
602
                case 3:
Gus Grubba's avatar
Gus Grubba committed
603 604 605
                    _addROIOnClick = checked
                    _addWaypointOnClick = false
                    break
606
                case 4:
Gus Grubba's avatar
Gus Grubba committed
607 608 609 610
                    if (_singleComplexItem) {
                        addComplexItem(_missionController.complexMissionItemNames[0])
                    }
                    break
611 612
                }
            }
Gus Grubba's avatar
Gus Grubba committed
613
        }
614

Gus Grubba's avatar
Gus Grubba committed
615
        //-----------------------------------------------------------
616 617 618
        // Right pane for mission editing controls
        Rectangle {
            id:                 rightPanel
619
            height:             parent.height
620 621
            width:              _rightPanelWidth
            color:              qgcPal.window
622
            opacity:            planExpanded.visible ? 0.2 : 0
Gus Grubba's avatar
Gus Grubba committed
623 624 625
            anchors.bottom:     parent.bottom
            anchors.right:      parent.right
            anchors.rightMargin: ScreenTools.defaultFontPixelWidth
626
        }
Gus Grubba's avatar
Gus Grubba committed
627 628
        //-------------------------------------------------------
        // Right Panel Controls
629
        Item {
Gus Grubba's avatar
Gus Grubba committed
630
            anchors.fill:           rightPanel
Gus Grubba's avatar
Gus Grubba committed
631
            anchors.topMargin:      _toolButtonTopMargin
Gus Grubba's avatar
Gus Grubba committed
632 633 634
            DeadMouseArea {
                anchors.fill:   parent
            }
Gus Grubba's avatar
Gus Grubba committed
635 636
            Column {
                id:                 rightControls
Gus Grubba's avatar
Gus Grubba committed
637
                spacing:            ScreenTools.defaultFontPixelHeight * 0.5
638 639
                anchors.left:       parent.left
                anchors.right:      parent.right
Gus Grubba's avatar
Gus Grubba committed
640 641 642 643
                anchors.top:        parent.top
                //-------------------------------------------------------
                // Airmap Airspace Control
                AirspaceControl {
Gus Grubba's avatar
Gus Grubba committed
644 645
                    id:             airspaceControl
                    width:          parent.width
646
                    visible:        _airspaceEnabled
647
                    planView:       true
648
                    showColapse:    true
649
                }
Gus Grubba's avatar
Gus Grubba committed
650 651 652 653
                //-------------------------------------------------------
                // Mission Controls (Colapsed)
                Rectangle {
                    width:      parent.width
Gus Grubba's avatar
Gus Grubba committed
654
                    height:     planControlColapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0
Gus Grubba's avatar
Gus Grubba committed
655 656
                    color:      qgcPal.missionItemEditor
                    radius:     _radius
657
                    visible:    planControlColapsed && _airspaceEnabled
Gus Grubba's avatar
Gus Grubba committed
658 659 660 661 662 663 664
                    Row {
                        id:                     colapsedRow
                        spacing:                ScreenTools.defaultFontPixelWidth
                        anchors.left:           parent.left
                        anchors.leftMargin:     ScreenTools.defaultFontPixelWidth
                        anchors.verticalCenter: parent.verticalCenter
                        QGCColoredImage {
665 666 667 668 669
                            width:              height
                            height:             ScreenTools.defaultFontPixelWidth * 2.5
                            sourceSize.height:  height
                            source:             "qrc:/res/waypoint.svg"
                            color:              qgcPal.text
Gus Grubba's avatar
Gus Grubba committed
670 671 672
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCLabel {
673 674
                            text:               qsTr("Plan")
                            color:              qgcPal.text
Gus Grubba's avatar
Gus Grubba committed
675
                            anchors.verticalCenter: parent.verticalCenter
676 677
                        }
                    }
Gus Grubba's avatar
Gus Grubba committed
678 679 680 681
                    QGCColoredImage {
                        width:                  height
                        height:                 ScreenTools.defaultFontPixelWidth * 2.5
                        sourceSize.height:      height
682
                        source:                 QGroundControl.airmapSupported ? "qrc:/airmap/expand.svg" : ""
683
                        color:                  "white"
684
                        visible:                QGroundControl.airmapSupported
Gus Grubba's avatar
Gus Grubba committed
685 686 687 688 689 690
                        anchors.right:          parent.right
                        anchors.rightMargin:    ScreenTools.defaultFontPixelWidth
                        anchors.verticalCenter: parent.verticalCenter
                    }
                    MouseArea {
                        anchors.fill:   parent
691
                        enabled:        QGroundControl.airmapSupported
Gus Grubba's avatar
Gus Grubba committed
692
                        onClicked: {
693
                            QGroundControl.airspaceManager.airspaceVisible = false
Gus Grubba's avatar
Gus Grubba committed
694 695
                        }
                    }
Gus Grubba's avatar
Gus Grubba committed
696
                }
Gus Grubba's avatar
Gus Grubba committed
697 698 699 700 701
                //-------------------------------------------------------
                // Mission Controls (Expanded)
                Rectangle {
                    id:         planExpanded
                    width:      parent.width
Gus Grubba's avatar
Gus Grubba committed
702
                    height:     (!planControlColapsed || !_airspaceEnabled) ? bar.height + ScreenTools.defaultFontPixelHeight : 0
Gus Grubba's avatar
Gus Grubba committed
703 704
                    color:      qgcPal.missionItemEditor
                    radius:     _radius
Gus Grubba's avatar
Gus Grubba committed
705
                    visible:    (!planControlColapsed || !_airspaceEnabled) && QGroundControl.corePlugin.options.enablePlanViewSelector
Gus Grubba's avatar
Gus Grubba committed
706
                    Item {
Gus Grubba's avatar
Gus Grubba committed
707
                        height:             bar.height
Gus Grubba's avatar
Gus Grubba committed
708 709
                        anchors.left:       parent.left
                        anchors.right:      parent.right
Gus Grubba's avatar
Gus Grubba committed
710
                        anchors.margins:    ScreenTools.defaultFontPixelWidth
Gus Grubba's avatar
Gus Grubba committed
711
                        anchors.verticalCenter: parent.verticalCenter
Gus Grubba's avatar
Gus Grubba committed
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728
                        QGCTabBar {
                            id:             bar
                            width:          parent.width
                            anchors.centerIn: parent
                            Component.onCompleted: {
                                currentIndex = 0
                            }
                            QGCTabButton {
                                text:       qsTr("Mission")
                            }
                            QGCTabButton {
                                text:       qsTr("Fence")
                                enabled:    _geoFenceController.supported
                            }
                            QGCTabButton {
                                text:       qsTr("Rally")
                                enabled:    _rallyPointController.supported
Gus Grubba's avatar
Gus Grubba committed
729 730 731 732 733 734 735 736 737 738 739 740
                            }
                        }
                    }
                }
            }
            //-------------------------------------------------------
            // Mission Item Editor
            Item {
                id:                     missionItemEditor
                anchors.left:           parent.left
                anchors.right:          parent.right
                anchors.top:            rightControls.bottom
Gus Grubba's avatar
Gus Grubba committed
741
                anchors.topMargin:      ScreenTools.defaultFontPixelHeight * 0.25
Gus Grubba's avatar
Gus Grubba committed
742 743 744 745
                anchors.bottom:         parent.bottom
                anchors.bottomMargin:   ScreenTools.defaultFontPixelHeight * 0.25
                visible:                _editingLayer == _layerMission && !planControlColapsed
                QGCListView {
Gus Grubba's avatar
Gus Grubba committed
746 747 748 749 750 751 752 753
                    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
Gus Grubba's avatar
Gus Grubba committed
754
                    highlightMoveDuration: 250
Gus Grubba's avatar
Gus Grubba committed
755
                    visible:            _editingLayer == _layerMission && !planControlColapsed
Gus Grubba's avatar
Gus Grubba committed
756 757
                    //-- List Elements
                    delegate: MissionItemEditor {
Gus Grubba's avatar
Gus Grubba committed
758
                        map:            editorMap
Gus Grubba's avatar
Gus Grubba committed
759
                        masterController:  _planMasterController
Gus Grubba's avatar
Gus Grubba committed
760 761 762 763
                        missionItem:    object
                        width:          parent.width
                        readOnly:       false
                        onClicked:      _missionController.setCurrentPlanViewIndex(object.sequenceNumber, false)
Gus Grubba's avatar
Gus Grubba committed
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779
                        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)
                    }
                }
            }
            // GeoFence Editor
            GeoFenceEditor {
                anchors.top:            rightControls.bottom
Gus Grubba's avatar
Gus Grubba committed
780
                anchors.topMargin:      ScreenTools.defaultFontPixelHeight * 0.25
Don Gagne's avatar
Don Gagne committed
781
                anchors.bottom:         parent.bottom
Gus Grubba's avatar
Gus Grubba committed
782 783 784 785 786 787 788 789 790 791
                anchors.left:           parent.left
                anchors.right:          parent.right
                myGeoFenceController:   _geoFenceController
                flightMap:              editorMap
                visible:                _editingLayer == _layerGeoFence
            }
            // Rally Point Editor
            RallyPointEditorHeader {
                id:                     rallyPointHeader
                anchors.top:            rightControls.bottom
Gus Grubba's avatar
Gus Grubba committed
792
                anchors.topMargin:      ScreenTools.defaultFontPixelHeight * 0.25
Gus Grubba's avatar
Gus Grubba committed
793 794 795 796 797 798 799 800
                anchors.left:           parent.left
                anchors.right:          parent.right
                visible:                _editingLayer == _layerRallyPoints
                controller:             _rallyPointController
            }
            RallyPointItemEditor {
                id:                     rallyPointEditor
                anchors.top:            rallyPointHeader.bottom
Gus Grubba's avatar
Gus Grubba committed
801
                anchors.topMargin:      ScreenTools.defaultFontPixelHeight * 0.25
Gus Grubba's avatar
Gus Grubba committed
802 803 804 805 806
                anchors.left:           parent.left
                anchors.right:          parent.right
                visible:                _editingLayer == _layerRallyPoints && _rallyPointController.points.count
                rallyPoint:             _rallyPointController.currentRallyPoint
                controller:             _rallyPointController
807
            }
Gus Grubba's avatar
Gus Grubba committed
808
        }
809 810 811 812 813 814 815

        MapScale {
            id:                 mapScale
            anchors.margins:    ScreenTools.defaultFontPixelHeight * (0.66)
            anchors.bottom:     waypointValuesDisplay.visible ? waypointValuesDisplay.top : parent.bottom
            anchors.left:       parent.left
            mapControl:         editorMap
816
            zoomButtonsOnLeft:  true
817
            visible:            _toolStripBottom < y
818 819 820 821 822 823
        }

        MissionItemStatus {
            id:                 waypointValuesDisplay
            anchors.margins:    ScreenTools.defaultFontPixelWidth
            anchors.left:       parent.left
824
            height:             ScreenTools.defaultFontPixelHeight * 7
825
            maxWidth:           parent.width - rightPanel.width - x
826
            anchors.bottom:     parent.bottom
827
            missionItems:       _missionController.visualItems
828
            visible:            _editingLayer === _layerMission && (_toolStripBottom + mapScale.height) < y && QGroundControl.corePlugin.options.showMissionStatus
829
        }
Gus Grubba's avatar
Gus Grubba committed
830
    }
831

832 833 834 835
    Component {
        id: syncLoadFromVehicleOverwrite
        QGCViewMessage {
            id:         syncLoadFromVehicleCheck
Don Gagne's avatar
Don Gagne committed
836
            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?")
837 838
            function accept() {
                hideDialog()
Gus Grubba's avatar
Gus Grubba committed
839
                _planMasterController.loadFromVehicle()
840 841 842 843 844 845 846 847
            }
        }
    }

    Component {
        id: syncLoadFromFileOverwrite
        QGCViewMessage {
            id:         syncLoadFromVehicleCheck
DonLakeFlyer's avatar
DonLakeFlyer committed
848
            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?")
849 850
            function accept() {
                hideDialog()
Gus Grubba's avatar
Gus Grubba committed
851
                _planMasterController.loadFromSelectedFile()
852 853 854 855
            }
        }
    }

856 857 858
    Component {
        id: removeAllPromptDialog
        QGCViewMessage {
859
            message: qsTr("Are you sure you want to remove all items and create a new plan? ") +
860
                     (_planMasterController.offline ? "" : qsTr("This will also remove all items from the vehicle."))
861
            function accept() {
862
                if (_planMasterController.offline) {
Gus Grubba's avatar
Gus Grubba committed
863
                    _planMasterController.removeAll()
864
                } else {
Gus Grubba's avatar
Gus Grubba committed
865
                    _planMasterController.removeAllFromVehicle()
866
                }
867 868 869 870 871
                hideDialog()
            }
        }
    }

872 873 874 875 876
    Component {
        id: clearVehicleMissionDialog
        QGCViewMessage {
            message: qsTr("Are you sure you want to remove all mission items and clear the mission from the vehicle?")
            function accept() {
Gus Grubba's avatar
Gus Grubba committed
877
                _planMasterController.removeAllFromVehicle()
878 879 880 881 882
                hideDialog()
            }
        }
    }

883 884 885 886 887 888 889 890 891 892 893
    //- ToolStrip DropPanel Components

    Component {
        id: centerMapDropPanel

        CenterMapDropPanel {
            map:            editorMap
            fitFunctions:   mapFitFunctions
        }
    }

894 895 896 897 898 899 900 901 902
    Component {
        id: patternDropPanel

        ColumnLayout {
            spacing:    ScreenTools.defaultFontPixelWidth * 0.5

            QGCLabel { text: qsTr("Create complex pattern:") }

            Repeater {
903
                model: _missionController.complexMissionItemNames
904 905 906 907 908 909

                QGCButton {
                    text:               modelData
                    Layout.fillWidth:   true

                    onClicked: {
910
                        addComplexItem(modelData)
911 912 913 914
                        dropPanel.hide()
                    }
                }
            }
915 916 917 918 919 920 921 922 923 924 925 926 927

            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
Gus Grubba's avatar
Gus Grubba committed
928
                enabled:            !_planMasterController.syncInProgress
929
                onClicked: {
Gus Grubba's avatar
Gus Grubba committed
930
                    _planMasterController.loadShapeFromSelectedFile()
931 932 933
                    dropPanel.hide()
                }
            }
934 935
        } // Column
    }
936 937

    Component {
938
        id: syncDropPanel
939

940 941 942
        Column {
            id:         columnHolder
            spacing:    _margin
943

944
            property string _overwriteText: (_editingLayer == _layerMission) ? qsTr("Mission overwrite") : ((_editingLayer == _layerGeoFence) ? qsTr("GeoFence overwrite") : qsTr("Rally Points overwrite"))
945

946 947 948
            QGCLabel {
                width:      sendSaveGrid.width
                wrapMode:   Text.WordWrap
Gus Grubba's avatar
Gus Grubba committed
949
                text:       _planMasterController.dirty ?
Gus Grubba's avatar
Gus Grubba committed
950
                                (activeVehicle ?
951 952 953 954
                                     qsTr("You have unsaved changes. You should upload to your vehicle, or save to a file:") :
                                     qsTr("You have unsaved changes.")
                                ) :
                                qsTr("Plan File:")
955 956
            }

957 958 959 960 961 962
            GridLayout {
                id:                 sendSaveGrid
                columns:            2
                anchors.margins:    _margin
                rowSpacing:         _margin
                columnSpacing:      ScreenTools.defaultFontPixelWidth
963

964
                QGCButton {
965
                    text:               qsTr("New...")
966
                    Layout.fillWidth:   true
967
                    enabled:            _planMasterController.containsItems
968
                    onClicked:  {
969
                        dropPanel.hide()
970
                        mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
971 972
                    }
                }
973

974
                QGCButton {
975
                    text:               qsTr("Open...")
976
                    Layout.fillWidth:   true
Gus Grubba's avatar
Gus Grubba committed
977
                    enabled:            !_planMasterController.syncInProgress
978 979
                    onClicked: {
                        dropPanel.hide()
Gus Grubba's avatar
Gus Grubba committed
980
                        if (_planMasterController.dirty) {
981
                            mainWindow.showComponentDialog(syncLoadFromFileOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
982
                        } else {
Gus Grubba's avatar
Gus Grubba committed
983
                            _planMasterController.loadFromSelectedFile()
984 985 986
                        }
                    }
                }
987

988
                QGCButton {
989
                    text:               qsTr("Save")
990
                    Layout.fillWidth:   true
Gus Grubba's avatar
Gus Grubba committed
991
                    enabled:            !_planMasterController.syncInProgress && _planMasterController.currentPlanFile !== ""
992 993
                    onClicked: {
                        dropPanel.hide()
Gus Grubba's avatar
Gus Grubba committed
994 995
                        if(_planMasterController.currentPlanFile !== "") {
                            _planMasterController.saveToCurrent()
996
                        } else {
Gus Grubba's avatar
Gus Grubba committed
997
                            _planMasterController.saveToSelectedFile()
998
                        }
999 1000 1001 1002
                    }
                }

                QGCButton {
1003
                    text:               qsTr("Save As...")
1004
                    Layout.fillWidth:   true
1005
                    enabled:            !_planMasterController.syncInProgress && _planMasterController.containsItems
1006 1007
                    onClicked: {
                        dropPanel.hide()
Gus Grubba's avatar
Gus Grubba committed
1008
                        _planMasterController.saveToSelectedFile()
1009 1010 1011 1012
                    }
                }

                QGCButton {
1013
                    text:               qsTr("Save Mission Waypoints As KML...")
1014
                    Layout.columnSpan:  2
Gus Grubba's avatar
Gus Grubba committed
1015
                    enabled:            !_planMasterController.syncInProgress && _visualItems.count > 1
1016
                    onClicked: {
1017
                        // First point does not count
1018
                        if (_visualItems.count < 2) {
1019
                            mainWindow.showComponentDialog(noItemForKML, qsTr("KML"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
1020 1021
                            return
                        }
1022
                        dropPanel.hide()
Gus Grubba's avatar
Gus Grubba committed
1023
                        _planMasterController.saveKmlToSelectedFile()
1024 1025
                    }
                }
1026

1027 1028 1029 1030 1031 1032 1033 1034 1035 1036
                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
                }

1037
                QGCButton {
1038
                    text:               qsTr("Upload")
1039
                    Layout.fillWidth:   true
1040
                    enabled:            !_planMasterController.offline && !_planMasterController.syncInProgress && _planMasterController.containsItems
1041 1042
                    visible:            !QGroundControl.corePlugin.options.disableVehicleConnection
                    onClicked: {
1043
                        dropPanel.hide()
Gus Grubba's avatar
Gus Grubba committed
1044
                        _planMasterController.upload()
1045 1046
                    }
                }
1047 1048 1049 1050

                QGCButton {
                    text:               qsTr("Download")
                    Layout.fillWidth:   true
Gus Grubba's avatar
Gus Grubba committed
1051
                    enabled:            !_planMasterController.offline && !_planMasterController.syncInProgress
1052 1053 1054
                    visible:            !QGroundControl.corePlugin.options.disableVehicleConnection
                    onClicked: {
                        dropPanel.hide()
Gus Grubba's avatar
Gus Grubba committed
1055
                        if (_planMasterController.dirty) {
1056
                            mainWindow.showComponentDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
1057
                        } else {
Gus Grubba's avatar
Gus Grubba committed
1058
                            _planMasterController.loadFromVehicle()
1059 1060 1061 1062 1063 1064 1065 1066
                        }
                    }
                }

                QGCButton {
                    text:               qsTr("Clear Vehicle Mission")
                    Layout.fillWidth:   true
                    Layout.columnSpan:  2
Gus Grubba's avatar
Gus Grubba committed
1067
                    enabled:            !_planMasterController.offline && !_planMasterController.syncInProgress
1068 1069 1070
                    visible:            !QGroundControl.corePlugin.options.disableVehicleConnection
                    onClicked: {
                        dropPanel.hide()
1071
                        mainWindow.showComponentDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
1072 1073 1074
                    }
                }

1075
            }
1076 1077
        }
    }
Gus Grubba's avatar
Gus Grubba committed
1078
}