Commit ae58e709 authored by Jacob Dahl's avatar Jacob Dahl

updated from reviewer feedback

parent 52d8a552
...@@ -23,9 +23,7 @@ Rectangle { ...@@ -23,9 +23,7 @@ Rectangle {
color: qgcPal.windowShade color: qgcPal.windowShade
radius: 3 radius: 3
property real _verticalMargin: ScreenTools.defaultFontPixelHeight / 2 property real _verticalMargin: ScreenTools.defaultFontPixelHeight / 2
property var _offlineEditingVehicleType: QGroundControl.settingsManager.appSettings.offlineEditingVehicleType
Loader { Loader {
id: modelContainer id: modelContainer
...@@ -68,44 +66,25 @@ Rectangle { ...@@ -68,44 +66,25 @@ Rectangle {
//-- Pick a checklist model that matches the current airframe type (if any) //-- Pick a checklist model that matches the current airframe type (if any)
function _updateModel() { function _updateModel() {
if(activeVehicle) { var vehicle = activeVehicle
if(activeVehicle.multiRotor) { if (!vehicle) {
modelContainer.source = "/checklists/MultiRotorChecklist.qml" vehicle = QGroundControl.multiVehicleManager.offlineEditingVehicle
} else if(activeVehicle.vtol) {
modelContainer.source = "/checklists/VTOLChecklist.qml"
} else if(activeVehicle.rover) {
modelContainer.source = "/checklists/RoverChecklist.qml"
} else if(activeVehicle.sub) {
modelContainer.source = "/checklists/SubChecklist.qml"
} else if(activeVehicle.fixedWing) {
modelContainer.source = "/checklists/FixedWingChecklist.qml"
} else {
modelContainer.source = "/checklists/DefaultChecklist.qml"
}
return
} }
// "enumStrings": "Fixed Wing,Multi-Rotor,VTOL,Rover,Sub", if(vehicle.multiRotor) {
// "enumValues": "1,2,20,10,12", modelContainer.source = "/checklists/MultiRotorChecklist.qml"
switch (_offlineEditingVehicleType.rawValue) { } else if(vehicle.vtol) {
case 1: modelContainer.source = "/checklists/VTOLChecklist.qml"
modelContainer.source = "/checklists/FixedWingChecklist.qml" } else if(vehicle.rover) {
return modelContainer.source = "/checklists/RoverChecklist.qml"
case 2: } else if(vehicle.sub) {
modelContainer.source = "/checklists/MultiRotorChecklist.qml" modelContainer.source = "/checklists/SubChecklist.qml"
return } else if(vehicle.fixedWing) {
case 20: modelContainer.source = "/checklists/FixedWingChecklist.qml"
modelContainer.source = "/checklists/VTOLChecklist.qml" } else {
return modelContainer.source = "/checklists/DefaultChecklist.qml"
case 10:
modelContainer.source = "/checklists/RoverChecklist.qml"
return
case 12:
modelContainer.source = "/checklists/SubChecklist.qml"
return
} }
return
modelContainer.source = "/checklists/DefaultChecklist.qml"
} }
Component.onCompleted: { Component.onCompleted: {
......
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