Commit edf1d742 authored by DoinLakeFlyer's avatar DoinLakeFlyer

parent 72c97a09
<RCC>
<qresource prefix="/unittest">
<file alias="SectionTest.plan">src/MissionManager/UnitTest/SectionTest.plan</file>
<file alias="MavCmdInfoCommon.json">src/MissionManager/UnitTest/MavCmdInfoCommon.json</file>
<file alias="MavCmdInfoFixedWing.json">src/MissionManager/UnitTest/MavCmdInfoFixedWing.json</file>
<file alias="MavCmdInfoMultiRotor.json">src/MissionManager/UnitTest/MavCmdInfoMultiRotor.json</file>
<file alias="MavCmdInfoRover.json">src/MissionManager/UnitTest/MavCmdInfoRover.json</file>
<file alias="MavCmdInfoSub.json">src/MissionManager/UnitTest/MavCmdInfoSub.json</file>
<file alias="MavCmdInfoVTOL.json">src/MissionManager/UnitTest/MavCmdInfoVTOL.json</file>
<file alias="SectionTest.plan">src/MissionManager/UnitTest/SectionTest.plan</file>
<file alias="UT-MavCmdInfoCommon.json">src/MissionManager/UnitTest/UT-MavCmdInfoCommon.json</file>
<file alias="UT-MavCmdInfoFixedWing.json">src/MissionManager/UnitTest/UT-MavCmdInfoFixedWing.json</file>
<file alias="UT-MavCmdInfoMultiRotor.json">src/MissionManager/UnitTest/UT-MavCmdInfoMultiRotor.json</file>
<file alias="UT-MavCmdInfoRover.json">src/MissionManager/UnitTest/UT-MavCmdInfoRover.json</file>
<file alias="UT-MavCmdInfoSub.json">src/MissionManager/UnitTest/UT-MavCmdInfoSub.json</file>
<file alias="UT-MavCmdInfoVTOL.json">src/MissionManager/UnitTest/UT-MavCmdInfoVTOL.json</file>
<file alias="MissionPlanner.waypoints">src/MissionManager/UnitTest/MissionPlanner.waypoints</file>
<file alias="OldFileFormat.mission">src/MissionManager/UnitTest/OldFileFormat.mission</file>
<file alias="PolygonAreaTest.kml">src/MissionManager/UnitTest/PolygonAreaTest.kml</file>
<file alias="PolygonGood.kml">src/MissionManager/UnitTest/PolygonGood.kml</file>
<file alias="PolygonMissingNode.kml">src/MissionManager/UnitTest/PolygonMissingNode.kml</file>
<file alias="PolygonBadXml.kml">src/MissionManager/UnitTest/PolygonBadXml.kml</file>
<file alias="PolygonBadCoordinatesNode.kml">src/MissionManager/UnitTest/PolygonBadCoordinatesNode.kml</file>
<file alias="PolygonAreaTest.kml">src/MissionManager/UnitTest/PolygonAreaTest.kml</file>
<file alias="PolygonGood.kml">src/MissionManager/UnitTest/PolygonGood.kml</file>
<file alias="PolygonMissingNode.kml">src/MissionManager/UnitTest/PolygonMissingNode.kml</file>
<file alias="PolygonBadXml.kml">src/MissionManager/UnitTest/PolygonBadXml.kml</file>
<file alias="PolygonBadCoordinatesNode.kml">src/MissionManager/UnitTest/PolygonBadCoordinatesNode.kml</file>
</qresource>
</RCC>
To generate (or update) a source translation file, use the `to-crowdin.sh` script in this directory. You will need to update the path to Qt within it.
# QGroundControl string translations
QGC uses the standard Qt Linguist mechanisms for string translation. QGC uses crowd sourced string translation through a [Crowdin project](https://crowdin.com/project/qgroundcontrol for translation).
## C++ and Qml code strings
These are coded using the standard Qt tr() for C++ and qsTr() for Qml mechanisms.
## Translating strings within Json files
QGC uses json files internally for metadata. These files need to be translated as well. There is a [python parser](https://github.com/mavlink/qgroundcontrol/blob/master/localization/qgc-lupdate-json.py) which is used to find all the json files in the source tree and pull all the strings out for translation. This parser outputs the localization file for json strings in Qt .ts file format.
In order for the parser to know which strings must be translated additional keys must be available at the root object level.
> Important: Json files which have the same name are not allowed. Since the name is used as the context for the translation lookup it must be unique. The parse will throw an error if it finds duplicate file names.
> Important: The root file name for the json file must be the same as the root filename for the Qt resource alias. This due to the fact that the root filename is used as the translation context. The json parser reads files from the file system and sees file system names. Whereas the QGC C++ code reads json files from the QT resource system and see the file alias as the full path and root name.
### Specifying known file type
The parser supports two known file types: "MAVCmdInfo" and "FactMetaData". If your json file is one of these types you should place a `fileType` key at the root with one of these values. This will cause the parser to use these defaults for instructions:
#### MAVCmdInfo
```
"translateKeys": "label,enumStrings,friendlyName,description",
"arrayIDKeys": "rawName,comment"
```
#### FactMetaData
```
"translateKeys": "shortDescription,longDescription,enumStrings"
"arrayIDKeys": "name"
```
### Manually specify parser instructions
For this case dont include the `fileType` key/value pair. And include the followings keys (as needed) in the root object:
* `translateKeys` This key is a string which is a list of all the keys which should be translated.
* `arrayIDKeys` The json localization parser provides additional information to the translator about where this string came from in the json hierarchy. If there is an array in the json, just displaying an array index as to where this came from is not that helpful. In most cases there is a key within each array element for which the value is unique. If this is the case then specify this key name(s) as the value for `arrayIDKeys`.
### Disambiguation
This is used when you have two strings in the same file which are equal, but there meaning ar different enough that when translated they may each have their own different translation. In order to specific that you include a special prefix marker in the string which includes comments to the translator to explain the specifics of the string.
```
"foo": "#loc.disambiguation#This is the foo version of baz#baz"
"bar": "#loc.disambiguation#This is the bar version of baz#baz"
```
In the example above "baz" is the string which is the same for two different keys. The prefix `#loc.disambiguation#` indicates a disambiguation is to follow which is the string between the next set of `#`s.
## Uploading new strings to Crowdin
To generate (or update) a source translation file, use the [to-crowdin.sh](https://github.com/mavlink/qgroundcontrol/blob/master/localization/to-crowdin.sh) script in this directory. You will need to update the path to Qt within it. This will do the following steps:
* Delete the current qgc.ts file
* Run the qt lupdate command to generate a new qgc.ts file
* Run the python json parser which will add the json strings to the qgc.ts file
Once this is complete you can upload the new qgc.ts file to Crowdin.
https://github.com/mavlink/qgroundcontrol/blob/master/localization/to-crowdin.sh
## Download translations from Crowdin
Once translations have been done/updated, within Crowdin "Build and Download". Extract the resulting qgroundcontro.zip here and run [from-crowdin.sh](https://github.com/mavlink/qgroundcontrol/blob/master/localization/from-crowdin.sh).
This will parse all the source files and generate a language translation file called qgc.ts, which should be uploaded to crowdin.
Once translations have been done/updated, within Crowdin "Build and Download". Extract the resulting qgroundcontro.zip here and run `from-crowdin.py`.
#!/usr/bin/env python
import os
import json
from xml.dom.minidom import parse
import xml.dom.minidom
import codecs
import sys
qgcFileTypeKey = "fileType"
translateKeysKey = "translateKeys"
arrayIDKeysKey = "arrayIDKeys"
disambiguationPrefix = "#loc.disambiguation#"
def parseJsonObjectForTranslateKeys(jsonObjectHierarchy, jsonObject, translateKeys, arrayIDKeys, locStringDict):
for translateKey in translateKeys:
if (translateKey in jsonObject):
locStr = jsonObject[translateKey]
currentHierarchy = jsonObjectHierarchy + "." + translateKey
if locStr in locStringDict:
# Duplicate of an existing string
locStringDict[locStr].append(currentHierarchy)
else:
# First time we are seeing this string
locStringDict[locStr] = [ currentHierarchy ]
for key in jsonObject:
currentHierarchy = jsonObjectHierarchy + "." + key
if (type(jsonObject[key]) == type({})):
parseJsonObjectForTranslateKeys(currentHierarchy, jsonObject[key], translateKeys,arrayIDKeys, locStringDict)
elif (type(jsonObject[key]) == type([])):
parseJsonArrayForTranslateKeys(currentHierarchy, jsonObject[key], translateKeys, arrayIDKeys, locStringDict)
def parseJsonArrayForTranslateKeys(jsonObjectHierarchy, jsonArray, translateKeys, arrayIDKeys, locStringDict):
for index in range(0, len(jsonArray)):
jsonObject = jsonArray[index]
arrayIndexStr = str(index)
for arrayIDKey in arrayIDKeys:
if arrayIDKey in jsonObject.keys():
arrayIndexStr = jsonObject[arrayIDKey]
break
currentHierarchy = jsonObjectHierarchy + "[" + arrayIndexStr + "]"
parseJsonObjectForTranslateKeys(currentHierarchy, jsonObject, translateKeys, arrayIDKeys, locStringDict)
def addLocKeysBasedOnQGCFileType(jsonPath, jsonDict):
# Instead of having to add the same keys over and over again in a pile of files we add them here automatically based on file type
if qgcFileTypeKey in jsonDict:
qgcFileType = jsonDict[qgcFileTypeKey]
translateKeyValue = ""
arrayIDKeysKeyValue = ""
if qgcFileType == "MavCmdInfo":
translateKeyValue = "label,enumStrings,friendlyName,description,category"
arrayIDKeysKeyValue = "rawName,comment"
elif qgcFileType == "FactMetaData":
translateKeyValue = "shortDescription,longDescription,enumStrings"
arrayIDKeysKeyValue = "name"
if translateKeysKey not in jsonDict and translateKeyValue != "":
jsonDict[translateKeysKey] = translateKeyValue
if arrayIDKeysKey not in jsonDict and arrayIDKeysKeyValue != "":
jsonDict[arrayIDKeysKey] = arrayIDKeysKeyValue
def parseJson(jsonPath, locStringDict):
jsonFile = open(jsonPath)
jsonDict = json.load(jsonFile)
if (type(jsonDict) != type({})):
return
addLocKeysBasedOnQGCFileType(jsonPath, jsonDict)
if (not translateKeysKey in jsonDict):
return
translateKeys = jsonDict[translateKeysKey].split(",")
arrayIDKeys = jsonDict.get(arrayIDKeysKey, "").split(",")
parseJsonObjectForTranslateKeys("", jsonDict, translateKeys, arrayIDKeys, locStringDict)
def walkDirectoryTreeForJsonFiles(dir, multiFileLocArray):
for filename in os.listdir(dir):
path = os.path.join(dir, filename)
if (os.path.isfile(path) and filename.endswith(".json")):
#print "json",path
singleFileLocStringDict = {}
parseJson(path, singleFileLocStringDict)
if len(singleFileLocStringDict.keys()):
# Check for duplicate file names
for entry in multiFileLocArray:
if entry[0] == filename:
print "Error: Duplicate filenames: %s paths: %s %s" % (filename, path, entry[1])
sys.exit(1)
multiFileLocArray.append([filename, path, singleFileLocStringDict])
if (os.path.isdir(path)):
walkDirectoryTreeForJsonFiles(path, multiFileLocArray)
def appendToQGCTSFile(multiFileLocArray):
originalTSFile = codecs.open('qgc.ts', 'r', "utf-8")
newTSFile = codecs.open('qgc.ts.new', 'w', "utf-8")
line = originalTSFile.readline()
while (line != "</TS>\n"):
newTSFile.write(line);
line = originalTSFile.readline()
originalTSFile.close()
for entry in multiFileLocArray:
newTSFile.write("<context>\n")
newTSFile.write(" <name>%s</name>\n" % entry[0])
singleFileLocStringDict = entry[2]
for locStr in singleFileLocStringDict.keys():
disambiguation = ""
if locStr.startswith(disambiguationPrefix):
workStr = locStr[len(disambiguationPrefix):]
terminatorIndex = workStr.find("#")
if terminatorIndex == -1:
print "Bad disambiguation %1 '%2'" % (entry[0], locStr)
sys.exit(1)
disambiguation = workStr[:terminatorIndex]
locStr = workStr[terminatorIndex+1:]
newTSFile.write(" <message>\n")
if len(disambiguation):
newTSFile.write(" <comment>%s</comment>\n" % disambiguation)
extraCommentStr = ""
for jsonHierachy in singleFileLocStringDict[locStr]:
extraCommentStr += "%s, " % jsonHierachy
newTSFile.write(" <extracomment>%s</extracomment>\n" % extraCommentStr)
newTSFile.write(" <location filename=\"%s\"/>\n" % entry[1])
newTSFile.write(unicode(" <source>%s</source>\n") % locStr)
newTSFile.write(" <translation type=\"unfinished\"></translation>\n")
newTSFile.write(" </message>\n")
newTSFile.write("</context>\n")
newTSFile.write("</TS>\n")
newTSFile.close()
def main():
multiFileLocArray = []
walkDirectoryTreeForJsonFiles("../src", multiFileLocArray)
appendToQGCTSFile(multiFileLocArray)
if __name__ == '__main__':
main()
#!/bin/bash
# This is set to find lupdate in my particular installation. You will need to set the path
# where you have Qt installed.
QT_PATH=~/Applications/Qt/5.12.3/clang_64/bin
QT_PATH=~//Qt/5.12.6/gcc_64/bin
rm qgc.ts
$QT_PATH/lupdate ../src -ts qgc.ts
python qgc-lupdate-json.py
mv qgc.ts.new qgc.ts
{
"version": 1,
"fileType": "FactMetaData",
"QGC.MetaData.Facts":
[
{
"name": "usePersonalApiKey",
......@@ -48,3 +52,4 @@
"defaultValue": false
}
]
}
{
"version": 1,
"fileType": "FactMetaData",
"QGC.MetaData.Facts":
[
{
"name": "angle",
......@@ -28,3 +32,4 @@
"defaultValue": 5
}
]
}
......@@ -266,7 +266,7 @@ SetupPage {
QGCLabel { text: qsTr("- The arming tone will be played (if the vehicle has a buzzer attached)") }
QGCLabel { text: qsTr("- If using a flight controller with a safety button press it until it displays solid red") }
QGCLabel { text: qsTr("- You will hear a musical tone then two beeps") }
QGCLabel { text: qsTr("- A few seconds later you should hear a number of beeps (one for each battery cell youre using)") }
QGCLabel { text: qsTr("- A few seconds later you should hear a number of beeps (one for each battery cell you're using)") }
QGCLabel { text: qsTr("- And finally a single long beep indicating the end points have been set and the ESC is calibrated") }
QGCLabel { text: qsTr("- Disconnect the battery and power up again normally") }
}
......
......@@ -111,7 +111,7 @@ SetupPage {
QGCLabel {
anchors.fill: parent
wrapMode: Text.WordWrap
text: qsTr("Clicking “Apply” will save the changes you have made to your airframe configuration.<br><br>\
text: qsTr("Clicking 'Apply' will save the changes you have made to your airframe configuration.<br><br>\
All vehicle parameters other than Radio Calibration will be reset.<br><br>\
Your vehicle will also be restarted in order to complete the process.")
}
......@@ -130,7 +130,7 @@ Your vehicle will also be restarted in order to complete the process.")
text: (controller.currentVehicleName != "" ?
qsTr("You've connected a %1.").arg(controller.currentVehicleName) :
qsTr("Airframe is not set.")) +
qsTr("To change this configuration, select the desired airframe below then click “Apply and Restart”.")
qsTr("To change this configuration, select the desired airframe below then click 'Apply and Restart'.")
font.family: ScreenTools.demiboldFontFamily
wrapMode: Text.WordWrap
}
......
......@@ -35,6 +35,7 @@ const qreal FactMetaData::UnitConsts_s::inchesToCentimeters = 2.54;
static const char* kDefaultCategory = QT_TRANSLATE_NOOP("FactMetaData", "Other");
static const char* kDefaultGroup = QT_TRANSLATE_NOOP("FactMetaData", "Misc");
const char* FactMetaData::qgcFileType = "FactMetaData";
const char* FactMetaData::_jsonMetaDataDefinesName = "QGC.MetaData.Defines";
const char* FactMetaData::_jsonMetaDataFactsName = "QGC.MetaData.Facts";
......@@ -1220,45 +1221,29 @@ QMap<QString, FactMetaData*> FactMetaData::createMapFromJsonFile(const QString&
{
QMap<QString, FactMetaData*> metaDataMap;
QFile jsonFile(jsonFilename);
if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Unable to open file" << jsonFilename << jsonFile.errorString();
return metaDataMap;
}
QByteArray bytes = jsonFile.readAll();
jsonFile.close();
QJsonParseError jsonParseError;
QJsonDocument doc = QJsonDocument::fromJson(bytes, &jsonParseError);
if (jsonParseError.error != QJsonParseError::NoError) {
qWarning() << "Unable to parse json document filename:error:offset" << jsonFilename << jsonParseError.errorString() << jsonParseError.offset;
QString errorString;
int version;
QJsonObject jsonObject = JsonHelper::openInternalQGCJsonFile(jsonFilename, qgcFileType, 1, 1, version, errorString);
if (!errorString.isEmpty()) {
qWarning() << "Internal Error: " << errorString;
return metaDataMap;
}
QJsonArray factArray;
QMap<QString /* define name */, QString /* define value */> defineMap;
if (doc.isObject()) {
// Check for Defines/Facts format
QString errorString;
QList<JsonHelper::KeyValidateInfo> keyInfoList = {
{ FactMetaData::_jsonMetaDataDefinesName, QJsonValue::Object, true },
{ FactMetaData::_jsonMetaDataFactsName, QJsonValue::Array, true },
};
if (!JsonHelper::validateKeys(doc.object(), keyInfoList, errorString)) {
qWarning() << "Json document incorrect format:" << errorString;
return metaDataMap;
}
_loadJsonDefines(doc.object()[FactMetaData::_jsonMetaDataDefinesName].toObject(), defineMap);
factArray = doc.object()[FactMetaData::_jsonMetaDataFactsName].toArray();
} else if (doc.isArray()) {
factArray = doc.array();
} else {
qWarning() << "Json document is neither array nor object";
QList<JsonHelper::KeyValidateInfo> keyInfoList = {
{ FactMetaData::_jsonMetaDataDefinesName, QJsonValue::Object, false },
{ FactMetaData::_jsonMetaDataFactsName, QJsonValue::Array, true },
};
if (!JsonHelper::validateKeys(jsonObject, keyInfoList, errorString)) {
qWarning() << "Json document incorrect format:" << errorString;
return metaDataMap;
}
_loadJsonDefines(jsonObject[FactMetaData::_jsonMetaDataDefinesName].toObject(), defineMap);
factArray = jsonObject[FactMetaData::_jsonMetaDataFactsName].toArray();
return createMapFromJsonArray(factArray, defineMap, metaDataParent);
}
......
......@@ -7,12 +7,7 @@
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#ifndef FactMetaData_H
#define FactMetaData_H
#pragma once
#include <QObject>
#include <QString>
......@@ -172,6 +167,8 @@ public:
static ValueType_t stringToType(const QString& typeString, bool& unknownType);
static size_t typeToSize(ValueType_t type);
static const char* qgcFileType;
private:
QVariant _minForType(void) const;
QVariant _maxForType(void) const;
......@@ -298,5 +295,3 @@ private:
static const char* _jsonMetaDataDefinesName;
static const char* _jsonMetaDataFactsName;
};
#endif
{
"comment": "ArduPilot, Any Vehicle",
"version": 1,
"comment": "ArduPilot, Any Vehicle",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
{
......
{
"comment": "ArduPilot, Fixed Wing",
"version": 1,
"comment": "ArduPilot, Fixed Wing",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
{
......
{
"comment": "ArduPilot, Multi Rotor",
"version": 1,
"comment": "ArduPilot, Multi Rotor",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
{
......
{
"comment": "ArduPilot, Rover",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
{
"comment": "ArduPilot, Sub",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
{
"comment": "ArduPilot, VTOL",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
......@@ -753,17 +753,17 @@ QString APMFirmwarePlugin::missionCommandOverrides(MAV_TYPE vehicleType) const
{
switch (vehicleType) {
case MAV_TYPE_GENERIC:
return QStringLiteral(":/json/APM/MavCmdInfoCommon.json");
return QStringLiteral(":/json/APM-MavCmdInfoCommon.json");
case MAV_TYPE_FIXED_WING:
return QStringLiteral(":/json/APM/MavCmdInfoFixedWing.json");
return QStringLiteral(":/json/APM-MavCmdInfoFixedWing.json");
case MAV_TYPE_QUADROTOR:
return QStringLiteral(":/json/APM/MavCmdInfoMultiRotor.json");
return QStringLiteral(":/json/APM-MavCmdInfoMultiRotor.json");
case MAV_TYPE_VTOL_QUADROTOR:
return QStringLiteral(":/json/APM/MavCmdInfoVTOL.json");
return QStringLiteral(":/json/APM-MavCmdInfoVTOL.json");
case MAV_TYPE_SUBMARINE:
return QStringLiteral(":/json/APM/MavCmdInfoSub.json");
return QStringLiteral(":/json/APM-MavCmdInfoSub.json");
case MAV_TYPE_GROUND_ROVER:
return QStringLiteral(":/json/APM/MavCmdInfoRover.json");
return QStringLiteral(":/json/APM-MavCmdInfoRover.json");
default:
qWarning() << "APMFirmwarePlugin::missionCommandOverrides called with bad MAV_TYPE:" << vehicleType;
return QString();
......
......@@ -33,12 +33,12 @@
<file alias="QGroundControl/ArduPilot/qmldir">QGroundControl.ArduPilot.qmldir</file>
</qresource>
<qresource prefix="/json">
<file alias="APM/MavCmdInfoCommon.json">MavCmdInfoCommon.json</file>
<file alias="APM/MavCmdInfoFixedWing.json">MavCmdInfoFixedWing.json</file>
<file alias="APM/MavCmdInfoMultiRotor.json">MavCmdInfoMultiRotor.json</file>
<file alias="APM/MavCmdInfoRover.json">MavCmdInfoRover.json</file>
<file alias="APM/MavCmdInfoSub.json">MavCmdInfoSub.json</file>
<file alias="APM/MavCmdInfoVTOL.json">MavCmdInfoVTOL.json</file>
<file alias="APM-MavCmdInfoCommon.json">APM-MavCmdInfoCommon.json</file>
<file alias="APM-MavCmdInfoFixedWing.json">APM-MavCmdInfoFixedWing.json</file>
<file alias="APM-MavCmdInfoMultiRotor.json">APM-MavCmdInfoMultiRotor.json</file>
<file alias="APM-MavCmdInfoRover.json">APM-MavCmdInfoRover.json</file>
<file alias="APM-MavCmdInfoSub.json">APM-MavCmdInfoSub.json</file>
<file alias="APM-MavCmdInfoVTOL.json">APM-MavCmdInfoVTOL.json</file>
<file alias="APMFollowComponent.FactMetaData.json">../../AutoPilotPlugins/APM/APMFollowComponent.FactMetaData.json</file>
</qresource>
<qresource prefix="/FirmwarePlugin/APM">
......
{
"comment": "ArduPilot, Rover",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "ArduPilot, Sub",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "ArduPilot, VTOL",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, Fixed Wing",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, Rover",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, Sub",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, VTOL",
"version": 1,
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, Any Vehicle",
"version": 1,
"comment": "PX4 Pro, Any Vehicle",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
{
......
{
"comment": "PX4 Pro, Fixed Wing",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, Multi Rotor",
"version": 1,
"comment": "PX4 Pro, Multi Rotor",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
{
......
{
"comment": "PX4 Pro, Rover",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, Sub",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
{
"comment": "PX4 Pro, VTOL",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
]
}
......@@ -312,17 +312,17 @@ QString PX4FirmwarePlugin::missionCommandOverrides(MAV_TYPE vehicleType) const
{
switch (vehicleType) {
case MAV_TYPE_GENERIC:
return QStringLiteral(":/json/PX4/MavCmdInfoCommon.json");
return QStringLiteral(":/json/PX4-MavCmdInfoCommon.json");
case MAV_TYPE_FIXED_WING:
return QStringLiteral(":/json/PX4/MavCmdInfoFixedWing.json");
return QStringLiteral(":/json/PX4-MavCmdInfoFixedWing.json");
case MAV_TYPE_QUADROTOR:
return QStringLiteral(":/json/PX4/MavCmdInfoMultiRotor.json");
return QStringLiteral(":/json/PX4-MavCmdInfoMultiRotor.json");
case MAV_TYPE_VTOL_QUADROTOR:
return QStringLiteral(":/json/PX4/MavCmdInfoVTOL.json");
return QStringLiteral(":/json/PX4-MavCmdInfoVTOL.json");
case MAV_TYPE_SUBMARINE:
return QStringLiteral(":/json/PX4/MavCmdInfoSub.json");
return QStringLiteral(":/json/PX4-MavCmdInfoSub.json");
case MAV_TYPE_GROUND_ROVER:
return QStringLiteral(":/json/PX4/MavCmdInfoRover.json");
return QStringLiteral(":/json/PX4-MavCmdInfoRover.json");
default:
qWarning() << "PX4FirmwarePlugin::missionCommandOverrides called with bad MAV_TYPE:" << vehicleType;
return QString();
......
......@@ -23,12 +23,12 @@
<file alias="QGroundControl/PX4/qmldir">../../QmlControls/QGroundControl/PX4/qmldir</file>
</qresource>
<qresource prefix="/json">
<file alias="PX4/MavCmdInfoCommon.json">MavCmdInfoCommon.json</file>
<file alias="PX4/MavCmdInfoFixedWing.json">MavCmdInfoFixedWing.json</file>
<file alias="PX4/MavCmdInfoMultiRotor.json">MavCmdInfoMultiRotor.json</file>
<file alias="PX4/MavCmdInfoRover.json">MavCmdInfoRover.json</file>
<file alias="PX4/MavCmdInfoSub.json">MavCmdInfoSub.json</file>
<file alias="PX4/MavCmdInfoVTOL.json">MavCmdInfoVTOL.json</file>
<file alias="PX4-MavCmdInfoCommon.json">PX4-MavCmdInfoCommon.json</file>
<file alias="PX4-MavCmdInfoFixedWing.json">PX4-MavCmdInfoFixedWing.json</file>
<file alias="PX4-MavCmdInfoMultiRotor.json">PX4-MavCmdInfoMultiRotor.json</file>
<file alias="PX4-MavCmdInfoRover.json">PX4-MavCmdInfoRover.json</file>
<file alias="PX4-MavCmdInfoSub.json">PX4-MavCmdInfoSub.json</file>
<file alias="PX4-MavCmdInfoVTOL.json">PX4-MavCmdInfoVTOL.json</file>
</qresource>
<qresource prefix="/AutoPilotPlugins/PX4">