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
f778e405
Commit
f778e405
authored
Dec 14, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading almost finished
parent
8250ef7b
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
329 additions
and
282 deletions
+329
-282
AreaData.cc
src/MeasurementComplexItem/AreaData.cc
+77
-97
AreaData.h
src/MeasurementComplexItem/AreaData.h
+3
-1
CircularGenerator.cpp
src/MeasurementComplexItem/CircularGenerator.cpp
+57
-30
CircularGenerator.h
src/MeasurementComplexItem/CircularGenerator.h
+10
-5
GeneratorBase.cc
src/MeasurementComplexItem/GeneratorBase.cc
+9
-17
GeneratorBase.h
src/MeasurementComplexItem/GeneratorBase.h
+1
-3
LinearGenerator.cpp
src/MeasurementComplexItem/LinearGenerator.cpp
+47
-21
LinearGenerator.h
src/MeasurementComplexItem/LinearGenerator.h
+10
-5
MeasurementComplexItem.cc
src/MeasurementComplexItem/MeasurementComplexItem.cc
+99
-56
MeasurementComplexItem.h
src/MeasurementComplexItem/MeasurementComplexItem.h
+4
-2
AreaDataEditor.qml
src/MeasurementComplexItem/qml/AreaDataEditor.qml
+0
-11
MeasurementItemEditor.qml
src/MeasurementComplexItem/qml/MeasurementItemEditor.qml
+4
-29
MeasurementItemMapVisual.qml
src/MeasurementComplexItem/qml/MeasurementItemMapVisual.qml
+7
-4
ParameterEditor.qml
src/MeasurementComplexItem/qml/ParameterEditor.qml
+1
-1
No files found.
src/MeasurementComplexItem/AreaData.cc
View file @
f778e405
...
@@ -13,14 +13,13 @@ QGC_LOGGING_CATEGORY(AreaDataLog, "AreaDataLog")
...
@@ -13,14 +13,13 @@ QGC_LOGGING_CATEGORY(AreaDataLog, "AreaDataLog")
const
char
*
originKey
=
"Origin"
;
const
char
*
originKey
=
"Origin"
;
const
char
*
areaListKey
=
"AreaList"
;
const
char
*
areaListKey
=
"AreaList"
;
const
char
*
initializedKey
=
"Initialized"
;
AreaData
::
AreaData
(
QObject
*
parent
)
:
QObject
(
parent
)
{}
AreaData
::
AreaData
(
QObject
*
parent
)
:
QObject
(
parent
)
{}
AreaData
::~
AreaData
()
{}
AreaData
::~
AreaData
()
{}
AreaData
::
AreaData
(
const
AreaData
&
other
,
QObject
*
parent
)
AreaData
::
AreaData
(
const
AreaData
&
other
,
QObject
*
parent
)
:
QObject
(
parent
),
_
initialized
(
false
),
_
showErrorMessages
(
true
)
{
:
QObject
(
parent
),
_showErrorMessages
(
true
)
{
*
this
=
other
;
*
this
=
other
;
}
}
...
@@ -35,7 +34,6 @@ AreaData &AreaData::operator=(const AreaData &other) {
...
@@ -35,7 +34,6 @@ AreaData &AreaData::operator=(const AreaData &other) {
}
}
_origin
=
other
.
_origin
;
_origin
=
other
.
_origin
;
_initialized
=
other
.
_initialized
;
return
*
this
;
return
*
this
;
}
}
...
@@ -130,11 +128,10 @@ bool AreaData::isCorrect() {
...
@@ -130,11 +128,10 @@ bool AreaData::isCorrect() {
// qDebug() << ss.str().c_str();
// qDebug() << ss.str().c_str();
if
(
!
bg
::
covered_by
(
measurementAreaENU
,
safeAreaENU
))
{
if
(
!
bg
::
covered_by
(
measurementAreaENU
,
safeAreaENU
))
{
_processError
(
tr
(
"Measurement Area not inside Safe Area. Please adjust "
_processError
(
tr
(
"Measurement Area not inside Safe Area. Please adjust "
"the Measurement Area."
));
"the Measurement Area.
\n
"
));
return
false
;
return
false
;
}
}
_initialized
=
true
;
return
true
;
return
true
;
}
}
...
@@ -196,7 +193,6 @@ bool AreaData::initialize(const QGeoCoordinate &bottomLeft,
...
@@ -196,7 +193,6 @@ bool AreaData::initialize(const QGeoCoordinate &bottomLeft,
safeArea
->
vertexCoordinate
(
0
).
longitude
()
*
0.5
+
safeArea
->
vertexCoordinate
(
0
).
longitude
()
*
0.5
+
measurementArea
->
vertexCoordinate
(
0
).
longitude
()
*
0.5
));
measurementArea
->
vertexCoordinate
(
0
).
longitude
()
*
0.5
));
_initialized
=
true
;
return
true
;
return
true
;
}
else
{
}
else
{
qCWarning
(
AreaDataLog
)
qCWarning
(
AreaDataLog
)
...
@@ -206,7 +202,12 @@ bool AreaData::initialize(const QGeoCoordinate &bottomLeft,
...
@@ -206,7 +202,12 @@ bool AreaData::initialize(const QGeoCoordinate &bottomLeft,
}
}
}
}
bool
AreaData
::
initialized
()
{
return
_initialized
;
}
bool
AreaData
::
initialized
()
{
auto
measurementArea
=
getGeoArea
<
MeasurementArea
*>
(
_areaList
);
auto
safeArea
=
getGeoArea
<
SafeArea
*>
(
_areaList
);
return
measurementArea
!=
nullptr
&&
safeArea
!=
nullptr
&&
measurementArea
->
count
()
>=
3
&&
safeArea
->
count
()
>=
3
;
}
void
AreaData
::
intersection
()
{
void
AreaData
::
intersection
()
{
if
(
initialized
()
&&
_areasCorrect
())
{
if
(
initialized
()
&&
_areasCorrect
())
{
...
@@ -261,6 +262,12 @@ void AreaData::intersection() {
...
@@ -261,6 +262,12 @@ void AreaData::intersection() {
}
}
}
}
MeasurementArea
*
AreaData
::
measurementArea
()
{
return
getGeoArea
<
MeasurementArea
*>
(
_areaList
);
}
SafeArea
*
AreaData
::
safeArea
()
{
return
getGeoArea
<
SafeArea
*>
(
_areaList
);
}
bool
AreaData
::
operator
==
(
const
AreaData
&
other
)
const
{
bool
AreaData
::
operator
==
(
const
AreaData
&
other
)
const
{
if
(
_areaList
.
count
()
==
other
.
_areaList
.
count
())
{
if
(
_areaList
.
count
()
==
other
.
_areaList
.
count
())
{
for
(
int
i
=
0
;
i
<
_areaList
.
count
();
++
i
)
{
for
(
int
i
=
0
;
i
<
_areaList
.
count
();
++
i
)
{
...
@@ -280,119 +287,93 @@ bool AreaData::operator!=(const AreaData &other) const {
...
@@ -280,119 +287,93 @@ bool AreaData::operator!=(const AreaData &other) const {
bool
AreaData
::
load
(
const
QJsonObject
&
obj
,
QString
&
errorString
)
{
bool
AreaData
::
load
(
const
QJsonObject
&
obj
,
QString
&
errorString
)
{
bool
returnValue
=
true
;
bool
returnValue
=
true
;
// load initialized.
{
QString
e
;
QList
<
JsonHelper
::
KeyValidateInfo
>
keyInfo
=
{
{
initializedKey
,
QJsonValue
::
Bool
,
true
},
};
if
(
JsonHelper
::
validateKeys
(
obj
,
keyInfo
,
e
))
{
_initialized
=
obj
[
initializedKey
].
toBool
();
}
else
{
returnValue
=
false
;
errorString
.
append
(
e
);
errorString
.
append
(
"
\n
"
);
}
}
// load areaList.
// load areaList.
{
if
(
obj
.
contains
(
areaListKey
)
&&
obj
[
areaListKey
].
isArray
())
{
QString
e
;
QList
<
JsonHelper
::
KeyValidateInfo
>
keyInfo
=
{
this
->
clear
();
{
areaListKey
,
QJsonValue
::
Array
,
true
},
};
// iterate over json array
if
(
JsonHelper
::
validateKeys
(
obj
,
keyInfo
,
e
))
{
for
(
const
auto
valueRef
:
obj
[
areaListKey
].
toArray
())
{
this
->
clear
();
const
auto
jsonArea
=
valueRef
.
toObject
();
// iterate over json array
for
(
const
auto
valueRef
:
obj
[
areaListKey
].
toArray
())
{
// check if area type key is present
const
auto
jsonArea
=
valueRef
.
toObject
();
if
(
jsonArea
.
contains
(
GeoArea
::
areaTypeKey
)
&&
// check if area type key is present
jsonArea
[
GeoArea
::
areaTypeKey
].
isString
())
{
QList
<
JsonHelper
::
KeyValidateInfo
>
areaInfo
=
{
{
GeoArea
::
areaTypeKey
,
QJsonValue
::
String
,
true
},
// load MeasurementArea
};
if
(
jsonArea
[
GeoArea
::
areaTypeKey
].
toString
()
==
if
(
!
JsonHelper
::
validateKeys
(
jsonArea
,
areaInfo
,
e
))
{
MeasurementArea
::
name
)
{
// load MeasurementArea
if
(
jsonArea
[
GeoArea
::
areaTypeKey
].
toString
()
==
auto
area
=
getGeoArea
<
MeasurementArea
*>
(
_areaList
);
MeasurementArea
::
name
)
{
auto
area
=
getGeoArea
<
MeasurementArea
*>
(
_areaList
);
if
(
area
==
nullptr
)
{
if
(
area
==
nullptr
)
{
auto
area
=
new
MeasurementArea
(
this
);
auto
area
=
new
MeasurementArea
(
this
);
if
(
area
->
loadFromJson
(
jsonArea
,
e
))
{
QString
e
;
this
->
insert
(
area
);
if
(
area
->
loadFromJson
(
jsonArea
,
e
))
{
}
else
{
this
->
insert
(
area
);
returnValue
=
false
;
errorString
.
append
(
e
);
errorString
.
append
(
"
\n
"
);
area
->
deleteLater
();
}
}
else
{
}
else
{
returnValue
=
false
;
returnValue
=
false
;
errorString
.
append
(
errorString
.
append
(
e
);
tr
(
"Multiple Measurement Areas detected. Area was ignored."
));
errorString
.
append
(
"
\n
"
);
area
->
deleteLater
();
}
}
}
else
{
returnValue
=
false
;
errorString
.
append
(
tr
(
"Multiple Measurement Areas detected. Area was ignored."
));
}
}
// load SafeArea
}
else
if
(
jsonArea
[
GeoArea
::
areaTypeKey
].
toString
()
==
// load SafeArea
SafeArea
::
name
)
{
else
if
(
jsonArea
[
GeoArea
::
areaTypeKey
].
toString
()
==
SafeArea
::
name
)
{
auto
area
=
getGeoArea
<
SafeArea
*>
(
_areaList
);
if
(
area
==
nullptr
)
{
auto
area
=
getGeoArea
<
SafeArea
*>
(
_areaList
);
auto
area
=
new
SafeArea
(
this
);
if
(
area
==
nullptr
)
{
if
(
area
->
loadFromJson
(
jsonArea
,
e
))
{
this
->
insert
(
area
);
auto
area
=
new
SafeArea
(
this
);
}
else
{
QString
e
;
returnValue
=
false
;
if
(
area
->
loadFromJson
(
jsonArea
,
e
))
{
errorString
.
append
(
e
);
this
->
insert
(
area
);
errorString
.
append
(
"
\n
"
);
area
->
deleteLater
();
}
}
else
{
}
else
{
returnValue
=
false
;
returnValue
=
false
;
errorString
.
append
(
errorString
.
append
(
e
);
tr
(
"Multiple Safe Areas detected. Area was ignored."
));
errorString
.
append
(
"
\n
"
);
area
->
deleteLater
();
}
}
}
}
else
{
// unknown area
else
{
returnValue
=
false
;
returnValue
=
false
;
errorString
.
append
(
tr
(
"Unknown area type: "
)
+
errorString
.
append
(
jsonArea
[
GeoArea
::
areaTypeKey
].
toString
(
));
tr
(
"Multiple Safe Areas detected. Area was ignored."
));
}
}
}
}
//
GeoArea::areaTypeKey missing
//
unknown area
else
{
else
{
returnValue
=
false
;
returnValue
=
false
;
errorString
.
append
(
e
);
errorString
.
append
(
tr
(
"Unknown area type: "
)
+
errorString
.
append
(
"
\n
"
);
jsonArea
[
GeoArea
::
areaTypeKey
].
toString
()
);
}
}
}
else
{
// GeoArea::areaTypeKey missing
returnValue
=
false
;
errorString
.
append
(
"Area type key missing, not able to determine area type.
\n
"
);
}
}
}
}
}
else
{
// AreaList missing
// AreaList missing
else
{
returnValue
=
false
;
returnValue
=
false
;
errorString
.
append
(
"Not able to load areas.
\n
"
);
errorString
.
append
(
e
);
errorString
.
append
(
"
\n
"
);
}
}
}
// load origin
// load origin
{
if
(
obj
.
contains
(
originKey
)
&&
obj
[
originKey
].
isObject
())
{
QGeoCoordinate
origin
;
QString
e
;
QString
e
;
QList
<
JsonHelper
::
KeyValidateInfo
>
keyInfo
=
{
if
(
JsonHelper
::
loadGeoCoordinate
(
obj
[
originKey
],
false
,
origin
,
e
))
{
{
originKey
,
QJsonValue
::
Object
,
true
},
_origin
=
origin
;
};
if
(
JsonHelper
::
validateKeys
(
obj
,
keyInfo
,
e
))
{
QGeoCoordinate
origin
;
if
(
JsonHelper
::
loadGeoCoordinate
(
obj
[
originKey
],
false
,
origin
,
e
))
{
_origin
=
origin
;
}
}
}
}
}
// check if this is correct.
if
(
!
this
->
isCorrect
())
{
returnValue
=
false
;
}
return
returnValue
;
return
returnValue
;
}
}
...
@@ -402,7 +383,6 @@ bool AreaData::save(QJsonObject &obj) {
...
@@ -402,7 +383,6 @@ bool AreaData::save(QJsonObject &obj) {
QJsonValue
jsonOrigin
;
QJsonValue
jsonOrigin
;
JsonHelper
::
saveGeoCoordinate
(
_origin
,
false
,
jsonOrigin
);
JsonHelper
::
saveGeoCoordinate
(
_origin
,
false
,
jsonOrigin
);
temp
[
originKey
]
=
jsonOrigin
;
temp
[
originKey
]
=
jsonOrigin
;
temp
[
initializedKey
]
=
_initialized
;
QJsonArray
jsonAreaList
;
QJsonArray
jsonAreaList
;
for
(
int
i
=
0
;
i
<
_areaList
.
count
();
++
i
)
{
for
(
int
i
=
0
;
i
<
_areaList
.
count
();
++
i
)
{
...
...
src/MeasurementComplexItem/AreaData.h
View file @
f778e405
...
@@ -71,6 +71,9 @@ public:
...
@@ -71,6 +71,9 @@ public:
Q_INVOKABLE
bool
initialized
();
Q_INVOKABLE
bool
initialized
();
Q_INVOKABLE
void
intersection
();
Q_INVOKABLE
void
intersection
();
Q_INVOKABLE
MeasurementArea
*
measurementArea
();
Q_INVOKABLE
SafeArea
*
safeArea
();
bool
operator
==
(
const
AreaData
&
other
)
const
;
bool
operator
==
(
const
AreaData
&
other
)
const
;
bool
operator
!=
(
const
AreaData
&
other
)
const
;
bool
operator
!=
(
const
AreaData
&
other
)
const
;
...
@@ -98,7 +101,6 @@ private:
...
@@ -98,7 +101,6 @@ private:
QGeoCoordinate
_origin
;
QGeoCoordinate
_origin
;
QmlObjectListModel
_areaList
;
QmlObjectListModel
_areaList
;
bool
_initialized
;
QString
_errorString
;
QString
_errorString
;
bool
_showErrorMessages
;
bool
_showErrorMessages
;
};
};
src/MeasurementComplexItem/CircularGenerator.cpp
View file @
f778e405
...
@@ -21,8 +21,6 @@ template <> inline auto get<1>(const IntPoint &p) { return p.Y; }
...
@@ -21,8 +21,6 @@ template <> inline auto get<1>(const IntPoint &p) { return p.Y; }
namespace
routing
{
namespace
routing
{
namespace
{
namespace
{
const
QString
generatorType
=
"CircularGenerator"
;
GeneratorBase
*
creator
(
QObject
*
parent
)
{
GeneratorBase
*
creator
(
QObject
*
parent
)
{
return
new
CircularGenerator
(
parent
);
return
new
CircularGenerator
(
parent
);
}
}
...
@@ -33,8 +31,6 @@ const char *minLengthKey = "MinLength";
...
@@ -33,8 +31,6 @@ const char *minLengthKey = "MinLength";
const
char
*
referenceKey
=
"ReferencePoint"
;
const
char
*
referenceKey
=
"ReferencePoint"
;
}
// namespace
}
// namespace
REGISTER_GENERATOR
(
generatorType
,
creator
)
bool
circularTransects
(
const
snake
::
FPoint
&
reference
,
bool
circularTransects
(
const
snake
::
FPoint
&
reference
,
const
snake
::
FPolygon
&
polygon
,
const
snake
::
FPolygon
&
polygon
,
const
std
::
vector
<
snake
::
FPolygon
>
&
tiles
,
const
std
::
vector
<
snake
::
FPolygon
>
&
tiles
,
...
@@ -42,9 +38,20 @@ bool circularTransects(const snake::FPoint &reference,
...
@@ -42,9 +38,20 @@ bool circularTransects(const snake::FPoint &reference,
snake
::
Length
minLength
,
snake
::
Transects
&
transects
);
snake
::
Length
minLength
,
snake
::
Transects
&
transects
);
const
char
*
CircularGenerator
::
settingsGroup
=
"CircularGenerator"
;
const
char
*
CircularGenerator
::
settingsGroup
=
"CircularGenerator"
;
const
char
*
CircularGenerator
::
typeString
=
"CircularGenerator"
;
REGISTER_GENERATOR
(
CircularGenerator
::
typeString
,
creator
)
CircularGenerator
::
CircularGenerator
(
QObject
*
parent
)
CircularGenerator
::
CircularGenerator
(
QObject
*
parent
)
:
CircularGenerator
(
nullptr
,
parent
)
{}
:
GeneratorBase
(
parent
),
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/CircularGenerator.SettingsGroup.json"
),
this
)),
_distance
(
settingsGroup
,
_metaDataMap
[
distanceKey
]),
_deltaAlpha
(
settingsGroup
,
_metaDataMap
[
deltaAlphaKey
]),
_minLength
(
settingsGroup
,
_metaDataMap
[
minLengthKey
]),
_measurementArea
(
nullptr
)
{
init
();
}
CircularGenerator
::
CircularGenerator
(
GeneratorBase
::
Data
d
,
QObject
*
parent
)
CircularGenerator
::
CircularGenerator
(
GeneratorBase
::
Data
d
,
QObject
*
parent
)
:
GeneratorBase
(
d
,
parent
),
:
GeneratorBase
(
d
,
parent
),
...
@@ -54,28 +61,20 @@ CircularGenerator::CircularGenerator(GeneratorBase::Data d, QObject *parent)
...
@@ -54,28 +61,20 @@ CircularGenerator::CircularGenerator(GeneratorBase::Data d, QObject *parent)
_deltaAlpha
(
settingsGroup
,
_metaDataMap
[
deltaAlphaKey
]),
_deltaAlpha
(
settingsGroup
,
_metaDataMap
[
deltaAlphaKey
]),
_minLength
(
settingsGroup
,
_metaDataMap
[
minLengthKey
]),
_minLength
(
settingsGroup
,
_metaDataMap
[
minLengthKey
]),
_measurementArea
(
nullptr
)
{
_measurementArea
(
nullptr
)
{
connect
(
this
->
distance
(),
&
Fact
::
rawValueChanged
,
this
,
init
();
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
deltaAlpha
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
minLength
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
,
&
CircularGenerator
::
referenceChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
setName
(
tr
(
"Circular Generator"
));
}
}
QString
CircularGenerator
::
editorQml
()
{
QString
CircularGenerator
::
editorQml
()
const
{
return
QStringLiteral
(
"CircularGeneratorEditor.qml"
);
return
QStringLiteral
(
"CircularGeneratorEditor.qml"
);
}
}
QString
CircularGenerator
::
mapVisualQml
()
{
QString
CircularGenerator
::
mapVisualQml
()
const
{
return
QStringLiteral
(
"CircularGeneratorMapVisual.qml"
);
return
QStringLiteral
(
"CircularGeneratorMapVisual.qml"
);
}
}
QString
CircularGenerator
::
abbreviation
()
{
return
tr
(
"C. Gen."
);
}
QString
CircularGenerator
::
abbreviation
()
const
{
return
tr
(
"C. Gen."
);
}
QString
CircularGenerator
::
type
()
{
return
generatorType
;
}
QString
CircularGenerator
::
type
()
const
{
return
typeString
;
}
bool
CircularGenerator
::
get
(
Generator
&
generator
)
{
bool
CircularGenerator
::
get
(
Generator
&
generator
)
{
if
(
this
->
_d
)
{
if
(
this
->
_d
)
{
...
@@ -327,19 +326,21 @@ void CircularGenerator::resetReferenceIfInvalid() {
...
@@ -327,19 +326,21 @@ void CircularGenerator::resetReferenceIfInvalid() {
}
}
void
CircularGenerator
::
resetReference
()
{
void
CircularGenerator
::
resetReference
()
{
auto
measurementArea
=
if
(
this
->
_d
!=
nullptr
)
{
getGeoArea
<
const
MeasurementArea
*>
(
*
this
->
_d
->
areaList
());
auto
measurementArea
=
getGeoArea
<
const
MeasurementArea
*>
(
*
this
->
_d
->
areaList
());
if
(
measurementArea
!=
nullptr
)
{
if
(
measurementArea
!=
nullptr
)
{
if
(
measurementArea
->
center
().
isValid
())
{
if
(
measurementArea
->
center
().
isValid
())
{
setReference
(
measurementArea
->
center
());
setReference
(
measurementArea
->
center
());
}
else
{
qCWarning
(
CircularGeneratorLog
)
<<
"measurement area center"
<<
measurementArea
->
center
();
}
}
else
{
}
else
{
qC
Warnin
g
(
CircularGeneratorLog
)
qC
Debu
g
(
CircularGeneratorLog
)
<<
"
measurement area center"
<<
measurementArea
->
center
()
;
<<
"
resetReference(): measurement area == nullptr"
;
}
}
}
else
{
qCDebug
(
CircularGeneratorLog
)
<<
"resetReference(): measurement area == nullptr"
;
}
}
}
}
...
@@ -350,8 +351,34 @@ Fact *CircularGenerator::deltaAlpha() { return &_deltaAlpha; }
...
@@ -350,8 +351,34 @@ Fact *CircularGenerator::deltaAlpha() { return &_deltaAlpha; }
Fact
*
CircularGenerator
::
minLength
()
{
return
&
_minLength
;
}
Fact
*
CircularGenerator
::
minLength
()
{
return
&
_minLength
;
}
void
CircularGenerator
::
onAreaListChanged
()
{
void
CircularGenerator
::
onAreaListChanged
()
{
auto
*
measurementArea
=
getGeoArea
<
MeasurementArea
*>
(
*
this
->
_d
->
areaList
());
if
(
this
->
_d
!=
nullptr
)
{
setMeasurementArea
(
measurementArea
);
auto
*
measurementArea
=
getGeoArea
<
MeasurementArea
*>
(
*
this
->
_d
->
areaList
());
setMeasurementArea
(
measurementArea
);
}
}
void
CircularGenerator
::
onDataChanged
()
{
if
(
this
->
_d
!=
nullptr
)
{
connect
(
this
->
_d
,
&
AreaData
::
areaListChanged
,
this
,
&
CircularGenerator
::
onAreaListChanged
);
onAreaListChanged
();
}
}
void
CircularGenerator
::
init
()
{
connect
(
this
->
distance
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
deltaAlpha
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
minLength
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
,
&
CircularGenerator
::
referenceChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
,
&
CircularGenerator
::
dataChanged
,
this
,
&
CircularGenerator
::
onDataChanged
);
onDataChanged
();
setName
(
tr
(
"Circular Generator"
));
}
}
void
CircularGenerator
::
setMeasurementArea
(
MeasurementArea
*
area
)
{
void
CircularGenerator
::
setMeasurementArea
(
MeasurementArea
*
area
)
{
...
...
src/MeasurementComplexItem/CircularGenerator.h
View file @
f778e405
...
@@ -20,11 +20,11 @@ public:
...
@@ -20,11 +20,11 @@ public:
Q_PROPERTY
(
Fact
*
deltaAlpha
READ
deltaAlpha
CONSTANT
)
Q_PROPERTY
(
Fact
*
deltaAlpha
READ
deltaAlpha
CONSTANT
)
Q_PROPERTY
(
Fact
*
minLength
READ
minLength
CONSTANT
)
Q_PROPERTY
(
Fact
*
minLength
READ
minLength
CONSTANT
)
virtual
QString
editorQml
()
override
;
virtual
QString
editorQml
()
const
override
;
virtual
QString
mapVisualQml
()
override
;
virtual
QString
mapVisualQml
()
const
override
;
virtual
QString
abbreviation
()
override
;
virtual
QString
abbreviation
()
const
override
;
virtual
QString
type
()
override
;
virtual
QString
type
()
const
override
;
virtual
bool
get
(
Generator
&
generator
)
override
;
virtual
bool
get
(
Generator
&
generator
)
override
;
...
@@ -47,6 +47,7 @@ public:
...
@@ -47,6 +47,7 @@ public:
virtual
bool
load
(
const
QJsonObject
&
obj
,
QString
&
guiErrorMessage
)
override
;
virtual
bool
load
(
const
QJsonObject
&
obj
,
QString
&
guiErrorMessage
)
override
;
static
const
char
*
settingsGroup
;
static
const
char
*
settingsGroup
;
static
const
char
*
typeString
;
signals:
signals:
void
referenceChanged
();
void
referenceChanged
();
...
@@ -55,8 +56,12 @@ public slots:
...
@@ -55,8 +56,12 @@ public slots:
Q_INVOKABLE
void
resetReferenceIfInvalid
();
Q_INVOKABLE
void
resetReferenceIfInvalid
();
Q_INVOKABLE
void
resetReference
();
Q_INVOKABLE
void
resetReference
();
private:
private
slots
:
void
onAreaListChanged
();
void
onAreaListChanged
();
void
onDataChanged
();
private:
void
init
();
void
setMeasurementArea
(
MeasurementArea
*
area
);
void
setMeasurementArea
(
MeasurementArea
*
area
);
QGeoCoordinate
_reference
;
QGeoCoordinate
_reference
;
...
...
src/MeasurementComplexItem/GeneratorBase.cc
View file @
f778e405
...
@@ -11,20 +11,18 @@ GeneratorBase::GeneratorBase(QObject *parent)
...
@@ -11,20 +11,18 @@ GeneratorBase::GeneratorBase(QObject *parent)
:
GeneratorBase
(
nullptr
,
parent
)
{}
:
GeneratorBase
(
nullptr
,
parent
)
{}
GeneratorBase
::
GeneratorBase
(
GeneratorBase
::
Data
d
,
QObject
*
parent
)
GeneratorBase
::
GeneratorBase
(
GeneratorBase
::
Data
d
,
QObject
*
parent
)
:
QObject
(
parent
),
_d
(
d
)
{
:
QObject
(
parent
),
_d
(
d
)
{}
establishConnections
();
}
GeneratorBase
::~
GeneratorBase
()
{}
GeneratorBase
::~
GeneratorBase
()
{}
bool
GeneratorBase
::
save
(
QJsonObject
&
obj
)
const
{
bool
GeneratorBase
::
save
(
QJsonObject
&
obj
)
const
{
obj
[
typeKey
]
=
type
();
obj
[
typeKey
]
=
t
his
->
t
ype
();
obj
[
name
]
=
name
();
obj
[
name
Key
]
=
this
->
name
();
return
true
;
return
true
;
}
}
bool
GeneratorBase
::
load
(
const
QJsonObject
&
obj
,
QString
&
errorString
)
{
bool
GeneratorBase
::
load
(
const
QJsonObject
&
obj
,
QString
&
errorString
)
{
if
(
obj
.
contains
[
nameKey
]
&&
obj
[
nameKey
].
isString
())
{
if
(
obj
.
contains
(
nameKey
)
&&
obj
[
nameKey
].
isString
())
{
setName
(
obj
[
nameKey
].
toString
());
setName
(
obj
[
nameKey
].
toString
());
return
true
;
return
true
;
}
else
{
}
else
{
...
@@ -46,18 +44,12 @@ void GeneratorBase::setName(const QString &name) {
...
@@ -46,18 +44,12 @@ void GeneratorBase::setName(const QString &name) {
GeneratorBase
::
Data
GeneratorBase
::
data
()
const
{
return
_d
;
}
GeneratorBase
::
Data
GeneratorBase
::
data
()
const
{
return
_d
;
}
void
GeneratorBase
::
setData
(
Data
d
)
{
void
GeneratorBase
::
setData
(
Data
d
)
{
if
(
d
!=
_d
&&
d
!=
nullptr
)
{
if
(
d
!=
_d
)
{
deleteConnections
();
_d
=
d
;
_d
=
d
;
establishConnections
();
emit
dataChanged
();
emit
dataChanged
();
}
}
}
}
void
GeneratorBase
::
establishConnections
()
{}
void
GeneratorBase
::
deleteConnections
()
{}
GeneratorFactory
::
GeneratorFactory
()
{}
GeneratorFactory
::
GeneratorFactory
()
{}
GeneratorFactory
*
GeneratorFactory
::
createInstance
()
{
GeneratorFactory
*
GeneratorFactory
::
createInstance
()
{
...
@@ -112,14 +104,14 @@ GeneratorBase *GeneratorFactory::create(const QJsonObject &jsonGenerator,
...
@@ -112,14 +104,14 @@ GeneratorBase *GeneratorFactory::create(const QJsonObject &jsonGenerator,
return
nullptr
;
return
nullptr
;
}
}
}
else
{
}
else
{
errorMessage
.
append
(
QObject
::
tr
(
"Not able to create generator of type"
)
+
errorMessage
.
append
(
" "
+
QObject
::
tr
(
"Not able to create generator of type.
\n
"
)
+
" "
+
jsonGenerator
[
GeneratorBase
::
typeKey
].
toString
());
jsonGenerator
[
GeneratorBase
::
typeKey
].
toString
());
return
nullptr
;
return
nullptr
;
}
}
}
else
{
}
else
{
errorMessage
.
append
(
QObject
::
tr
(
errorMessage
.
append
(
QObject
::
tr
(
"Not able to load Generator. Impossible to determine type."
));
"Not able to load Generator. Impossible to determine type.
\n
"
));
return
nullptr
;
return
nullptr
;
}
}
}
}
...
...
src/MeasurementComplexItem/GeneratorBase.h
View file @
f778e405
...
@@ -53,8 +53,6 @@ signals:
...
@@ -53,8 +53,6 @@ signals:
void
nameChanged
();
void
nameChanged
();
protected:
protected:
virtual
void
establishConnections
();
virtual
void
deleteConnections
();
Data
_d
;
Data
_d
;
QString
_name
;
QString
_name
;
...
@@ -87,7 +85,7 @@ private:
...
@@ -87,7 +85,7 @@ private:
#define REGISTER_GENERATOR(type, creator) \
#define REGISTER_GENERATOR(type, creator) \
namespace { \
namespace { \
auto registered
_##type =
\
auto registered
=
\
GeneratorFactory::instance() -> registerGenerator(type, creator); \
GeneratorFactory::instance() -> registerGenerator(type, creator); \
}
}
}
// namespace routing
}
// namespace routing
src/MeasurementComplexItem/LinearGenerator.cpp
View file @
f778e405
...
@@ -14,8 +14,6 @@
...
@@ -14,8 +14,6 @@
namespace
routing
{
namespace
routing
{
namespace
{
namespace
{
const
QString
generatorType
=
"LinearGenerator"
;
GeneratorBase
*
creator
(
QObject
*
parent
)
{
return
new
LinearGenerator
(
parent
);
}
GeneratorBase
*
creator
(
QObject
*
parent
)
{
return
new
LinearGenerator
(
parent
);
}
const
char
*
distanceKey
=
"TransectDistance"
;
const
char
*
distanceKey
=
"TransectDistance"
;
...
@@ -23,7 +21,6 @@ const char *alphaKey = "Alpha";
...
@@ -23,7 +21,6 @@ const char *alphaKey = "Alpha";
const
char
*
minLengthKey
=
"MinLength"
;
const
char
*
minLengthKey
=
"MinLength"
;
}
// namespace
}
// namespace
REGISTER_GENERATOR
(
generatorType
,
creator
)
QGC_LOGGING_CATEGORY
(
LinearGeneratorLog
,
"LinearGeneratorLog"
)
QGC_LOGGING_CATEGORY
(
LinearGeneratorLog
,
"LinearGeneratorLog"
)
bool
linearTransects
(
const
snake
::
FPolygon
&
polygon
,
bool
linearTransects
(
const
snake
::
FPolygon
&
polygon
,
...
@@ -32,9 +29,20 @@ bool linearTransects(const snake::FPolygon &polygon,
...
@@ -32,9 +29,20 @@ bool linearTransects(const snake::FPolygon &polygon,
snake
::
Length
minLength
,
snake
::
Transects
&
transects
);
snake
::
Length
minLength
,
snake
::
Transects
&
transects
);
const
char
*
LinearGenerator
::
settingsGroup
=
"LinearGenerator"
;
const
char
*
LinearGenerator
::
settingsGroup
=
"LinearGenerator"
;
const
char
*
LinearGenerator
::
typeString
=
"LinearGenerator"
;
REGISTER_GENERATOR
(
"LinearGenerator"
,
creator
)
LinearGenerator
::
LinearGenerator
(
QObject
*
parent
)
LinearGenerator
::
LinearGenerator
(
QObject
*
parent
)
:
LinearGenerator
(
nullptr
,
parent
)
{}
:
GeneratorBase
(
nullptr
,
parent
),
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/LinearGenerator.SettingsGroup.json"
),
this
)),
_distance
(
settingsGroup
,
_metaDataMap
[
distanceKey
]),
_alpha
(
settingsGroup
,
_metaDataMap
[
alphaKey
]),
_minLength
(
settingsGroup
,
_metaDataMap
[
minLengthKey
]),
_measurementArea
(
nullptr
)
{
init
();
}
LinearGenerator
::
LinearGenerator
(
GeneratorBase
::
Data
d
,
QObject
*
parent
)
LinearGenerator
::
LinearGenerator
(
GeneratorBase
::
Data
d
,
QObject
*
parent
)
:
GeneratorBase
(
d
,
parent
),
:
GeneratorBase
(
d
,
parent
),
...
@@ -43,30 +51,24 @@ LinearGenerator::LinearGenerator(GeneratorBase::Data d, QObject *parent)
...
@@ -43,30 +51,24 @@ LinearGenerator::LinearGenerator(GeneratorBase::Data d, QObject *parent)
_distance
(
settingsGroup
,
_metaDataMap
[
distanceKey
]),
_distance
(
settingsGroup
,
_metaDataMap
[
distanceKey
]),
_alpha
(
settingsGroup
,
_metaDataMap
[
alphaKey
]),
_alpha
(
settingsGroup
,
_metaDataMap
[
alphaKey
]),
_minLength
(
settingsGroup
,
_metaDataMap
[
minLengthKey
]),
_minLength
(
settingsGroup
,
_metaDataMap
[
minLengthKey
]),
_measurementArea
(
nullptr
),
_safeArea
(
nullptr
)
{
_measurementArea
(
nullptr
)
{
connect
(
this
->
distance
(),
&
Fact
::
rawValueChanged
,
this
,
init
();
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
alpha
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
minLength
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
_d
,
&
AreaData
::
areaListChanged
,
this
,
&
LinearGenerator
::
onAreaListChanged
);
setName
(
tr
(
"Linear Generator"
));
}
}
QString
LinearGenerator
::
editorQml
()
{
QString
LinearGenerator
::
editorQml
()
const
{
return
QStringLiteral
(
"LinearGeneratorEditor.qml"
);
return
QStringLiteral
(
"LinearGeneratorEditor.qml"
);
}
}
QString
LinearGenerator
::
mapVisualQml
()
{
return
QStringLiteral
(
""
);
}
QString
LinearGenerator
::
mapVisualQml
()
const
{
return
QStringLiteral
(
""
);
}
QString
LinearGenerator
::
abbreviation
()
{
return
QStringLiteral
(
"L. Gen."
);
}
QString
LinearGenerator
::
abbreviation
()
const
{
return
QStringLiteral
(
"L. Gen."
);
}
QString
LinearGenerator
::
type
()
{
return
generatorType
;
}
QString
LinearGenerator
::
type
()
const
{
return
typeString
;
}
bool
LinearGenerator
::
get
(
Generator
&
generator
)
{
bool
LinearGenerator
::
get
(
Generator
&
generator
)
{
if
(
_d
)
{
if
(
_d
!=
nullptr
)
{
if
(
this
->
_d
->
isCorrect
())
{
if
(
this
->
_d
->
isCorrect
())
{
// Prepare data.
// Prepare data.
auto
origin
=
this
->
_d
->
origin
();
auto
origin
=
this
->
_d
->
origin
();
...
@@ -268,9 +270,33 @@ Fact *LinearGenerator::alpha() { return &_alpha; }
...
@@ -268,9 +270,33 @@ Fact *LinearGenerator::alpha() { return &_alpha; }
Fact
*
LinearGenerator
::
minLength
()
{
return
&
_minLength
;
}
Fact
*
LinearGenerator
::
minLength
()
{
return
&
_minLength
;
}
void
LinearGenerator
::
init
()
{
connect
(
this
->
distance
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
alpha
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
->
minLength
(),
&
Fact
::
rawValueChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
connect
(
this
,
&
LinearGenerator
::
dataChanged
,
this
,
&
LinearGenerator
::
onDataChanged
);
onDataChanged
();
setName
(
tr
(
"Linear Generator"
));
}
void
LinearGenerator
::
onAreaListChanged
()
{
void
LinearGenerator
::
onAreaListChanged
()
{
auto
*
measurementArea
=
getGeoArea
<
MeasurementArea
*>
(
*
this
->
_d
->
areaList
());
if
(
this
->
_d
!=
nullptr
)
{
setMeasurementArea
(
measurementArea
);
auto
*
measurementArea
=
getGeoArea
<
MeasurementArea
*>
(
*
this
->
_d
->
areaList
());
setMeasurementArea
(
measurementArea
);
}
}
void
LinearGenerator
::
onDataChanged
()
{
if
(
this
->
_d
!=
nullptr
)
{
connect
(
this
->
_d
,
&
AreaData
::
areaListChanged
,
this
,
&
LinearGenerator
::
onAreaListChanged
);
onAreaListChanged
();
}
}
}
void
LinearGenerator
::
setMeasurementArea
(
MeasurementArea
*
area
)
{
void
LinearGenerator
::
setMeasurementArea
(
MeasurementArea
*
area
)
{
...
...
src/MeasurementComplexItem/LinearGenerator.h
View file @
f778e405
...
@@ -19,11 +19,11 @@ public:
...
@@ -19,11 +19,11 @@ public:
Q_PROPERTY
(
Fact
*
alpha
READ
alpha
CONSTANT
)
Q_PROPERTY
(
Fact
*
alpha
READ
alpha
CONSTANT
)
Q_PROPERTY
(
Fact
*
minLength
READ
minLength
CONSTANT
)
Q_PROPERTY
(
Fact
*
minLength
READ
minLength
CONSTANT
)
virtual
QString
editorQml
()
override
;
virtual
QString
editorQml
()
const
override
;
virtual
QString
mapVisualQml
()
override
;
virtual
QString
mapVisualQml
()
const
override
;
virtual
QString
abbreviation
()
override
;
virtual
QString
abbreviation
()
const
override
;
virtual
QString
type
()
override
;
virtual
QString
type
()
const
override
;
virtual
bool
get
(
Generator
&
generator
)
override
;
virtual
bool
get
(
Generator
&
generator
)
override
;
...
@@ -43,9 +43,14 @@ public:
...
@@ -43,9 +43,14 @@ public:
Fact
*
minLength
();
Fact
*
minLength
();
static
const
char
*
settingsGroup
;
static
const
char
*
settingsGroup
;
static
const
char
*
typeString
;
private:
private
slots
:
void
onAreaListChanged
();
void
onAreaListChanged
();
void
onDataChanged
();
private:
void
init
();
void
setMeasurementArea
(
MeasurementArea
*
area
);
void
setMeasurementArea
(
MeasurementArea
*
area
);
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
...
...
src/MeasurementComplexItem/MeasurementComplexItem.cc
View file @
f778e405
This diff is collapsed.
Click to expand it.
src/MeasurementComplexItem/MeasurementComplexItem.h
View file @
f778e405
...
@@ -123,7 +123,9 @@ public:
...
@@ -123,7 +123,9 @@ public:
//! editingStart() if it is invalid. Triggers a route update.
//! editingStart() if it is invalid. Triggers a route update.
//!
//!
//! \param doUpdate No route update will be triggered if false, route update
//! \param doUpdate No route update will be triggered if false, route update
//! will eventually be triggered if true. \return Returns true if a route
//! will eventually be triggered if true.
//!
//! \return Returns true if a route
//! update was triggered, false either.
//! update was triggered, false either.
//!
//!
Q_INVOKABLE
bool
stopEditing
(
bool
doUpdate
=
true
);
Q_INVOKABLE
bool
stopEditing
(
bool
doUpdate
=
true
);
...
@@ -145,7 +147,7 @@ public:
...
@@ -145,7 +147,7 @@ public:
QStringList
variantNames
()
const
;
QStringList
variantNames
()
const
;
bool
calculating
()
const
;
bool
calculating
()
const
;
bool
editing
()
const
;
bool
editing
()
const
;
// set to true on creation
bool
idle
()
const
;
bool
idle
()
const
;
bool
followTerrain
()
const
;
bool
followTerrain
()
const
;
...
...
src/MeasurementComplexItem/qml/AreaDataEditor.qml
View file @
f778e405
...
@@ -23,11 +23,8 @@ GridLayout {
...
@@ -23,11 +23,8 @@ GridLayout {
Component.onCompleted
:
{
Component.onCompleted
:
{
console
.
assert
(
missionItem
!==
undefined
,
"
please set the missionItem property
"
)
console
.
assert
(
missionItem
!==
undefined
,
"
please set the missionItem property
"
)
checkedChangedHandler
()
}
}
onCheckedChanged
:
checkedChangedHandler
()
ExclusiveGroup
{
id
:
areaGroup
}
ExclusiveGroup
{
id
:
areaGroup
}
Repeater
{
Repeater
{
...
@@ -115,13 +112,5 @@ GridLayout {
...
@@ -115,13 +112,5 @@ GridLayout {
_areaData
.
intersection
()
_areaData
.
intersection
()
}
}
}
}
function
checkedChangedHandler
(){
if
(
_root
.
checked
){
missionItem
.
startEditing
()
}
else
{
missionItem
.
stopEditing
()
}
}
}
}
src/MeasurementComplexItem/qml/MeasurementItemEditor.qml
View file @
f778e405
...
@@ -65,7 +65,7 @@ Rectangle {
...
@@ -65,7 +65,7 @@ Rectangle {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.columnSpan
:
2
Layout.columnSpan
:
2
onClicked
:{
onClicked
:{
areaDataEditor
.
checked
=
true
_missionItem
.
startEditing
()
}
}
}
}
...
@@ -75,7 +75,7 @@ Rectangle {
...
@@ -75,7 +75,7 @@ Rectangle {
visible
:
areaDataEditor
.
visible
visible
:
areaDataEditor
.
visible
onClicked
:
{
onClicked
:
{
if
(
_areaData
.
isCorrect
()){
if
(
_areaData
.
isCorrect
()){
parameterEditor
.
checked
=
true
_missionItem
.
stopEditing
()
}
}
}
}
}
}
...
@@ -86,32 +86,18 @@ Rectangle {
...
@@ -86,32 +86,18 @@ Rectangle {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onClicked
:{
onClicked
:{
missionItem
.
abortEditing
()
missionItem
.
abortEditing
()
parameterEditor
.
checked
=
true
}
}
}
}
}
// editorSelector
}
// editorSelector
ExclusiveGroup
{
id
:
editorGroup
}
MCI.ParameterEditor
{
MCI.ParameterEditor
{
id
:
parameterEditor
id
:
parameterEditor
missionItem
:
_root
.
_missionItem
missionItem
:
_root
.
_missionItem
availableWidth
:
mainColumn
.
width
availableWidth
:
mainColumn
.
width
checked
:
!
_missionItem
.
editing
visible
:
checked
visible
:
checked
property
ExclusiveGroup
group
:
editorGroup
onGroupChanged
:
{
if
(
group
){
group
.
bindCheckable
(
parameterEditor
)
}
}
Component
.
onCompleted
:
{
checked
=
false
}
}
}
MCI.AreaDataEditor
{
MCI.AreaDataEditor
{
...
@@ -119,19 +105,8 @@ Rectangle {
...
@@ -119,19 +105,8 @@ Rectangle {
missionItem
:
_root
.
_missionItem
missionItem
:
_root
.
_missionItem
availableWidth
:
mainColumn
.
width
availableWidth
:
mainColumn
.
width
checked
:
_missionItem
.
editing
visible
:
checked
visible
:
checked
property
ExclusiveGroup
group
:
editorGroup
onGroupChanged
:
{
if
(
group
){
group
.
bindCheckable
(
areaDataEditor
)
}
}
Component
.
onCompleted
:
{
checked
=
true
}
}
}
}
// main Column
}
// main Column
...
...
src/MeasurementComplexItem/qml/MeasurementItemMapVisual.qml
View file @
f778e405
...
@@ -55,9 +55,12 @@ Item {
...
@@ -55,9 +55,12 @@ Item {
Component.onCompleted
:
{
Component.onCompleted
:
{
console
.
assert
(
map
!=
undefined
,
"
please set the map property
"
)
console
.
assert
(
map
!=
undefined
,
"
please set the map property
"
)
var
bbox
=
boundingBox
()
_missionItem
.
areaData
.
initialize
(
bbox
[
0
],
bbox
[
1
])
if
(
!
_missionItem
.
areaData
.
initialized
()){
// _addEntryCoordinate()
var
bbox
=
boundingBox
()
_missionItem
.
areaData
.
initialize
(
bbox
[
0
],
bbox
[
1
])
}
// _addEntryCoordinate()
// _addExitCoordinate()
// _addExitCoordinate()
_addTransects
()
_addTransects
()
_addGeneratorVisuals
()
_addGeneratorVisuals
()
...
@@ -174,7 +177,7 @@ Item {
...
@@ -174,7 +177,7 @@ Item {
// Generator visuals
// Generator visuals
function
_addGeneratorVisuals
(){
function
_addGeneratorVisuals
(){
if
(
_generator
.
mapVisualQml
&&
!
_generatorObject
)
{
if
(
_generator
&&
_generator
.
mapVisualQml
&&
!
_generatorObject
)
{
var
component
=
Qt
.
createComponent
(
_generator
.
mapVisualQml
)
var
component
=
Qt
.
createComponent
(
_generator
.
mapVisualQml
)
if
(
component
.
status
===
Component
.
Error
)
{
if
(
component
.
status
===
Component
.
Error
)
{
console
.
log
(
"
Error loading Qml:
"
,
console
.
log
(
"
Error loading Qml:
"
,
...
...
src/MeasurementComplexItem/qml/ParameterEditor.qml
View file @
f778e405
...
@@ -187,7 +187,7 @@ ColumnLayout {
...
@@ -187,7 +187,7 @@ ColumnLayout {
}
// indicator column
}
// indicator column
function
_addGeneratorEditor
(){
function
_addGeneratorEditor
(){
if
(
_generator
.
editorQml
&&
!
_generatorEditor
)
{
if
(
_generator
&&
_generator
.
editorQml
&&
!
_generatorEditor
)
{
var
component
=
Qt
.
createComponent
(
_generator
.
editorQml
)
var
component
=
Qt
.
createComponent
(
_generator
.
editorQml
)
if
(
component
.
status
===
Component
.
Error
)
{
if
(
component
.
status
===
Component
.
Error
)
{
console
.
log
(
"
Error loading Qml:
"
,
console
.
log
(
"
Error loading Qml:
"
,
...
...
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