Commit 0520baf5 authored by Gus Grubba's avatar Gus Grubba

Firmware Upgrade Fixes

Custom, single firmware upgrades were fixed to "stable", even if the user selected "custom".
The code, when selecting the firmware type was using the combo box model index instead of the actual type defined by the list model.
parent 05992691
......@@ -168,7 +168,7 @@ SetupPage {
function accept() {
hideDialog()
if (_singleFirmwareMode) {
controller.flashSingleFirmwareMode()
controller.flashSingleFirmwareMode(controller.selectedFirmwareType)
} else {
var stack = apmFlightStack.checked ? FirmwareUpgradeController.AutoPilotStackAPM : FirmwareUpgradeController.AutoPilotStackPX4
if (px4Flow) {
......@@ -353,7 +353,7 @@ SetupPage {
currentIndex: controller.selectedFirmwareType
onActivated: {
controller.selectedFirmwareType = index
controller.selectedFirmwareType = model.get(index).firmwareType
if (model.get(index).firmwareType === FirmwareUpgradeController.BetaFirmware) {
firmwareVersionWarningLabel.visible = true
firmwareVersionWarningLabel.text = qsTr("WARNING: BETA FIRMWARE. ") +
......
......@@ -114,9 +114,9 @@ void FirmwareUpgradeController::flash(const FirmwareIdentifier& firmwareId)
flash(firmwareId.autopilotStackType, firmwareId.firmwareType, firmwareId.firmwareVehicleType);
}
void FirmwareUpgradeController::flashSingleFirmwareMode(void)
void FirmwareUpgradeController::flashSingleFirmwareMode(FirmwareType_t firmwareType)
{
flash(SingleFirmwareMode, StableFirmware, DefaultVehicleFirmware);
flash(SingleFirmwareMode, firmwareType, DefaultVehicleFirmware);
}
void FirmwareUpgradeController::cancel(void)
......
......@@ -123,7 +123,7 @@ public:
FirmwareVehicleType_t vehicleType = DefaultVehicleFirmware );
/// Called to flash when upgrade is running in singleFirmwareMode
Q_INVOKABLE void flashSingleFirmwareMode(void);
Q_INVOKABLE void flashSingleFirmwareMode(FirmwareType_t firmwareType);
Q_INVOKABLE FirmwareVehicleType_t vehicleTypeFromVersionIndex(int index);
......
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