From 080cc0bfe8c44b36bacc31207e92f1ba874615a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 17 Feb 2020 18:54:27 -0300 Subject: [PATCH 1/3] AutoPilotPlugins: Use QElapsedTimer over deprecated QTime::start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/AutoPilotPlugins/Common/RadioComponentController.cc | 1 + src/AutoPilotPlugins/Common/RadioComponentController.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/Common/RadioComponentController.cc b/src/AutoPilotPlugins/Common/RadioComponentController.cc index b6b7bd2..59864de 100644 --- a/src/AutoPilotPlugins/Common/RadioComponentController.cc +++ b/src/AutoPilotPlugins/Common/RadioComponentController.cc @@ -15,6 +15,7 @@ #include "RadioComponentController.h" #include "QGCApplication.h" +#include #include QGC_LOGGING_CATEGORY(RadioComponentControllerLog, "RadioComponentControllerLog") diff --git a/src/AutoPilotPlugins/Common/RadioComponentController.h b/src/AutoPilotPlugins/Common/RadioComponentController.h index 86ee03b..db6cdce 100644 --- a/src/AutoPilotPlugins/Common/RadioComponentController.h +++ b/src/AutoPilotPlugins/Common/RadioComponentController.h @@ -310,7 +310,7 @@ private: int _stickDetectInitialValue; int _stickDetectValue; bool _stickDetectSettleStarted; - QTime _stickDetectSettleElapsed; + QElapsedTimer _stickDetectSettleElapsed; static const int _stickDetectSettleMSecs; bool _unitTestMode = false; From 8cdc908868c932648a44ad5c63d360f56c053ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 17 Feb 2020 18:54:48 -0300 Subject: [PATCH 2/3] Vehicle: Use QElapsedTimer over deprecated QTime::start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/Vehicle/Vehicle.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index b124d80..611eaaa 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -9,6 +9,7 @@ #pragma once +#include #include #include #include @@ -1515,7 +1516,7 @@ private: QString _gitHash; quint64 _uid; - QTime _lastBatteryAnnouncement; + QElapsedTimer _lastBatteryAnnouncement; int _lastAnnouncedLowBatteryPercent; SharedLinkInterfacePointer _priorityLink; // We always keep a reference to the priority link to manage shutdown ordering From 248fef231881446cfd1643567fb9569656cd3c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 17 Feb 2020 18:55:41 -0300 Subject: [PATCH 3/3] VehicleSetup: Use QElapsedTimer over deprecated QTime::start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/VehicleSetup/Bootloader.cc | 6 +++--- src/VehicleSetup/JoystickConfigController.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/VehicleSetup/Bootloader.cc b/src/VehicleSetup/Bootloader.cc index a5382b3..86138b6 100644 --- a/src/VehicleSetup/Bootloader.cc +++ b/src/VehicleSetup/Bootloader.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "QGC.h" @@ -54,9 +54,9 @@ bool Bootloader::_write(QSerialPort* port, const uint8_t byte) bool Bootloader::_read(QSerialPort* port, uint8_t* data, qint64 maxSize, int readTimeout) { qint64 bytesAlreadyRead = 0; - + while (bytesAlreadyRead < maxSize) { - QTime timeout; + QElapsedTimer timeout; timeout.start(); while (port->bytesAvailable() < 1) { if (timeout.elapsed() > readTimeout) { diff --git a/src/VehicleSetup/JoystickConfigController.h b/src/VehicleSetup/JoystickConfigController.h index a840aa1..1105027 100644 --- a/src/VehicleSetup/JoystickConfigController.h +++ b/src/VehicleSetup/JoystickConfigController.h @@ -14,7 +14,7 @@ #ifndef JoystickConfigController_H #define JoystickConfigController_H -#include +#include #include "FactPanelController.h" #include "QGCLoggingCategory.h" @@ -273,7 +273,7 @@ private: int _stickDetectInitialValue; int _stickDetectValue; bool _stickDetectSettleStarted; - QTime _stickDetectSettleElapsed; + QElapsedTimer _stickDetectSettleElapsed; static const int _stickDetectSettleMSecs;