Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
51edd95b
Commit
51edd95b
authored
Sep 30, 2016
by
Don Gagne
Committed by
GitHub
Sep 30, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4087 from DonLakeFlyer/SurveyUI
Major Survey UI rework
parents
03b02749
1fc04bf4
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
870 additions
and
473 deletions
+870
-473
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
FactTextFieldGrid.qml
src/FactSystem/FactControls/FactTextFieldGrid.qml
+27
-0
FactTextFieldRow.qml
src/FactSystem/FactControls/FactTextFieldRow.qml
+19
-0
qmldir
src/FactSystem/FactControls/qmldir
+8
-6
JsonHelper.cc
src/JsonHelper.cc
+22
-0
JsonHelper.h
src/JsonHelper.h
+8
-0
SurveyItemEditor.qml
src/MissionEditor/SurveyItemEditor.qml
+404
-352
Survey.FactMetaData.json
src/MissionManager/Survey.FactMetaData.json
+66
-1
SurveyMissionItem.cc
src/MissionManager/SurveyMissionItem.cc
+213
-72
SurveyMissionItem.h
src/MissionManager/SurveyMissionItem.h
+101
-42
No files found.
qgroundcontrol.qrc
View file @
51edd95b
...
...
@@ -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>
...
...
src/FactSystem/FactControls/FactTextFieldGrid.qml
0 → 100644
View file @
51edd95b
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
}
}
}
src/FactSystem/FactControls/FactTextFieldRow.qml
0 → 100644
View file @
51edd95b
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
}
}
src/FactSystem/FactControls/qmldir
View file @
51edd95b
...
...
@@ -6,3 +6,5 @@ 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
src/JsonHelper.cc
View file @
51edd95b
...
...
@@ -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
);
}
src/JsonHelper.h
View file @
51edd95b
...
...
@@ -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
...
...
src/MissionEditor/SurveyItemEditor.qml
View file @
51edd95b
This diff is collapsed.
Click to expand it.
src/MissionManager/Survey.FactMetaData.json
View file @
51edd95b
...
...
@@ -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"
}
]
src/MissionManager/SurveyMissionItem.cc
View file @
51edd95b
This diff is collapsed.
Click to expand it.
src/MissionManager/SurveyMissionItem.h
View file @
51edd95b
...
...
@@ -25,8 +25,6 @@ class SurveyMissionItem : public ComplexMissionItem
public:
SurveyMissionItem
(
Vehicle
*
vehicle
,
QObject
*
parent
=
NULL
);
const
SurveyMissionItem
&
operator
=
(
const
SurveyMissionItem
&
other
);
Q_PROPERTY
(
Fact
*
gridAltitude
READ
gridAltitude
CONSTANT
)
Q_PROPERTY
(
bool
gridAltitudeRelative
MEMBER
_gridAltitudeRelative
NOTIFY
gridAltitudeRelativeChanged
)
Q_PROPERTY
(
Fact
*
gridAngle
READ
gridAngle
CONSTANT
)
...
...
@@ -34,10 +32,22 @@ public:
Q_PROPERTY
(
Fact
*
turnaroundDist
READ
turnaroundDist
CONSTANT
)
Q_PROPERTY
(
bool
cameraTrigger
MEMBER
_cameraTrigger
NOTIFY
cameraTriggerChanged
)
Q_PROPERTY
(
Fact
*
cameraTriggerDistance
READ
cameraTriggerDistance
CONSTANT
)
Q_PROPERTY
(
Fact
*
groundResolution
READ
groundResolution
CONSTANT
)
Q_PROPERTY
(
Fact
*
frontalOverlap
READ
frontalOverlap
CONSTANT
)
Q_PROPERTY
(
Fact
*
sideOverlap
READ
sideOverlap
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraSensorWidth
READ
cameraSensorWidth
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraSensorHeight
READ
cameraSensorHeight
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraResolutionWidth
READ
cameraResolutionWidth
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraResolutionHeight
READ
cameraResolutionHeight
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraFocalLength
READ
cameraFocalLength
CONSTANT
)
Q_PROPERTY
(
QVariantList
polygonPath
READ
polygonPath
NOTIFY
polygonPathChanged
)
Q_PROPERTY
(
QVariantList
gridPoints
READ
gridPoints
NOTIFY
gridPointsChanged
)
Q_PROPERTY
(
int
cameraShots
READ
cameraShots
NOTIFY
cameraShotsChanged
)
Q_PROPERTY
(
double
coveredArea
READ
coveredArea
NOTIFY
coveredAreaChanged
)
Q_PROPERTY
(
bool
fixedValueIsAltitude
MEMBER
_fixedValueIsAltitude
NOTIFY
fixedValueIsAltitudeChanged
)
Q_PROPERTY
(
bool
cameraOrientationLandscape
MEMBER
_cameraOrientationLandscape
NOTIFY
cameraOrientationLandscapeChanged
)
Q_PROPERTY
(
bool
manualGrid
MEMBER
_manualGrid
NOTIFY
manualGridChanged
)
Q_PROPERTY
(
QString
camera
MEMBER
_camera
NOTIFY
cameraChanged
)
Q_INVOKABLE
void
clearPolygon
(
void
);
Q_INVOKABLE
void
addPolygonCoordinate
(
const
QGeoCoordinate
coordinate
);
...
...
@@ -46,11 +56,19 @@ public:
QVariantList
polygonPath
(
void
)
{
return
_polygonPath
;
}
QVariantList
gridPoints
(
void
)
{
return
_gridPoints
;
}
Fact
*
gridAltitude
(
void
)
{
return
&
_gridAltitudeFact
;
}
Fact
*
gridAngle
(
void
)
{
return
&
_gridAngleFact
;
}
Fact
*
gridSpacing
(
void
)
{
return
&
_gridSpacingFact
;
}
Fact
*
turnaroundDist
(
void
)
{
return
&
_turnaroundDistFact
;
}
Fact
*
cameraTriggerDistance
(
void
)
{
return
&
_cameraTriggerDistanceFact
;
}
Fact
*
gridAltitude
(
void
)
{
return
&
_gridAltitudeFact
;
}
Fact
*
gridAngle
(
void
)
{
return
&
_gridAngleFact
;
}
Fact
*
gridSpacing
(
void
)
{
return
&
_gridSpacingFact
;
}
Fact
*
turnaroundDist
(
void
)
{
return
&
_turnaroundDistFact
;
}
Fact
*
cameraTriggerDistance
(
void
)
{
return
&
_cameraTriggerDistanceFact
;
}
Fact
*
groundResolution
(
void
)
{
return
&
_groundResolutionFact
;
}
Fact
*
frontalOverlap
(
void
)
{
return
&
_frontalOverlapFact
;
}
Fact
*
sideOverlap
(
void
)
{
return
&
_sideOverlapFact
;
}
Fact
*
cameraSensorWidth
(
void
)
{
return
&
_cameraSensorWidthFact
;
}
Fact
*
cameraSensorHeight
(
void
)
{
return
&
_cameraSensorHeightFact
;
}
Fact
*
cameraResolutionWidth
(
void
)
{
return
&
_cameraResolutionWidthFact
;
}
Fact
*
cameraResolutionHeight
(
void
)
{
return
&
_cameraResolutionHeightFact
;
}
Fact
*
cameraFocalLength
(
void
)
{
return
&
_cameraFocalLengthFact
;
}
int
cameraShots
(
void
)
const
;
double
coveredArea
(
void
)
const
{
return
_coveredArea
;
}
...
...
@@ -95,6 +113,12 @@ signals:
void
gridAltitudeRelativeChanged
(
bool
gridAltitudeRelative
);
void
cameraShotsChanged
(
int
cameraShots
);
void
coveredAreaChanged
(
double
coveredArea
);
void
cameraValueChanged
(
void
);
void
fixedValueIsAltitudeChanged
(
bool
fixedValueIsAltitude
);
void
gridTypeChanged
(
QString
gridType
);
void
cameraOrientationLandscapeChanged
(
bool
cameraOrientationLandscape
);
void
cameraChanged
(
QString
camera
);
void
manualGridChanged
(
bool
manualGrid
);
private
slots
:
void
_cameraTriggerChanged
(
void
);
...
...
@@ -113,6 +137,7 @@ private:
void
_setSurveyDistance
(
double
surveyDistance
);
void
_setCameraShots
(
int
cameraShots
);
void
_setCoveredArea
(
double
coveredArea
);
void
_cameraValueChanged
(
void
);
int
_sequenceNumber
;
bool
_dirty
;
...
...
@@ -121,9 +146,12 @@ private:
QGeoCoordinate
_coordinate
;
QGeoCoordinate
_exitCoordinate
;
double
_altitude
;
double
_gridAngle
;
bool
_cameraTrigger
;
bool
_gridAltitudeRelative
;
bool
_manualGrid
;
QString
_camera
;
bool
_cameraOrientationLandscape
;
bool
_fixedValueIsAltitude
;
double
_surveyDistance
;
int
_cameraShots
;
...
...
@@ -134,12 +162,21 @@ private:
Fact
_gridSpacingFact
;
Fact
_turnaroundDistFact
;
Fact
_cameraTriggerDistanceFact
;
Fact
_groundResolutionFact
;
Fact
_frontalOverlapFact
;
Fact
_sideOverlapFact
;
Fact
_cameraSensorWidthFact
;
Fact
_cameraSensorHeightFact
;
Fact
_cameraResolutionWidthFact
;
Fact
_cameraResolutionHeightFact
;
Fact
_cameraFocalLengthFact
;
static
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
static
const
char
*
_jsonTypeKey
;
static
const
char
*
_jsonPolygonKey
;
static
const
char
*
_jsonPolygon
Object
Key
;
static
const
char
*
_jsonIdKey
;
static
const
char
*
_jsonGridObjectKey
;
static
const
char
*
_jsonGridAltitudeKey
;
static
const
char
*
_jsonGridAltitudeRelativeKey
;
static
const
char
*
_jsonGridAngleKey
;
...
...
@@ -147,12 +184,34 @@ private:
static
const
char
*
_jsonTurnaroundDistKey
;
static
const
char
*
_jsonCameraTriggerKey
;
static
const
char
*
_jsonCameraTriggerDistanceKey
;
static
const
char
*
_jsonGroundResolutionKey
;
static
const
char
*
_jsonFrontalOverlapKey
;
static
const
char
*
_jsonSideOverlapKey
;
static
const
char
*
_jsonCameraSensorWidthKey
;
static
const
char
*
_jsonCameraSensorHeightKey
;
static
const
char
*
_jsonCameraResolutionWidthKey
;
static
const
char
*
_jsonCameraResolutionHeightKey
;
static
const
char
*
_jsonCameraFocalLengthKey
;
static
const
char
*
_jsonManualGridKey
;
static
const
char
*
_jsonCameraObjectKey
;
static
const
char
*
_jsonCameraNameKey
;
static
const
char
*
_jsonCameraOrientationLandscapeKey
;
static
const
char
*
_jsonFixedValueIsAltitudeKey
;
static
const
char
*
_gridAltitudeFactName
;
static
const
char
*
_gridAngleFactName
;
static
const
char
*
_gridSpacingFactName
;
static
const
char
*
_turnaroundDistFactName
;
static
const
char
*
_cameraTriggerDistanceFactName
;
static
const
char
*
_groundResolutionFactName
;
static
const
char
*
_frontalOverlapFactName
;
static
const
char
*
_sideOverlapFactName
;
static
const
char
*
_cameraSensorWidthFactName
;
static
const
char
*
_cameraSensorHeightFactName
;
static
const
char
*
_cameraResolutionWidthFactName
;
static
const
char
*
_cameraResolutionHeightFactName
;
static
const
char
*
_cameraFocalLengthFactName
;
static
const
char
*
_complexType
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment