Skip to content

Commit

Permalink
QGC: Remove Unused Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Jan 15, 2025
1 parent 5047a10 commit a5747c5
Show file tree
Hide file tree
Showing 10 changed files with 197 additions and 263 deletions.
4 changes: 2 additions & 2 deletions src/AnalyzeView/MAVLinkChartController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "MAVLinkChartController.h"
#include "MAVLinkInspectorController.h"
#include "MAVLinkMessageField.h"
#include "QGC.h"
#include "QGCApplication.h"
#include "QGCLoggingCategory.h"

#include <QtCharts/QAbstractSeries>
Expand Down Expand Up @@ -82,7 +82,7 @@ void MAVLinkChartController::updateXRange()
return;
}

const qint64 bootTime = static_cast<qint64>(QGC::bootTimeMilliseconds());
const qint64 bootTime = static_cast<qint64>(qgcApp()->msecsSinceBoot());
_rangeXMax = QDateTime::fromMSecsSinceEpoch(bootTime);
emit rangeXMaxChanged();

Expand Down
6 changes: 3 additions & 3 deletions src/AnalyzeView/MAVLinkMessageField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "MAVLinkMessageField.h"
#include "MAVLinkChartController.h"
#include "MAVLinkMessage.h"
#include "QGC.h"
#include "QGCApplication.h"
#include "QGCLoggingCategory.h"

#include <QtCharts/QLineSeries>
Expand Down Expand Up @@ -98,13 +98,13 @@ void QGCMAVLinkMessageField::updateValue(const QString &newValue, qreal v)

const int count = _values.count();
if (count < (50 * 60)) { ///< Arbitrary limit of 1 minute of data at 50Hz for now
const QPointF p(QGC::bootTimeMilliseconds(), v);
const QPointF p(qgcApp()->msecsSinceBoot(), v);
_values.append(p);
} else {
if (_dataIndex >= count) {
_dataIndex = 0;
}
_values[_dataIndex].setX(QGC::bootTimeMilliseconds());
_values[_dataIndex].setX(qgcApp()->msecsSinceBoot());
_values[_dataIndex].setY(v);
_dataIndex++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/AutoPilotPlugins/PX4/AirframeComponentController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include "MultiVehicleManager.h"
#include "QGCApplication.h"
#include "LinkManager.h"
#include "QGC.h"
#include "Fact.h"
#include "Vehicle.h"
#include "ParameterManager.h"

#include <QtCore/QThread>
#include <QtCore/QVariant>
#include <QtQml/QtQml>
#include <QtGui/QCursor>
Expand Down Expand Up @@ -123,7 +123,7 @@ void AirframeComponentController::_rebootAfterStackUnwind(void)
_vehicle->sendMavCommand(_vehicle->defaultComponentId(), MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN, true /* showError */, 1.0f);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
for (unsigned i = 0; i < 2000; i++) {
QGC::SLEEP::usleep(500);
QThread::usleep(500);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}
QGuiApplication::restoreOverrideCursor();
Expand Down
6 changes: 3 additions & 3 deletions src/FirmwarePlugin/FirmwarePlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include "VehicleCameraControl.h"
#include "VehicleComponent.h"
#include "MAVLinkProtocol.h"
#include "QGC.h"
#include "QGCLoggingCategory.h"

#include <QtCore/QRegularExpression>
#include <QtCore/QThread>

QGC_LOGGING_CATEGORY(FirmwarePluginLog, "FirmwarePluginLog")

Expand Down Expand Up @@ -356,7 +356,7 @@ bool FirmwarePlugin::_armVehicleAndValidate(Vehicle* vehicle)
vehicleArmed = true;
break;
}
QGC::SLEEP::msleep(100);
QThread::msleep(100);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}

Expand All @@ -381,7 +381,7 @@ bool FirmwarePlugin::_setFlightModeAndValidate(Vehicle* vehicle, const QString&
flightModeChanged = true;
break;
}
QGC::SLEEP::msleep(100);
QThread::msleep(100);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}
if (flightModeChanged) {
Expand Down
Loading

0 comments on commit a5747c5

Please sign in to comment.