diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 393fa25dc1fad977d1e87b1498bfa204fa35db1f..99a7e3278cd60980a7ae0504a6d35d90ad7a8c16 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -272,6 +272,9 @@ CustomBuild { RESOURCES += $$PWD/qgcresources.qrc } } else { + DEFINES += QGC_APPLICATION_NAME=\"\\\"QGroundControl\\\"\" + DEFINES += QGC_ORG_NAME=\"\\\"QGroundControl.org\\\"\" + DEFINES += QGC_ORG_DOMAIN=\"\\\"org.qgroundcontrol\\\"\" RESOURCES += \ $$PWD/qgroundcontrol.qrc \ $$PWD/qgcresources.qrc diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.qml b/src/AutoPilotPlugins/PX4/PowerComponent.qml index 06db44fc48863f7ca50a491a56a126d65147652c..5cb20f2e14a4844137b0478bda0c5295e9a3ed29 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponent.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponent.qml @@ -12,6 +12,7 @@ import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.2 +import QGroundControl 1.0 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 import QGroundControl.Controls 1.0 @@ -89,8 +90,8 @@ SetupPage { id: controller factPanel: powerPage.viewPanel - onOldFirmware: showMessage(qsTr("ESC Calibration"), qsTr("QGroundControl cannot perform ESC Calibration with this version of firmware. You will need to upgrade to a newer firmware."), StandardButton.Ok) - onNewerFirmware: showMessage(qsTr("ESC Calibration"), qsTr("QGroundControl cannot perform ESC Calibration with this version of firmware. You will need to upgrade QGroundControl."), StandardButton.Ok) + onOldFirmware: showMessage(qsTr("ESC Calibration"), qsTr("%1 cannot perform ESC Calibration with this version of firmware. You will need to upgrade to a newer firmware.").arg(QGroundControl.appName), StandardButton.Ok) + onNewerFirmware: showMessage(qsTr("ESC Calibration"), qsTr("%1 cannot perform ESC Calibration with this version of firmware. You will need to upgrade %1.").arg(QGroundControl.appName), StandardButton.Ok) onBatteryConnected: showMessage(qsTr("ESC Calibration"), qsTr("Performing calibration. This will take a few seconds.."), 0) onCalibrationFailed: showMessage(qsTr("ESC Calibration failed"), errorMessage, StandardButton.Ok) onCalibrationSuccess: showMessage(qsTr("ESC Calibration"), qsTr("Calibration complete. You can disconnect your battery now if you like."), StandardButton.Ok) diff --git a/src/FactSystem/ParameterManager.cc b/src/FactSystem/ParameterManager.cc index a05cb8ec935ebca2276ae38966942207a7a11b56..30d4ac195be39b41c7ca174526d01c304ebf19a3 100644 --- a/src/FactSystem/ParameterManager.cc +++ b/src/FactSystem/ParameterManager.cc @@ -1038,10 +1038,10 @@ void ParameterManager::_checkInitialLoadComplete(void) _missingParameters = false; if (initialLoadFailures) { _missingParameters = true; - QString errorMsg = tr("QGroundControl was unable to retrieve the full set of parameters from vehicle %1. " - "This will cause QGroundControl to be unable to display its full user interface. " + QString errorMsg = tr("%1 was unable to retrieve the full set of parameters from vehicle %2. " + "This will cause %1 to be unable to display its full user interface. " "If you are using modified firmware, you may need to resolve any vehicle startup errors to resolve the issue. " - "If you are using standard firmware, you may need to upgrade to a newer version to resolve the issue.").arg(_vehicle->id()); + "If you are using standard firmware, you may need to upgrade to a newer version to resolve the issue.").arg(qgcApp()->applicationName()).arg(_vehicle->id()); qCDebug(ParameterManagerLog) << errorMsg; qgcApp()->showMessage(errorMsg); if (!qgcApp()->runningUnitTests()) { @@ -1065,7 +1065,7 @@ void ParameterManager::_initialRequestTimeout(void) } else { if (!_vehicle->genericFirmware()) { QString errorMsg = tr("Vehicle %1 did not respond to request for parameters. " - "This will cause QGroundControl to be unable to display its full user interface.").arg(_vehicle->id()); + "This will cause %2 to be unable to display its full user interface.").arg(_vehicle->id()).arg(qgcApp()->applicationName()); qCDebug(ParameterManagerLog) << errorMsg; qgcApp()->showMessage(errorMsg); } diff --git a/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json b/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json index 6bcc967d8f32740433617d55818f34ff27ae5d62..4cfe9f9b6b10815417f55546b3ae9f7e4c038e42 100644 --- a/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json +++ b/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json @@ -15,10 +15,10 @@ "paramRemove": "4" }, { - "id": 22, - "comment": "MAV_CMD_NAV_TAKEOFF", - "specifiesCoordinate": false, - "paramRemove": "2,3,4,5,6" + "id": 22, + "comment": "MAV_CMD_NAV_TAKEOFF", + "specifiesCoordinate": false, + "specifiesAltitudeOnly": true }, { "id": 82, diff --git a/src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json b/src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json index b4fc94b4f0b79fc672e85b99886cd8122b4eef51..294ffa7ef73acba949ae9b5193407701affba995 100644 --- a/src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json +++ b/src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json @@ -30,10 +30,11 @@ "paramRemove": "1,4" }, { - "id": 22, - "comment": "MAV_CMD_NAV_TAKEOFF", - "specifiesCoordinate": false, - "paramRemove": "1,2,3,4,5,6" + "id": 22, + "comment": "MAV_CMD_NAV_TAKEOFF", + "specifiesCoordinate": false, + "specifiesAltitudeOnly": true, + "paramRemove": "1,2,3,4" }, { "id": 31, diff --git a/src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json b/src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json index a7ee3f4c33aa47d299c7e4398091553de3ed8a76..8315a3dfdaaf1dd2665691fee33e155f07fd98aa 100644 --- a/src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json +++ b/src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json @@ -5,20 +5,11 @@ "mavCmdInfo": [ { - "id": 21, - "comment": "MAV_CMD_NAV_LAND", - "paramRemove": "1,4", - "param7": { - "label": "Altitude", - "units": "m", - "default": 0, - "decimalPlaces": 1 - } - }, - { - "id": 22, - "comment": "MAV_CMD_NAV_TAKEOFF", - "paramRemove": "4" + "id": 21, + "comment": "MAV_CMD_NAV_LAND", + "paramRemove": "1,4", + "specifiesCoordinate": false, + "specifiesAltitudeOnly": true } ] } diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index aaf840381fcb9666b4885d7947edf00f234a251f..bdff6482e20e0358eda84e5779d375003f02ab58 100644 --- a/src/FlightDisplay/FlightDisplayViewMap.qml +++ b/src/FlightDisplay/FlightDisplayViewMap.qml @@ -27,35 +27,64 @@ FlightMap { anchors.fill: parent mapName: _mapName - gesture.acceptedGestures: _followVehicle ? - MapGestureArea.PinchGesture : - MapGestureArea.PinchGesture | MapGestureArea.PanGesture | MapGestureArea.FlickGesture - property alias missionController: missionController property var flightWidgets property var rightPanelWidth - property bool _followVehicle: true + property bool _followVehicleSetting: true ///< User facing setting for follow vehicle + property bool _followVehicle: _followVehicleSetting && _activeVehicleCoordinateValid ///< Control map follow vehicle functionality property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property bool _activeVehicleCoordinateValid: _activeVehicle ? _activeVehicle.coordinateValid : false property var activeVehicleCoordinate: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate() property var _gotoHereCoordinate: QtPositioning.coordinate() property int _retaskSequence: 0 property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2) - - property bool followVehicleConnection: _followVehicle ///< Only use to create connection on + property bool _firstVehicleCoordinate: false + property bool _centerUpdateFromTimer: true Component.onCompleted: { QGroundControl.flightMapPosition = center QGroundControl.flightMapZoom = zoomLevel } - onCenterChanged: QGroundControl.flightMapPosition = center + onZoomLevelChanged: QGroundControl.flightMapZoom = zoomLevel + onCenterChanged: { + if (_centerUpdateFromTimer) { + _centerUpdateFromTimer = false + } else { + vehicleCenterTimer.restart() + } + + QGroundControl.flightMapPosition = center + } + onActiveVehicleCoordinateChanged: { - if (_followVehicle && _activeVehicleCoordinateValid && activeVehicleCoordinate.isValid) { + if (!_firstVehicleCoordinate && _activeVehicleCoordinateValid) { + _firstVehicleCoordinate = true + updateMapToVehiclePosition() + } + } + + function updateMapToVehiclePosition() { + if (_followVehicle) { _initialMapPositionSet = true - flightMap.center = activeVehicleCoordinate + _firstVehicleCoordinate = true + _centerUpdateFromTimer = true + flightMap.center = activeVehicleCoordinate + } + } + + Timer { + id: vehicleCenterTimer + interval: 5000 + running: true + triggeredOnStart: true + repeat: true + + onTriggered: { + triggeredOnStart = false + updateMapToVehiclePosition() } } @@ -149,9 +178,9 @@ FlightMap { map: _flightMap fitFunctions: mapFitFunctions showFollowVehicle: true - followVehicle: _followVehicle + followVehicle: _followVehicleSetting - onFollowVehicleChanged: _followVehicle = followVehicle + onFollowVehicleChanged: _followVehicleSetting = followVehicle } } diff --git a/src/MissionManager/FixedWingLandingComplexItem.cc b/src/MissionManager/FixedWingLandingComplexItem.cc index e748394ef4cf80685dab739b68d623260329089a..2f747c1a156456b5b5d60b8342841728d212f85a 100644 --- a/src/MissionManager/FixedWingLandingComplexItem.cc +++ b/src/MissionManager/FixedWingLandingComplexItem.cc @@ -163,7 +163,7 @@ bool FixedWingLandingComplexItem::load(const QJsonObject& complexObject, int seq QString itemType = complexObject[VisualMissionItem::jsonTypeKey].toString(); QString complexType = complexObject[ComplexMissionItem::jsonComplexItemTypeKey].toString(); if (itemType != VisualMissionItem::jsonTypeComplexItemValue || complexType != jsonComplexItemTypeValue) { - errorString = tr("QGroundControl does not support loading this complex mission item type: %1:2").arg(itemType).arg(complexType); + errorString = tr("%1 does not support loading this complex mission item type: %2:%3").arg(qgcApp()->applicationName()).arg(itemType).arg(complexType); return false; } diff --git a/src/MissionManager/FixedWingLandingComplexItem.h b/src/MissionManager/FixedWingLandingComplexItem.h index c2a352baf043108adaf36919e6b0123a54273221..8d9d4c29c3b3c1b039c23a2dbb7a378b4e4782d1 100644 --- a/src/MissionManager/FixedWingLandingComplexItem.h +++ b/src/MissionManager/FixedWingLandingComplexItem.h @@ -64,6 +64,7 @@ public: bool isSimpleItem (void) const final { return false; } bool isStandaloneCoordinate (void) const final { return false; } bool specifiesCoordinate (void) const final; + bool specifiesAltitudeOnly (void) const final { return false; } QString commandDescription (void) const final { return "Landing Pattern"; } QString commandName (void) const final { return "Landing Pattern"; } QString abbreviation (void) const final { return "L"; } diff --git a/src/MissionManager/GeoFenceController.cc b/src/MissionManager/GeoFenceController.cc index 5a00533dcfc404826d85460af52b8b29344b1828..a9171b22bbb37e87f939b758c98d1129dd95890b 100644 --- a/src/MissionManager/GeoFenceController.cc +++ b/src/MissionManager/GeoFenceController.cc @@ -183,7 +183,7 @@ bool GeoFenceController::_loadTextFile(QTextStream& stream, QmlObjectListModel* } } } else { - errorString = QStringLiteral("The mission file is not compatible with this version of QGroundControl."); + errorString = QStringLiteral("The mission file is not compatible with this version of %1.").arg(qgcApp()->applicationName())); return false; } diff --git a/src/MissionManager/MavCmdInfoCommon.json b/src/MissionManager/MavCmdInfoCommon.json index 4aa25b46f0e3959673630f65f7dc0e27904bbb73..c139686f145a54bc6953149888ed256cb9c15eff 100644 --- a/src/MissionManager/MavCmdInfoCommon.json +++ b/src/MissionManager/MavCmdInfoCommon.json @@ -182,25 +182,20 @@ { "id": 24, "rawName": "MAV_CMD_NAV_TAKEOFF_LOCAL", "friendlyName": "Takeoff local" }, { "id": 25, "rawName": "MAV_CMD_NAV_FOLLOW", "friendlyName": "Nav follow" }, { - "id": 30, - "rawName": "MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT", - "friendlyName": "Change Altitude", - "description": "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command.", - "specifiesCoordinate": false, - "friendlyEdit": true, - "category": "Flight control", + "id": 30, + "rawName": "MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT", + "friendlyName": "Change Altitude", + "description": "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command.", + "specifiesCoordinate": false, + "specifiesAltitudeOnly": true, + "friendlyEdit": true, + "category": "Flight control", "param1": { "label": "Mode", "enumStrings": "Climb,Neutral,Descend", "enumValues": "1,0,2", "default": 1, "decimalPlaces": 0 - }, - "param7": { - "label": "Altitude", - "units": "m", - "default": 55, - "decimalPlaces": 2 } }, { @@ -391,22 +386,18 @@ } }, { - "id": 113, - "rawName": "MAV_CMD_CONDITION_CHANGE_ALT", - "description": "Delay the mission until the specified altitide is reached.", - "friendlyName": "Wait for altitude", - "category": "Conditionals", + "id": 113, + "rawName": "MAV_CMD_CONDITION_CHANGE_ALT", + "description": "Delay the mission until the specified altitide is reached.", + "friendlyName": "Wait for altitude", + "category": "Conditionals", + "specifiesCoordinate": false, + "specifiesAltitudeOnly": true, "param1": { "label": "Rate", "units": "m/s", "default": 5, "decimalPlaces": 2 - }, - "param7": { - "label": "Altitude", - "units": "m", - "default": 55, - "decimalPlaces": 2 } }, { diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index fba71fa76bcb5d19335cc462b3c46d7d0f97b6c1..6a5064c23ea4c1a1b52df9cf52f1c17869d3b20e 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -560,7 +560,7 @@ bool MissionController::_loadTextMissionFile(Vehicle* vehicle, QTextStream& stre } } } else { - errorString = QStringLiteral("The mission file is not compatible with this version of QGroundControl."); + errorString = QStringLiteral("The mission file is not compatible with this version of %1.").arg(qgcApp()->applicationName()); return false; } diff --git a/src/MissionManager/MissionSettingsComplexItem.h b/src/MissionManager/MissionSettingsComplexItem.h index 7011a616c95b69697e670aaed2199885d8563a08..c003855e73549a035e85ef99d7464e24fd71ba1f 100644 --- a/src/MissionManager/MissionSettingsComplexItem.h +++ b/src/MissionManager/MissionSettingsComplexItem.h @@ -69,6 +69,7 @@ public: bool isSimpleItem (void) const final { return false; } bool isStandaloneCoordinate (void) const final { return false; } bool specifiesCoordinate (void) const final; + bool specifiesAltitudeOnly (void) const final { return false; } QString commandDescription (void) const final { return "Mission Settings"; } QString commandName (void) const final { return "Mission Settings"; } QString abbreviation (void) const final { return "H"; } diff --git a/src/MissionManager/SimpleMissionItem.cc b/src/MissionManager/SimpleMissionItem.cc index 406fbc212ca9c517ebb947674410ad203b524ec7..ef23fb8eb91b1f00e2a0dd73279ebf9ea69f6abe 100644 --- a/src/MissionManager/SimpleMissionItem.cc +++ b/src/MissionManager/SimpleMissionItem.cc @@ -185,6 +185,7 @@ void SimpleMissionItem::_connectSignals(void) connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::commandDescriptionChanged); connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::abbreviationChanged); connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::specifiesCoordinateChanged); + connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::specifiesAltitudeOnlyChanged); connect(&_missionItem._commandFact, &Fact::valueChanged, this, &SimpleMissionItem::isStandaloneCoordinateChanged); // Whenever these properties change the ui model changes as well @@ -296,6 +297,16 @@ bool SimpleMissionItem::specifiesCoordinate(void) const } } +bool SimpleMissionItem::specifiesAltitudeOnly(void) const +{ + const MissionCommandUIInfo* uiInfo = _commandTree->getUIInfo(_vehicle, (MAV_CMD)command()); + if (uiInfo) { + return uiInfo->specifiesAltitudeOnly(); + } else { + return false; + } +} + QString SimpleMissionItem::commandDescription(void) const { const MissionCommandUIInfo* uiInfo = _commandTree->getUIInfo(_vehicle, (MAV_CMD)command()); @@ -392,9 +403,10 @@ QmlObjectListModel* SimpleMissionItem::textFieldFacts(void) Fact* rgParamFacts[7] = { &_missionItem._param1Fact, &_missionItem._param2Fact, &_missionItem._param3Fact, &_missionItem._param4Fact, &_missionItem._param5Fact, &_missionItem._param6Fact, &_missionItem._param7Fact }; FactMetaData* rgParamMetaData[7] = { &_param1MetaData, &_param2MetaData, &_param3MetaData, &_param4MetaData, &_param5MetaData, &_param6MetaData, &_param7MetaData }; - bool altitudeAdded = false; + const MissionCommandUIInfo* uiInfo = _commandTree->getUIInfo(_vehicle, command); + for (int i=1; i<=7; i++) { - const MissionCmdParamInfo* paramInfo = _commandTree->getUIInfo(_vehicle, command)->getParamInfo(i); + const MissionCmdParamInfo* paramInfo = uiInfo->getParamInfo(i); if (paramInfo && paramInfo->enumStrings().count() == 0) { Fact* paramFact = rgParamFacts[i-1]; @@ -406,14 +418,10 @@ QmlObjectListModel* SimpleMissionItem::textFieldFacts(void) paramMetaData->setRawUnits(paramInfo->units()); paramFact->setMetaData(paramMetaData); model->append(paramFact); - - if (i == 7) { - altitudeAdded = true; - } } } - if (specifiesCoordinate() && !altitudeAdded) { + if (uiInfo->specifiesCoordinate() || uiInfo->specifiesAltitudeOnly()) { _missionItem._param7Fact._setName("Altitude"); _missionItem._param7Fact.setMetaData(_altitudeMetaData); model->append(&_missionItem._param7Fact); @@ -430,7 +438,7 @@ QmlObjectListModel* SimpleMissionItem::checkboxFacts(void) if (rawEdit()) { model->append(&_missionItem._autoContinueFact); - } else if (specifiesCoordinate() && !_homePositionSpecialCase) { + } else if ((specifiesCoordinate() || specifiesAltitudeOnly()) && !_homePositionSpecialCase) { model->append(&_altitudeRelativeToHomeFact); } @@ -483,7 +491,7 @@ bool SimpleMissionItem::friendlyEditAllowed(void) const return false; } - if (specifiesCoordinate()) { + if (specifiesCoordinate() || specifiesAltitudeOnly()) { return _missionItem.frame() == MAV_FRAME_GLOBAL || _missionItem.frame() == MAV_FRAME_GLOBAL_RELATIVE_ALT; } @@ -560,14 +568,22 @@ void SimpleMissionItem::setDefaultsForCommand(void) } } - if (command == MAV_CMD_NAV_WAYPOINT) { + switch (command) { + case MAV_CMD_NAV_WAYPOINT: // We default all acceptance radius to 0. This allows flight controller to be in control of // accept radius. _missionItem.setParam2(0); + break; + + case MAV_CMD_NAV_LAND: + _missionItem.setParam7(0); + break; + default: + break; } _missionItem.setAutoContinue(true); - _missionItem.setFrame(specifiesCoordinate() ? MAV_FRAME_GLOBAL_RELATIVE_ALT : MAV_FRAME_MISSION); + _missionItem.setFrame((specifiesCoordinate() || specifiesAltitudeOnly()) ? MAV_FRAME_GLOBAL_RELATIVE_ALT : MAV_FRAME_MISSION); setRawEdit(false); } diff --git a/src/MissionManager/SimpleMissionItem.h b/src/MissionManager/SimpleMissionItem.h index ce1af09ae9a5d359a567178c834e26becf3a903c..a7d5720ac8f940b0f3b2fcd85acc50f8e11201f4 100644 --- a/src/MissionManager/SimpleMissionItem.h +++ b/src/MissionManager/SimpleMissionItem.h @@ -87,6 +87,7 @@ public: bool isSimpleItem (void) const final { return true; } bool isStandaloneCoordinate (void) const final; bool specifiesCoordinate (void) const final; + bool specifiesAltitudeOnly (void) const final; QString commandDescription (void) const final; QString commandName (void) const final; QString abbreviation (void) const final; diff --git a/src/MissionManager/SurveyMissionItem.cc b/src/MissionManager/SurveyMissionItem.cc index e9f68eb85424d7ab411880261a324aa2cd4271d1..3aec328374c1bbf055ce733555803a3f8d9037c3 100644 --- a/src/MissionManager/SurveyMissionItem.cc +++ b/src/MissionManager/SurveyMissionItem.cc @@ -381,7 +381,7 @@ bool SurveyMissionItem::load(const QJsonObject& complexObject, int sequenceNumbe int version = v2Object[JsonHelper::jsonVersionKey].toInt(); if (version != 2 && version != 3) { - errorString = tr("QGroundControl does not support this version of survey items"); + errorString = tr("%1 does not support this version of survey items").arg(qgcApp()->applicationName()); return false; } if (version == 2) { @@ -411,7 +411,7 @@ bool SurveyMissionItem::load(const QJsonObject& complexObject, int sequenceNumbe QString itemType = v2Object[VisualMissionItem::jsonTypeKey].toString(); QString complexType = v2Object[ComplexMissionItem::jsonComplexItemTypeKey].toString(); if (itemType != VisualMissionItem::jsonTypeComplexItemValue || complexType != jsonComplexItemTypeValue) { - errorString = tr("QGroundControl does not support loading this complex mission item type: %1:2").arg(itemType).arg(complexType); + errorString = tr("%1 does not support loading this complex mission item type: %2:%3").arg(qgcApp()->applicationName()).arg(itemType).arg(complexType); return false; } diff --git a/src/MissionManager/SurveyMissionItem.h b/src/MissionManager/SurveyMissionItem.h index 389cb4744ff5098285c8823cb1b4dee9aaaca95b..20fb2ddc94c386f12ce5985aa31458ac7f4646e8 100644 --- a/src/MissionManager/SurveyMissionItem.h +++ b/src/MissionManager/SurveyMissionItem.h @@ -110,6 +110,7 @@ public: bool isSimpleItem (void) const final { return false; } bool isStandaloneCoordinate (void) const final { return false; } bool specifiesCoordinate (void) const final; + bool specifiesAltitudeOnly (void) const final { return false; } QString commandDescription (void) const final { return "Survey"; } QString commandName (void) const final { return "Survey"; } QString abbreviation (void) const final { return "S"; } diff --git a/src/MissionManager/VisualMissionItem.h b/src/MissionManager/VisualMissionItem.h index 17f2de5f82bc4baf827339681c2262d6bc3fe026..201c26df6cc218ff2e3801afb77bcdc2b9caa2ab 100644 --- a/src/MissionManager/VisualMissionItem.h +++ b/src/MissionManager/VisualMissionItem.h @@ -80,8 +80,9 @@ public: Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) ///< Item is dirty and requires save/send Q_PROPERTY(bool isCurrentItem READ isCurrentItem WRITE setIsCurrentItem NOTIFY isCurrentItemChanged) Q_PROPERTY(int sequenceNumber READ sequenceNumber WRITE setSequenceNumber NOTIFY sequenceNumberChanged) - Q_PROPERTY(bool specifiesCoordinate READ specifiesCoordinate NOTIFY specifiesCoordinateChanged) ///< Item is associated with a coordinate position - Q_PROPERTY(bool isStandaloneCoordinate READ isStandaloneCoordinate NOTIFY isStandaloneCoordinateChanged) ///< Waypoint line does not go through item + Q_PROPERTY(bool specifiesCoordinate READ specifiesCoordinate NOTIFY specifiesCoordinateChanged) ///< true: Item is associated with a coordinate position + Q_PROPERTY(bool isStandaloneCoordinate READ isStandaloneCoordinate NOTIFY isStandaloneCoordinateChanged) ///< true: Waypoint line does not go through item + Q_PROPERTY(bool specifiesAltitudeOnly READ specifiesAltitudeOnly NOTIFY specifiesAltitudeOnlyChanged) ///< true: Item has altitude only, no full coordinate Q_PROPERTY(bool isSimpleItem READ isSimpleItem NOTIFY isSimpleItemChanged) ///< Simple or Complex MissionItem Q_PROPERTY(QString editorQml MEMBER _editorQml CONSTANT) ///< Qml code for editing this item Q_PROPERTY(QString mapVisualQML READ mapVisualQML CONSTANT) ///< QMl code for map visuals @@ -119,6 +120,7 @@ public: virtual bool isSimpleItem (void) const = 0; virtual bool isStandaloneCoordinate (void) const = 0; virtual bool specifiesCoordinate (void) const = 0; + virtual bool specifiesAltitudeOnly (void) const = 0;; virtual QString commandDescription (void) const = 0; virtual QString commandName (void) const = 0; virtual QString abbreviation (void) const = 0; @@ -169,6 +171,7 @@ signals: void isSimpleItemChanged (bool isSimpleItem); void specifiesCoordinateChanged (void); void isStandaloneCoordinateChanged (void); + void specifiesAltitudeOnlyChanged (void); void flightSpeedChanged (double flightSpeed); void lastSequenceNumberChanged (int sequenceNumber); diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index ef2656325db94cbad57eb7e6388c96885a544384..a387a1a6be75e1bd6845fc14835f4d35406efa1f 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -191,12 +191,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) if (!_runningUnitTests) { if (getuid() == 0) { QMessageBox msgBox; - msgBox.setInformativeText("You are running QGroundControl as root. " - "You should not do this since it will cause other issues with QGroundControl. " - "QGroundControl will now exit. " + msgBox.setInformativeText(tr("You are running %1 as root. " + "You should not do this since it will cause other issues with %1. " + "%1 will now exit. " "If you are having serial port issues on Ubuntu, execute the following commands to fix most issues:\n" "sudo usermod -a -G dialout $USER\n" - "sudo apt-get remove modemmanager"); + "sudo apt-get remove modemmanager").arg(qgcApp()->applicationName())); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); msgBox.exec(); diff --git a/src/QGCConfig.h b/src/QGCConfig.h index 4c32051dbdcccbb4ee69967a88d54f1d653d3dff..be09b2ea97210fb6b5eb46c00b3df4981cba5c5b 100644 --- a/src/QGCConfig.h +++ b/src/QGCConfig.h @@ -12,8 +12,4 @@ // up by 1. This will caused store settings to be cleared on next boot. #define QGC_SETTINGS_VERSION 7 -#define QGC_APPLICATION_NAME "QGroundControl" -#define QGC_ORG_NAME "QGroundControl.org" -#define QGC_ORG_DOMAIN "org.qgroundcontrol" - #endif // QGC_CONFIGURATION_H diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h index 955d021d721916464e9e517b1ae5d85201040ee8..4f9ea6e82e92d7d9b83f1e1aad7d954ca0cc72d2 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.h +++ b/src/QmlControls/QGroundControlQmlGlobal.h @@ -37,6 +37,8 @@ public: QGroundControlQmlGlobal(QGCApplication* app); ~QGroundControlQmlGlobal(); + Q_PROPERTY(QString appName READ appName CONSTANT) + Q_PROPERTY(FlightMapSettings* flightMapSettings READ flightMapSettings CONSTANT) Q_PROPERTY(LinkManager* linkManager READ linkManager CONSTANT) Q_PROPERTY(MultiVehicleManager* multiVehicleManager READ multiVehicleManager CONSTANT) @@ -123,6 +125,7 @@ public: // Property accesors + QString appName () { return qgcApp()->applicationName(); } FlightMapSettings* flightMapSettings () { return _flightMapSettings; } LinkManager* linkManager () { return _linkManager; } MultiVehicleManager* multiVehicleManager () { return _multiVehicleManager; } diff --git a/src/Settings/App.SettingsGroup.json b/src/Settings/App.SettingsGroup.json index 4632012ff671d6679ee6554a230c7dad20954ad4..675af1fad1f2340026dc92f72728f5e105e70a49 100644 --- a/src/Settings/App.SettingsGroup.json +++ b/src/Settings/App.SettingsGroup.json @@ -38,7 +38,7 @@ { "name": "batteryPercentRemainingAnnounce", "shortDescription": "Announce battery remaining percent", - "longDescription": "QGroundControl will announce the remaining battery percent when it falls below the specified percentage.", + "longDescription": "Announce the remaining battery percent when it falls below the specified percentage.", "type": "uint32", "defaultValue": 30, "units": "%", @@ -92,8 +92,8 @@ }, { "name": "BaseDeviceFontPointSize", - "shortDescription": "QGroundControl font size", - "longDescription": "The point size for the default font used in QGroundControl.", + "shortDescription": "Application font size", + "longDescription": "The point size for the default font used.", "type": "uint32", "units": "pt", "min": 6, @@ -102,8 +102,8 @@ }, { "name": "StyleIsDark", - "shortDescription": "QGroundControl color scheme", - "longDescription": "The color scheme for the QGroundControl user interface.", + "shortDescription": "Application color scheme", + "longDescription": "The color scheme for the user interface.", "type": "uint32", "enumStrings": "Indoor,Outdoor", "enumValues": "1,0" diff --git a/src/Settings/Video.SettingsGroup.json b/src/Settings/Video.SettingsGroup.json index 457a519c274f87171d725a012a2097ee175eabb9..260a872a64c7ba927a663936adcad5c1e274106e 100644 --- a/src/Settings/Video.SettingsGroup.json +++ b/src/Settings/Video.SettingsGroup.json @@ -2,7 +2,7 @@ { "name": "VideoSource", "shortDescription": "Video source", - "longDescription": "Source for video. UDP, RTSP and UVC Cameras may be supported supported depending on Vehicle and QGroundControl version.", + "longDescription": "Source for video. UDP, RTSP and UVC Cameras may be supported depending on Vehicle and ground station version.", "type": "string", "defaultValue": "" }, diff --git a/src/Vehicle/MultiVehicleManager.cc b/src/Vehicle/MultiVehicleManager.cc index 105da0786d8ba8696aa1e5dc67b87b56737f8120..ef4fddeb1d05bb017b70dc52f9dfc6ebd717bc92 100644 --- a/src/Vehicle/MultiVehicleManager.cc +++ b/src/Vehicle/MultiVehicleManager.cc @@ -97,16 +97,16 @@ void MultiVehicleManager::_vehicleHeartbeatInfo(LinkInterface* link, int vehicle << vehicleType; if (vehicleId == _mavlinkProtocol->getSystemId()) { - _app->showMessage(QString("Warning: A vehicle is using the same system id as QGroundControl: %1").arg(vehicleId)); + _app->showMessage(QString("Warning: A vehicle is using the same system id as %1: %2").arg(qgcApp()->applicationName()).arg(vehicleId)); } // QSettings settings; // bool mavlinkVersionCheck = settings.value("VERSION_CHECK_ENABLED", true).toBool(); // if (mavlinkVersionCheck && vehicleMavlinkVersion != MAVLINK_VERSION) { // _ignoreVehicleIds += vehicleId; -// _app->showMessage(QString("The MAVLink protocol version on vehicle #%1 and QGroundControl differ! " +// _app->showMessage(QString("The MAVLink protocol version on vehicle #%1 and %2 differ! " // "It is unsafe to use different MAVLink versions. " -// "QGroundControl therefore refuses to connect to vehicle #%1, which sends MAVLink version %2 (QGroundControl uses version %3).").arg(vehicleId).arg(vehicleMavlinkVersion).arg(MAVLINK_VERSION)); +// "%2 therefore refuses to connect to vehicle #%1, which sends MAVLink version %3 (%2 uses version %4).").arg(vehicleId).arg(qgcApp()->applicationName()).arg(vehicleMavlinkVersion).arg(MAVLINK_VERSION)); // return; // } diff --git a/src/VehicleSetup/FirmwareUpgrade.qml b/src/VehicleSetup/FirmwareUpgrade.qml index d20ee293134aa3861f6c1d1ef30ce2d551d356dd..b16bfb2078d00f657282ed640d0e11898ce1ce30 100644 --- a/src/VehicleSetup/FirmwareUpgrade.qml +++ b/src/VehicleSetup/FirmwareUpgrade.qml @@ -33,11 +33,11 @@ QGCView { readonly property string title: "FIRMWARE" readonly property string highlightPrefix: "" readonly property string highlightSuffix: "" - readonly property string welcomeText: "QGroundControl can upgrade the firmware on Pixhawk devices, SiK Radios and PX4 Flow Smart Cameras." + readonly property string welcomeText: qsTr("%1 can upgrade the firmware on Pixhawk devices, SiK Radios and PX4 Flow Smart Cameras.").arg(QGroundControl.appName) readonly property string plugInText: "" + highlightPrefix + "Plug in your device" + highlightSuffix + " via USB to " + highlightPrefix + "start" + highlightSuffix + " firmware upgrade." readonly property string flashFailText: "If upgrade failed, make sure to connect " + highlightPrefix + "directly" + highlightSuffix + " to a powered USB port on your computer, not through a USB hub. " + "Also make sure you are only powered via USB " + highlightPrefix + "not battery" + highlightSuffix + "." - readonly property string qgcUnplugText1: "All QGroundControl connections to vehicles must be " + highlightPrefix + " disconnected " + highlightSuffix + "prior to firmware upgrade." + readonly property string qgcUnplugText1: qsTr("All %1 connections to vehicles must be ").arg(QGroundControl.appName) + highlightPrefix + " disconnected " + highlightSuffix + "prior to firmware upgrade." readonly property string qgcUnplugText2: highlightPrefix + "Please unplug your Pixhawk and/or Radio from USB." + highlightSuffix property string firmwareWarningMessage @@ -45,6 +45,8 @@ QGCView { property bool initialBoardSearch: true property string firmwareName + property bool _singleFirmwareMode: QGroundControl.corePlugin.options.firmwareUpgradeSingleURL.length != 0 ///< true: running in special single firmware download mode + function cancelFlash() { statusTextArea.append(highlightPrefix + qsTr("Upgrade cancelled") + highlightSuffix) statusTextArea.append("------------------------------------------") @@ -147,17 +149,21 @@ QGCView { function accept() { hideDialog() - var stack = apmFlightStack.checked ? FirmwareUpgradeController.AutoPilotStackAPM : FirmwareUpgradeController.AutoPilotStackPX4 - if (px4Flow) { - stack = FirmwareUpgradeController.PX4Flow - } + if (_singleFirmwareMode) { + controller.flashSingleFirmwareMode() + } else { + var stack = apmFlightStack.checked ? FirmwareUpgradeController.AutoPilotStackAPM : FirmwareUpgradeController.AutoPilotStackPX4 + if (px4Flow) { + stack = FirmwareUpgradeController.PX4Flow + } - var firmwareType = firmwareVersionCombo.model.get(firmwareVersionCombo.currentIndex).firmwareType - var vehicleType = FirmwareUpgradeController.DefaultVehicleFirmware - if (apmFlightStack.checked) { - vehicleType = controller.vehicleTypeFromVersionIndex(vehicleTypeSelectionCombo.currentIndex) + var firmwareType = firmwareVersionCombo.model.get(firmwareVersionCombo.currentIndex).firmwareType + var vehicleType = FirmwareUpgradeController.DefaultVehicleFirmware + if (apmFlightStack.checked) { + vehicleType = controller.vehicleTypeFromVersionIndex(vehicleTypeSelectionCombo.currentIndex) + } + controller.flash(stack, firmwareType, vehicleType) } - controller.flash(stack, firmwareType, vehicleType) } function reject() { @@ -203,6 +209,19 @@ QGCView { } } + ListModel { + id: singleFirmwareModeTypeList + + ListElement { + text: qsTr("Standard Version") + firmwareType: FirmwareUpgradeController.StableFirmware + } + ListElement { + text: qsTr("Custom firmware file...") + firmwareType: FirmwareUpgradeController.CustomFirmware + } + } + Column { anchors.fill: parent spacing: defaultTextHeight @@ -210,7 +229,11 @@ QGCView { QGCLabel { width: parent.width wrapMode: Text.WordWrap - text: px4Flow ? "Detected PX4 Flow board. You can select from the following firmware:" : "Detected Pixhawk board. You can select from the following flight stacks:" + text: _singleFirmwareMode ? _singleFirmwareLabel : (px4Flow ? _px4FlowLabel : _pixhawkLabel) + + readonly property string _px4FlowLabel: qsTr("Detected PX4 Flow board. You can select from the following firmware:") + readonly property string _pixhawkLabel: qsTr("Detected Pixhawk board. You can select from the following flight stacks:") + readonly property string _singleFirmwareLabel: qsTr("Press Ok to upgrade your vehicle.") } function firmwareVersionChanged(model) { @@ -229,7 +252,7 @@ QGCView { checked: true exclusiveGroup: firmwareGroup text: qsTr("PX4 Flight Stack ") - visible: !px4Flow + visible: !_singleFirmwareMode && !px4Flow onClicked: parent.firmwareVersionChanged(firmwareTypeList) } @@ -238,7 +261,7 @@ QGCView { id: apmFlightStack exclusiveGroup: firmwareGroup text: qsTr("ArduPilot Flight Stack") - visible: !px4Flow + visible: !_singleFirmwareMode && !px4Flow onClicked: parent.firmwareVersionChanged(firmwareTypeList) } @@ -295,7 +318,7 @@ QGCView { anchors.left: parent.left anchors.right: parent.right visible: showFirmwareTypeSelection - model: px4Flow ? px4FlowTypeList : firmwareTypeList + model: _singleFirmwareMode ? singleFirmwareModeTypeList: (px4Flow ? px4FlowTypeList : firmwareTypeList) currentIndex: controller.selectedFirmwareType onActivated: { diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index bf83ef8cc5ee9e36ee052464eb3268279211b202..0378805d88ef9825f037d7ac05e46494597031f2 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -17,6 +17,8 @@ #include "QGCFileDialog.h" #include "QGCApplication.h" #include "QGCFileDownload.h" +#include "QGCOptions.h" +#include "QGCCorePlugin.h" #include #include @@ -41,7 +43,9 @@ uint qHash(const FirmwareUpgradeController::FirmwareIdentifier& firmwareId) /// @Brief Constructs a new FirmwareUpgradeController Widget. This widget is used within the PX4VehicleConfig set of screens. FirmwareUpgradeController::FirmwareUpgradeController(void) - : _downloadManager(NULL) + : _singleFirmwareURL(qgcApp()->toolbox()->corePlugin()->options()->firmwareUpgradeSingleURL()) + , _singleFirmwareMode(!_singleFirmwareURL.isEmpty()) + , _downloadManager(NULL) , _downloadNetworkReply(NULL) , _statusLog(NULL) , _selectedFirmwareType(StableFirmware) @@ -110,6 +114,11 @@ void FirmwareUpgradeController::flash(const FirmwareIdentifier& firmwareId) flash(firmwareId.autopilotStackType, firmwareId.firmwareType, firmwareId.firmwareVehicleType); } +void FirmwareUpgradeController::flashSingleFirmwareMode(void) +{ + flash(SingleFirmwareMode, StableFirmware, DefaultVehicleFirmware); +} + void FirmwareUpgradeController::cancel(void) { _eraseTimer.stop(); @@ -202,7 +211,8 @@ void FirmwareUpgradeController::_initFirmwareHash() { AutoPilotStackAPM, DeveloperFirmware, CopterFirmware, "http://firmware.ardupilot.org/Copter/latest/PX4/ArduCopter-v4.px4"}, { AutoPilotStackAPM, DeveloperFirmware, HeliFirmware, "http://firmware.ardupilot.org/Copter/latest/PX4-heli/ArduCopter-v4.px4"}, { AutoPilotStackAPM, DeveloperFirmware, PlaneFirmware, "http://firmware.ardupilot.org/Plane/latest/PX4/ArduPlane-v4.px4"}, - { AutoPilotStackAPM, DeveloperFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v4.px4"} + { AutoPilotStackAPM, DeveloperFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v4.px4"}, + { SingleFirmwareMode,StableFirmware, DefaultVehicleFirmware, _singleFirmwareURL}, }; //////////////////////////////////// PX4FMUV2 firmwares ////////////////////////////////////////////////// @@ -228,6 +238,7 @@ void FirmwareUpgradeController::_initFirmwareHash() { AutoPilotStackAPM, DeveloperFirmware, PlaneFirmware, "http://firmware.ardupilot.org/Plane/latest/PX4/ArduPlane-v2.px4"}, { AutoPilotStackAPM, DeveloperFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v2.px4"}, { AutoPilotStackAPM, DeveloperFirmware, SubFirmware, "http://firmware.ardupilot.org/Sub/latest/PX4/ArduSub-v2.px4"}, + { SingleFirmwareMode,StableFirmware, DefaultVehicleFirmware, _singleFirmwareURL}, }; //////////////////////////////////// PX4FMU aerocore firmwares ////////////////////////////////////////////////// @@ -299,6 +310,7 @@ void FirmwareUpgradeController::_initFirmwareHash() { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/tap-v1_default.px4"}, { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/tap-v1_default.px4"}, { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/tap-v1_default.px4"}, + { SingleFirmwareMode,StableFirmware, DefaultVehicleFirmware, _singleFirmwareURL}, }; //////////////////////////////////// ASCV1 firmwares ////////////////////////////////////////////////// FirmwareToUrlElement_t rgASCV1FirmwareArray[] = { @@ -376,6 +388,12 @@ void FirmwareUpgradeController::_initFirmwareHash() const FirmwareToUrlElement_t& element = rg3DRRadioFirmwareArray[i]; _rg3DRRadioFirmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); } + + size = sizeof(rg3DRRadioFirmwareArray)/sizeof(rg3DRRadioFirmwareArray[0]); + for (int i = 0; i < size; i++) { + const FirmwareToUrlElement_t& element = rg3DRRadioFirmwareArray[i]; + _rg3DRRadioFirmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } } /// @brief Called when the findBootloader process is unable to sync to the bootloader. Moves the state @@ -429,7 +447,6 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareId) QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), // Initial directory "Firmware Files (*.px4 *.bin *.ihx)"); // File filter } else { - if (prgFirmware->contains(firmwareId)) { _firmwareFilename = prgFirmware->value(firmwareId); } else { diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index 1209135dfd51ec4d374dd42d00eaba2588e4f361..6ce335d6caa2a0eb561e34b161a111bf05322dd8 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -42,7 +42,8 @@ public: AutoPilotStackPX4, AutoPilotStackAPM, PX4Flow, - ThreeDRRadio + ThreeDRRadio, + SingleFirmwareMode } AutoPilotStackType_t; typedef enum { @@ -122,6 +123,9 @@ public: FirmwareType_t firmwareType = StableFirmware, FirmwareVehicleType_t vehicleType = DefaultVehicleFirmware ); + /// Called to flash when upgrade is running in singleFirmwareMode + Q_INVOKABLE void flashSingleFirmwareMode(void); + Q_INVOKABLE FirmwareVehicleType_t vehicleTypeFromVersionIndex(int index); // overload, not exposed to qml side @@ -191,6 +195,8 @@ private: QHash* _firmwareHashForBoardId(int boardId); void _determinePX4StableVersion(void); + QString _singleFirmwareURL; + bool _singleFirmwareMode; QString _portName; QString _portDescription; diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index 7876a63dd70ad1313fa506bb29ce51af9c89966c..a4b7b7a74ca78911ab88316adaa2d2de8ef8958f 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -141,7 +141,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap font.pointSize: ScreenTools.mediumFontPointSize - text: "QGroundControl does not currently support setup of your vehicle type. " + + text: tr("%1 does not currently support setup of your vehicle type. ").arg(QGroundControl.appName) + "If your vehicle is already configured you can still Fly." onLinkActivated: Qt.openUrlExternally(link) @@ -162,7 +162,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap font.pointSize: ScreenTools.largeFontPointSize - text: "Connect vehicle to your device and QGroundControl will automatically detect it." + + text: qsTr("Connect vehicle to your device and %1 will automatically detect it.").arg(QGroundControl.appName) + (ScreenTools.isMobile ? "" : " Click Firmware on the left to upgrade your vehicle.") onLinkActivated: Qt.openUrlExternally(link) diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index baf6cb678c8126adacadda4a5ba05ae0b6c20952..d21b5920e7b2f2929aa404983d8bf1662abba620 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -35,6 +35,7 @@ public: Q_PROPERTY(bool showSensorCalibrationAirspeed READ showSensorCalibrationAirspeed NOTIFY showSensorCalibrationAirspeedChanged) Q_PROPERTY(bool showSensorCalibrationOrient READ showSensorCalibrationOrient NOTIFY showSensorCalibrationOrientChanged) Q_PROPERTY(bool showFirmwareUpgrade READ showFirmwareUpgrade NOTIFY showFirmwareUpgradeChanged) + Q_PROPERTY(QString firmwareUpgradeSingleURL READ firmwareUpgradeSingleURL CONSTANT) /// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)? /// @return true if QGC should consolidate both menus into one. @@ -53,14 +54,19 @@ public: virtual CustomInstrumentWidget* instrumentWidget(); /// By returning false you can hide the following sensor calibration pages - virtual bool showSensorCalibrationCompass () const { return true; } - virtual bool showSensorCalibrationGyro () const { return true; } - virtual bool showSensorCalibrationAccel () const { return true; } - virtual bool showSensorCalibrationLevel () const { return true; } - virtual bool showSensorCalibrationAirspeed () const { return true; } - virtual bool showSensorCalibrationOrient () const { return true; } + virtual bool showSensorCalibrationCompass () const { return true; } + virtual bool showSensorCalibrationGyro () const { return true; } + virtual bool showSensorCalibrationAccel () const { return true; } + virtual bool showSensorCalibrationLevel () const { return true; } + virtual bool showSensorCalibrationAirspeed () const { return true; } + virtual bool showSensorCalibrationOrient () const { return true; } - virtual bool showFirmwareUpgrade () const { return true; } + virtual bool showFirmwareUpgrade () const { return true; } + + /// If returned QString in non-empty it means that firmware upgrade will run in a mode which only + /// supports downloading a single firmware file from the URL. It also supports custom install through + /// the Advanced options. + virtual QString firmwareUpgradeSingleURL () const { return QString(); } signals: void showSensorCalibrationCompassChanged (bool show); diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index 0f6868495a4083d97693986175058ed7cc571a65..29a9848118981aa0cca501eff9ac22c6f297a0ec 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -867,8 +867,8 @@ void LinkManager::_activeLinkCheck(void) } qgcApp()->showMessage(foundNSHPrompt ? - QStringLiteral("Please check to make sure you have an SD Card inserted in your Vehicle and try again.") : - QStringLiteral("Your Vehicle is not responding. If this continues shutdown QGroundControl, restart the Vehicle letting it boot completely, then start QGroundControl.")); + tr("Please check to make sure you have an SD Card inserted in your Vehicle and try again.") : + tr("Your Vehicle is not responding. If this continues, shutdown %1, restart the Vehicle letting it boot completely, then start %1.").arg(qgcApp()->applicationName())); } } #endif diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 1acb6d40934d188b84f926f8e34ed4fc179a44f0..5067c5e1e6a2088ebb22fc07f5532f6aea71034c 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -193,7 +193,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b) { warnedUserNonMavlink = true; emit protocolStatusMessage(tr("MAVLink Protocol"), tr("There is a MAVLink Version or Baud Rate Mismatch. " - "Please check if the baud rates of QGroundControl and your autopilot are the same.")); + "Please check if the baud rates of %1 and your autopilot are the same.").arg(qgcApp()->applicationName())); } } } diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc index ec5112e6f25d970336d75ed8a4342daf29abc653..3af960e5f2f0d8638b3963a11b61a1c102ce46d1 100644 --- a/src/comm/QGCFlightGearLink.cc +++ b/src/comm/QGCFlightGearLink.cc @@ -288,7 +288,7 @@ void QGCFlightGearLink::readBytes() qDebug() << "RETURN LENGTH MISMATCHING EXPECTED" << nValues << "BUT GOT" << values.size(); qDebug() << state; emit showCriticalMessageFromThread(tr("FlightGear HIL"), - tr("Flight Gear protocol file '%1' is out of date. Quit QGroundControl. Delete the file and restart QGroundControl to fix.").arg(_fgProtocolFileFullyQualified)); + tr("Flight Gear protocol file '%1' is out of date. Quit %2. Delete the file and restart %2 to fix.").arg(_fgProtocolFileFullyQualified).arg(qgcApp()->applicationName())); disconnectSimulation(); return; } @@ -820,7 +820,7 @@ bool QGCFlightGearLink::connectSimulation() // Setup and verify directory which contains QGC provided aircraft files QString qgcAircraftDir(QApplication::applicationDirPath() + "/flightgear/Aircraft"); if (!QFileInfo(qgcAircraftDir).isDir()) { - QGCMessageBox::critical(tr("FlightGear HIL"), tr("Incorrect QGroundControl installation. Aircraft directory is missing: '%1'.").arg(qgcAircraftDir)); + QGCMessageBox::critical(tr("FlightGear HIL"), tr("Incorrect %1 installation. Aircraft directory is missing: '%2'.").arg(qgcApp()->applicationName()).arg(qgcAircraftDir)); return false; } _fgArgList += "--fg-aircraft=" + qgcAircraftDir; @@ -841,7 +841,7 @@ bool QGCFlightGearLink::connectSimulation() // Verify directory which contains QGC provided FlightGear communication protocol files QDir qgcProtocolDir(QApplication::applicationDirPath() + "/flightgear/Protocol/"); if (!qgcProtocolDir.isReadable()) { - QGCMessageBox::critical(tr("FlightGear HIL"), tr("Incorrect QGroundControl installation. Protocol directory is missing (%1).").arg(qgcProtocolDir.path())); + QGCMessageBox::critical(tr("FlightGear HIL"), tr("Incorrect installation. Protocol directory is missing (%1).").arg(qgcProtocolDir.path())); return false; } @@ -849,7 +849,7 @@ bool QGCFlightGearLink::connectSimulation() QString fgProtocolXmlFile = fgProtocol + ".xml"; QString qgcProtocolFileFullyQualified = qgcProtocolDir.absoluteFilePath(fgProtocolXmlFile); if (!QFileInfo(qgcProtocolFileFullyQualified).exists()) { - QGCMessageBox::critical(tr("FlightGear HIL"), tr("Incorrect QGroundControl installation. FlightGear protocol file missing: %1").arg(qgcProtocolFileFullyQualified)); + QGCMessageBox::critical(tr("FlightGear HIL"), tr("Incorrect installation. FlightGear protocol file missing: %1").arg(qgcProtocolFileFullyQualified)); return false; } @@ -868,7 +868,7 @@ bool QGCFlightGearLink::connectSimulation() !qgcFile.open(QIODevice::ReadOnly)) { QGCMessageBox::warning(tr("FlightGear HIL"), tr("Unable to verify that protocol file %1 is current. " "If file is out of date, you may experience problems. " - "Safest approach is to delete the file manually and allow QGroundControl install the latest file.").arg(_fgProtocolFileFullyQualified)); + "Safest approach is to delete the file manually and allow %2 install the latest file.").arg(qgcApp()->applicationName()).arg(_fgProtocolFileFullyQualified)); } QByteArray fgBytes = fgFile.readAll(); @@ -878,7 +878,7 @@ bool QGCFlightGearLink::connectSimulation() qgcFile.close(); if (fgBytes != qgcBytes) { - QGCMessageBox::warning(tr("FlightGear HIL"), tr("FlightGear protocol file %1 is out of date. It will be deleted, which will cause QGroundControl to install the latest version of the file.").arg(_fgProtocolFileFullyQualified)); + QGCMessageBox::warning(tr("FlightGear HIL"), tr("FlightGear protocol file %1 is out of date. It will be deleted, which will cause %2 to install the latest version of the file.").arg(_fgProtocolFileFullyQualified).arg(qgcApp()->applicationName())); if (!QFile::remove(_fgProtocolFileFullyQualified)) { QGCMessageBox::warning(tr("FlightGear HIL"), tr("Delete of protocol file failed. You will have to manually delete the file.")); return false; @@ -889,7 +889,7 @@ bool QGCFlightGearLink::connectSimulation() if (!QFileInfo(_fgProtocolFileFullyQualified).exists()) { QMessageBox msgBox(QMessageBox::Critical, tr("FlightGear Failed to Start"), - tr("FlightGear Failed to Start. QGroundControl protocol (%1) not installed to FlightGear Protocol directory (%2)").arg(fgProtocolXmlFile).arg(fgProtocolDir.path()), + tr("FlightGear Failed to Start. %1 protocol (%2) not installed to FlightGear Protocol directory (%3)").arg(qgcApp()->applicationName()).arg(fgProtocolXmlFile).arg(fgProtocolDir.path()), QMessageBox::Cancel, MainWindow::instance()); msgBox.setWindowModality(Qt::ApplicationModal); diff --git a/src/ui/MainWindowInner.qml b/src/ui/MainWindowInner.qml index 15793b907c34a4ac5e2fc7b7aa8bf033283af793..3e899f3275e7f031efa3ee8b138242e72fb5bae3 100644 --- a/src/ui/MainWindowInner.qml +++ b/src/ui/MainWindowInner.qml @@ -134,7 +134,7 @@ Item { MessageDialog { id: unsavedMissionCloseDialog - title: qsTr("QGroundControl close") + title: qsTr("%1 close").arg(QGroundControl.appName) text: qsTr("You have a mission edit in progress which has not been saved/sent. If you close you will lose changes. Are you sure you want to close?") standardButtons: StandardButton.Yes | StandardButton.No modality: Qt.ApplicationModal @@ -153,7 +153,7 @@ Item { MessageDialog { id: activeConnectionsCloseDialog - title: qsTr("QGroundControl close") + title: qsTr("%1 close").arg(QGroundControl.appName) text: qsTr("There are still active connections to vehicles. Do you want to disconnect these before closing?") standardButtons: StandardButton.Yes | StandardButton.Cancel modality: Qt.ApplicationModal diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index 2810da2048556eb6ad156b3a219341d7efb37ff7..6ca4a16c84d07b2a40fb434c2757d26db357990f 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -277,7 +277,7 @@ QGCView { icon: StandardIcon.Warning standardButtons: StandardButton.Yes | StandardButton.No title: qsTr("Clear Settings") - text: qsTr("All saved settings will be reset the next time you start QGroundControl. Is this really what you want?") + text: qsTr("All saved settings will be reset the next time you start %1. Is this really what you want?").arg(QGroundControl.appName) onYes: { QGroundControl.deleteAllSettingsNextBoot() clearDialog.visible = false @@ -598,7 +598,7 @@ QGCView { QGCLabel { anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("QGroundControl Version: " + QGroundControl.qgcVersion) + text: qsTr("%1 Version: %2").arg(QGroundControl.appName).arg(QGroundControl.qgcVersion) } } // settingsColumn } // QGCFlickable