Commit d7b26227 authored by Don Gagne's avatar Don Gagne

Unused formal parameter, unused local variable and a couple unreachable code changes

parent aa4de767
......@@ -3070,6 +3070,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);
......
......@@ -117,6 +117,9 @@ HUD::HUD(int width, int height, QWidget* parent)
imageRequested(false),
image(NULL)
{
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();
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
};
/**
......
......@@ -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