Browse Source

Refactor sub default param loading, allow loading params for sub 4.0

QGC4.4
Willian Galvani 4 years ago committed by Jacob Walser
parent
commit
36118d69be
  1. 20
      src/AutoPilotPlugins/APM/APMSubFrameComponent.qml

20
src/AutoPilotPlugins/APM/APMSubFrameComponent.qml

@ -189,6 +189,20 @@ SetupPage { @@ -189,6 +189,20 @@ SetupPage {
}
Flow {
function getParametersFile(frame) {
const filename = frame === "heavy" ? "Sub/bluerov2-heavy" : "Sub/bluerov2"
if (globals.activeVehicle.versionCompare(4 ,0 ,0) >= 0) {
return filename + "-4_0_0.params"
}
if (globals.activeVehicle.versionCompare(3 ,5 ,4) >= 0) {
return filename + "-3_5_4.params"
}
if (globals.activeVehicle.versionCompare(3 ,5 ,2) >= 0) {
return filename + "-3_5_2.params"
}
return filename + "-3_5.params"
}
anchors.margins: _margins
anchors.top: applyParamsText.bottom
anchors.left: parent.left
@ -200,10 +214,9 @@ SetupPage { @@ -200,10 +214,9 @@ SetupPage {
QGCButton {
width: parent.width
text: "Blue Robotics BlueROV2"
property var file: _oldFW ? "Sub/bluerov2-3_5.params" : "Sub/bluerov2-3_5_2.params"
onClicked : {
controller.loadParameters(file)
controller.loadParameters(parent.getParametersFile())
hideDialog()
}
}
@ -211,10 +224,9 @@ SetupPage { @@ -211,10 +224,9 @@ SetupPage {
QGCButton {
width: parent.width
text: "Blue Robotics BlueROV2 Heavy"
property var file: "Sub/bluerov2-heavy-3_5_2.params"
onClicked : {
controller.loadParameters(file)
controller.loadParameters(parent.getParametersFile("heavy"))
hideDialog()
}
}

Loading…
Cancel
Save