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
6485d280
Commit
6485d280
authored
Nov 27, 2020
by
Valentin Platzgummer
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flightpathSegments added to MeasurementComplexItem
parent
5f9f30c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
6 deletions
+54
-6
MeasurementComplexItem.cc
src/MeasurementComplexItem/MeasurementComplexItem.cc
+44
-4
MeasurementComplexItem.h
src/MeasurementComplexItem/MeasurementComplexItem.h
+1
-1
ParameterEditor.qml
src/MeasurementComplexItem/qml/ParameterEditor.qml
+9
-1
No files found.
src/MeasurementComplexItem/MeasurementComplexItem.cc
View file @
6485d280
...
...
@@ -20,8 +20,6 @@
#include <boost/units/io.hpp>
#include <boost/units/systems/si.hpp>
#define CLIPPER_SCALE 1000000
QGC_LOGGING_CATEGORY
(
MeasurementComplexItemLog
,
"MeasurementComplexItemLog"
)
template
<
typename
T
>
...
...
@@ -39,8 +37,7 @@ const QString MeasurementComplexItem::name(tr("Measurement"));
MeasurementComplexItem
::
MeasurementComplexItem
(
PlanMasterController
*
masterController
,
bool
flyView
,
const
QString
&
kmlOrShpFile
,
QObject
*
parent
)
:
ComplexMissionItem
(
masterController
,
flyView
,
parent
),
_masterController
(
masterController
),
_sequenceNumber
(
0
),
:
ComplexMissionItem
(
masterController
,
flyView
,
parent
),
_sequenceNumber
(
0
),
_followTerrain
(
false
),
_state
(
STATE
::
IDLE
),
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/MeasurementComplexItem.SettingsGroup.json"
),
...
...
@@ -86,9 +83,15 @@ MeasurementComplexItem::MeasurementComplexItem(
}
}
});
// Connect readyForSave
connect
(
this
,
&
MeasurementComplexItem
::
idleChanged
,
this
,
&
MeasurementComplexItem
::
readyForSaveStateChanged
);
// Connect flightPathSegments
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
this
,
&
MeasurementComplexItem
::
_updateFlightpathSegments
);
// Connect complexDistance.
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
[
this
]
{
emit
this
->
complexDistanceChanged
();
});
...
...
@@ -385,6 +388,43 @@ bool MeasurementComplexItem::_idle(MeasurementComplexItem::STATE state) {
return
state
==
STATE
::
IDLE
;
}
void
MeasurementComplexItem
::
_updateFlightpathSegments
()
{
if
(
_cTerrainCollisionSegments
!=
0
)
{
_cTerrainCollisionSegments
=
0
;
emit
terrainCollisionChanged
(
false
);
qCritical
()
<<
"add alt color here..."
;
}
_flightPathSegments
.
beginReset
();
_flightPathSegments
.
clearAndDeleteContents
();
if
(
_route
.
size
()
>
2
)
{
bool
ok
=
false
;
double
alt
=
_altitude
.
rawValue
().
toDouble
(
&
ok
)
+
_masterController
->
missionController
()
->
plannedHomePosition
()
.
altitude
();
if
(
ok
)
{
auto
prev
=
_route
.
cbegin
();
for
(
auto
next
=
_route
.
cbegin
()
+
1
;
next
!=
_route
.
end
();
++
next
)
{
auto
v1
=
prev
->
value
<
QGeoCoordinate
>
();
auto
v2
=
next
->
value
<
QGeoCoordinate
>
();
_appendFlightPathSegment
(
v1
,
alt
,
v2
,
alt
);
prev
=
next
;
}
}
else
{
qCCritical
(
MeasurementComplexItemLog
)
<<
"_altitude fact not ok."
;
}
}
_flightPathSegments
.
endReset
();
if
(
_cTerrainCollisionSegments
!=
0
)
{
emit
terrainCollisionChanged
(
true
);
}
_masterController
->
missionController
()
->
recalcTerrainProfile
();
}
void
MeasurementComplexItem
::
_setAreaData
(
MeasurementComplexItem
::
PtrAreaData
data
)
{
if
(
_pCurrentData
!=
data
)
{
...
...
src/MeasurementComplexItem/MeasurementComplexItem.h
View file @
6485d280
...
...
@@ -174,9 +174,9 @@ private:
static
bool
_calculating
(
STATE
state
);
static
bool
_editing
(
STATE
state
);
static
bool
_idle
(
STATE
state
);
void
_updateFlightpathSegments
();
// Hirarcical stuff.
PlanMasterController
*
_masterController
;
int
_sequenceNumber
;
bool
_followTerrain
;
...
...
src/MeasurementComplexItem/qml/ParameterEditor.qml
View file @
6485d280
...
...
@@ -58,7 +58,15 @@ ColumnLayout {
columns
:
2
visible
:
generalHeader
.
checked
QGCLabel
{
text
:
qsTr
(
"
Altitude!!!
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Altitude
"
)
Layout.fillWidth
:
true
}
FactTextField
{
fact
:
missionItem
.
altitude
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Relative Altitude!!!
"
)
}
QGCLabel
{
...
...
Valentin Platzgummer
@platzgummer
mentioned in commit
a0521309
·
Dec 07, 2020
mentioned in commit
a0521309
mentioned in commit a0521309a9e53fdb7fd1a53771dc81257854a9bc
Toggle commit list
Valentin Platzgummer
@platzgummer
mentioned in commit
236327b8
·
Dec 07, 2020
mentioned in commit
236327b8
mentioned in commit 236327b8956d7b712ebf178b933f3dafa563578e
Toggle commit list
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