Commit 51edd95b authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4087 from DonLakeFlyer/SurveyUI

Major Survey UI rework
parents 03b02749 1fc04bf4
......@@ -103,6 +103,8 @@
<file alias="QGroundControl/FactControls/FactLabel.qml">src/FactSystem/FactControls/FactLabel.qml</file>
<file alias="QGroundControl/FactControls/FactPanel.qml">src/FactSystem/FactControls/FactPanel.qml</file>
<file alias="QGroundControl/FactControls/FactTextField.qml">src/FactSystem/FactControls/FactTextField.qml</file>
<file alias="QGroundControl/FactControls/FactTextFieldGrid.qml">src/FactSystem/FactControls/FactTextFieldGrid.qml</file>
<file alias="QGroundControl/FactControls/FactTextFieldRow.qml">src/FactSystem/FactControls/FactTextFieldRow.qml</file>
<file alias="QGroundControl/FactControls/qmldir">src/FactSystem/FactControls/qmldir</file>
<file alias="QGroundControl/FlightDisplay/qmldir">src/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file>
......
import QtQuick 2.2
import QtQuick.Layouts 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.Controls 1.0
GridLayout {
property var factList ///< List of Facts to show
rows: factList.length
flow: GridLayout.TopToBottom
Repeater {
model: parent.factList
QGCLabel { text: modelData.name + ":" }
}
Repeater {
model: parent.factList
FactTextField {
Layout.fillWidth: true
fact: modelData
}
}
}
import QtQuick 2.2
import QtQuick.Layouts 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.Controls 1.0
RowLayout {
property var fact: Fact { }
QGCLabel {
text: fact.name + ":"
}
FactTextField {
Layout.fillWidth: true
showUnits: true
fact: parent.fact
}
}
Module QGroundControl.FactControls
FactBitmask 1.0 FactBitmask.qml
FactCheckBox 1.0 FactCheckBox.qml
FactComboBox 1.0 FactComboBox.qml
FactLabel 1.0 FactLabel.qml
FactPanel 1.0 FactPanel.qml
FactTextField 1.0 FactTextField.qml
FactBitmask 1.0 FactBitmask.qml
FactCheckBox 1.0 FactCheckBox.qml
FactComboBox 1.0 FactComboBox.qml
FactLabel 1.0 FactLabel.qml
FactPanel 1.0 FactPanel.qml
FactTextField 1.0 FactTextField.qml
FactTextFieldGrid 1.0 FactTextFieldGrid.qml
FactTextFieldRow 1.0 FactTextFieldRow.qml
......@@ -262,3 +262,25 @@ void JsonHelper::saveGeoCoordinateArray(const QList<QGeoCoordinate>& rgPoints
}
return saveGeoCoordinateArray(rgVarPoints, writeAltitude, jsonValue);
}
bool JsonHelper::validateKeys(const QJsonObject& jsonObject, const QList<JsonHelper::KeyValidateInfo>& keyInfo, QString& errorString)
{
QStringList keyList;
QList<QJsonValue::Type> typeList;
for (int i=0; i<keyInfo.count(); i++) {
if (keyInfo[i].required) {
keyList.append(keyInfo[i].key);
}
}
if (!validateRequiredKeys(jsonObject, keyList, errorString)) {
return false;
}
keyList.clear();
for (int i=0; i<keyInfo.count(); i++) {
keyList.append(keyInfo[i].key);
typeList.append(keyInfo[i].type);
}
return validateKeyTypes(jsonObject, keyList, typeList, errorString);
}
......@@ -37,6 +37,14 @@ public:
static bool validateRequiredKeys(const QJsonObject& jsonObject, const QStringList& keys, QString& errorString);
static bool validateKeyTypes(const QJsonObject& jsonObject, const QStringList& keys, const QList<QJsonValue::Type>& types, QString& errorString);
typedef struct {
const char* key; ///< json key name
QJsonValue::Type type; ///< type of key
bool required; ///< true: key must be present
} KeyValidateInfo;
static bool validateKeys(const QJsonObject& jsonObject, const QList<KeyValidateInfo>& keyInfo, QString& errorString);
/// Loads a QGeoCoordinate
/// @return false: validation failed
static bool loadGeoCoordinate(const QJsonValue& jsonValue, ///< json value to load from
......
This diff is collapsed.
......@@ -18,20 +18,85 @@
"shortDescription": "Amount of spacing in between parallel grid lines.",
"type": "double",
"decimalPlaces": 2,
"min": 0.1,
"units": "m"
},
{
"name": "Turnaround dist.",
"name": "Turnaround dist",
"shortDescription": "Amount of additional distance to add outside the grid area for vehicle turnaround.",
"type": "double",
"decimalPlaces": 2,
"min": 0,
"units": "m"
},
{
"name": "Ground resolution",
"shortDescription": "Resolution of image in relationship to ground distance.",
"type": "double",
"decimalPlaces": 2,
"min": 0,
"units": "cm/px"
},
{
"name": "Frontal overlap",
"shortDescription": "Amount of overlap between images in the forward facing direction.",
"type": "double",
"decimalPlaces": 0,
"max": 75,
"units": "%"
},
{
"name": "Side overlap",
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "double",
"decimalPlaces": 0,
"max": 75,
"units": "%"
},
{
"name": "Camera sensor width",
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "double",
"decimalPlaces": 2,
"min": 1,
"units": "mm"
},
{
"name": "Camera sensor height",
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "double",
"decimalPlaces": 2,
"min": 1,
"units": "mm"
},
{
"name": "Camera resolution width",
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "uint32",
"min": 1,
"units": "px"
},
{
"name": "Camera resolution height",
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "uint32",
"min": 1,
"units": "px"
},
{
"name": "Focal length",
"shortDescription": "Amount of overlap between images in the side facing direction.",
"type": "double",
"decimalPlaces": 1,
"min": 1,
"units": "mm"
},
{
"name": "Camera trigger distance",
"shortDescription": "Distance between each triggering of the camera.",
"type": "double",
"decimalPlaces": 2,
"min": 0.1,
"units": "m"
}
]
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment