Commit fb48b351 authored by Pritam Ghanghas's avatar Pritam Ghanghas

some cosmetic changes, rename variables

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