Commit fa4e7a2c authored by Don Gagne's avatar Don Gagne

Merge pull request #1847 from DonLakeFlyer/ControlReorg

Restructure map controls for better reusability
parents 4719c514 d1285c18
......@@ -25,12 +25,13 @@ import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
import QtLocation 5.3
import QGroundControl.FlightMap 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
/// Flight Display View
Item {
......@@ -76,9 +77,70 @@ Item {
mapName: "FlightDisplayView"
latitude: parent._latitude
longitude: parent._longitude
z: 10
showVehicles: true
showMissionItems: true
// Add the vehicles to the map
MapItemView {
model: multiVehicleManager.vehicles
delegate:
VehicleMapItem {
vehicle: object
coordinate: object.coordinate
isSatellite: flightMap.isSatelliteMap
}
}
// Add the mission items to the map
MapItemView {
model: multiVehicleManager.activeVehicle ? multiVehicleManager.activeVehicle.missionItems : 0
delegate:
MissionMapItem {
missionItem: object
}
}
// Vehicle GPS lock display
Column {
id: gpsLockColumn
y: (parent.height - height) / 2
width: parent.width
Repeater {
model: multiVehicleManager.vehicles
delegate:
QGCLabel {
width: gpsLockColumn.width
horizontalAlignment: Text.AlignHCenter
visible: object.satelliteLock < 2
text: "No GPS Lock for Vehicle #" + object.id
}
}
}
// Mission item list
ListView {
id: missionItemSummaryList
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.right: flightMap.mapWidgets.left
anchors.bottom: parent.bottom
height: ScreenTools.defaultFontPixelHeight * 7
spacing: ScreenTools.defaultFontPixelWidth / 2
opacity: 0.75
orientation: ListView.Horizontal
model: multiVehicleManager.activeVehicle ? multiVehicleManager.activeVehicle.missionItems : 0
property real _maxItemHeight: 0
delegate:
MissionItemSummary {
opacity: 0.75
missionItem: object
}
} // ListView - Mission item list
}
QGCCompassWidget {
......
This diff is collapsed.
......@@ -24,8 +24,9 @@ This file is part of the QGROUNDCONTROL project
/// @file
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.4
import QtLocation 5.3
import QtQuick 2.4
import QtLocation 5.3
import QtPositioning 5.3
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
......@@ -37,7 +38,6 @@ MapQuickItem {
anchorPoint.x: vehicleIcon.width / 2
anchorPoint.y: vehicleIcon.height / 2
coordinate: vehicle.coordinate
visible: vehicle.satelliteLock >= 2 // 2D lock
sourceItem: Image {
......
......@@ -729,6 +729,7 @@ void Vehicle::_waypointViewOnlyListChanged()
for(int i = 0; i < newMisionItems.count(); i++) {
MissionItem* itemToCopy = newMisionItems[i];
MissionItem* item = new MissionItem(*itemToCopy);
item->setParent(this);
_missionItems.append(item);
}
}
......
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