Commit 1518d206 authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #472 from DonLakeFlyer/ReorderWarnings

Reorder warnings
parents 75a27239 c9cdc464
......@@ -129,7 +129,6 @@ MacBuild | LinuxBuild {
QMAKE_CXXFLAGS_WARN_ON += \
-Wall \
-Wno-unused-parameter \
-Wno-reorder \
-Wno-unused-variable \
-Wno-narrowing \
-Wno-unused-function
......
......@@ -7,8 +7,14 @@
#include "XbeeLink.h"
XbeeLink::XbeeLink(QString portName, int baudRate) :
m_xbeeCon(NULL), m_portName(NULL), m_portNameLength(0), m_baudRate(baudRate), m_connected(false), m_id(-1),
m_addrHigh(0), m_addrLow(0)
m_xbeeCon(NULL),
m_id(-1),
m_portName(NULL),
m_portNameLength(0),
m_baudRate(baudRate),
m_connected(false),
m_addrHigh(0),
m_addrLow(0)
{
/* setup the xbee */
......
......@@ -115,23 +115,19 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
altitudeAMSL(0.0),
altitudeRelative(0.0),
airSpeed(std::numeric_limits<double>::quiet_NaN()),
groundSpeed(std::numeric_limits<double>::quiet_NaN()),
globalEstimatorActive(false),
latitude_gps(0.0),
longitude_gps(0.0),
altitude_gps(0.0),
speedX(0.0),
speedY(0.0),
speedZ(0.0),
globalEstimatorActive(false),
latitude_gps(0.0),
longitude_gps(0.0),
altitude_gps(0.0),
nedPosGlobalOffset(0,0,0),
nedAttGlobalOffset(0,0,0),
waypointManager(this),
paramMgr(this),
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
receivedOverlayTimestamp(0.0),
receivedObstacleListTimestamp(0.0),
......@@ -140,6 +136,10 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
receivedRGBDImageTimestamp(0.0),
#endif
airSpeed(std::numeric_limits<double>::quiet_NaN()),
groundSpeed(std::numeric_limits<double>::quiet_NaN()),
waypointManager(this),
attitudeKnown(false),
attitudeStamped(false),
lastAttitude(0),
......@@ -148,7 +148,12 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
pitch(0.0),
yaw(0.0),
blockHomePositionChanges(false),
receivedMode(false),
paramsOnceRequested(false),
paramMgr(this),
simulation(0),
// The protected members.
......@@ -159,9 +164,7 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
hilEnabled(false),
sensorHil(false),
lastSendTimeGPS(0),
lastSendTimeSensors(0),
blockHomePositionChanges(false),
receivedMode(false)
lastSendTimeSensors(0)
{
for (unsigned int i = 0; i<255;++i)
{
......@@ -3070,6 +3073,11 @@ void UAS::sendHilGroundTruth(quint64 time_us, float roll, float pitch, float yaw
float pitchspeed, float yawspeed, double lat, double lon, double alt,
float vx, float vy, float vz, float ind_airspeed, float true_airspeed, float xacc, float yacc, float zacc)
{
Q_UNUSED(time_us);
Q_UNUSED(xacc);
Q_UNUSED(yacc);
Q_UNUSED(zacc);
float q[4];
double cosPhi_2 = cos(double(roll) / 2.0);
......
......@@ -57,6 +57,7 @@ This file is part of the QGROUNDCONTROL project
*/
HUD::HUD(int width, int height, QWidget* parent)
: QLabel(parent),
image(NULL),
uas(NULL),
yawInt(0.0f),
mode(tr("UNKNOWN MODE")),
......@@ -111,12 +112,14 @@ HUD::HUD(int width, int height, QWidget* parent)
nextOfflineImage(""),
HUDInstrumentsEnabled(false),
videoEnabled(true),
imageLoggingEnabled(false),
xImageFactor(1.0),
yImageFactor(1.0),
imageLoggingEnabled(false),
imageRequested(false),
image(NULL)
imageRequested(false)
{
Q_UNUSED(width);
Q_UNUSED(height);
// Set auto fill to false
setAutoFillBackground(false);
......@@ -501,11 +504,18 @@ void HUD::paintText(QString text, QColor color, float fontSize, float refX, floa
*/
void HUD::setupGLView(float referencePositionX, float referencePositionY, float referenceWidth, float referenceHeight)
{
Q_UNUSED(referencePositionX);
Q_UNUSED(referencePositionY);
Q_UNUSED(referenceWidth);
Q_UNUSED(referenceHeight);
#if 0
// code ifdef'ed out but left in to silence warnings
int pixelWidth = (int)(referenceWidth * scalingFactor);
int pixelHeight = (int)(referenceHeight * scalingFactor);
// Translate and scale the GL view in the virtual reference coordinate units on the screen
int pixelPositionX = (int)((referencePositionX * scalingFactor) + xCenterOffset);
int pixelPositionY = this->height() - (referencePositionY * scalingFactor) + yCenterOffset - pixelHeight;
#endif
}
void HUD::paintRollPitchStrips()
......@@ -515,7 +525,7 @@ void HUD::paintRollPitchStrips()
void HUD::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
paintHUD();
}
......
......@@ -121,13 +121,13 @@ MainWindow::MainWindow(QWidget *parent):
currentStyle(QGC_MAINWINDOW_STYLE_DARK),
aboutToCloseFlag(false),
changingViewsFlag(false),
mavlink(new MAVLinkProtocol()),
centerStackActionGroup(new QActionGroup(this)),
darkStyleFileName(defaultDarkStyle),
lightStyleFileName(defaultLightStyle),
autoReconnect(false),
simulationLink(NULL),
lowPowerMode(false),
mavlink(new MAVLinkProtocol()),
customMode(CUSTOM_MODE_NONE),
menuActionHelper(new MenuActionHelper())
{
......@@ -800,6 +800,7 @@ void MainWindow::loadDockWidget(const QString& name)
void MainWindow::addToCentralStackedWidget(QWidget* widget, VIEW_SECTIONS viewSection, const QString& title)
{
Q_UNUSED(viewSection);
Q_UNUSED(title);
Q_ASSERT(widget->objectName().length() != 0);
......
......@@ -606,6 +606,8 @@ void PrimaryFlightDisplay::drawPitchScale(
bool drawNumbersRight
) {
Q_UNUSED(intrusion);
float displayPitch = this->pitch;
if (isnan(displayPitch))
displayPitch = 0;
......
......@@ -11,8 +11,8 @@
QGCBaseParamWidget::QGCBaseParamWidget(QWidget *parent) :
QWidget(parent),
mav(NULL),
paramMgr(NULL),
mav(NULL),
updatingParamNameLock("")
{
}
......
......@@ -48,7 +48,7 @@ QGCHilConfiguration::~QGCHilConfiguration()
void QGCHilConfiguration::setVersion(QString version)
{
Q_UNUSED(version);
}
void QGCHilConfiguration::on_simComboBox_currentIndexChanged(int index)
......
......@@ -355,6 +355,8 @@ void QGCPX4VehicleConfig::toggleCalibrationRC(bool enabled)
void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled)
{
Q_UNUSED(enabled);
if (!ui->dsm2RadioButton->isChecked() && !ui->dsmxRadioButton && !ui->dsmx8RadioButton) {
// Reject
QMessageBox warnMsgBox;
......
......@@ -13,8 +13,8 @@
QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
QDialog(parent, flags),
ui(new Ui::QGCSettingsWidget),
mainWindow((MainWindow*)parent)
mainWindow((MainWindow*)parent),
ui(new Ui::QGCSettingsWidget)
{
ui->setupUi(this);
......
......@@ -47,6 +47,7 @@ void UASRawStatusView::valueChanged(const int uasId, const QString& name, const
}
void UASRawStatusView::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event);
m_tableDirty = true;
}
......
......@@ -25,7 +25,10 @@ void AP2ConfigWidget::activeUASSet(UASInterface *uas)
void AP2ConfigWidget::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
Q_UNUSED(parameterName);
Q_UNUSED(value);
}
void AP2ConfigWidget::showNullMAVErrorMessageBox()
{
......
......@@ -71,6 +71,8 @@ void AccelCalibrationConfig::calibrateButtonClicked()
}
void AccelCalibrationConfig::hideEvent(QHideEvent *evt)
{
Q_UNUSED(evt);
if (!m_uas || !m_accelAckCount)
{
return;
......@@ -82,6 +84,9 @@ void AccelCalibrationConfig::hideEvent(QHideEvent *evt)
}
void AccelCalibrationConfig::uasTextMessageReceived(int uasid, int componentid, int severity, QString text)
{
Q_UNUSED(uasid);
Q_UNUSED(componentid);
//command received: " Severity 1
//Place APM Level and press any key" severity 5
if (severity == 5)
......
......@@ -25,7 +25,9 @@ void AdvParameterList::setParameterMetaData(QString name,QString humanname,QStri
void AdvParameterList::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (!m_paramValueMap.contains(parameterName))
{
ui.tableWidget->setRowCount(ui.tableWidget->rowCount()+1);
......
......@@ -33,6 +33,9 @@ void AdvancedParamConfig::addCombo(QString title,QString description,QString par
}
void AdvancedParamConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (m_paramToWidgetMap.contains(parameterName))
{
if (value.type() == QVariant::Double)
......
......@@ -14,6 +14,9 @@ AirspeedConfig::~AirspeedConfig()
}
void AirspeedConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "ARSPD_ENABLE")
{
if (value.toInt() == 0)
......
......@@ -387,6 +387,7 @@ void ApmFirmwareConfig::flashButtonClicked()
void ApmFirmwareConfig::firmwareListError(QNetworkReply::NetworkError error)
{
Q_UNUSED(error);
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
qDebug() << "Error!" << reply->errorString();
}
......
......@@ -52,6 +52,9 @@ void ApmPlaneLevel::manualCheckBoxToggled(bool checked)
}
void ApmPlaneLevel::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "MANUAL_LEVEL")
{
if (value.toInt() == 1)
......
......@@ -139,6 +139,9 @@ ArduCopterPidConfig::~ArduCopterPidConfig()
}
void ArduCopterPidConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (m_nameToBoxMap.contains(parameterName))
{
m_nameToBoxMap[parameterName]->setValue(value.toDouble());
......
......@@ -66,6 +66,9 @@ ArduPlanePidConfig::~ArduPlanePidConfig()
}
void ArduPlanePidConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (m_nameToBoxMap.contains(parameterName))
{
m_nameToBoxMap[parameterName]->setValue(value.toDouble());
......
......@@ -73,6 +73,9 @@ void ArduRoverPidConfig::refreshButtonClicked()
void ArduRoverPidConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (nameToBoxMap.contains(parameterName))
{
nameToBoxMap[parameterName]->setValue(value.toFloat());
......
......@@ -49,6 +49,7 @@ void BatteryMonitorConfig::activeUASSet(UASInterface *uas)
}
void BatteryMonitorConfig::alertOnLowClicked(bool checked)
{
Q_UNUSED(checked);
}
void BatteryMonitorConfig::calcDividerSet()
......@@ -246,6 +247,11 @@ BatteryMonitorConfig::~BatteryMonitorConfig()
}
void BatteryMonitorConfig::batteryChanged(UASInterface* uas, double voltage, double current, double percent, int seconds)
{
Q_UNUSED(uas);
Q_UNUSED(current);
Q_UNUSED(percent);
Q_UNUSED(seconds);
ui.calcVoltsLineEdit->setText(QString::number(voltage,'f',2));
if (ui.measuredVoltsLineEdit->text() == "")
{
......@@ -255,6 +261,9 @@ void BatteryMonitorConfig::batteryChanged(UASInterface* uas, double voltage, dou
void BatteryMonitorConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "VOLT_DIVIDER")
{
ui.calcDividerLineEdit->setText(QString::number(value.toFloat(),'f',4));
......
......@@ -265,6 +265,9 @@ CameraGimbalConfig::~CameraGimbalConfig()
void CameraGimbalConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "MNT_ANGMIN_TIL") //TILT
{
ui.tiltAngleMinSpinBox->setValue(value.toInt() / 100.0);
......
......@@ -46,6 +46,9 @@ CompassConfig::~CompassConfig()
}
void CompassConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "MAG_ENABLE")
{
if (value.toInt() == 0)
......
......@@ -278,6 +278,9 @@ void FailSafeConfig::activeUASSet(UASInterface *uas)
}
void FailSafeConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
//Arducopter
if (parameterName == "FS_THR_ENABLE")
{
......@@ -414,6 +417,8 @@ void FailSafeConfig::remoteControlChannelRawChanges(int chan,float value)
}
void FailSafeConfig::hilActuatorsChanged(uint64_t time, float act1, float act2, float act3, float act4, float act5, float act6, float act7, float act8)
{
Q_UNUSED(time);
ui.radio1Out->setValue(act1);
ui.radio2Out->setValue(act2);
ui.radio3Out->setValue(act3);
......@@ -425,6 +430,8 @@ void FailSafeConfig::hilActuatorsChanged(uint64_t time, float act1, float act2,
}
void FailSafeConfig::gpsStatusChanged(UASInterface* uas,int fixtype)
{
Q_UNUSED(uas);
if (fixtype == 0 || fixtype == 1)
{
ui.gpsLabel->setText("<h1>None</h1>");
......
......@@ -52,6 +52,9 @@ FrameTypeConfig::~FrameTypeConfig()
}
void FrameTypeConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "FRAME")
{
ui.xRadioButton->setEnabled(true);
......
......@@ -13,6 +13,9 @@ OpticalFlowConfig::~OpticalFlowConfig()
}
void OpticalFlowConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "FLOW_ENABLE")
{
if (value.toInt() == 0)
......
......@@ -48,6 +48,8 @@ ParamWidget::~ParamWidget()
void ParamWidget::setupInt(QString title,QString description,int value,int min,int max)
{
Q_UNUSED(value);
type = INT;
ui.titleLabel->setText("<h3>" + title + "</h3>");
ui.descriptionLabel->setText(description);
......@@ -71,6 +73,8 @@ void ParamWidget::setupInt(QString title,QString description,int value,int min,i
void ParamWidget::setupDouble(QString title,QString description,double value,double min,double max)
{
Q_UNUSED(value);
type = DOUBLE;
ui.titleLabel->setText("<h3>" + title + "</h3>");
ui.descriptionLabel->setText(description);
......
......@@ -119,7 +119,10 @@ void RadioCalibrationConfig::remoteControlChannelRawChanged(int chan,float val)
void RadioCalibrationConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
Q_UNUSED(parameterName);
Q_UNUSED(value);
}
void RadioCalibrationConfig::guiUpdateTimerTick()
{
......@@ -153,10 +156,12 @@ void RadioCalibrationConfig::guiUpdateTimerTick()
}
void RadioCalibrationConfig::showEvent(QShowEvent *event)
{
Q_UNUSED(event);
guiUpdateTimer->start(100);
}
void RadioCalibrationConfig::hideEvent(QHideEvent *event)
{
Q_UNUSED(event);
guiUpdateTimer->stop();
}
void RadioCalibrationConfig::calibrateButtonClicked()
......
......@@ -32,6 +32,8 @@ void SonarConfig::checkBoxToggled(bool enabled)
}
void SonarConfig::sonarTypeChanged(int index)
{
Q_UNUSED(index);
if (!m_uas)
{
QMessageBox::information(0,tr("Error"),tr("Please connect to a MAV before attempting to set configuration"));
......@@ -42,6 +44,9 @@ void SonarConfig::sonarTypeChanged(int index)
void SonarConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (parameterName == "SONAR_ENABLE")
{
if (value.toInt() == 0)
......
......@@ -31,6 +31,9 @@ void StandardParamConfig::addCombo(QString title,QString description,QString par
}
void StandardParamConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
if (paramToWidgetMap.contains(parameterName))
{
if (value.type() == QVariant::Double)
......
......@@ -257,6 +257,7 @@ void TerminalConsole::setBaudRate(int index)
void TerminalConsole::setLink(int index)
{
Q_UNUSED(index);
m_settings.name = ui->linkComboBox->currentText();
qDebug() << "Changed Link to:" << m_settings.name;
......
......@@ -34,6 +34,8 @@ void QGCRadioChannelDisplay::setOrientation(Qt::Orientation orient)
void QGCRadioChannelDisplay::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
//Values range from 0-3000.
//1500 is the middle, static servo value.
QPainter painter(this);
......
......@@ -192,6 +192,10 @@ QList<QString> QGCToolWidget::getParamList()
}
void QGCToolWidget::setParameterValue(int uas, int component, QString parameterName, const QVariant value)
{
Q_UNUSED(uas);
Q_UNUSED(component);
Q_UNUSED(value);
QString widgetName = getTitle();
int size = settingsMap["count"].toInt();
if (paramToItemMap.contains(parameterName))
......
......@@ -61,8 +61,6 @@ private:
int d_count;
QwtArray<double> d_x;
QwtArray<double> d_y;
QTimer *d_timer;
int d_timerCount;
};
/**
......
......@@ -5,8 +5,8 @@
QGCViewModeSelection::QGCViewModeSelection(QWidget *parent) :
QWidget(parent),
selected(false),
ui(new Ui::QGCViewModeSelection)
ui(new Ui::QGCViewModeSelection),
selected(false)
{
ui->setupUi(this);
......
......@@ -7,12 +7,12 @@ QGCMapToolBar::QGCMapToolBar(QWidget *parent) :
ui(new Ui::QGCMapToolBar),
map(NULL),
optionsMenu(this),
mapTypesMenu(this),
trailPlotMenu(this),
updateTimesMenu(this),
mapTypesGroup(new QActionGroup(this)),
mapTypesMenu(this),
trailSettingsGroup(new QActionGroup(this)),
updateTimesGroup(new QActionGroup(this))
updateTimesGroup(new QActionGroup(this)),
mapTypesGroup(new QActionGroup(this))
{
ui->setupUi(this);
}
......
......@@ -190,6 +190,7 @@ void UASQuickView::sortItems(int columncount)
}
void UASQuickView::resizeEvent(QResizeEvent *evt)
{
Q_UNUSED(evt);
recalculateItemTextSizing();
}
void UASQuickView::recalculateItemTextSizing()
......@@ -273,6 +274,8 @@ void UASQuickView::valueChanged(const int uasId, const QString& name, const QStr
{
Q_UNUSED(uasId);
Q_UNUSED(unit);
Q_UNUSED(msec);
bool ok;
double value = variant.toDouble(&ok);
QMetaType::Type metaType = static_cast<QMetaType::Type>(variant.type());
......
......@@ -15,6 +15,8 @@ void UASQuickViewGaugeItem::setTitle(QString title)
}
void UASQuickViewGaugeItem::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event);
QFont valuefont = valueLabel->font();
QFont titlefont = titleLabel->font();
valuefont.setPixelSize(this->height() / 2.0);
......
......@@ -59,6 +59,8 @@ void UASQuickViewItemSelect::addItem(QString item,bool enabled)
}
void UASQuickViewItemSelect::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event);
/*for (int i=0;i<m_checkBoxList.size();i++)
{
ui.gridLayout->removeWidget(m_checkBoxList[i]);
......
......@@ -119,7 +119,10 @@ void UASQuickViewTextItem::setValuePixelSize(int size)
void UASQuickViewTextItem::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event);
return;
#if 0
// code ifdef'ed out to silence warnings
QFont valuefont = valueLabel->font();
QFont titlefont = titleLabel->font();
valuefont.setPixelSize(this->height());
......@@ -158,4 +161,5 @@ titlefont.setPixelSize(valuefont.pixelSize() / 2.0);
valueLabel->setFont(valuefont);
titleLabel->setFont(titlefont);
update();
#endif
}
......@@ -17,7 +17,6 @@ protected:
private:
QLabel *titleLabel;
QLabel *valueLabel;
QSpacerItem *spacerItem;
};
#endif // UASQUICKVIEWTEXTITEM_H
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