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
60b604d9
Commit
60b604d9
authored
Oct 19, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp, with errors
parent
58b2b82d
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
236 additions
and
340 deletions
+236
-340
CircularSurvey.cc
src/Wima/CircularSurvey.cc
+176
-247
CircularSurvey.h
src/Wima/CircularSurvey.h
+50
-89
RoutingThread.h
src/Wima/RoutingThread.h
+1
-1
CircularGenerator.cpp
src/Wima/Snake/CircularGenerator.cpp
+3
-0
CircularGenerator.h
src/Wima/Snake/CircularGenerator.h
+3
-0
LinkConfiguration.h
src/comm/LinkConfiguration.h
+1
-1
LinkInterface.h
src/comm/LinkInterface.h
+1
-1
UnitTest.h
src/qgcunittest/UnitTest.h
+1
-1
No files found.
src/Wima/CircularSurvey.cc
View file @
60b604d9
This diff is collapsed.
Click to expand it.
src/Wima/CircularSurvey.h
View file @
60b604d9
...
...
@@ -2,26 +2,26 @@
#include <QFutureWatcher>
#include <QVector>
#include <memory>
#include "SettingsFact.h"
#include "TransectStyleComplexItem.h"
#include "Geometry/WimaJoinedAreaData.h"
#include "Geometry/WimaMeasurementAreaData.h"
#include "WimaPlanData.h"
class
RoutingThread
;
class
RoutingData
;
class
GeneratorBase
;
class
CircularSurvey
:
public
TransectStyleComplexItem
{
Q_OBJECT
public:
using
PtrRoutingData
=
QSharedPointer
<
RoutingData
>
;
enum
class
Type
{
Circular
=
0
,
Linear
=
1
,
Count
=
2
// Must me last, onyl for counting
};
using
PtrGenerator
=
std
::
shared_ptr
<
GeneratorBase
>
;
using
PtrRoutingData
=
std
::
shared_ptr
<
RoutingData
>
;
public:
/// @param vehicle Vehicle which this is being contructed for
/// @param flyView true: Created for use in the Fly View, false: Created for
/// use in the Plan View
...
...
@@ -31,50 +31,25 @@ public:
QObject
*
parent
);
~
CircularSurvey
();
Q_PROPERTY
(
QGeoCoordinate
refPoint
READ
refPoint
WRITE
setRefPoint
NOTIFY
refPointChanged
)
Q_PROPERTY
(
Fact
*
transectDistance
READ
transectDistance
CONSTANT
)
Q_PROPERTY
(
Fact
*
alpha
READ
alpha
CONSTANT
)
Q_PROPERTY
(
Fact
*
minLength
READ
minLength
CONSTANT
)
Q_PROPERTY
(
Fact
*
type
READ
type
CONSTANT
)
Q_PROPERTY
(
Fact
*
variant
READ
variant
CONSTANT
)
Q_PROPERTY
(
Fact
*
numRuns
READ
numRuns
CONSTANT
)
Q_PROPERTY
(
Fact
*
run
READ
run
CONSTANT
)
Q_PROPERTY
(
int
typeCount
READ
typeCount
CONSTANT
)
Q_PROPERTY
(
bool
calculating
READ
calculating
NOTIFY
calculatingChanged
)
Q_PROPERTY
(
bool
hidePolygon
READ
hidePolygon
NOTIFY
hidePolygonChanged
)
Q_PROPERTY
(
Fact
*
variant
READ
variant
CONSTANT
)
Q_PROPERTY
(
QList
<
QString
>
variantNames
READ
variantNames
NOTIFY
variantNamesChanged
)
Q_PROPERTY
(
QList
<
QString
>
runNames
READ
runNames
NOTIFY
runNamesChanged
)
Q_PROPERTY
(
QList
<
QString
>
generatorNameList
READ
generatorNameList
NOTIFY
generatorNameListChanged
)
Q_PROPERTY
(
bool
calculating
READ
calculating
NOTIFY
calculatingChanged
)
Q_INVOKABLE
void
resetReference
(
void
);
Q_INVOKABLE
void
reverse
(
void
);
// Property setters
void
setRefPoint
(
const
QGeoCoordinate
&
refPt
);
void
setHidePolygon
(
bool
hide
);
void
setMeasurementArea
(
const
WimaMeasurementAreaData
&
mArea
);
void
setJoinedArea
(
const
WimaJoinedAreaData
&
jArea
);
void
setMeasurementArea
(
const
WimaMeasurementArea
&
mArea
);
void
setJoinedArea
(
const
WimaJoinedArea
&
jArea
);
void
setDepot
(
const
QGeoCoordinate
&
depot
);
void
setPlanData
(
const
WimaPlanData
&
d
);
// Property getters
QGeoCoordinate
refPoint
()
const
;
Fact
*
transectDistance
();
Fact
*
alpha
();
Fact
*
minLength
();
Fact
*
type
();
Fact
*
variant
();
Fact
*
numRuns
();
Fact
*
run
();
int
typeCount
()
const
;
bool
calculating
()
const
;
bool
hidePolygon
()
const
;
Fact
*
variant
();
QList
<
QString
>
variantNames
()
const
;
QList
<
QString
>
runNames
()
const
;
QGeoCoordinate
depot
()
const
;
const
QList
<
QList
<
QGeoCoordinate
>>
&
rawTransects
()
const
;
// Overrides
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
...
...
@@ -92,91 +67,77 @@ public:
bool
readyForSave
(
void
)
const
override
final
;
double
additionalTimeDelay
(
void
)
const
override
final
;
// Generator
bool
registerGenerator
(
const
QString
&
name
,
std
::
shared_ptr
<
GeneratorBase
>
g
);
bool
unregisterGenerator
(
const
QString
&
name
);
bool
unregisterGenerator
(
int
index
);
Q_INVOKABLE
bool
switchToGenerator
(
const
QString
&
name
);
Q_INVOKABLE
bool
switchToGenerator
(
int
index
);
QList
<
QString
>
generatorNameList
();
static
const
char
*
settingsGroup
;
static
const
char
*
transectDistanceName
;
static
const
char
*
alphaName
;
static
const
char
*
minLengthName
;
static
const
char
*
typeName
;
static
const
char
*
variantName
;
static
const
char
*
numRunsName
;
static
const
char
*
runName
;
static
const
char
*
CircularSurveyName
;
static
const
char
*
refPointLongitudeName
;
static
const
char
*
refPointLatitudeName
;
static
const
char
*
refPointAltitudeName
;
signals:
void
refPointChanged
();
void
calculatingChanged
();
void
hidePolygonChanged
();
void
depotChanged
();
void
variantNamesChanged
();
void
runNamesChanged
();
void
measurementAreaChanged
();
void
joinedAreaChanged
();
void
generatorNameListChanged
();
void
generatorChanged
();
private
slots
:
// Overrides from TransectStyleComplexItem
void
_rebuildTransectsPhase1
(
void
)
final
;
void
_recalcComplexDistance
(
void
)
final
;
void
_recalcCameraShots
(
void
)
final
;
// Worker functions.
void
_setTransects
(
PtrRoutingData
pRoute
);
void
_changeVariant
();
void
_updateWorker
();
void
_changeVariantWorker
();
void
_reverseWorker
();
void
_storeWorker
();
private:
void
_appendLoadedMissionItems
(
QList
<
MissionItem
*>
&
items
,
QObject
*
missionItemParent
);
void
_buildAndAppendMissionItems
(
QList
<
MissionItem
*>
&
items
,
QObject
*
missionItemParent
);
void
_changeVariant
();
void
_changeRun
();
void
_updateWorker
();
void
_changeVariantRunWorker
();
void
_reverseWorker
();
void
_storeWorker
();
void
_changeRunWorker
();
bool
_switchToGenerator
(
const
PtrGenerator
&
newG
);
// State.
enum
class
STATE
{
IDLE
,
STORE
,
REVERSE
,
VARIANT_CHANGE
,
RUN_CHANGE
,
};
STATE
_state
;
// center of the circular lanes, e.g. base station
QGeoCoordinate
_referencePoint
;
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
// distance between two neighbour circles
SettingsFact
_transectDistance
;
// angle discretisation of the circles
SettingsFact
_alpha
;
// minimal transect lenght, transects are rejected if they are shorter than
// this value
SettingsFact
_minLength
;
SettingsFact
_type
;
SettingsFact
_variant
;
QList
<
QString
>
_variantNames
;
SettingsFact
_numRuns
;
SettingsFact
_run
;
QList
<
QString
>
_runNames
;
// Area data
WimaMeasurementAreaData
_mArea
;
WimaJoinedAreaData
_jArea
;
QGeoCoordinate
_depot
;
std
::
shared_ptr
<
WimaAreaData
>
_areaData
;
// Generators
QList
<
PtrGenerator
>
_generatorList
;
QList
<
QString
>
_generatorNameList
;
PtrGenerator
_pGenerator
;
// Worker
using
PtrWorker
=
std
::
shared_ptr
<
RoutingThread
>
;
PtrWorker
_pWorker
;
PtrRoutingData
_pRoutingData
;
PtrRoutingData
_pRoutingData
;
// remove this, not necessary.
// Routing data.
QList
<
QList
<
QGeoCoordinate
>>
_rawTransects
;
using
Runs
=
QVector
<
Transects
>
;
QVector
<
Runs
>
_variantVector
;
// State.
enum
class
STATE
{
DEFAULT
,
STORE
,
REVERSE
,
VARIANT_CHANGE
,
RUN_CHANGE
,
};
STATE
_state
;
bool
_hidePolygon
;
using
Variant
=
Transects
;
QVector
<
Variant
>
_variantVector
;
};
src/Wima/RoutingThread.h
View file @
60b604d9
...
...
@@ -31,7 +31,7 @@ class RoutingThread : public QThread {
using
Lock
=
std
::
unique_lock
<
std
::
mutex
>
;
public:
using
PtrRoutingData
=
QSharedPointe
r
<
RoutingData
>
;
using
PtrRoutingData
=
shared_pt
r
<
RoutingData
>
;
using
Generator
=
std
::
function
<
bool
(
snake
::
Transects
&
)
>
;
using
Consumer
=
std
::
function
<
void
(
const
RoutingData
&
)
>
;
...
...
src/Wima/Snake/CircularGenerator.cpp
View file @
60b604d9
...
...
@@ -26,6 +26,9 @@ const char *CircularGenerator::settingsGroup = "CircularGenerator";
const
char
*
CircularGenerator
::
distanceName
=
"TransectDistance"
;
const
char
*
CircularGenerator
::
deltaAlphaName
=
"DeltaAlpha"
;
const
char
*
CircularGenerator
::
minLengthName
=
"MinLength"
;
const
char
*
CircularGenerator
::
refPointLatitudeName
=
"ReferencePointLat"
;
const
char
*
CircularGenerator
::
refPointLongitudeName
=
"ReferencePointLong"
;
const
char
*
CircularGenerator
::
refPointAltitudeName
=
"ReferencePointAlt"
;
CircularGenerator
::
CircularGenerator
(
QObject
*
parent
)
:
CircularGenerator
(
nullptr
,
parent
)
{}
...
...
src/Wima/Snake/CircularGenerator.h
View file @
60b604d9
...
...
@@ -36,6 +36,9 @@ public:
static
const
char
*
distanceName
;
static
const
char
*
deltaAlphaName
;
static
const
char
*
minLengthName
;
static
const
char
*
refPointLongitudeName
;
static
const
char
*
refPointLatitudeName
;
static
const
char
*
refPointAltitudeName
;
signals:
void
referenceChanged
();
...
...
src/comm/LinkConfiguration.h
View file @
60b604d9
...
...
@@ -213,5 +213,5 @@ private:
bool
_highLatency
;
};
typedef
QSharedPointe
r
<
LinkConfiguration
>
SharedLinkConfigurationPointer
;
typedef
shared_pt
r
<
LinkConfiguration
>
SharedLinkConfigurationPointer
;
src/comm/LinkInterface.h
View file @
60b604d9
...
...
@@ -305,5 +305,5 @@ private:
QMap
<
int
/* vehicle id */
,
MavlinkMessagesTimer
*>
_mavlinkMessagesTimers
;
};
typedef
QSharedPointe
r
<
LinkInterface
>
SharedLinkInterfacePointer
;
typedef
shared_pt
r
<
LinkInterface
>
SharedLinkInterfacePointer
;
src/qgcunittest/UnitTest.h
View file @
60b604d9
...
...
@@ -215,7 +215,7 @@ public:
}
private:
QSharedPointe
r
<
T
>
_unitTest
;
shared_pt
r
<
T
>
_unitTest
;
};
#endif
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