Commit ae58e709 authored by Jacob Dahl's avatar Jacob Dahl

updated from reviewer feedback

parent 52d8a552
...@@ -24,8 +24,6 @@ Rectangle { ...@@ -24,8 +24,6 @@ Rectangle {
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,16 +66,20 @@ Rectangle { ...@@ -68,16 +66,20 @@ 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) {
vehicle = QGroundControl.multiVehicleManager.offlineEditingVehicle
}
if(vehicle.multiRotor) {
modelContainer.source = "/checklists/MultiRotorChecklist.qml" modelContainer.source = "/checklists/MultiRotorChecklist.qml"
} else if(activeVehicle.vtol) { } else if(vehicle.vtol) {
modelContainer.source = "/checklists/VTOLChecklist.qml" modelContainer.source = "/checklists/VTOLChecklist.qml"
} else if(activeVehicle.rover) { } else if(vehicle.rover) {
modelContainer.source = "/checklists/RoverChecklist.qml" modelContainer.source = "/checklists/RoverChecklist.qml"
} else if(activeVehicle.sub) { } else if(vehicle.sub) {
modelContainer.source = "/checklists/SubChecklist.qml" modelContainer.source = "/checklists/SubChecklist.qml"
} else if(activeVehicle.fixedWing) { } else if(vehicle.fixedWing) {
modelContainer.source = "/checklists/FixedWingChecklist.qml" modelContainer.source = "/checklists/FixedWingChecklist.qml"
} else { } else {
modelContainer.source = "/checklists/DefaultChecklist.qml" modelContainer.source = "/checklists/DefaultChecklist.qml"
...@@ -85,29 +87,6 @@ Rectangle { ...@@ -85,29 +87,6 @@ Rectangle {
return return
} }
// "enumStrings": "Fixed Wing,Multi-Rotor,VTOL,Rover,Sub",
// "enumValues": "1,2,20,10,12",
switch (_offlineEditingVehicleType.rawValue) {
case 1:
modelContainer.source = "/checklists/FixedWingChecklist.qml"
return
case 2:
modelContainer.source = "/checklists/MultiRotorChecklist.qml"
return
case 20:
modelContainer.source = "/checklists/VTOLChecklist.qml"
return
case 10:
modelContainer.source = "/checklists/RoverChecklist.qml"
return
case 12:
modelContainer.source = "/checklists/SubChecklist.qml"
return
}
modelContainer.source = "/checklists/DefaultChecklist.qml"
}
Component.onCompleted: { Component.onCompleted: {
_updateModel() _updateModel()
} }
......
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