Commit 71813e49 authored by Gus Grubba's avatar Gus Grubba

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol into exportTileSet

* 'master' of https://github.com/mavlink/qgroundcontrol:
  Use QCoreApplicationName::applicationName()
  Add new single firmware mode from QGCOptions
  Allow custom build to override app name information
  Make compiler happy
  Changed follow vehicle user model
  MissionCmdUIInfo: New support for specifiesAltitudeOnly
parents f2b56ac2 fbc34cc5
......@@ -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
......
......@@ -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)
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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,
......
......@@ -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
}
]
}
......@@ -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
}
}
......
......@@ -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;
}
......
......@@ -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"; }
......
......@@ -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;
}
......
......@@ -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
}
},
{
......
......@@ -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;
}
......
......@@ -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"; }
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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"; }
......
......@@ -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);
......
......@@ -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();
......
......@@ -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
......@@ -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; }
......
......@@ -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"
......
......@@ -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": ""
},
......
......@@ -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;
// }
......
......@@ -33,11 +33,11 @@ QGCView {
readonly property string title: "FIRMWARE"
readonly property string highlightPrefix: "<font color=\"" + qgcPal.warningText + "\">"
readonly property string highlightSuffix: "</font>"
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: "<big>" + highlightPrefix + "Plug in your device" + highlightSuffix + " via USB to " + highlightPrefix + "start" + highlightSuffix + " firmware upgrade.</big>"
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 + "<big>Please unplug your Pixhawk and/or Radio from USB.</big>" + 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)