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
5bc6896c
Commit
5bc6896c
authored
Aug 20, 2016
by
Don Gagne
Committed by
GitHub
Aug 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3960 from DonLakeFlyer/SurveyUpdate
Survey update
parents
70d225be
1d1d8624
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
53 deletions
+96
-53
MissionItemStatus.qml
src/MissionEditor/MissionItemStatus.qml
+0
-22
SurveyItemEditor.qml
src/MissionEditor/SurveyItemEditor.qml
+53
-19
SurveyMissionItem.cc
src/MissionManager/SurveyMissionItem.cc
+33
-6
SurveyMissionItem.h
src/MissionManager/SurveyMissionItem.h
+10
-6
No files found.
src/MissionEditor/MissionItemStatus.qml
View file @
5bc6896c
...
...
@@ -50,8 +50,6 @@ Rectangle {
property
real
_gradient
:
_statusValid
&&
_currentMissionItem
.
distance
>
0
?
Math
.
atan
(
_currentMissionItem
.
altDifference
/
_currentMissionItem
.
distance
)
:
0
property
real
_gradientPercent
:
isNaN
(
_gradient
)
?
0
:
_gradient
*
100
property
real
_azimuth
:
_statusValid
?
_currentMissionItem
.
azimuth
:
-
1
property
int
_numberShots
:
_currentSurvey
?
_currentMissionItem
.
cameraShots
:
0
property
real
_coveredArea
:
_currentSurvey
?
_currentMissionItem
.
coveredArea
:
0
property
real
_missionDistance
:
_missionValid
?
missionDistance
:
0
property
real
_missionMaxTelemetry
:
_missionValid
?
missionMaxTelemetry
:
0
property
real
_missionTime
:
_missionValid
&&
_missionSpeed
>
0
?
(
_isVTOL
?
_hoverTime
+
_cruiseTime
:
_missionDistance
/
_missionSpeed
)
:
0
...
...
@@ -71,8 +69,6 @@ Rectangle {
property
string
_altText
:
_statusValid
?
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_altDifference
).
toFixed
(
2
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
:
"
"
property
string
_gradientText
:
_statusValid
?
_gradientPercent
.
toFixed
(
0
)
+
"
%
"
:
"
"
property
string
_azimuthText
:
_statusValid
?
Math
.
round
(
_azimuth
)
:
"
"
property
string
_numberShotsText
:
_currentSurvey
?
_numberShots
.
toFixed
(
0
)
:
"
"
property
string
_coveredAreaText
:
_currentSurvey
?
QGroundControl
.
squareMetersToAppSettingsAreaUnits
(
_coveredArea
).
toFixed
(
2
)
+
"
"
+
QGroundControl
.
appSettingsAreaUnitsString
:
"
"
property
string
_missionDistanceText
:
_missionValid
?
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_missionDistance
).
toFixed
(
2
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
:
"
"
property
string
_missionTimeText
:
_missionValid
?
_missionTime
.
toFixed
(
0
)
+
"
s
"
:
"
"
property
string
_missionMaxTelemetryText
:
_missionValid
?
QGroundControl
.
metersToAppSettingsDistanceUnits
(
_missionMaxTelemetry
).
toFixed
(
2
)
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
:
"
"
...
...
@@ -113,24 +109,6 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Azimuth:
"
)
}
QGCLabel
{
text
:
_azimuthText
}
QGCLabel
{
text
:
qsTr
(
"
# shots:
"
)
visible
:
_currentSurvey
}
QGCLabel
{
text
:
_numberShotsText
visible
:
_currentSurvey
}
QGCLabel
{
text
:
qsTr
(
"
Covered area:
"
)
visible
:
_currentSurvey
}
QGCLabel
{
text
:
_coveredAreaText
visible
:
_currentSurvey
}
}
ListView
{
...
...
src/MissionEditor/SurveyItemEditor.qml
View file @
5bc6896c
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
Controls
1.0
...
...
@@ -38,7 +39,7 @@ Rectangle {
}
Repeater
{
model
:
[
missionItem
.
gridA
ltitude
,
missionItem
.
gridAngle
,
missionItem
.
gridSpacing
]
model
:
[
missionItem
.
gridA
ngle
,
missionItem
.
gridSpacing
,
missionItem
.
gridAltitude
]
Item
{
anchors.left
:
parent
.
left
...
...
@@ -114,31 +115,64 @@ Rectangle {
onPolygonAdjustVertex
:
missionItem
.
adjustPolygonCoordinate
(
vertexIndex
,
vertexCoordinate
)
}
QGCButton
{
text
:
editorMap
.
polygonDraw
.
drawingPolygon
?
qsTr
(
"
Finish Draw
"
)
:
qsTr
(
"
Draw Polygon
"
)
enabled
:
((
editorMap
.
polygonDraw
.
drawingPolygon
&&
editorMap
.
polygonDraw
.
polygonReady
)
||
!
editorMap
.
polygonDraw
.
drawingPolygon
)
&&
!
editorMap
.
polygonDraw
.
adjustingPolygon
QGCLabel
{
text
:
qsTr
(
"
Polygon:
"
)
}
onClicked
:
{
if
(
editorMap
.
polygonDraw
.
drawingPolygon
)
{
editorMap
.
polygonDraw
.
finishCapturePolygon
()
}
else
{
editorMap
.
polygonDraw
.
startCapturePolygon
()
Rectangle
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
1
color
:
qgcPal
.
text
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCButton
{
text
:
editorMap
.
polygonDraw
.
drawingPolygon
?
qsTr
(
"
Finish Draw
"
)
:
qsTr
(
"
Draw
"
)
visible
:
!
editorMap
.
polygonDraw
.
adjustingPolygon
enabled
:
((
editorMap
.
polygonDraw
.
drawingPolygon
&&
editorMap
.
polygonDraw
.
polygonReady
)
||
!
editorMap
.
polygonDraw
.
drawingPolygon
)
onClicked
:
{
if
(
editorMap
.
polygonDraw
.
drawingPolygon
)
{
editorMap
.
polygonDraw
.
finishCapturePolygon
()
}
else
{
editorMap
.
polygonDraw
.
startCapturePolygon
()
}
}
}
}
QGCButton
{
text
:
editorMap
.
polygonDraw
.
adjustingPolygon
?
qsTr
(
"
Finish Adjust
"
)
:
qsTr
(
"
Adjust Polygon
"
)
enabled
:
!
editorMap
.
polygonDraw
.
drawingPolygon
QGCButton
{
text
:
editorMap
.
polygonDraw
.
adjustingPolygon
?
qsTr
(
"
Finish Adjust
"
)
:
qsTr
(
"
Adjust
"
)
visible
:
missionItem
.
polygonPath
.
length
>
0
&&
!
editorMap
.
polygonDraw
.
drawingPolygon
onClicked
:
{
if
(
editorMap
.
polygonDraw
.
adjustingPolygon
)
{
editorMap
.
polygonDraw
.
finishAdjustPolygon
()
}
else
{
editorMap
.
polygonDraw
.
startAdjustPolygon
(
missionItem
.
polygonPath
)
onClicked
:
{
if
(
editorMap
.
polygonDraw
.
adjustingPolygon
)
{
editorMap
.
polygonDraw
.
finishAdjustPolygon
()
}
else
{
editorMap
.
polygonDraw
.
startAdjustPolygon
(
missionItem
.
polygonPath
)
}
}
}
}
QGCLabel
{
text
:
qsTr
(
"
Statistics:
"
)
}
Rectangle
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
1
color
:
qgcPal
.
text
}
Grid
{
columns
:
2
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
Survey area:
"
)
}
QGCLabel
{
text
:
QGroundControl
.
squareMetersToAppSettingsAreaUnits
(
missionItem
.
coveredArea
).
toFixed
(
2
)
+
"
"
+
QGroundControl
.
appSettingsAreaUnitsString
}
QGCLabel
{
text
:
qsTr
(
"
# shots:
"
)
}
QGCLabel
{
text
:
missionItem
.
cameraShots
}
}
}
}
src/MissionManager/SurveyMissionItem.cc
View file @
5bc6896c
...
...
@@ -39,17 +39,38 @@ 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
)
,
_gridAltitudeFact
(
0
,
"Altitude:"
,
FactMetaData
::
valueTypeDouble
)
,
_gridAngleFact
(
0
,
"Grid angle:"
,
FactMetaData
::
valueTypeDouble
)
,
_gridSpacingFact
(
0
,
"Grid spacing:"
,
FactMetaData
::
valueTypeDouble
)
,
_cameraTriggerDistanceFact
(
0
,
"Camera trigger distance"
,
FactMetaData
::
valueTypeDouble
)
,
_gridAltitudeMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_gridAngleMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_gridSpacingMetaData
(
FactMetaData
::
valueTypeDouble
)
,
_cameraTriggerDistanceMetaData
(
FactMetaData
::
valueTypeDouble
)
{
_gridAltitudeFact
.
setRawValue
(
25
);
_gridSpacingFact
.
setRawValue
(
10
);
_cameraTriggerDistanceFact
.
setRawValue
(
25
);
connect
(
&
_gridSpacingFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
connect
(
&
_gridAngleFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
_gridAltitudeMetaData
.
setRawUnits
(
"m"
);
_gridAngleMetaData
.
setRawUnits
(
"deg"
);
_gridSpacingMetaData
.
setRawUnits
(
"m"
);
_cameraTriggerDistanceMetaData
.
setRawUnits
(
"m"
);
_gridAltitudeMetaData
.
setDecimalPlaces
(
1
);
_gridAngleMetaData
.
setDecimalPlaces
(
1
);
_gridSpacingMetaData
.
setDecimalPlaces
(
2
);
_cameraTriggerDistanceMetaData
.
setDecimalPlaces
(
2
);
_gridAltitudeFact
.
setMetaData
(
&
_gridAltitudeMetaData
);
_gridAngleFact
.
setMetaData
(
&
_gridAngleMetaData
);
_gridSpacingFact
.
setMetaData
(
&
_gridSpacingMetaData
);
_cameraTriggerDistanceFact
.
setMetaData
(
&
_cameraTriggerDistanceMetaData
);
connect
(
&
_gridSpacingFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
connect
(
&
_gridAngleFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
connect
(
&
_cameraTriggerDistanceFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
connect
(
this
,
&
SurveyMissionItem
::
cameraTriggerChanged
,
this
,
&
SurveyMissionItem
::
_cameraTriggerChanged
);
...
...
@@ -78,7 +99,7 @@ void SurveyMissionItem::_setCameraShots(int cameraShots)
{
if
(
_cameraShots
!=
cameraShots
)
{
_cameraShots
=
cameraShots
;
emit
cameraShotsChanged
(
_cameraShots
);
emit
cameraShotsChanged
(
this
->
cameraShots
()
);
}
}
...
...
@@ -611,4 +632,10 @@ void SurveyMissionItem::_cameraTriggerChanged(void)
// If we have grid turn on/off camera trigger will add/remove two camera trigger mission items
emit
lastSequenceNumberChanged
(
lastSequenceNumber
());
}
emit
cameraShotsChanged
(
cameraShots
());
}
int
SurveyMissionItem
::
cameraShots
(
void
)
const
{
return
_cameraTrigger
?
_cameraShots
:
0
;
}
src/MissionManager/SurveyMissionItem.h
View file @
5bc6896c
...
...
@@ -50,8 +50,8 @@ public:
Fact
*
gridSpacing
(
void
)
{
return
&
_gridSpacingFact
;
}
Fact
*
cameraTriggerDistance
(
void
)
{
return
&
_cameraTriggerDistanceFact
;
}
int
cameraShots
(
void
)
const
{
return
_cameraShots
;
}
double
coveredArea
(
void
)
const
{
return
_coveredArea
;
}
int
cameraShots
(
void
)
const
;
double
coveredArea
(
void
)
const
{
return
_coveredArea
;
}
// Overrides from ComplexMissionItem
...
...
@@ -125,10 +125,14 @@ private:
int
_cameraShots
;
double
_coveredArea
;
Fact
_gridAltitudeFact
;
Fact
_gridAngleFact
;
Fact
_gridSpacingFact
;
Fact
_cameraTriggerDistanceFact
;
Fact
_gridAltitudeFact
;
Fact
_gridAngleFact
;
Fact
_gridSpacingFact
;
Fact
_cameraTriggerDistanceFact
;
FactMetaData
_gridAltitudeMetaData
;
FactMetaData
_gridAngleMetaData
;
FactMetaData
_gridSpacingMetaData
;
FactMetaData
_cameraTriggerDistanceMetaData
;
static
const
char
*
_jsonVersionKey
;
static
const
char
*
_jsonTypeKey
;
...
...
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