From 1715d347d1493678acd7a32f8db6599e0d4bf112 Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Mon, 30 Oct 2017 17:49:39 -0400 Subject: [PATCH] Add ArduSub 3.5.2 default params for BlueROV2 --- .../APM/APMSubFrameComponent.qml | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/AutoPilotPlugins/APM/APMSubFrameComponent.qml b/src/AutoPilotPlugins/APM/APMSubFrameComponent.qml index 807f8632c..c32cf6fe4 100644 --- a/src/AutoPilotPlugins/APM/APMSubFrameComponent.qml +++ b/src/AutoPilotPlugins/APM/APMSubFrameComponent.qml @@ -12,6 +12,7 @@ import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 +import QGroundControl 1.0 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 import QGroundControl.Palette 1.0 @@ -22,12 +23,9 @@ import QGroundControl.Controllers 1.0 SetupPage { id: subFramePage pageComponent: subFramePageComponent - property var _flatParamList: ListModel { - ListElement { - name: "Blue Robotics BlueROV2" - file: "Sub/bluerov2-3_5.params" - } - } + + property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle + property bool _oldFW: !(_activeVehicle.firmwareMajorVersion > 3 || _activeVehicle.firmwareMinorVersion > 5 || _activeVehicle.firmwarePatchVersion >= 2) APMAirframeComponentController { id: controller; factPanel: subFramePage.viewPanel } @@ -194,18 +192,16 @@ SetupPage { spacing : _margins layoutDirection: Qt.Vertical; - Repeater { - id: airframePicker - model: _flatParamList - - delegate: QGCButton { - width: parent.width - text: name - - onClicked : { - controller.loadParameters(file) - hideDialog() - } + QGCButton { + width: parent.width + text: "Blue Robotics BlueROV2" + property var file: _oldFW ? "Sub/bluerov2-3_5.params" : "Sub/bluerov2-3_5_2.params" + + onClicked : { + console.log(_oldFW) + console.log(_activeVehicle.firmwarePatchVersion) + controller.loadParameters(file) + hideDialog() } } } -- 2.22.0