diff --git a/ground/openpilotgcs/src/app/main.cpp b/ground/openpilotgcs/src/app/main.cpp index e976375b3..23a06b1d7 100644 --- a/ground/openpilotgcs/src/app/main.cpp +++ b/ground/openpilotgcs/src/app/main.cpp @@ -211,6 +211,7 @@ inline QString msgSendArgumentFailed() void mainMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { + Q_UNUSED(context); QFile file(QDir::tempPath() + "/gcs.log"); if (file.open(QIODevice::Append | QIODevice::Text)) { diff --git a/ground/openpilotgcs/src/libs/eigen/Eigen/src/Core/util/Memory.h b/ground/openpilotgcs/src/libs/eigen/Eigen/src/Core/util/Memory.h index eff86a23f..6c45b7e61 100644 --- a/ground/openpilotgcs/src/libs/eigen/Eigen/src/Core/util/Memory.h +++ b/ground/openpilotgcs/src/libs/eigen/Eigen/src/Core/util/Memory.h @@ -229,7 +229,7 @@ template inline void ei_conditional_aligned_delete(T *pt template inline static Integer ei_alignmentOffset(const Scalar* array, Integer size) { - typedef typename ei_packet_traits::type Packet; + typedef typename ei_packet_traits::type Packet __attribute__ ((unused)); enum { PacketSize = ei_packet_traits::size, PacketAlignedMask = PacketSize-1 }; diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp index 0d81a8bdf..b56d84e75 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp @@ -34,7 +34,7 @@ using namespace projections; namespace internals { Core::Core() : MouseWheelZooming(false), currentPosition(0, 0), currentPositionPixel(0, 0), LastLocationInBounds(-1, -1), sizeOfMapArea(0, 0) - , minOfTiles(0, 0), maxOfTiles(0, 0), zoom(0), isDragging(false), TooltipTextPadding(10, 10), loaderLimit(5), maxzoom(21), started(false), runningThreads(0) + , minOfTiles(0, 0), maxOfTiles(0, 0), zoom(0), isDragging(false), TooltipTextPadding(10, 10), loaderLimit(5), maxzoom(21), runningThreads(0), started(false) { mousewheelzoomtype = MouseWheelZoomType::MousePositionAndCenter; SetProjection(new MercatorProjection()); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/lks94projection.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/lks94projection.cpp index 415bbf7f6..760609ba3 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/lks94projection.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/lks94projection.cpp @@ -88,14 +88,15 @@ QVector LKS94Projection::DTM10(const QVector & lonlat) double es; // Eccentricity squared : (a^2 - b^2)/a^2 double semiMajor = 6378137.0; // major axis double semiMinor = 6356752.3142451793; // minor axis - double ab; // Semi_major / semi_minor - double ba; // Semi_minor / semi_major - double ses; // Second eccentricity squared : (a^2 - b^2)/b^2 - es = 1.0 - (semiMinor * semiMinor) / (semiMajor * semiMajor); // e^2 - ses = (pow(semiMajor, 2) - pow(semiMinor, 2)) / pow(semiMinor, 2); - ba = semiMinor / semiMajor; - ab = semiMajor / semiMinor; + // double ab; // Semi_major / semi_minor + // double ba; // Semi_minor / semi_major + // double ses; // Second eccentricity squared : (a^2 - b^2)/b^2 + + es = 1.0 - (semiMinor * semiMinor) / (semiMajor * semiMajor); // e^2 + // ses = (pow(semiMajor, 2) - pow(semiMinor, 2)) / pow(semiMinor, 2); + // ba = semiMinor / semiMajor; + // ab = semiMajor / semiMinor; // ... @@ -121,14 +122,14 @@ QVector LKS94Projection::MTD10(QVector & pnt) double es; // Eccentricity squared : (a^2 - b^2)/a^2 double semiMajor = 6378137.0; // major axis double semiMinor = 6356752.3141403561; // minor axis - double ab; // Semi_major / semi_minor - double ba; // Semi_minor / semi_major + // double ab; // Semi_major / semi_minor + // double ba; // Semi_minor / semi_major double ses; // Second eccentricity squared : (a^2 - b^2)/b^2 es = 1.0 - (semiMinor * semiMinor) / (semiMajor * semiMajor); // e^2 ses = (pow(semiMajor, 2) - pow(semiMinor, 2)) / pow(semiMinor, 2); - ba = semiMinor / semiMajor; - ab = semiMajor / semiMinor; + // ba = semiMinor / semiMajor; + // ab = semiMajor / semiMinor; // ... @@ -201,11 +202,13 @@ QVector LKS94Projection::DTM00(QVector & lonlat) double metersPerUnit = 1.0; double e0, e1, e2, e3; // eccentricity constants - double e, es, esp; // eccentricity constants + // double e; + double es; + double esp; // eccentricity constants double ml0; // small value m es = 1.0 - pow(semiMinor / semiMajor, 2); - e = sqrt(es); + // e = sqrt(es); e0 = e0fn(es); e1 = e1fn(es); e2 = e2fn(es); @@ -262,14 +265,15 @@ QVector LKS94Projection::DTM01(QVector & lonlat) double es; // Eccentricity squared : (a^2 - b^2)/a^2 double semiMajor = 6378137.0; // major axis double semiMinor = 6356752.3141403561; // minor axis - double ab; // Semi_major / semi_minor - double ba; // Semi_minor / semi_major - double ses; // Second eccentricity squared : (a^2 - b^2)/b^2 - es = 1.0 - (semiMinor * semiMinor) / (semiMajor * semiMajor); - ses = (pow(semiMajor, 2) - pow(semiMinor, 2)) / pow(semiMinor, 2); - ba = semiMinor / semiMajor; - ab = semiMajor / semiMinor; + // double ab; // Semi_major / semi_minor + // double ba; // Semi_minor / semi_major + // double ses; // Second eccentricity squared : (a^2 - b^2)/b^2 + + es = 1.0 - (semiMinor * semiMinor) / (semiMajor * semiMajor); + // ses = (pow(semiMajor, 2) - pow(semiMinor, 2)) / pow(semiMinor, 2); + // ba = semiMinor / semiMajor; + // ab = semiMajor / semiMinor; // ... @@ -294,14 +298,14 @@ QVector LKS94Projection::MTD01(QVector & pnt) double es; // Eccentricity squared : (a^2 - b^2)/a^2 double semiMajor = 6378137.0; // major axis double semiMinor = 6356752.3142451793; // minor axis - double ab; // Semi_major / semi_minor - double ba; // Semi_minor / semi_major + // double ab; // Semi_major / semi_minor + // double ba; // Semi_minor / semi_major double ses; // Second eccentricity squared : (a^2 - b^2)/b^2 es = 1.0 - (semiMinor * semiMinor) / (semiMajor * semiMajor); ses = (pow(semiMajor, 2) - pow(semiMinor, 2)) / pow(semiMinor, 2); - ba = semiMinor / semiMajor; - ab = semiMajor / semiMinor; + // ba = semiMinor / semiMajor; + // ab = semiMajor / semiMinor; // ... @@ -378,12 +382,14 @@ QVector LKS94Projection::MTD11(QVector & p) double metersPerUnit = 1.0; double e0, e1, e2, e3; // eccentricity constants - double e, es, esp; // eccentricity constants + // double e; + double es; + double esp; // eccentricity constants double ml0; // small value m es = (semiMinor * semiMinor) / (semiMajor * semiMajor); es = 1.0 - es; - e = sqrt(es); + // e = sqrt(es); e0 = e0fn(es); e1 = e1fn(es); e2 = e2fn(es); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp index 16dd65272..4d6017721 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp @@ -56,7 +56,7 @@ Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const } internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, const int &y, const int &zoom) { - Size s = GetTileMatrixSizePixel(zoom); + // Size s = GetTileMatrixSizePixel(zoom); // double mapSizeX = s.Width(); // double mapSizeY = s.Height(); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp index 8544a67a5..cc338fc75 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp @@ -31,7 +31,8 @@ #include namespace mapcontrol { -MapGraphicItem::MapGraphicItem(internals::Core *core, Configuration *configuration) : core(core), config(configuration), MapRenderTransform(1), maxZoom(17), minZoom(2), zoomReal(0), isSelected(false), rotation(0), zoomDigi(0) +MapGraphicItem::MapGraphicItem(internals::Core *core, Configuration *configuration) : core(core), config(configuration), MapRenderTransform(1), + maxZoom(17), minZoom(2), zoomReal(0), zoomDigi(0), isSelected(false), rotation(0) { dragons.load(QString::fromUtf8(":/markers/images/dragons1.jpg")); showTileGridLines = false; diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp index 58190c735..4cf9975d5 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp @@ -31,8 +31,8 @@ namespace mapcontrol { double UAVItem::groundspeed_mps_filt = 0; -UAVItem::UAVItem(MapGraphicItem *map, OPMapWidget *parent, QString uavPic) : map(map), mapwidget(parent), showtrail(true), showtrailline(true), trailtime(5), traildistance(50), autosetreached(true) - , autosetdistance(100), altitude(0), showUAVInfo(false) +UAVItem::UAVItem(MapGraphicItem *map, OPMapWidget *parent, QString uavPic) : map(map), mapwidget(parent), altitude(0), showtrail(true), showtrailline(true), + trailtime(5), traildistance(50), autosetreached(true), autosetdistance(100), showUAVInfo(false) { pic.load(uavPic); this->setFlag(QGraphicsItem::ItemIsMovable, false); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp index 3748ab6d0..9cf9cc89e 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp @@ -29,8 +29,8 @@ #include "homeitem.h" namespace mapcontrol { -WayPointCircle::WayPointCircle(WayPointItem *center, WayPointItem *radius, bool clockwise, MapGraphicItem *map, QColor color) : my_center(center), - my_radius(radius), my_map(map), QGraphicsEllipseItem(map), myColor(color), myClockWise(clockwise) +WayPointCircle::WayPointCircle(WayPointItem *center, WayPointItem *radius, bool clockwise, MapGraphicItem *map, QColor color) : QGraphicsEllipseItem(map), + my_center(center), my_radius(radius), my_map(map), myColor(color), myClockWise(clockwise) { connect(center, SIGNAL(localPositionChanged(QPointF, WayPointItem *)), this, SLOT(refreshLocations())); connect(radius, SIGNAL(localPositionChanged(QPointF, WayPointItem *)), this, SLOT(refreshLocations())); @@ -40,8 +40,8 @@ WayPointCircle::WayPointCircle(WayPointItem *center, WayPointItem *radius, bool connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal))); } -WayPointCircle::WayPointCircle(HomeItem *radius, WayPointItem *center, bool clockwise, MapGraphicItem *map, QColor color) : my_center(center), - my_radius(radius), my_map(map), QGraphicsEllipseItem(map), myColor(color), myClockWise(clockwise) +WayPointCircle::WayPointCircle(HomeItem *radius, WayPointItem *center, bool clockwise, MapGraphicItem *map, QColor color) : QGraphicsEllipseItem(map), + my_center(center), my_radius(radius), my_map(map), myColor(color), myClockWise(clockwise) { connect(radius, SIGNAL(homePositionChanged(internals::PointLatLng, float)), this, SLOT(refreshLocations())); connect(center, SIGNAL(localPositionChanged(QPointF)), this, SLOT(refreshLocations())); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp index c90670475..7a187685c 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp @@ -337,7 +337,7 @@ void WayPointItem::SetReached(const bool &value) picture.load(QString::fromUtf8(":/markers/images/bigMarkerGreen.png")); } else { if (!isMagic) { - if (this->flags() & QGraphicsItem::ItemIsMovable == QGraphicsItem::ItemIsMovable) { + if ((this->flags() & QGraphicsItem::ItemIsMovable) == QGraphicsItem::ItemIsMovable) { picture.load(QString::fromUtf8(":/markers/images/marker.png")); } else { picture.load(QString::fromUtf8(":/markers/images/waypoint_marker2.png")); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp index eb750a1e6..62e595784 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp @@ -29,8 +29,8 @@ #include "homeitem.h" namespace mapcontrol { -WayPointLine::WayPointLine(WayPointItem *from, WayPointItem *to, MapGraphicItem *map, QColor color) : source(from), - destination(to), my_map(map), QGraphicsLineItem(map), myColor(color) +WayPointLine::WayPointLine(WayPointItem *from, WayPointItem *to, MapGraphicItem *map, QColor color) : QGraphicsLineItem(map), + source(from), destination(to), my_map(map), myColor(color) { this->setLine(to->pos().x(), to->pos().y(), from->pos().x(), from->pos().y()); connect(from, SIGNAL(localPositionChanged(QPointF, WayPointItem *)), this, SLOT(refreshLocations())); @@ -47,8 +47,8 @@ WayPointLine::WayPointLine(WayPointItem *from, WayPointItem *to, MapGraphicItem connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal))); } -WayPointLine::WayPointLine(HomeItem *from, WayPointItem *to, MapGraphicItem *map, QColor color) : source(from), - destination(to), my_map(map), QGraphicsLineItem(map), myColor(color) +WayPointLine::WayPointLine(HomeItem *from, WayPointItem *to, MapGraphicItem *map, QColor color) : QGraphicsLineItem(map), + source(from), destination(to), my_map(map), myColor(color) { this->setLine(to->pos().x(), to->pos().y(), from->pos().x(), from->pos().y()); connect(from, SIGNAL(homePositionChanged(internals::PointLatLng, float)), this, SLOT(refreshLocations())); diff --git a/ground/openpilotgcs/src/libs/qwt/src/src.pro b/ground/openpilotgcs/src/libs/qwt/src/src.pro index c8498533a..753b91f71 100644 --- a/ground/openpilotgcs/src/libs/qwt/src/src.pro +++ b/ground/openpilotgcs/src/libs/qwt/src/src.pro @@ -27,6 +27,9 @@ else { CONFIG += staticlib } +# disable all warnings (no need for warnings as qwt sources are imported) +CONFIG += exceptions warn_off + unix:!mac:LIBS += -lrt HEADERS += \ diff --git a/ground/openpilotgcs/src/libs/utils/logfile.cpp b/ground/openpilotgcs/src/libs/utils/logfile.cpp index 4c20b413f..4dad41bf3 100644 --- a/ground/openpilotgcs/src/libs/utils/logfile.cpp +++ b/ground/openpilotgcs/src/libs/utils/logfile.cpp @@ -105,7 +105,7 @@ void LogFile::timerFired() // TODO: going back in time will be a problem while ((m_lastPlayed + ((time - m_timeOffset) * m_playbackSpeed) > m_lastTimeStamp)) { m_lastPlayed += ((time - m_timeOffset) * m_playbackSpeed); - if (m_file.bytesAvailable() < sizeof(dataSize)) { + if (m_file.bytesAvailable() < (qint64)sizeof(dataSize)) { stopReplay(); return; } @@ -129,7 +129,7 @@ void LogFile::timerFired() emit readyRead(); - if (m_file.bytesAvailable() < sizeof(m_lastTimeStamp)) { + if (m_file.bytesAvailable() < (qint64)sizeof(m_lastTimeStamp)) { stopReplay(); return; } diff --git a/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp b/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp index dc349e726..4a61369da 100644 --- a/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp +++ b/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp @@ -63,7 +63,7 @@ bool XmlConfig::readXmlFile(QIODevice &device, QSettings::SettingsMap &map) .arg(errorLine) .arg(errorColumn) .arg(errorStr); - qFatal(err.toLatin1().data()); + qFatal("%s", err.toLatin1().data()); return false; } root = domDoc.documentElement(); @@ -99,7 +99,7 @@ void XmlConfig::handleNode(QDomElement *node, QSettings::SettingsMap &map, QStri } // qDebug() << "Node: " << ": " << path << " Children: " << node->childNodes().length(); - for (uint i = 0; i < node->childNodes().length(); ++i) { + for (int i = 0; i < node->childNodes().length(); ++i) { QDomNode child = node->childNodes().item(i); if (child.isElement()) { handleNode(static_cast(&child), map, path); diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp index 838a1f782..ad8c4cdc7 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp @@ -1447,7 +1447,7 @@ void ConfigCcpmWidget::setSwashplateLevel(int percent) ActuatorCommand::DataFields actuatorCommandData = actuatorCommand->getData(); for (int i = 0; i < CCPM_MAX_SWASH_SERVOS; i++) { - double value; + double value = 0; if (level == 0) { value = newSwashLvlConfiguration.Neutral[i]; } else if (level > 0) { diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configcustomwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configcustomwidget.cpp index 020138ba3..05c0a4b1f 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configcustomwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configcustomwidget.cpp @@ -78,6 +78,7 @@ ConfigCustomWidget::~ConfigCustomWidget() void ConfigCustomWidget::setupUI(QString frameType) { + Q_UNUSED(frameType); Q_ASSERT(m_aircraft); } @@ -91,7 +92,9 @@ void ConfigCustomWidget::registerWidgets(ConfigTaskWidget &parent) } void ConfigCustomWidget::resetActuators(GUIConfigDataUnion *configData) -{} +{ + Q_UNUSED(configData); +} /** Helper function to refresh the UI widget values @@ -219,6 +222,7 @@ QString ConfigCustomWidget::updateConfigObjectsFromWidgets() */ bool ConfigCustomWidget::throwConfigError(int numMotors) { + Q_UNUSED(numMotors); return false; } @@ -265,6 +269,8 @@ SpinBoxDelegate::SpinBoxDelegate(QObject *parent) : QWidget *SpinBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { + Q_UNUSED(option); + Q_UNUSED(index); QSpinBox *editor = new QSpinBox(parent); editor->setMinimum(-127); @@ -295,5 +301,6 @@ void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, c void SpinBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const { + Q_UNUSED(index); editor->setGeometry(option.rect); } diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp index d37a2ed74..545d81d75 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp @@ -86,7 +86,6 @@ void VehicleConfig::setConfigData(GUIConfigDataUnion configData) // get an instance of systemsettings SystemSettings *systemSettings = SystemSettings::GetInstance(getUAVObjectManager()); Q_ASSERT(systemSettings); - SystemSettings::DataFields systemSettingsData = systemSettings->getData(); UAVObjectField *guiConfig = systemSettings->getField("GUIConfigData"); Q_ASSERT(guiConfig); diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp index 74e9ecaa5..e4429ab1d 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp @@ -214,6 +214,7 @@ void ConfigCCAttitudeWidget::openHelp() void ConfigCCAttitudeWidget::setAccelFiltering(bool active) { + Q_UNUSED(active); setDirty(true); } diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index acb1ea601..d3348787c 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -914,7 +914,7 @@ void ConfigInputWidget::setMoveFromCommand(int command) // CHANNELNUMBER_ACCESSORY1=6, // CHANNELNUMBER_ACCESSORY2=7 - txMovements movement; + txMovements movement = moveLeftVerticalStick; switch (command) { case ManualControlSettings::CHANNELNUMBER_ROLL: @@ -1032,10 +1032,10 @@ void ConfigInputWidget::setTxMovement(txMovements movement) void ConfigInputWidget::moveTxControls() { QTransform trans; - QGraphicsItem *item; - txMovementType move; - int limitMax; - int limitMin; + QGraphicsItem *item = NULL; + txMovementType move = vertical; + int limitMax = 0; + int limitMin = 0; static bool auxFlag = false; switch (currentMovement) { diff --git a/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp b/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp index 9f85cbf76..78b9553ac 100644 --- a/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp @@ -896,11 +896,8 @@ void ConfigRevoWidget::doStartNoiseMeasurement() Q_UNUSED(lock); - RevoCalibration *revoCalibration = RevoCalibration::GetInstance(getObjectManager()); HomeLocation *homeLocation = HomeLocation::GetInstance(getObjectManager()); - Q_ASSERT(revoCalibration); Q_ASSERT(homeLocation); - RevoCalibration::DataFields revoCalibrationData = revoCalibration->getData(); HomeLocation::DataFields homeLocationData = homeLocation->getData(); // check if Homelocation is set diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h index c2ae524b8..e4312df58 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h @@ -54,8 +54,8 @@ private: // Milliseconds between automatic 'Instant Updates' static const int AUTOMATIC_UPDATE_RATE = 500; - int m_pidBankCount; int boardModel; + int m_pidBankCount; int m_currentPIDBank; protected: QString mapObjectName(const QString objectName); diff --git a/ground/openpilotgcs/src/plugins/config/fancytabwidget.cpp b/ground/openpilotgcs/src/plugins/config/fancytabwidget.cpp index 998f5145e..a34d176e2 100644 --- a/ground/openpilotgcs/src/plugins/config/fancytabwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/fancytabwidget.cpp @@ -123,7 +123,6 @@ void FancyTabBar::mouseMoveEvent(QMouseEvent *e) m_hoverRect = QRect(); if (m_hoverIndex >= 0) { - QRect oldHoverRect = m_hoverRect; m_hoverRect = tabRect(m_hoverIndex); m_hoverControl.start(); } diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index aa3d1a7f4..b6a1f765e 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -1756,7 +1756,7 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread - + 120 diff --git a/ground/openpilotgcs/src/plugins/config/mixercurve.ui b/ground/openpilotgcs/src/plugins/config/mixercurve.ui index cd47bd04e..37d8925ee 100644 --- a/ground/openpilotgcs/src/plugins/config/mixercurve.ui +++ b/ground/openpilotgcs/src/plugins/config/mixercurve.ui @@ -272,16 +272,6 @@ - GenerateCurve - CurveSettings - CurveType - CurveMin - minLabel - CurveMax - maxLabel - CurveStep - stepLabel - verticalSpacer diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.h b/ground/openpilotgcs/src/plugins/config/outputchannelform.h index a669fc2f8..a537f55e7 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.h +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.h @@ -56,10 +56,10 @@ signals: void channelChanged(int index, int value); private: + Ui::outputChannelForm ui; /// Channel index int m_index; bool m_inChannelTest; - Ui::outputChannelForm ui; private slots: void linkToggled(bool state); diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.ui b/ground/openpilotgcs/src/plugins/config/outputchannelform.ui index 84ee3a2be..abe5d04dd 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.ui +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.ui @@ -495,7 +495,7 @@ margin:1px; - + 45 diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index a60e15d73..0d640831f 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -24133,7 +24133,7 @@ border-radius: 5; - + Cruise Control diff --git a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp index d19ad9e2c..a225b97e6 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp @@ -105,6 +105,7 @@ void ConnectionManager::addWidget(QWidget *widget) */ bool ConnectionManager::connectDevice(DevListItem device) { + Q_UNUSED(device); QString deviceName = m_availableDevList->itemData(m_availableDevList->currentIndex(), Qt::ToolTipRole).toString(); DevListItem connection_device = findDevice(deviceName); diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mimedatabase.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mimedatabase.cpp index 770f9c0f0..7896f5bd6 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mimedatabase.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mimedatabase.cpp @@ -1110,7 +1110,7 @@ MimeType MimeDatabasePrivate::findByFile(const QFileInfo &f) const // Returns a mime type or Null one if none found MimeType MimeDatabasePrivate::findByFile(const QFileInfo &f, unsigned *priorityPtr) const { - typedef QList MimeMapEntryList; + typedef QList MimeMapEntryList __attribute__((unused)); // Is the hierarchy set up in case we find several matches? if (m_maxLevel < 0) { diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp index be05426f3..fdc7716cb 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavconfiginfo.cpp @@ -181,7 +181,7 @@ bool UAVConfigInfo::askToAbort(int compat, QString message) msgBox.setInformativeText(tr("Do you want to continue the import?")); msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); - int result; + int result = QMessageBox::Abort; switch (compat) { case FullyCompatible: diff --git a/ground/openpilotgcs/src/plugins/debuggadget/debuggadgetwidget.cpp b/ground/openpilotgcs/src/plugins/debuggadget/debuggadgetwidget.cpp index 81a8d1fe0..1958f3d0e 100644 --- a/ground/openpilotgcs/src/plugins/debuggadget/debuggadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/debuggadget/debuggadgetwidget.cpp @@ -43,6 +43,7 @@ QPointer m_textedit; void DebugGadgetWidget::customMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { + Q_UNUSED(context); QString txt; QColor color = Qt::black; diff --git a/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp b/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp index 60578532a..ef27951c5 100644 --- a/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp +++ b/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp @@ -193,6 +193,102 @@ void FlightLogManager::retrieveLogs(int flightToRetrieve) setDisableControls(false); } +void FlightLogManager::exportToOPL(QString fileName) +{ + // Fix the file name + fileName.replace(QString(".opl"), QString("%1.opl")); + + // Loop and create a new file for each flight. + int currentEntry = 0; + int currentFlight = 0; + quint32 adjustedBaseTime = 0; + // Continue until all entries are exported + while (currentEntry < m_logEntries.count()) { + if (m_adjustExportedTimestamps) { + adjustedBaseTime = m_logEntries[currentEntry]->getFlightTime(); + } + + // Get current flight + currentFlight = m_logEntries[currentEntry]->getFlight(); + + LogFile logFile; + logFile.useProvidedTimeStamp(true); + + // Set the file name to contain flight number + logFile.setFileName(fileName.arg(tr("_flight-%1").arg(currentFlight + 1))); + logFile.open(QIODevice::WriteOnly); + UAVTalk uavTalk(&logFile, m_objectManager); + + // Export entries until no more available or flight changes + while (currentEntry < m_logEntries.count() && m_logEntries[currentEntry]->getFlight() == currentFlight) { + ExtendedDebugLogEntry *entry = m_logEntries[currentEntry]; + + // Only log uavobjects + if (entry->getType() == ExtendedDebugLogEntry::TYPE_UAVOBJECT) { + // Set timestamp that should be logged for this entry + logFile.setNextTimeStamp(entry->getFlightTime() - adjustedBaseTime); + + // Use UAVTalk to log complete message to file + uavTalk.sendObject(entry->uavObject(), false, false); + qDebug() << entry->getFlightTime() - adjustedBaseTime << "=" << entry->toStringBrief(); + } + currentEntry++; + } + + logFile.close(); + } +} + +void FlightLogManager::exportToCSV(QString fileName) +{ + QFile csvFile(fileName); + if (csvFile.open(QFile::WriteOnly | QFile::Truncate)) { + QTextStream csvStream(&csvFile); + quint32 baseTime = 0; + quint32 currentFlight = 0; + csvStream << "Flight" << '\t' << "Flight Time" << '\t' << "Entry" << '\t' << "Data" << '\n'; + foreach (ExtendedDebugLogEntry *entry , m_logEntries) { + if(m_adjustExportedTimestamps && entry->getFlight() != currentFlight) { + currentFlight = entry->getFlight(); + baseTime = entry->getFlightTime(); + } + entry->toCSV(&csvStream, baseTime); + } + csvStream.flush(); + csvFile.flush(); + csvFile.close(); + } +} + +void FlightLogManager::exportToXML(QString fileName) +{ + QFile xmlFile(fileName); + if (xmlFile.open(QFile::WriteOnly | QFile::Truncate)) { + + QXmlStreamWriter xmlWriter(&xmlFile); + xmlWriter.setAutoFormatting(true); + xmlWriter.setAutoFormattingIndent(4); + + xmlWriter.writeStartDocument("1.0", true); + xmlWriter.writeStartElement("logs"); + xmlWriter.writeComment("This file was created by the flight log export in OpenPilot GCS."); + + quint32 baseTime = 0; + quint32 currentFlight = 0; + foreach (ExtendedDebugLogEntry *entry , m_logEntries) { + if(m_adjustExportedTimestamps && entry->getFlight() != currentFlight) { + currentFlight = entry->getFlight(); + baseTime = entry->getFlightTime(); + } + entry->toXML(&xmlWriter, baseTime); + } + xmlWriter.writeEndElement(); + xmlWriter.writeEndDocument(); + xmlFile.flush(); + xmlFile.close(); + } +} + void FlightLogManager::exportLogs() { if (m_logEntries.isEmpty()) { @@ -202,49 +298,31 @@ void FlightLogManager::exportLogs() setDisableControls(true); QApplication::setOverrideCursor(Qt::WaitCursor); - QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save Log"), - tr("OP-%0.opl").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss")), - tr("OpenPilot Log (*.opl)")); + QString oplFilter = tr("OpenPilot Log file %1").arg("(*.opl)"); + QString csvFilter = tr("Text file %1").arg("(*.csv)"); + QString xmlFilter = tr("XML file %1").arg("(*.xml)"); + + QString selectedFilter = csvFilter; + + QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save Log Entries"), + QString("OP-%1").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss")), + QString("%1;;%2;;%3").arg(oplFilter, csvFilter, xmlFilter), &selectedFilter); if (!fileName.isEmpty()) { - // Loop and create a new file for each flight. - fileName = fileName.replace(QString(".opl"), QString("%1.opl")); - int currentEntry = 0; - int currentFlight = 0; - quint32 adjustedBaseTime = 0; - // Continue until all entries are exported - while (currentEntry < m_logEntries.count()) { - if (m_adjustExportedTimestamps) { - adjustedBaseTime = m_logEntries[currentEntry]->getFlightTime(); + if (selectedFilter == oplFilter) { + if (!fileName.endsWith(".opl")) { + fileName.append(".opl"); } - - // Get current flight - currentFlight = m_logEntries[currentEntry]->getFlight(); - - LogFile logFile; - logFile.useProvidedTimeStamp(true); - - // Set the file name to contain flight number - logFile.setFileName(fileName.arg(tr("_flight-%1").arg(currentFlight + 1))); - logFile.open(QIODevice::WriteOnly); - UAVTalk uavTalk(&logFile, m_objectManager); - - // Export entries until no more available or flight changes - while (currentEntry < m_logEntries.count() && m_logEntries[currentEntry]->getFlight() == currentFlight) { - ExtendedDebugLogEntry *entry = m_logEntries[currentEntry]; - - // Only log uavobjects - if (entry->getType() == ExtendedDebugLogEntry::TYPE_UAVOBJECT) { - // Set timestamp that should be logged for this entry - logFile.setNextTimeStamp(entry->getFlightTime() - adjustedBaseTime); - - // Use UAVTalk to log complete message to file - uavTalk.sendObject(entry->uavObject(), false, false); - qDebug() << entry->getFlightTime() - adjustedBaseTime << "=" << entry->toStringBrief(); - } - currentEntry++; + exportToOPL(fileName); + } else if (selectedFilter == csvFilter) { + if (!fileName.endsWith(".csv")) { + fileName.append(".csv"); } - - logFile.close(); + exportToCSV(fileName); + } else if (selectedFilter == xmlFilter) { + if (!fileName.endsWith(".xml")) { + fileName.append(".xml"); + } + exportToXML(fileName); } } @@ -297,6 +375,33 @@ QString ExtendedDebugLogEntry::getLogString() } } +void ExtendedDebugLogEntry::toXML(QXmlStreamWriter *xmlWriter, quint32 baseTime) +{ + xmlWriter->writeStartElement("entry"); + xmlWriter->writeAttribute("flight", QString::number(getFlight() + 1)); + xmlWriter->writeAttribute("flighttime", QString::number(getFlightTime() - baseTime)); + xmlWriter->writeAttribute("entry", QString::number(getEntry())); + if (getType() == DebugLogEntry::TYPE_TEXT) { + xmlWriter->writeAttribute("type", "text"); + xmlWriter->writeTextElement("message", QString((const char *)getData().Data)); + } else if (getType() == DebugLogEntry::TYPE_UAVOBJECT) { + xmlWriter->writeAttribute("type", "uavobject"); + m_object->toXML(xmlWriter); + } + xmlWriter->writeEndElement(); //entry +} + +void ExtendedDebugLogEntry::toCSV(QTextStream *csvStream, quint32 baseTime) +{ + QString data; + if (getType() == DebugLogEntry::TYPE_TEXT) { + data = QString((const char *)getData().Data); + } else if (getType() == DebugLogEntry::TYPE_UAVOBJECT) { + data = m_object->toString().replace("\n", "").replace("\t", ""); + } + *csvStream << QString::number(getFlight() + 1) << '\t' << QString::number(getFlightTime() - baseTime) << '\t' << QString::number(getEntry()) << '\t' << data << '\n'; +} + void ExtendedDebugLogEntry::setData(const DebugLogEntry::DataFields &data, UAVObjectManager *objectManager) { DebugLogEntry::setData(data); diff --git a/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.h b/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.h index af01dd7e7..1ad5db515 100644 --- a/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.h +++ b/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.h @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include "uavobjectmanager.h" #include "debuglogentry.h" @@ -46,6 +48,8 @@ public: ~ExtendedDebugLogEntry(); QString getLogString(); + void toXML(QXmlStreamWriter *xmlWriter, quint32 baseTime); + void toCSV(QTextStream *csvStream, quint32 baseTime); UAVDataObject *uavObject() { return m_object; @@ -157,6 +161,11 @@ private: bool m_disableExport; bool m_cancelDownload; bool m_adjustExportedTimestamps; + + void exportToOPL(QString fileName); + void exportToCSV(QString fileName); + void exportToXML(QString fileName); + }; #endif // FLIGHTLOGMANAGER_H diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp index 7d513bd73..13cfd3206 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp @@ -146,10 +146,10 @@ void GCSControlGadget::sticksChangedLocally(double leftX, double leftY, double r double oldYaw = manualControlCommand->getField("Yaw")->getDouble(); double oldThrottle = manualControlCommand->getField("Throttle")->getDouble(); - double newRoll; - double newPitch; - double newYaw; - double newThrottle; + double newRoll = 0.0; + double newPitch = 0.0; + double newYaw = 0.0; + double newThrottle = 0.0; // Remap left X/Y and right X/Y to RPYT depending on mode switch (controlsMode) { @@ -248,7 +248,10 @@ void GCSControlGadget::gamepads(quint8 count) void GCSControlGadget::readUDPCommand() { - double pitch, yaw, roll, throttle; + double pitch = 0.0; + double yaw = 0.0; + double roll = 0.0; + double throttle = 0.0; while (control_sock->hasPendingDatagrams()) { QByteArray datagram; diff --git a/ground/openpilotgcs/src/plugins/hitl/fgsimulator.cpp b/ground/openpilotgcs/src/plugins/hitl/fgsimulator.cpp index 1f4ae8c85..1b4b2a8da 100644 --- a/ground/openpilotgcs/src/plugins/hitl/fgsimulator.cpp +++ b/ground/openpilotgcs/src/plugins/hitl/fgsimulator.cpp @@ -247,15 +247,15 @@ void FGSimulator::processUpdate(const QByteArray & inp) // Get rollRate (deg/s) float rollRate = fields[9].toFloat(); // Get yaw (deg) - float yaw = fields[10].toFloat(); + float yaw = fields[10].toFloat(); // Get yawRate (deg/s) - float yawRate = fields[11].toFloat(); + float yawRate = fields[11].toFloat(); // Get latitude (deg) - float latitude = fields[12].toFloat(); + float latitude = fields[12].toFloat(); // Get longitude (deg) - float longitude = fields[13].toFloat(); + float longitude = fields[13].toFloat(); // Get heading (deg) - float heading = fields[14].toFloat(); + // float heading = fields[14].toFloat(); // Get altitude (m) float altitude_msl = fields[15].toFloat() * FT2M; // Get altitudeAGL (m) diff --git a/ground/openpilotgcs/src/plugins/hitl/simulator.cpp b/ground/openpilotgcs/src/plugins/hitl/simulator.cpp index 355e76448..624bc0ca3 100644 --- a/ground/openpilotgcs/src/plugins/hitl/simulator.cpp +++ b/ground/openpilotgcs/src/plugins/hitl/simulator.cpp @@ -410,14 +410,10 @@ void Simulator::updateUAVOs(Output2Hardware out) homeData.Latitude = out.latitude; // Already in *10^7 integer format homeData.Longitude = out.longitude; // Already in *10^7 integer format homeData.Altitude = out.agl; - double LLA[3]; - LLA[0] = out.latitude; - LLA[1] = out.longitude; - LLA[2] = out.altitude; - homeData.Be[0] = 0; - homeData.Be[1] = 0; - homeData.Be[2] = 0; + homeData.Be[0] = 0; + homeData.Be[1] = 0; + homeData.Be[2] = 0; posHome->setData(homeData); posHome->updated(); @@ -498,13 +494,13 @@ void Simulator::updateUAVOs(Output2Hardware out) AttitudeSettings::DataFields attSettData = attSettings->getData(); float accelKp = attSettData.AccelKp * 0.1666666666666667; - float accelKi = attSettData.AccelKp * 0.1666666666666667; + // float accelKi = attSettData.AccelKp * 0.1666666666666667; float yawBiasRate = attSettData.YawBiasRate; // calibrate sensors on arming if (flightStatus->getData().Armed == FlightStatus::ARMED_ARMING) { accelKp = 2.0; - accelKi = 0.9; + // accelKi = 0.9; } float gyro[3] = { out.rollRate, out.pitchRate, out.yawRate }; diff --git a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetconfiguration.h b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetconfiguration.h index 3a85146a1..ae1c8b564 100644 --- a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetconfiguration.h +++ b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetconfiguration.h @@ -176,11 +176,9 @@ private: double yellowMax; double greenMin; double greenMax; - double factor; - bool useOpenGLFlag; - int decimalPlaces; + bool useOpenGLFlag; }; #endif // LINEARDIALGADGETCONFIGURATION_H diff --git a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui index 1b8353d29..db73d0a8c 100644 --- a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui +++ b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui @@ -78,7 +78,7 @@ - + 0 diff --git a/ground/openpilotgcs/src/plugins/logging/logginggadget.cpp b/ground/openpilotgcs/src/plugins/logging/logginggadget.cpp index a4fbc8d7d..d07152898 100644 --- a/ground/openpilotgcs/src/plugins/logging/logginggadget.cpp +++ b/ground/openpilotgcs/src/plugins/logging/logginggadget.cpp @@ -42,4 +42,6 @@ LoggingGadget::~LoggingGadget() } void LoggingGadget::loadConfiguration(IUAVGadgetConfiguration *config) -{} +{ + Q_UNUSED(config); +} diff --git a/ground/openpilotgcs/src/plugins/magicwaypoint/positionfield.cpp b/ground/openpilotgcs/src/plugins/magicwaypoint/positionfield.cpp index eb3a8a96a..dec30402b 100644 --- a/ground/openpilotgcs/src/plugins/magicwaypoint/positionfield.cpp +++ b/ground/openpilotgcs/src/plugins/magicwaypoint/positionfield.cpp @@ -48,9 +48,8 @@ PositionField::PositionField(QWidget *parent) : setScene(new QGraphicsScene(this)); setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); - m_renderer = new QSvgRenderer(); - bool success = m_renderer->load(QString(":/magicwaypoint/images/positionfield.svg")); - Q_ASSERT(success); + m_renderer = new QSvgRenderer(); + m_renderer->load(QString(":/magicwaypoint/images/positionfield.svg")); m_background = new QGraphicsSvgItem(); m_background->setSharedRenderer(m_renderer); diff --git a/ground/openpilotgcs/src/plugins/notify/notificationitem.cpp b/ground/openpilotgcs/src/plugins/notify/notificationitem.cpp index b3d627838..358974388 100644 --- a/ground/openpilotgcs/src/plugins/notify/notificationitem.cpp +++ b/ground/openpilotgcs/src/plugins/notify/notificationitem.cpp @@ -46,9 +46,9 @@ QStringList NotificationItem::retryValues; NotificationItem::NotificationItem(QObject *parent) : QObject(parent) - , _currentUpdatePlayed(false) , isNowPlaying(0) , _isPlayed(false) + , _currentUpdatePlayed(false) , _timer(NULL) , _expireTimer(NULL) , _soundCollectionPath("") diff --git a/ground/openpilotgcs/src/plugins/notify/notifyitemdelegate.cpp b/ground/openpilotgcs/src/plugins/notify/notifyitemdelegate.cpp index a39405e9e..b2440762b 100644 --- a/ground/openpilotgcs/src/plugins/notify/notifyitemdelegate.cpp +++ b/ground/openpilotgcs/src/plugins/notify/notifyitemdelegate.cpp @@ -144,6 +144,7 @@ void NotifyItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model void NotifyItemDelegate::selectRow(const QString & text) { + Q_UNUSED(text); QComboBox *combo = qobject_cast(sender()); QTableWidget *table = new QTableWidget; diff --git a/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp b/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp index 4eee0438e..56620a7b0 100644 --- a/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp +++ b/ground/openpilotgcs/src/plugins/notify/notifyplugin.cpp @@ -351,13 +351,6 @@ void SoundNotifyPlugin::stateChanged(QMediaPlayer::State newstate) playNotification(notification); qNotifyDebug() << "end playNotification"; } - } else { - if (newstate == QMediaPlayer::ServiceMissingError) { - if (phonon.mo->error() == 0) { - qDebug() << "Phonon::ErrorState: ErrorType = " << phonon.mo->error(); - phonon.mo->stop(); - } - } } } diff --git a/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp b/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp index 57eb4d21a..bca83ad8e 100644 --- a/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/notify/notifypluginoptionspage.cpp @@ -640,7 +640,8 @@ void NotifyPluginOptionsPage::on_FinishedPlaying() void NotifyPluginOptionsPage::on_toggled_checkEnableSound(bool state) { - bool state1 = 1 ^ state; + Q_UNUSED(state); + // bool state1 = 1 ^ state; // QList listOutputs = _testSound->outputPaths(); // Phonon::AudioOutput *audioOutput = (Phonon::AudioOutput *)listOutputs.last().sink(); diff --git a/ground/openpilotgcs/src/plugins/notify/notifytablemodel.cpp b/ground/openpilotgcs/src/plugins/notify/notifytablemodel.cpp index 8871f2352..380b1c942 100644 --- a/ground/openpilotgcs/src/plugins/notify/notifytablemodel.cpp +++ b/ground/openpilotgcs/src/plugins/notify/notifytablemodel.cpp @@ -186,6 +186,7 @@ QStringList NotifyTableModel::mimeTypes() const bool NotifyTableModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex & parent) { + Q_UNUSED(column); if (action == Qt::IgnoreAction) { return true; } @@ -233,11 +234,9 @@ bool NotifyTableModel::dropMimeData(const QMimeData *data, Qt::DropAction action continue; } - bool success = insertRows(rows + direction, 1, QModelIndex()); - Q_ASSERT(success); + insertRows(rows + direction, 1, QModelIndex()); _list.replace(rows + direction, item); - success = removeRows(dragged, 1, QModelIndex()); - Q_ASSERT(success); + removeRows(dragged, 1, QModelIndex()); if (direction == UP_DIRECTION) { ++rows; } diff --git a/ground/openpilotgcs/src/plugins/notify/notifytablemodel.h b/ground/openpilotgcs/src/plugins/notify/notifytablemodel.h index 01974baab..9820b2deb 100644 --- a/ground/openpilotgcs/src/plugins/notify/notifytablemodel.h +++ b/ground/openpilotgcs/src/plugins/notify/notifytablemodel.h @@ -45,6 +45,7 @@ public: NotifyTableModel(QList & parentList, QObject *parent = 0); int rowCount(const QModelIndex & parent = QModelIndex()) const { + Q_UNUSED(parent); return _list.count(); } diff --git a/ground/openpilotgcs/src/plugins/ophid/hidapi/libusb/hid.c b/ground/openpilotgcs/src/plugins/ophid/hidapi/libusb/hid.c index a25eaa6f3..13a4e5aa4 100644 --- a/ground/openpilotgcs/src/plugins/ophid/hidapi/libusb/hid.c +++ b/ground/openpilotgcs/src/plugins/ophid/hidapi/libusb/hid.c @@ -1205,9 +1205,9 @@ int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index } -HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev) +HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev __attribute__ ((unused))) { - return NULL; + return NULL; } diff --git a/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp b/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp index ab829da75..73c495b34 100644 --- a/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp @@ -92,19 +92,14 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type) case MapDataDelegate::MODE_DRIVEVECTOR: return OVERLAY_LINE; - break; case MapDataDelegate::MODE_FLYCIRCLERIGHT: case MapDataDelegate::MODE_DRIVECIRCLERIGHT: return OVERLAY_CIRCLE_RIGHT; - break; case MapDataDelegate::MODE_FLYCIRCLELEFT: case MapDataDelegate::MODE_DRIVECIRCLELEFT: - return OVERLAY_CIRCLE_LEFT; - - break; default: - break; + return OVERLAY_CIRCLE_LEFT; } } @@ -297,7 +292,11 @@ void modelMapProxy::dataChanged(const QModelIndex &topLeft, const QModelIndex &b void modelMapProxy::rowsInserted(const QModelIndex &parent, int first, int last) { Q_UNUSED(parent); - for (int x = first; x < last + 1; x++) { + Q_UNUSED(first); + Q_UNUSED(last); + + /* + for (int x = first; x < last + 1; x++) { QModelIndex index; WayPointItem *item; internals::PointLatLng latlng; @@ -325,7 +324,8 @@ void modelMapProxy::rowsInserted(const QModelIndex &parent, int first, int last) } else { item = myMap->WPInsert(latlng, altitude, desc, x); } - } + } + */ refreshOverlays(); } void modelMapProxy::deleteWayPoint(int number) diff --git a/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h b/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h index 46dadab97..84f7303ea 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h +++ b/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.h @@ -51,10 +51,10 @@ public: void editWaypoint(mapcontrol::WayPointItem *waypoint_item); private: - Ui::opmap_edit_waypoint_dialog *ui; QDataWidgetMapper *mapper; QAbstractItemModel *model; QItemSelectionModel *itemSelection; + Ui::opmap_edit_waypoint_dialog *ui; private slots: private slots: diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.ui b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.ui index e72bc2105..5d5285811 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.ui +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.ui @@ -490,13 +490,6 @@ - - - - - verticalSpacer - line - label_7 diff --git a/ground/openpilotgcs/src/plugins/pathactioneditor/pathactioneditortreemodel.cpp b/ground/openpilotgcs/src/plugins/pathactioneditor/pathactioneditortreemodel.cpp index 26580212f..476a1ab27 100644 --- a/ground/openpilotgcs/src/plugins/pathactioneditor/pathactioneditortreemodel.cpp +++ b/ground/openpilotgcs/src/plugins/pathactioneditor/pathactioneditortreemodel.cpp @@ -153,7 +153,7 @@ void PathActionEditorTreeModel::addSingleField(int index, UAVObjectField *field, data.append(QString("[%1]").arg((field->getElementNames())[index])); } - FieldTreeItem *item; + FieldTreeItem *item = NULL; UAVObjectField::FieldType type = field->getType(); // hack: list available actions in an enum if (field->getName().compare("Action") == 0 && type == UAVObjectField::UINT8) { @@ -423,8 +423,9 @@ void PathActionEditorTreeModel::newInstance(UAVObject *obj) void PathActionEditorTreeModel::objUpdated(UAVObject *obj) { - quint16 index = m_objManager->getObject("WaypointActive")->getField("Index")->getValue().toInt(); - quint16 action; + Q_UNUSED(obj); + quint16 index = m_objManager->getObject("WaypointActive")->getField("Index")->getValue().toInt(); + quint16 action = 0; foreach(TreeItem * child, m_waypointsTree->treeChildren()) { ObjectTreeItem *objItem = dynamic_cast(child); diff --git a/ground/openpilotgcs/src/plugins/pathactioneditor/treeitem.cpp b/ground/openpilotgcs/src/plugins/pathactioneditor/treeitem.cpp index 2fe0b7717..5dbdb2d1a 100644 --- a/ground/openpilotgcs/src/plugins/pathactioneditor/treeitem.cpp +++ b/ground/openpilotgcs/src/plugins/pathactioneditor/treeitem.cpp @@ -108,6 +108,7 @@ void TreeItem::apply() void TreeItem::setHighlight(bool highlight) { + Q_UNUSED(highlight) // m_highlight = highlight; m_changed = false; } diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp index 96fa900a4..ae0229ae2 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp @@ -162,6 +162,7 @@ void PfdQmlGadgetWidget::setAltitudeFactor(double factor) void PfdQmlGadgetWidget::setOpenGLEnabled(bool arg) { + Q_UNUSED(arg); setTerrainEnabled(m_terrainEnabled); } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp b/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp index 4a19eb4cf..248ec3a97 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp @@ -155,7 +155,8 @@ void ConnectionDiagram::setupGraphicsScene() void ConnectionDiagram::setupGraphicsSceneItems(QList elementsToShow) { qreal z = 0; - QRectF backgBounds = m_renderer->boundsOnElement("background"); + + // QRectF backgBounds = m_renderer->boundsOnElement("background"); foreach(QString elementId, elementsToShow) { if (m_renderer->elementExists(elementId)) { diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index cfd326a68..4ff286d45 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -398,10 +398,9 @@ void VehicleConfigurationHelper::applySensorBiasConfiguration() void VehicleConfigurationHelper::applyStabilizationConfiguration() { - StabilizationSettings *stabSettings = StabilizationSettings::GetInstance(m_uavoManager); + StabilizationSettings *stabSettings = StabilizationSettings::GetInstance(m_uavoManager); Q_ASSERT(stabSettings); - StabilizationSettings::DataFields data = stabSettings->getData(); StabilizationSettings defaultSettings; stabSettings->setData(defaultSettings.getData()); @@ -715,11 +714,6 @@ GUIConfigDataUnion VehicleConfigurationHelper::getGUIConfigData() { GUIConfigDataUnion configData; - SystemSettings *systemSettings = SystemSettings::GetInstance(m_uavoManager); - - Q_ASSERT(systemSettings); - SystemSettings::DataFields systemSettingsData = systemSettings->getData(); - for (int i = 0; i < (int)(SystemSettings::GUICONFIGDATA_NUMELEM); i++) { configData.UAVObject[i] = 0; // systemSettingsData.GUIConfigData[i]; } @@ -731,7 +725,7 @@ void VehicleConfigurationHelper::setupQuadCopter() { mixerChannelSettings channels[10]; GUIConfigDataUnion guiSettings = getGUIConfigData(); - SystemSettings::AirframeTypeOptions frame; + SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_QUADX; switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS: @@ -821,7 +815,7 @@ void VehicleConfigurationHelper::setupHexaCopter() { mixerChannelSettings channels[10]; GUIConfigDataUnion guiSettings = getGUIConfigData(); - SystemSettings::AirframeTypeOptions frame; + SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_HEXA; switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::MULTI_ROTOR_HEXA: @@ -1000,7 +994,7 @@ void VehicleConfigurationHelper::setupOctoCopter() { mixerChannelSettings channels[10]; GUIConfigDataUnion guiSettings = getGUIConfigData(); - SystemSettings::AirframeTypeOptions frame; + SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_OCTO; switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::MULTI_ROTOR_OCTO: diff --git a/ground/openpilotgcs/src/plugins/telemetry/monitorgadget.cpp b/ground/openpilotgcs/src/plugins/telemetry/monitorgadget.cpp index e23591da2..23423fe1c 100644 --- a/ground/openpilotgcs/src/plugins/telemetry/monitorgadget.cpp +++ b/ground/openpilotgcs/src/plugins/telemetry/monitorgadget.cpp @@ -46,6 +46,7 @@ MonitorGadget::~MonitorGadget() */ void MonitorGadget::loadConfiguration(IUAVGadgetConfiguration *config) { + Q_UNUSED(config); // MonitorGadgetConfiguration *m = qobject_cast(config); // m_widget->setSystemFile(m->getSystemFile()); // Triggers widget repaint diff --git a/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetconfiguration.cpp b/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetconfiguration.cpp index 6a69905af..48b0efd37 100644 --- a/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetconfiguration.cpp +++ b/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetconfiguration.cpp @@ -47,6 +47,7 @@ IUAVGadgetConfiguration *MonitorGadgetConfiguration::clone() */ void MonitorGadgetConfiguration::saveConfig(QSettings *qSettings) const { + Q_UNUSED(qSettings); // qSettings->setValue("acFilename", Utils::PathUtils().RemoveDataPath(m_acFilename)); // qSettings->setValue("bgFilename", Utils::PathUtils().RemoveDataPath(m_bgFilename)); // qSettings->setValue("enableVbo", m_enableVbo); diff --git a/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetfactory.cpp index 62526cd1d..b6c33e7c5 100644 --- a/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetfactory.cpp @@ -81,5 +81,6 @@ IUAVGadgetConfiguration *MonitorGadgetFactory::createConfiguration(QSettings *qS IOptionsPage *MonitorGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *config) { + Q_UNUSED(config); return 0; // new MonitorGadgetOptionsPage(qobject_cast(config)); } diff --git a/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetoptionspage.cpp index 6601efd54..ca99c7c6e 100644 --- a/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/telemetry/monitorgadgetoptionspage.cpp @@ -32,7 +32,9 @@ MonitorGadgetOptionsPage::MonitorGadgetOptionsPage(MonitorGadgetConfiguration *config, QObject *parent) : IOptionsPage(parent) -{} +{ + Q_UNUSED(config); +} MonitorGadgetOptionsPage::~MonitorGadgetOptionsPage() {} diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h index 6dcae4bf5..ff6237e7c 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserconfiguration.h @@ -111,8 +111,8 @@ public slots: private: QColor m_recentlyUpdatedColor; QColor m_manuallyChangedColor; - int m_recentlyUpdatedTimeout; bool m_onlyHilightChangedValues; + int m_recentlyUpdatedTimeout; bool m_useCategorizedView; bool m_useScientificView; bool m_showMetaData; diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp index ecc9343bf..fd900591c 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp @@ -94,13 +94,8 @@ void UAVObjectBrowserWidget::showMetaData(bool show) void UAVObjectBrowserWidget::categorize(bool categorize) { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - - Q_ASSERT(pm); - UAVObjectManager *objManager = pm->getObject(); - Q_ASSERT(objManager); - UAVObjectTreeModel *tmpModel = m_model; + m_model = new UAVObjectTreeModel(0, categorize, m_viewoptions->cbScientific->isChecked()); m_model->setRecentlyUpdatedColor(m_recentlyUpdatedColor); m_model->setManuallyChangedColor(m_manuallyChangedColor); @@ -115,13 +110,8 @@ void UAVObjectBrowserWidget::categorize(bool categorize) void UAVObjectBrowserWidget::useScientificNotation(bool scientific) { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - - Q_ASSERT(pm); - UAVObjectManager *objManager = pm->getObject(); - Q_ASSERT(objManager); - UAVObjectTreeModel *tmpModel = m_model; + m_model = new UAVObjectTreeModel(0, m_viewoptions->cbCategorized->isChecked(), scientific); m_model->setRecentlyUpdatedColor(m_recentlyUpdatedColor); m_model->setManuallyChangedColor(m_manuallyChangedColor); diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp index f1665bd59..3966ee708 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp @@ -207,7 +207,7 @@ void UAVObjectTreeModel::addSingleField(int index, UAVObjectField *field, TreeIt data.append(QString("[%1]").arg((field->getElementNames())[index])); } - FieldTreeItem *item; + FieldTreeItem *item = NULL; UAVObjectField::FieldType type = field->getType(); switch (type) { case UAVObjectField::BITFIELD: diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h index 775785c69..be7737e1d 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.h @@ -110,12 +110,12 @@ private: TreeItem *m_rootItem; TopTreeItem *m_settingsTree; TopTreeItem *m_nonSettingsTree; + bool m_useScientificFloatNotation; + bool m_categorize; int m_recentlyUpdatedTimeout; QColor m_recentlyUpdatedColor; QColor m_manuallyChangedColor; bool m_onlyHilightChangedValues; - bool m_useScientificFloatNotation; - bool m_categorize; // Highlight manager to handle highlighting of tree items. HighLightManager *m_highlightManager; diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobject.cpp b/ground/openpilotgcs/src/plugins/uavobjects/uavobject.cpp index 90a42be9e..092490257 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobject.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobject.cpp @@ -519,6 +519,19 @@ QString UAVObject::toStringData() return sout; } +void UAVObject::toXML(QXmlStreamWriter *xmlWriter) +{ + xmlWriter->writeStartElement("object"); + xmlWriter->writeAttribute("name", getName()); + xmlWriter->writeAttribute("id", QString("%1-%2").arg(getObjID(), 1, 16).toUpper().arg(getInstID())); + xmlWriter->writeStartElement("fields"); + foreach(UAVObjectField* field , fields) { + field->toXML(xmlWriter); + } + xmlWriter->writeEndElement(); // fields + xmlWriter->writeEndElement(); // object +} + /** * Emit the transactionCompleted event (used by the UAVTalk plugin) */ diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobject.h b/ground/openpilotgcs/src/plugins/uavobjects/uavobject.h index 9c34271c0..51ab38217 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobject.h +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobject.h @@ -37,6 +37,7 @@ #include #include #include +#include #include "uavobjectfield.h" #define UAVOBJ_ACCESS_SHIFT 0 @@ -127,6 +128,7 @@ public: QString toString(); QString toStringBrief(); QString toStringData(); + void toXML(QXmlStreamWriter *xmlWriter); void emitTransactionCompleted(bool success); void emitNewInstance(UAVObject *); diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp b/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp index e6c01d831..19ea0a563 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp @@ -654,6 +654,24 @@ QString UAVObjectField::toString() return sout; } +void UAVObjectField::toXML(QXmlStreamWriter *xmlWriter) +{ + xmlWriter->writeStartElement("field"); + xmlWriter->writeAttribute("name", getName()); + xmlWriter->writeAttribute("type", getTypeAsString()); + if (!getUnits().isEmpty()) { + xmlWriter->writeAttribute("unit", getUnits()); + } + for (unsigned int n = 0; n < numElements; ++n) { + xmlWriter->writeStartElement("value"); + if(getElementNames().size() > 1) { + xmlWriter->writeAttribute("name", getElementNames().at(n)); + } + xmlWriter->writeCharacters(getValue(n).toString()); + xmlWriter->writeEndElement(); // value + } + xmlWriter->writeEndElement(); // field +} qint32 UAVObjectField::pack(quint8 *dataOut) { diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.h b/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.h index c782a86f3..141fa6af7 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.h +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.h @@ -34,6 +34,7 @@ #include #include #include +#include class UAVObject; @@ -72,6 +73,7 @@ public: bool isNumeric(); bool isText(); QString toString(); + void toXML(QXmlStreamWriter *xmlWriter); bool isWithinLimits(QVariant var, quint32 index, int board = 0); QVariant getMaxLimit(quint32 index, int board = 0); diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index 74ddae50f..fc3758e7a 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -316,12 +316,11 @@ int UAVObjectUtilManager::setHomeLocation(double LLA[3], bool save_to_sdcard) { double Be[3]; - int result = Utils::HomeLocationUtil().getDetails(LLA, Be); - - Q_ASSERT(result == 0); + Utils::HomeLocationUtil().getDetails(LLA, Be); // save the new settings HomeLocation *homeLocation = HomeLocation::GetInstance(obm); + Q_ASSERT(homeLocation != NULL); HomeLocation::DataFields homeLocationData = homeLocation->getData(); diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 84505cd26..156dd26e8 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -404,7 +404,7 @@ void ConfigTaskWidget::widgetsContentsChanged() { QWidget *emitter = ((QWidget *)sender()); emit widgetContentsChanged(emitter); - double scale; + double scale = 1.0; QVariant value; foreach(WidgetBinding * binding, m_widgetBindingsPerWidget.values(emitter)) { diff --git a/ground/openpilotgcs/src/plugins/uploader/SSP/port.h b/ground/openpilotgcs/src/plugins/uploader/SSP/port.h index 8f141625f..e9f3bf049 100644 --- a/ground/openpilotgcs/src/plugins/uploader/SSP/port.h +++ b/ground/openpilotgcs/src/plugins/uploader/SSP/port.h @@ -64,7 +64,7 @@ public: uint32_t TxError; uint16_t flags; port(QString name); - ~port(); + virtual ~port(); portstatus status(); private: portstatus mstatus; diff --git a/ground/openpilotgcs/src/plugins/uploader/SSP/qsspt.h b/ground/openpilotgcs/src/plugins/uploader/SSP/qsspt.h index 2a4714bcb..0ec228ce6 100644 --- a/ground/openpilotgcs/src/plugins/uploader/SSP/qsspt.h +++ b/ground/openpilotgcs/src/plugins/uploader/SSP/qsspt.h @@ -47,8 +47,8 @@ private: QQueue queue; QMutex mutex; QMutex sendbufmutex; - bool datapending; bool endthread; + bool datapending; uint16_t sendstatus; uint16_t receivestatus; QWaitCondition sendwait; diff --git a/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp b/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp index 9afbe5bdb..4e3312c72 100644 --- a/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp @@ -225,6 +225,7 @@ void DeviceWidget::dfuStatus(QString str) void DeviceWidget::confirmCB(int value) { + Q_UNUSED(value); updateButtons(true); } @@ -277,7 +278,7 @@ void DeviceWidget::loadFirmware() QByteArray desc = loadedFW.right(100); QPixmap px; - if (loadedFW.length() > m_dfu->devices[deviceID].SizeOfCode) { + if (loadedFW.length() > (int)m_dfu->devices[deviceID].SizeOfCode) { myDevice->lblCRCL->setText(tr("Can't calculate, file too big for device")); } else { myDevice->lblCRCL->setText(QString::number(DFUObject::CRCFromQBArray(loadedFW, m_dfu->devices[deviceID].SizeOfCode))); diff --git a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp index c3dcd20ad..64bf57be8 100644 --- a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp @@ -246,7 +246,7 @@ bool DFUObject::UploadData(qint32 const & numberOfBytes, QByteArray & data) buf[1] = OP_DFU::Upload; // DFU Command int packetsize; float percentage; - int laspercentage; + int laspercentage = 0; for (qint32 packetcount = 0; packetcount < numberOfPackets; ++packetcount) { percentage = (float)(packetcount + 1) / numberOfPackets * 100; if (laspercentage != (int)percentage) { @@ -433,7 +433,7 @@ bool DFUObject::StartDownloadT(QByteArray *fw, qint32 const & numberOfBytes, Tra qDebug() << "StartDownload:" << numberOfPackets << "packets" << " Last Packet Size=" << lastPacketCount << " " << result << " bytes sent"; } float percentage; - int laspercentage; + int laspercentage = 0; // Now get those packets: for (qint32 x = 0; x < numberOfPackets; ++x) { @@ -637,8 +637,8 @@ bool DFUObject::findDevices() buf[7] = 0; buf[8] = 0; buf[9] = 0; - int result = sendData(buf, BUF_LEN); - result = receiveData(buf, BUF_LEN); + sendData(buf, BUF_LEN); + receiveData(buf, BUF_LEN); devices[x].ID = buf[14]; devices[x].ID = devices[x].ID << 8 | (quint8)buf[15]; devices[x].BL_Version = buf[7]; @@ -749,7 +749,7 @@ OP_DFU::Status DFUObject::UploadFirmwareT(const QString &sfile, const bool &veri pad = pad - arr.length(); arr.append(QByteArray(pad, 255)); } - if (devices[device].SizeOfCode < arr.length()) { + if (devices[device].SizeOfCode < (quint32)arr.length()) { if (debug) { qDebug() << "ERROR file to big for device"; } diff --git a/ground/openpilotgcs/src/plugins/uploader/op_dfu.h b/ground/openpilotgcs/src/plugins/uploader/op_dfu.h index 33cef9abb..346582872 100644 --- a/ground/openpilotgcs/src/plugins/uploader/op_dfu.h +++ b/ground/openpilotgcs/src/plugins/uploader/op_dfu.h @@ -115,7 +115,7 @@ public: // DFUObject(bool debug); DFUObject(bool debug, bool use_serial, QString port); - ~DFUObject(); + virtual ~DFUObject(); // Service commands: bool enterDFU(int const &devNumber); diff --git a/ground/openpilotgcs/src/plugins/uploader/uploader.pro b/ground/openpilotgcs/src/plugins/uploader/uploader.pro index 2b52a8649..20e358c8b 100644 --- a/ground/openpilotgcs/src/plugins/uploader/uploader.pro +++ b/ground/openpilotgcs/src/plugins/uploader/uploader.pro @@ -11,6 +11,10 @@ macx { QMAKE_CXXFLAGS += -fpermissive } +!macx { + QMAKE_CXXFLAGS += -Wno-enum-compare +} + HEADERS += uploadergadget.h \ uploadergadgetconfiguration.h \ uploadergadgetfactory.h \