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
6dc2f488
Commit
6dc2f488
authored
Sep 28, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FactMetaData loading for survey item
parent
ceab6afc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
64 deletions
+96
-64
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-1
MissionItemEditor.qml
src/MissionEditor/MissionItemEditor.qml
+1
-1
RallyPointItemEditor.qml
src/MissionEditor/RallyPointItemEditor.qml
+22
-26
SurveyItemEditor.qml
src/MissionEditor/SurveyItemEditor.qml
+4
-2
RallyPoint.FactMetaData.json
src/MissionManager/RallyPoint.FactMetaData.json
+0
-0
Survey.FactMetaData.json
src/MissionManager/Survey.FactMetaData.json
+37
-0
SurveyMissionItem.cc
src/MissionManager/SurveyMissionItem.cc
+22
-29
SurveyMissionItem.h
src/MissionManager/SurveyMissionItem.h
+8
-5
No files found.
qgroundcontrol.qrc
View file @
6dc2f488
...
...
@@ -192,6 +192,7 @@
<file alias="Vehicle/WindFact.json">src/Vehicle/WindFact.json</file>
<file alias="Vehicle/VibrationFact.json">src/Vehicle/VibrationFact.json</file>
<file alias="QGroundControlQmlGlobal.json">src/QmlControls/QGroundControlQmlGlobal.json</file>
<file alias="RallyPoint.json">src/MissionManager/RallyPoint.json</file>
<file alias="RallyPoint.FactMetaData.json">src/MissionManager/RallyPoint.FactMetaData.json</file>
<file alias="Survey.FactMetaData.json">src/MissionManager/Survey.FactMetaData.json</file>
</qresource>
</RCC>
src/MissionEditor/MissionItemEditor.qml
View file @
6dc2f488
...
...
@@ -142,7 +142,7 @@ Rectangle {
verticalAlignment
:
Text
.
AlignVCenter
text
:
missionItem
.
sequenceNumber
==
0
?
qsTr
(
"
Planned Home Position
"
)
:
(
missionItem
.
isSimpleItem
?
missionItem
.
commandName
:
qsTr
(
"
Survey
(WIP)
"
))
(
missionItem
.
isSimpleItem
?
missionItem
.
commandName
:
qsTr
(
"
Survey
"
))
color
:
_outerTextColor
}
...
...
src/MissionEditor/RallyPointItemEditor.qml
View file @
6dc2f488
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.2
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
...
...
@@ -21,7 +20,6 @@ Rectangle {
property
bool
_currentItem
:
rallyPoint
?
rallyPoint
==
controller
.
currentRallyPoint
:
false
property
color
_outerTextColor
:
_currentItem
?
"
black
"
:
qgcPal
.
text
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_titleHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2
...
...
@@ -84,41 +82,39 @@ Rectangle {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
titleBar
.
bottom
height
:
values
Column
.
height
+
(
_margin
*
2
)
height
:
values
Grid
.
height
+
(
_margin
*
2
)
color
:
qgcPal
.
windowShadeDark
visible
:
_currentItem
radius
:
_radius
Column
{
id
:
values
Column
GridLayout
{
id
:
values
Grid
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
spacing
:
_margin
rowSpacing
:
_margin
columnSpacing
:
_margin
rows
:
rallyPoint
?
rallyPoint
.
textFieldFacts
.
length
:
0
flow
:
GridLayout
.
TopToBottom
Repeater
{
model
:
rallyPoint
?
rallyPoint
.
textFieldFacts
:
0
Item
{
width
:
valuesColumn
.
width
height
:
textField
.
height
QGCLabel
{
text
:
modelData
.
name
+
"
:
"
}
}
QGCLabel
{
id
:
textFieldLabel
anchors.baseline
:
textField
.
baseline
text
:
modelData
.
name
+
"
:
"
}
Repeater
{
model
:
rallyPoint
?
rallyPoint
.
textFieldFacts
:
0
FactTextField
{
id
:
textField
anchors.right
:
parent
.
right
width
:
_editFieldWidth
showUnits
:
true
fact
:
modelData
}
FactTextField
{
Layout.fillWidth
:
true
showUnits
:
true
fact
:
modelData
}
}
// Repeater - text fields
}
//
Column
}
}
//
GridLayout
}
// Rectangle
}
// Rectangle
src/MissionEditor/SurveyItemEditor.qml
View file @
6dc2f488
...
...
@@ -194,9 +194,11 @@ Rectangle {
spacing
:
_margin
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
Work in progress, be careful!
"
)
text
:
qsTr
(
"
Create a flight path to fully cover a polygonal area with a camera.
"
)
}
Repeater
{
...
...
@@ -210,7 +212,7 @@ Rectangle {
QGCLabel
{
anchors.baseline
:
textField
.
baseline
anchors.left
:
parent
.
left
text
:
modelData
.
name
text
:
modelData
.
name
+
"
:
"
}
FactTextField
{
...
...
src/MissionManager/RallyPoint.json
→
src/MissionManager/RallyPoint.
FactMetaData.
json
View file @
6dc2f488
File moved
src/MissionManager/Survey.FactMetaData.json
0 → 100644
View file @
6dc2f488
[
{
"name"
:
"Altitude"
,
"shortDescription"
:
"Altitude for all waypoints within the grid."
,
"type"
:
"double"
,
"units"
:
"m"
,
"decimalPlaces"
:
1
},
{
"name"
:
"Grid angle"
,
"shortDescription"
:
"Angle for parallel lines of grid."
,
"type"
:
"double"
,
"units"
:
"deg"
,
"decimalPlaces"
:
1
},
{
"name"
:
"Grid spacing"
,
"shortDescription"
:
"Amount of spacing in between parallel grid lines."
,
"type"
:
"double"
,
"decimalPlaces"
:
2
,
"units"
:
"m"
},
{
"name"
:
"Turnaround dist."
,
"shortDescription"
:
"Amount of additional distance to add outside the grid area for vehicle turnaround."
,
"type"
:
"double"
,
"decimalPlaces"
:
2
,
"units"
:
"m"
},
{
"name"
:
"Camera trigger distance"
,
"shortDescription"
:
"Distance between each triggering of the camera."
,
"type"
:
"double"
,
"decimalPlaces"
:
2
,
"units"
:
"m"
}
]
src/MissionManager/SurveyMissionItem.cc
View file @
6dc2f488
...
...
@@ -28,8 +28,16 @@ const char* SurveyMissionItem::_jsonTurnaroundDistKey = "turnaroundDist";
const
char
*
SurveyMissionItem
::
_jsonCameraTriggerKey
=
"cameraTrigger"
;
const
char
*
SurveyMissionItem
::
_jsonCameraTriggerDistanceKey
=
"cameraTriggerDistance"
;
const
char
*
SurveyMissionItem
::
_gridAltitudeFactName
=
"Altitude"
;
const
char
*
SurveyMissionItem
::
_gridAngleFactName
=
"Grid angle"
;
const
char
*
SurveyMissionItem
::
_gridSpacingFactName
=
"Grid spacing"
;
const
char
*
SurveyMissionItem
::
_turnaroundDistFactName
=
"Turnaround dist."
;
const
char
*
SurveyMissionItem
::
_cameraTriggerDistanceFactName
=
"Camera trigger distance"
;
const
char
*
SurveyMissionItem
::
_complexType
=
"survey"
;
QMap
<
QString
,
FactMetaData
*>
SurveyMissionItem
::
_metaDataMap
;
SurveyMissionItem
::
SurveyMissionItem
(
Vehicle
*
vehicle
,
QObject
*
parent
)
:
ComplexMissionItem
(
vehicle
,
parent
)
,
_sequenceNumber
(
0
)
...
...
@@ -39,41 +47,26 @@ SurveyMissionItem::SurveyMissionItem(Vehicle* vehicle, QObject* parent)
,
_surveyDistance
(
0.0
)
,
_cameraShots
(
0
)
,
_coveredArea
(
0.0
)
,
_gridAltitudeFact
(
0
,
"Altitude:"
,
FactMetaData
::
valueTypeDouble
)
,
_gridAngleFact
(
0
,
"Grid angle:"
,
FactMetaData
::
valueTypeDouble
)
,
_gridSpacingFact
(
0
,
"Grid spacing:"
,
FactMetaData
::
valueTypeDouble
)
,
_turnaroundDistFact
(
0
,
"Turnaround dist.:"
,
FactMetaData
::
valueTypeDouble
)
,
_cameraTriggerDistanceFact
(
0
,
"Camera trigger distance"
,
FactMetaData
::
valueTypeDouble
)
,
_gridAltitudeMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_gridAngleMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_gridSpacingMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_turnaroundDistMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_cameraTriggerDistanceMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_gridAltitudeFact
(
0
,
_gridAltitudeFactName
,
FactMetaData
::
valueTypeDouble
)
,
_gridAngleFact
(
0
,
_gridAngleFactName
,
FactMetaData
::
valueTypeDouble
)
,
_gridSpacingFact
(
0
,
_gridSpacingFactName
,
FactMetaData
::
valueTypeDouble
)
,
_turnaroundDistFact
(
0
,
_turnaroundDistFactName
,
FactMetaData
::
valueTypeDouble
)
,
_cameraTriggerDistanceFact
(
0
,
_cameraTriggerDistanceFactName
,
FactMetaData
::
valueTypeDouble
)
{
if
(
_metaDataMap
.
isEmpty
())
{
_metaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/Survey.FactMetaData.json"
),
NULL
/* metaDataParent */
);
}
_gridAltitudeFact
.
setRawValue
(
50
);
_gridSpacingFact
.
setRawValue
(
10
);
_turnaroundDistFact
.
setRawValue
(
60
);
_cameraTriggerDistanceFact
.
setRawValue
(
25
);
_gridAltitudeMetaData
.
setRawUnits
(
"m"
);
_gridAngleMetaData
.
setRawUnits
(
"deg"
);
_gridSpacingMetaData
.
setRawUnits
(
"m"
);
_turnaroundDistMetaData
.
setRawUnits
(
"m"
);
_cameraTriggerDistanceMetaData
.
setRawUnits
(
"m"
);
_gridAltitudeMetaData
.
setDecimalPlaces
(
1
);
_gridAngleMetaData
.
setDecimalPlaces
(
1
);
_gridSpacingMetaData
.
setDecimalPlaces
(
2
);
_turnaroundDistMetaData
.
setDecimalPlaces
(
2
);
_cameraTriggerDistanceMetaData
.
setDecimalPlaces
(
2
);
_gridAltitudeFact
.
setMetaData
(
&
_gridAltitudeMetaData
);
_gridAngleFact
.
setMetaData
(
&
_gridAngleMetaData
);
_gridSpacingFact
.
setMetaData
(
&
_gridSpacingMetaData
);
_turnaroundDistFact
.
setMetaData
(
&
_turnaroundDistMetaData
);
_cameraTriggerDistanceFact
.
setMetaData
(
&
_cameraTriggerDistanceMetaData
);
_gridAltitudeFact
.
setMetaData
(
_metaDataMap
[
_gridAltitudeFactName
]);
_gridAngleFact
.
setMetaData
(
_metaDataMap
[
_gridAngleFactName
]);
_gridSpacingFact
.
setMetaData
(
_metaDataMap
[
_gridSpacingFactName
]);
_turnaroundDistFact
.
setMetaData
(
_metaDataMap
[
_turnaroundDistFactName
]);
_cameraTriggerDistanceFact
.
setMetaData
(
_metaDataMap
[
_cameraTriggerDistanceFactName
]);
connect
(
&
_gridSpacingFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
connect
(
&
_gridAngleFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
...
...
src/MissionManager/SurveyMissionItem.h
View file @
6dc2f488
...
...
@@ -134,11 +134,8 @@ private:
Fact
_gridSpacingFact
;
Fact
_turnaroundDistFact
;
Fact
_cameraTriggerDistanceFact
;
FactMetaData
_gridAltitudeMetaData
;
FactMetaData
_gridAngleMetaData
;
FactMetaData
_gridSpacingMetaData
;
FactMetaData
_turnaroundDistMetaData
;
FactMetaData
_cameraTriggerDistanceMetaData
;
static
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
static
const
char
*
_jsonTypeKey
;
static
const
char
*
_jsonPolygonKey
;
...
...
@@ -151,6 +148,12 @@ private:
static
const
char
*
_jsonCameraTriggerKey
;
static
const
char
*
_jsonCameraTriggerDistanceKey
;
static
const
char
*
_gridAltitudeFactName
;
static
const
char
*
_gridAngleFactName
;
static
const
char
*
_gridSpacingFactName
;
static
const
char
*
_turnaroundDistFactName
;
static
const
char
*
_cameraTriggerDistanceFactName
;
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