diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index aaeb2842eb0631e25e1c9bbb21fa31313d284405..f9df2416364608a87f7aed71b0f03c827d58997e 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -38,11 +38,11 @@ struct FirmwareToUrlElement_t { QString url; }; -uint qHash(const FirmwareUpgradeController::FirmwareIdentifier& firmwareIDTrinity) +uint qHash(const FirmwareUpgradeController::FirmwareIdentifier& firmwareId) { - return ( firmwareIDTrinity.autopilotStackType | - (firmwareIDTrinity.firmwareType << 8) | - (firmwareIDTrinity.firmwareVehicleType << 16) ); + return ( firmwareId.autopilotStackType | + (firmwareId.firmwareType << 8) | + (firmwareId.firmwareVehicleType << 16) ); } /// @Brief Constructs a new FirmwareUpgradeController Widget. This widget is used within the PX4VehicleConfig set of screens. @@ -308,7 +308,7 @@ void FirmwareUpgradeController::_bootloaderSyncFailed(void) } /// @brief Prompts the user to select a firmware file if needed and moves the state machine to the next state. -void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareIDTrinity) +void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareId) { // make sure the firmware hashes are populated _initFirmwareHash(); @@ -342,20 +342,20 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareIDTr break; } - if (prgFirmware.isEmpty() && firmwareIDTrinity.firmwareType != CustomFirmware) { + if (prgFirmware.isEmpty() && firmwareId.firmwareType != CustomFirmware) { _errorCancel("Attempting to flash an unknown board type, you must select 'Custom firmware file'"); return; } - if (firmwareIDTrinity.firmwareType == CustomFirmware) { + if (firmwareId.firmwareType == CustomFirmware) { _firmwareFilename = QGCFileDialog::getOpenFileName(NULL, // Parent to main window "Select Firmware File", // Dialog Caption QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), // Initial directory "Firmware Files (*.px4 *.bin *.ihx)"); // File filter } else { - if (prgFirmware.contains(firmwareIDTrinity)) { - _firmwareFilename = prgFirmware.value(firmwareIDTrinity); + if (prgFirmware.contains(firmwareId)) { + _firmwareFilename = prgFirmware.value(firmwareId); } else { _errorCancel("Unable to find specified firmware download location"); return; diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index 1c1f9f64270f45ce04d54de765ba0cd9a90d3f31..f6cf376eb9725b9140822d15141abadd1f52c3cd 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -90,11 +90,11 @@ public: FirmwareVehicleType_t vehicle = DefaultVehicleFirmware) : autopilotStackType(stack), firmwareType(firmware), firmwareVehicleType(vehicle) {} - bool operator==(const FirmwareIdentifier& firmwareIDTrinity) const + bool operator==(const FirmwareIdentifier& firmwareId) const { - return (firmwareIDTrinity.autopilotStackType == autopilotStackType && - firmwareIDTrinity.firmwareType == firmwareType && - firmwareIDTrinity.firmwareVehicleType == firmwareVehicleType); + return (firmwareId.autopilotStackType == autopilotStackType && + firmwareId.firmwareType == firmwareType && + firmwareId.firmwareVehicleType == firmwareVehicleType); } // members @@ -173,7 +173,7 @@ private slots: void _linkDisconnected(LinkInterface* link); private: - void _getFirmwareFile(FirmwareIdentifier firmwareIDTrinity); + void _getFirmwareFile(FirmwareIdentifier firmwareId); void _initFirmwareHash(); void _downloadFirmware(void); void _appendStatusLog(const QString& text, bool critical = false); @@ -228,6 +228,6 @@ private: }; // global hashing function -uint qHash(const FirmwareUpgradeController::FirmwareIdentifier& firmwareIDTrinity); +uint qHash(const FirmwareUpgradeController::FirmwareIdentifier& firmwareId); #endif