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
a4d09405
Commit
a4d09405
authored
Jan 31, 2021
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
670dffae
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
324 additions
and
213 deletions
+324
-213
MeasurementComplexItem.cc
src/MeasurementComplexItem/MeasurementComplexItem.cc
+22
-9
MeasurementComplexItem.h
src/MeasurementComplexItem/MeasurementComplexItem.h
+15
-0
NemoInterface.cpp
src/MeasurementComplexItem/NemoInterface.cpp
+248
-194
NemoInterface.h
src/MeasurementComplexItem/NemoInterface.h
+31
-9
MeasurementComplexItem.SettingsGroup.json
...omplexItem/json/MeasurementComplexItem.SettingsGroup.json
+7
-0
QGCApplication.cc
src/QGCApplication.cc
+1
-1
No files found.
src/MeasurementComplexItem/MeasurementComplexItem.cc
View file @
a4d09405
...
...
@@ -41,6 +41,7 @@ const char *variantNamesKey = "VariantNames";
const
char
*
generatorArrayKey
=
"GeneratorArray"
;
const
char
*
variantArrayKey
=
"VariantArray"
;
const
char
*
generatorIndexKey
=
"GeneratorIndex"
;
const
char
*
connectionsStringKey
=
"ConnectionString"
;
}
// namespace
MeasurementComplexItem
::
MeasurementComplexItem
(
...
...
@@ -55,7 +56,8 @@ MeasurementComplexItem::MeasurementComplexItem(
_variantIndex
(
settingsGroup
,
_metaDataMap
[
variantIndexKey
]),
_pAreaData
(
new
AreaData
(
this
)),
_pEditorData
(
new
AreaData
(
this
)),
_pCurrentData
(
_pAreaData
),
_holdProgress
(
false
),
_pGenerator
(
nullptr
),
_pWorker
(
new
RoutingThread
(
this
))
{
_pWorker
(
new
RoutingThread
(
this
)),
_nemoCString
(
settingsGroup
,
_metaDataMap
[
connectionsStringKey
])
{
// Setup altitude.
_altitude
.
setRawValue
(
qgcApp
()
...
...
@@ -91,17 +93,17 @@ MeasurementComplexItem::MeasurementComplexItem(
&
MeasurementComplexItem
::
_storeRoutingData
);
// Connect coordinate and exitCoordinate.
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
this
,
[
this
]
{
emit
this
->
coordinateChanged
(
this
->
coordinate
());
});
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
this
,
[
this
]
{
emit
this
->
exitCoordinateChanged
(
this
->
exitCoordinate
());
});
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
[
this
]
{
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
this
,
[
this
]
{
emit
this
->
exitCoordinateSameAsEntryChanged
(
this
->
exitCoordinateSameAsEntry
());
});
// Connect isIncomplete.
connect
(
this
,
&
MeasurementComplexItem
::
idleChanged
,
[
this
]
{
connect
(
this
,
&
MeasurementComplexItem
::
idleChanged
,
this
,
[
this
]
{
if
(
this
->
idle
())
{
if
(
this
->
route
().
size
()
>
0
&&
this
->
_isIncomplete
==
true
)
{
this
->
_isIncomplete
=
false
;
...
...
@@ -124,14 +126,14 @@ MeasurementComplexItem::MeasurementComplexItem(
&
MeasurementComplexItem
::
_updateFlightpathSegments
);
// Connect complexDistance.
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
connect
(
this
,
&
MeasurementComplexItem
::
routeChanged
,
this
,
[
this
]
{
emit
this
->
complexDistanceChanged
();
});
resetGenerators
();
startEditing
();
// connect to nemo interface
connect
(
pNemoInterface
,
&
Nemo
I
nterface
::
progressChanged
,
this
,
connect
(
pNemoInterface
,
&
Nemo
i
nterface
::
progressChanged
,
this
,
&
MeasurementComplexItem
::
_onNewProgress
);
}
...
...
@@ -773,6 +775,17 @@ void MeasurementComplexItem::_onAltitudeChanged() {
}
}
QString
MeasurementComplexItem
::
nemoError
()
const
{
return
_nemoError
;
}
void
MeasurementComplexItem
::
_setNemoError
(
const
QString
&
nemoError
)
{
if
(
_nemoError
!=
nemoError
)
{
_nemoError
=
nemoError
;
emit
nemoErrorChanged
();
}
}
Fact
*
MeasurementComplexItem
::
nemoCString
()
{
return
&
_nemoCString
;
}
bool
MeasurementComplexItem
::
holdProgress
()
const
{
return
_holdProgress
;
}
void
MeasurementComplexItem
::
setHoldProgress
(
bool
holdProgress
)
{
...
...
@@ -781,10 +794,10 @@ void MeasurementComplexItem::setHoldProgress(bool holdProgress) {
emit
holdProgressChanged
();
if
(
_holdProgress
)
{
disconnect
(
pNemoInterface
,
&
Nemo
I
nterface
::
progressChanged
,
this
,
disconnect
(
pNemoInterface
,
&
Nemo
i
nterface
::
progressChanged
,
this
,
&
MeasurementComplexItem
::
_onNewProgress
);
}
else
{
connect
(
pNemoInterface
,
&
Nemo
I
nterface
::
progressChanged
,
this
,
connect
(
pNemoInterface
,
&
Nemo
i
nterface
::
progressChanged
,
this
,
&
MeasurementComplexItem
::
_onNewProgress
);
_onNewProgress
(
pNemoInterface
->
getProgress
());
}
...
...
src/MeasurementComplexItem/MeasurementComplexItem.h
View file @
a4d09405
...
...
@@ -14,6 +14,7 @@
class
RoutingThread
;
class
RoutingResult
;
class
Nemointerface
;
namespace
routing
{
class
GeneratorBase
;
...
...
@@ -51,6 +52,8 @@ public:
Q_PROPERTY
(
int
generatorIndex
READ
generatorIndex
NOTIFY
generatorChanged
)
Q_PROPERTY
(
AreaData
*
areaData
READ
areaData
NOTIFY
areaDataChanged
)
Q_PROPERTY
(
QVariantList
route
READ
route
NOTIFY
routeChanged
)
Q_PROPERTY
(
QString
nemoError
READ
nemoError
NOTIFY
nemoErrorChanged
)
Q_PROPERTY
(
Fact
*
nemoCString
READ
nemoCString
CONSTANT
)
Q_INVOKABLE
void
reverseRoute
(
void
);
...
...
@@ -224,6 +227,10 @@ public:
bool
holdProgress
()
const
;
void
setHoldProgress
(
bool
holdProgress
);
QString
nemoError
()
const
;
Fact
*
nemoCString
();
signals:
void
variantNamesChanged
();
...
...
@@ -238,6 +245,8 @@ signals:
void
routeChanged
();
void
holdProgressChanged
();
void
nemoErrorChanged
();
private
slots
:
// Worker functions.
...
...
@@ -257,6 +266,7 @@ private:
static
bool
_idle
(
STATE
state
);
void
_updateFlightpathSegments
();
void
_onAltitudeChanged
();
void
_setNemoError
(
const
QString
&
nemoError
);
// Hirarcical stuff.
int
_sequenceNumber
;
...
...
@@ -285,4 +295,9 @@ private:
QVector
<
Variant
>
_variantVector
;
Variant
_route
;
PtrWorker
_pWorker
;
// NemoInterface
std
::
shared_ptr
<
Nemointerface
>
_pNemointerface
;
QString
_nemoError
;
SettingsFact
_nemoCString
;
};
src/MeasurementComplexItem/NemoInterface.cpp
View file @
a4d09405
...
...
@@ -11,6 +11,7 @@
#include <QJsonArray>
#include <QJsonObject>
#include <QQmlEngine>
#include <QTimer>
#include <QUrl>
...
...
@@ -52,7 +53,7 @@
Q_DECLARE_METATYPE
(
ProgressArray
)
QGC_LOGGING_CATEGORY
(
Nemo
InterfaceLog
,
"NemoI
nterfaceLog"
)
QGC_LOGGING_CATEGORY
(
Nemo
interfaceLog
,
"Nemoi
nterfaceLog"
)
#define NO_HEARTBEAT_TIMEOUT 5000 // ms
#define RESTART_INTERVAl 600000 // ms == 10 min
...
...
@@ -98,7 +99,7 @@ typedef ros_bridge::messages::nemo_msgs::heartbeat::Heartbeat Heartbeat;
typedef
nemo_interface
::
TaskDispatcher
Dispatcher
;
typedef
std
::
unique_lock
<
std
::
mutex
>
Lock
;
class
Nemo
I
nterface
::
Impl
{
class
Nemo
i
nterface
::
Impl
{
enum
class
STATE
{
STOPPED
,
START_BRIDGE
,
...
...
@@ -113,7 +114,7 @@ class NemoInterface::Impl {
};
public:
Impl
(
NemoI
nterface
*
p
);
Impl
(
const
QString
&
connectionString
,
Nemoi
nterface
*
p
);
~
Impl
();
void
start
();
...
...
@@ -136,12 +137,13 @@ public:
ProgressArray
getProgress
()
const
;
ProgressArray
getProgress
(
const
IDArray
&
idArray
)
const
;
Nemo
I
nterface
::
STATUS
status
()
const
;
Nemo
i
nterface
::
STATUS
status
()
const
;
bool
running
()
const
;
// thread safe
bool
ready
()
const
;
// thread safe
const
QString
&
infoString
()
const
;
const
QString
&
warningString
()
const
;
const
QString
&
connectionString
()
const
;
private:
void
_doSetup
();
...
...
@@ -167,9 +169,9 @@ private:
static
bool
_userSyncNotSafe
(
STATE
s
);
static
bool
_sysSyncNotSafe
(
STATE
s
);
static
bool
_runningNotSafe
(
STATE
s
);
static
Nemo
I
nterface
::
STATUS
_status
(
STATE
state
);
static
Nemo
i
nterface
::
STATUS
_status
(
STATE
state
);
static
QString
_toString
(
STATE
s
);
static
QString
_toString
(
Nemo
I
nterface
::
STATUS
s
);
static
QString
_toString
(
Nemo
i
nterface
::
STATUS
s
);
// impl functions
bool
_addTilesImpl
(
...
...
@@ -201,10 +203,11 @@ private:
// static and const members
static
const
char
*
_localVersion
;
NemoInterface
*
const
_parent
;
Nemointerface
*
const
_parent
;
const
QString
_connectionString
;
// thread safe members
R
OSBridgePtr
_pR
osbridge
;
R
osbridge
_r
osbridge
;
Dispatcher
_dispatcher
;
// protected by mutex
...
...
@@ -221,51 +224,33 @@ private:
QTimer
_restartTimer
;
};
const
char
*
Nemo
I
nterface
::
Impl
::
_localVersion
(
"V_1.0"
);
const
char
*
Nemo
i
nterface
::
Impl
::
_localVersion
(
"V_1.0"
);
using
StatusMap
=
std
::
map
<
Nemo
I
nterface
::
STATUS
,
QString
>
;
using
StatusMap
=
std
::
map
<
Nemo
i
nterface
::
STATUS
,
QString
>
;
static
StatusMap
statusMap
{
std
::
make_pair
<
Nemo
I
nterface
::
STATUS
,
QString
>
(
Nemo
I
nterface
::
STATUS
::
NOT_CONNECTED
,
"Not Connected"
),
std
::
make_pair
<
Nemo
Interface
::
STATUS
,
QString
>
(
NemoI
nterface
::
STATUS
::
ERROR
,
std
::
make_pair
<
Nemo
i
nterface
::
STATUS
,
QString
>
(
Nemo
i
nterface
::
STATUS
::
NOT_CONNECTED
,
"Not Connected"
),
std
::
make_pair
<
Nemo
interface
::
STATUS
,
QString
>
(
Nemoi
nterface
::
STATUS
::
ERROR
,
"ERROR"
),
std
::
make_pair
<
Nemo
Interface
::
STATUS
,
QString
>
(
NemoI
nterface
::
STATUS
::
SYNC
,
std
::
make_pair
<
Nemo
interface
::
STATUS
,
QString
>
(
Nemoi
nterface
::
STATUS
::
SYNC
,
"Synchronizing"
),
std
::
make_pair
<
Nemo
Interface
::
STATUS
,
QString
>
(
NemoI
nterface
::
STATUS
::
READY
,
std
::
make_pair
<
Nemo
interface
::
STATUS
,
QString
>
(
Nemoi
nterface
::
STATUS
::
READY
,
"Ready"
),
std
::
make_pair
<
NemoInterface
::
STATUS
,
QString
>
(
NemoInterface
::
STATUS
::
TIMEOUT
,
"Timeout"
),
std
::
make_pair
<
NemoInterface
::
STATUS
,
QString
>
(
NemoInterface
::
STATUS
::
WEBSOCKET_DETECTED
,
"Websocket Detected"
)};
NemoInterface
::
Impl
::
Impl
(
NemoInterface
*
p
)
:
_parent
(
p
),
_state
(
STATE
::
STOPPED
)
{
// ROS Bridge.
WimaSettings
*
wimaSettings
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
wimaSettings
();
auto
connectionStringFact
=
wimaSettings
->
rosbridgeConnectionString
();
auto
setConnectionString
=
[
connectionStringFact
,
this
]
{
auto
connectionString
=
connectionStringFact
->
rawValue
().
toString
();
bool
wasRunning
=
this
->
running
();
this
->
stop
();
this
->
_pRosbridge
=
std
::
make_shared
<
Rosbridge
>
(
QUrl
(
QString
(
"ws://"
)
+
connectionString
.
toLocal8Bit
().
data
()));
if
(
wasRunning
)
{
this
->
start
();
}
};
std
::
make_pair
<
Nemointerface
::
STATUS
,
QString
>
(
Nemointerface
::
STATUS
::
TIMEOUT
,
"Timeout"
),
std
::
make_pair
<
Nemointerface
::
STATUS
,
QString
>
(
Nemointerface
::
STATUS
::
WEBSOCKET_DETECTED
,
"Websocket Detected"
)};
connect
(
connectionStringFact
,
&
SettingsFact
::
rawValueChanged
,
setConnectionString
);
setConnectionString
();
Nemointerface
::
Impl
::
Impl
(
const
QString
&
connectionString
,
Nemointerface
*
p
)
:
_parent
(
p
),
_connectionString
(
connectionString
),
_rosbridge
(
QUrl
(
QString
(
"ws://"
)
+
connectionString
)),
_state
(
STATE
::
STOPPED
)
{
// Heartbeat timeout.
connect
(
&
this
->
_timeoutTimer
,
&
QTimer
::
timeout
,
std
::
bind
(
&
Impl
::
_onHeartbeatTimeout
,
this
));
connect
(
this
->
_pRosbridge
.
get
()
,
&
Rosbridge
::
stateChanged
,
this
->
_parent
,
connect
(
&
this
->
_rosbridge
,
&
Rosbridge
::
stateChanged
,
this
->
_parent
,
[
this
]
{
this
->
_onRosbridgeStateChanged
();
});
connect
(
&
this
->
_restartTimer
,
&
QTimer
::
timeout
,
this
->
_parent
,
...
...
@@ -278,9 +263,9 @@ NemoInterface::Impl::Impl(NemoInterface *p)
std
::
call_once
(
flag
,
[]
{
qRegisterMetaType
<
ProgressArray
>
();
});
}
Nemo
Interface
::
Impl
::~
Impl
()
{
this
->
_pRosbridge
->
stop
();
}
Nemo
interface
::
Impl
::~
Impl
()
{
this
->
_rosbridge
.
stop
();
}
void
Nemo
I
nterface
::
Impl
::
start
()
{
void
Nemo
i
nterface
::
Impl
::
start
()
{
Lock
lk
(
this
->
_m
);
if
(
!
_runningNotSafe
(
this
->
_state
))
{
this
->
_setStateNotSafe
(
STATE
::
START_BRIDGE
);
...
...
@@ -288,7 +273,7 @@ void NemoInterface::Impl::start() {
}
}
void
Nemo
I
nterface
::
Impl
::
stop
()
{
void
Nemo
i
nterface
::
Impl
::
stop
()
{
Lock
lk
(
this
->
_m
);
if
(
_runningNotSafe
(
this
->
_state
))
{
this
->
_setStateNotSafe
(
STATE
::
STOPPED
);
...
...
@@ -297,7 +282,7 @@ void NemoInterface::Impl::stop() {
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
Impl
::
addTiles
(
const
TilePtrArray
&
tileArray
)
{
Nemo
i
nterface
::
Impl
::
addTiles
(
const
TilePtrArray
&
tileArray
)
{
using
namespace
nemo_interface
;
// qDebug() << "addTiles called";
...
...
@@ -320,7 +305,7 @@ NemoInterface::Impl::addTiles(const TilePtrArray &tileArray) {
pTileArray
->
push_back
(
pTileCopy
);
pIdArray
->
push_back
(
id
);
}
else
{
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"addTiles(): tile with id: "
<<
pTile
->
id
()
<<
"already added."
;
}
}
...
...
@@ -364,7 +349,7 @@ NemoInterface::Impl::addTiles(const TilePtrArray &tileArray) {
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
Impl
::
removeTiles
(
const
IDArray
&
idArray
)
{
Nemo
i
nterface
::
Impl
::
removeTiles
(
const
IDArray
&
idArray
)
{
using
namespace
nemo_interface
;
// qDebug() << "removeTiles called";
...
...
@@ -382,7 +367,7 @@ NemoInterface::Impl::removeTiles(const IDArray &idArray) {
_localTiles
.
erase
(
it
);
pIdArray
->
push_back
(
id
);
}
else
{
qCDebug
(
Nemo
I
nterfaceLog
)
<<
"removeTiles(): unknown id: "
<<
id
<<
"."
;
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"removeTiles(): unknown id: "
<<
id
<<
"."
;
}
}
if
(
pIdArray
->
size
()
>
0
)
{
...
...
@@ -426,7 +411,7 @@ NemoInterface::Impl::removeTiles(const IDArray &idArray) {
return
p
.
get_future
();
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
Impl
::
clearTiles
()
{
std
::
shared_future
<
QVariant
>
Nemo
i
nterface
::
Impl
::
clearTiles
()
{
using
namespace
nemo_interface
;
// qDebug() << "clearTiles called";
...
...
@@ -472,7 +457,7 @@ std::shared_future<QVariant> NemoInterface::Impl::clearTiles() {
}
}
TileArray
Nemo
I
nterface
::
Impl
::
getTiles
(
const
IDArray
&
idArray
)
const
{
TileArray
Nemo
i
nterface
::
Impl
::
getTiles
(
const
IDArray
&
idArray
)
const
{
TileArray
tileArray
;
Lock
lk
(
this
->
_m
);
...
...
@@ -503,7 +488,7 @@ TileArray NemoInterface::Impl::getTiles(const IDArray &idArray) const {
return
tileArray
;
}
TileArray
Nemo
I
nterface
::
Impl
::
getAllTiles
()
const
{
TileArray
Nemo
i
nterface
::
Impl
::
getAllTiles
()
const
{
TileArray
tileArray
;
Lock
lk
(
this
->
_m
);
...
...
@@ -531,7 +516,7 @@ TileArray NemoInterface::Impl::getAllTiles() const {
return
tileArray
;
}
LogicalArray
Nemo
I
nterface
::
Impl
::
containsTiles
(
const
IDArray
&
idArray
)
const
{
LogicalArray
Nemo
i
nterface
::
Impl
::
containsTiles
(
const
IDArray
&
idArray
)
const
{
LogicalArray
logicalArray
;
Lock
lk
(
this
->
_m
);
...
...
@@ -543,18 +528,18 @@ LogicalArray NemoInterface::Impl::containsTiles(const IDArray &idArray) const {
return
logicalArray
;
}
std
::
size_t
Nemo
I
nterface
::
Impl
::
size
()
const
{
std
::
size_t
Nemo
i
nterface
::
Impl
::
size
()
const
{
Lock
lk
(
this
->
_m
);
return
_localTiles
.
size
();
}
bool
Nemo
I
nterface
::
Impl
::
empty
()
const
{
bool
Nemo
i
nterface
::
Impl
::
empty
()
const
{
Lock
lk
(
this
->
_m
);
return
_localTiles
.
empty
();
}
ProgressArray
Nemo
I
nterface
::
Impl
::
getProgress
()
const
{
ProgressArray
Nemo
i
nterface
::
Impl
::
getProgress
()
const
{
ProgressArray
progressArray
;
Lock
lk
(
this
->
_m
);
...
...
@@ -573,7 +558,7 @@ ProgressArray NemoInterface::Impl::getProgress() const {
return
progressArray
;
}
ProgressArray
Nemo
I
nterface
::
Impl
::
getProgress
(
const
IDArray
&
idArray
)
const
{
ProgressArray
Nemo
i
nterface
::
Impl
::
getProgress
(
const
IDArray
&
idArray
)
const
{
ProgressArray
progressArray
;
Lock
lk
(
this
->
_m
);
...
...
@@ -598,34 +583,34 @@ ProgressArray NemoInterface::Impl::getProgress(const IDArray &idArray) const {
return
progressArray
;
}
Nemo
Interface
::
STATUS
NemoI
nterface
::
Impl
::
status
()
const
{
Nemo
interface
::
STATUS
Nemoi
nterface
::
Impl
::
status
()
const
{
Lock
lk
(
this
->
_m
);
return
_status
(
this
->
_state
);
}
bool
Nemo
I
nterface
::
Impl
::
running
()
const
{
bool
Nemo
i
nterface
::
Impl
::
running
()
const
{
Lock
lk1
(
this
->
_m
);
return
_runningNotSafe
(
this
->
_state
);
}
bool
Nemo
I
nterface
::
Impl
::
ready
()
const
{
bool
Nemo
i
nterface
::
Impl
::
ready
()
const
{
Lock
lk1
(
this
->
_m
);
return
_readyNotSafe
(
this
->
_state
);
}
bool
Nemo
I
nterface
::
Impl
::
_sysSync
()
const
{
bool
Nemo
i
nterface
::
Impl
::
_sysSync
()
const
{
Lock
lk1
(
this
->
_m
);
return
_sysSyncNotSafe
(
this
->
_state
);
}
void
Nemo
I
nterface
::
Impl
::
_onHeartbeatTimeout
()
{
void
Nemo
i
nterface
::
Impl
::
_onHeartbeatTimeout
()
{
Lock
lk1
(
this
->
_m
);
this
->
_setStateNotSafe
(
STATE
::
HEARTBEAT_TIMEOUT
);
this
->
_doActionNotSafe
();
}
void
Nemo
I
nterface
::
Impl
::
_onRosbridgeStateChanged
()
{
auto
rbState
=
this
->
_
pRosbridge
->
state
();
void
Nemo
i
nterface
::
Impl
::
_onRosbridgeStateChanged
()
{
auto
rbState
=
this
->
_
rosbridge
.
state
();
if
(
rbState
==
Rosbridge
::
STATE
::
CONNECTED
)
{
Lock
lk1
(
this
->
_m
);
if
(
this
->
_state
==
STATE
::
START_BRIDGE
||
...
...
@@ -644,22 +629,26 @@ void NemoInterface::Impl::_onRosbridgeStateChanged() {
}
}
bool
Nemo
I
nterface
::
Impl
::
_userSync
()
const
{
bool
Nemo
i
nterface
::
Impl
::
_userSync
()
const
{
Lock
lk1
(
this
->
_m
);
return
_userSyncNotSafe
(
this
->
_state
);
}
const
QString
&
Nemo
I
nterface
::
Impl
::
infoString
()
const
{
const
QString
&
Nemo
i
nterface
::
Impl
::
infoString
()
const
{
Lock
lk1
(
this
->
_m
);
return
_infoString
;
}
const
QString
&
Nemo
I
nterface
::
Impl
::
warningString
()
const
{
const
QString
&
Nemo
i
nterface
::
Impl
::
warningString
()
const
{
Lock
lk1
(
this
->
_m
);
return
_warningString
;
}
bool
NemoInterface
::
Impl
::
_updateProgress
(
const
ProgressArray
&
pArray
)
{
const
QString
&
Nemointerface
::
Impl
::
connectionString
()
const
{
return
this
->
_connectionString
;
}
bool
Nemointerface
::
Impl
::
_updateProgress
(
const
ProgressArray
&
pArray
)
{
ProgressArray
copy
;
bool
error
=
false
;
...
...
@@ -673,7 +662,7 @@ bool NemoInterface::Impl::_updateProgress(const ProgressArray &pArray) {
it
->
second
->
setProgress
(
itLP
->
progress
());
copy
.
push_back
(
*
itLP
);
}
else
{
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"_updateProgress(): tile with id "
<<
itLP
->
id
()
<<
" not found."
;
error
=
true
;
}
...
...
@@ -687,7 +676,7 @@ bool NemoInterface::Impl::_updateProgress(const ProgressArray &pArray) {
return
!
error
;
}
void
Nemo
I
nterface
::
Impl
::
_onHeartbeatReceived
(
const
QNemoHeartbeat
&
)
{
void
Nemo
i
nterface
::
Impl
::
_onHeartbeatReceived
(
const
QNemoHeartbeat
&
)
{
INVM
(
this
->
_parent
,
([
this
]()
mutable
{
this
->
_timeoutTimer
.
start
(
NO_HEARTBEAT_TIMEOUT
);
}))
...
...
@@ -699,7 +688,7 @@ void NemoInterface::Impl::_onHeartbeatReceived(const QNemoHeartbeat &) {
}
}
void
Nemo
I
nterface
::
Impl
::
_setInfoStringNotSafe
(
const
QString
&
info
)
{
void
Nemo
i
nterface
::
Impl
::
_setInfoStringNotSafe
(
const
QString
&
info
)
{
if
(
_infoString
!=
info
)
{
_infoString
=
info
;
...
...
@@ -709,7 +698,7 @@ void NemoInterface::Impl::_setInfoStringNotSafe(const QString &info) {
}
}
void
Nemo
I
nterface
::
Impl
::
_setWarningStringNotSafe
(
const
QString
&
warning
)
{
void
Nemo
i
nterface
::
Impl
::
_setWarningStringNotSafe
(
const
QString
&
warning
)
{
if
(
_warningString
!=
warning
)
{
_warningString
=
warning
;
...
...
@@ -719,20 +708,20 @@ void NemoInterface::Impl::_setWarningStringNotSafe(const QString &warning) {
}
}
void
Nemo
I
nterface
::
Impl
::
_setInfoString
(
const
QString
&
info
)
{
void
Nemo
i
nterface
::
Impl
::
_setInfoString
(
const
QString
&
info
)
{
Lock
lk
(
this
->
_m
);
_setInfoStringNotSafe
(
info
);
}
void
Nemo
I
nterface
::
Impl
::
_setWarningString
(
const
QString
&
warning
)
{
void
Nemo
i
nterface
::
Impl
::
_setWarningString
(
const
QString
&
warning
)
{
Lock
lk
(
this
->
_m
);
_setWarningStringNotSafe
(
warning
);
}
void
Nemo
I
nterface
::
Impl
::
_doSetup
()
{
void
Nemo
i
nterface
::
Impl
::
_doSetup
()
{
// create task
auto
pTask
=
std
::
make_unique
<
nemo_interface
::
Task
>
([
this
]
{
auto
rb
=
this
->
_pR
osbridge
;
auto
&
rb
=
this
->
_r
osbridge
;
auto
&
disp
=
this
->
_dispatcher
;
// check if required services are available
...
...
@@ -742,7 +731,7 @@ void NemoInterface::Impl::_doSetup() {
this
->
_setInfoString
(
"Waiting for required service "
+
s
);
auto
available
=
rb
->
waitForService
(
cc
,
cond
);
auto
available
=
rb
.
waitForService
(
cc
,
cond
);
if
(
!
available
)
{
return
QVariant
(
false
);
}
...
...
@@ -750,7 +739,7 @@ void NemoInterface::Impl::_doSetup() {
// check if version is compatible{
this
->
_setInfoString
(
"Checking version."
);
auto
version
=
_callGetVersion
(
disp
,
*
rb
);
auto
version
=
_callGetVersion
(
disp
,
rb
);
if
(
version
!=
_localVersion
)
{
this
->
_setWarningString
(
"Version checking failed. Local protocol version ("
+
...
...
@@ -763,14 +752,14 @@ void NemoInterface::Impl::_doSetup() {
for
(
const
auto
&
cc
:
requiredTopics
)
{
QString
s
(
cc
);
this
->
_setInfoString
(
"Waiting for required topic "
+
s
);
auto
available
=
rb
->
waitForTopic
(
cc
,
cond
);
auto
available
=
rb
.
waitForTopic
(
cc
,
cond
);
if
(
!
available
)
{
return
QVariant
(
false
);
}
}
// subscribe topics
rb
->
subscribeTopic
(
progressTopic
,
[
this
](
const
QJsonObject
&
o
)
{
rb
.
subscribeTopic
(
progressTopic
,
[
this
](
const
QJsonObject
&
o
)
{
ros_bridge
::
messages
::
nemo_msgs
::
progress_array
::
ProgressArray
progressArray
;
if
(
ros_bridge
::
messages
::
nemo_msgs
::
progress_array
::
fromJson
(
...
...
@@ -789,7 +778,7 @@ void NemoInterface::Impl::_doSetup() {
}
if
(
rangeError
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
<<
progressTopic
qCWarning
(
Nemo
i
nterfaceLog
)
<<
progressTopic
<<
" progress out "
"of range, value was set to: "
<<
lp
.
progress
();
...
...
@@ -799,7 +788,7 @@ void NemoInterface::Impl::_doSetup() {
if
(
!
ret
)
this
->
_setWarningString
(
"Progress update failed."
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
<<
progressTopic
qCWarning
(
Nemo
i
nterfaceLog
)
<<
progressTopic
<<
" not able to "
"create ProgressArray form json: "
<<
o
;
...
...
@@ -807,12 +796,12 @@ void NemoInterface::Impl::_doSetup() {
});
using
namespace
ros_bridge
::
messages
;
rb
->
subscribeTopic
(
heartbeatTopic
,
[
this
](
const
QJsonObject
&
o
)
{
rb
.
subscribeTopic
(
heartbeatTopic
,
[
this
](
const
QJsonObject
&
o
)
{
nemo_msgs
::
heartbeat
::
Heartbeat
heartbeat
;
if
(
nemo_msgs
::
heartbeat
::
fromJson
(
o
,
heartbeat
))
{
this
->
_onHeartbeatReceived
(
heartbeat
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
<<
heartbeatTopic
qCWarning
(
Nemo
i
nterfaceLog
)
<<
heartbeatTopic
<<
" not able to "
"create Heartbeat form json: "
<<
o
;
...
...
@@ -832,7 +821,7 @@ void NemoInterface::Impl::_doSetup() {
Q_UNUSED
(
f
);
}
void
Nemo
I
nterface
::
Impl
::
_synchronize
()
{
void
Nemo
i
nterface
::
Impl
::
_synchronize
()
{
Lock
lk
(
this
->
_m
);
if
(
this
->
_state
==
STATE
::
READY
||
this
->
_state
==
STATE
::
SYNC_ERROR
)
{
...
...
@@ -848,11 +837,11 @@ void NemoInterface::Impl::_synchronize() {
// create cmd.
auto
pTask
=
std
::
make_unique
<
nemo_interface
::
Task
>
([
this
,
pTileArray
]
{
auto
rb
=
this
->
_pR
osbridge
;
auto
&
rb
=
this
->
_r
osbridge
;
auto
&
disp
=
this
->
_dispatcher
;
// are _localTiles and _remoteTiles synced?
auto
remoteTiles
=
this
->
_callGetAllTiles
(
disp
,
*
rb
);
auto
remoteTiles
=
this
->
_callGetAllTiles
(
disp
,
rb
);
// create tile map;
std
::
map
<
QString
,
std
::
shared_ptr
<
Tile
>>
tempMap
;
...
...
@@ -861,7 +850,7 @@ void NemoInterface::Impl::_synchronize() {
if
(
Q_LIKELY
(
it
==
tempMap
.
end
()))
{
tempMap
.
insert
(
std
::
make_pair
(
pTile
->
id
(),
pTile
));
}
else
{
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"_synchronizeIfNeccessary(): remoteTiles contains "
"duplicate id"
;
}
...
...
@@ -918,7 +907,7 @@ void NemoInterface::Impl::_synchronize() {
this
->
_doActionNotSafe
();
lk
.
unlock
();
this
->
_setWarningString
(
"Getting progress failed."
);
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"_addTilesImpl(): _updateProgress failed: unknown id."
;
return
QVariant
(
false
);
}
...
...
@@ -947,7 +936,7 @@ void NemoInterface::Impl::_synchronize() {
}
}
void
Nemo
I
nterface
::
Impl
::
_tryRestart
()
{
void
Nemo
i
nterface
::
Impl
::
_tryRestart
()
{
if
(
this
->
running
())
{
if
(
_dispatcher
.
idle
())
{
qDebug
()
<<
"_tryRestart: restarting"
;
...
...
@@ -960,19 +949,19 @@ void NemoInterface::Impl::_tryRestart() {
}
}
bool
Nemo
I
nterface
::
Impl
::
_isSynchronizedNotSafe
()
const
{
bool
Nemo
i
nterface
::
Impl
::
_isSynchronizedNotSafe
()
const
{
return
_localTiles
.
size
()
==
_remoteTiles
.
size
()
&&
std
::
equal
(
_localTiles
.
begin
(),
_localTiles
.
end
(),
_remoteTiles
.
begin
(),
[](
const
auto
&
a
,
const
auto
&
b
)
{
return
a
.
first
==
b
.
first
;
});
}
bool
Nemo
I
nterface
::
Impl
::
_isSynchronized
()
const
{
bool
Nemo
i
nterface
::
Impl
::
_isSynchronized
()
const
{
Lock
lk
(
this
->
_m
);
return
_isSynchronizedNotSafe
();
}
void
Nemo
I
nterface
::
Impl
::
_doActionNotSafe
()
{
void
Nemo
i
nterface
::
Impl
::
_doActionNotSafe
()
{
static
bool
resetDone
=
false
;
switch
(
this
->
_state
)
{
case
STATE
:
:
STOPPED
:
{
...
...
@@ -983,8 +972,8 @@ void NemoInterface::Impl::_doActionNotSafe() {
this
->
_syncTimer
.
stop
();
}))
if
(
this
->
_
pRosbridge
->
state
()
!=
Rosbridge
::
STATE
::
STOPPED
)
{
this
->
_
pRosbridge
->
stop
();
if
(
this
->
_
rosbridge
.
state
()
!=
Rosbridge
::
STATE
::
STOPPED
)
{
this
->
_
rosbridge
.
stop
();
}
_dispatcher
.
stop
();
_dispatcher
.
clear
();
...
...
@@ -998,7 +987,7 @@ void NemoInterface::Impl::_doActionNotSafe() {
INVM
(
this
->
_parent
,
([
this
]()
mutable
{
this
->
_restartTimer
.
start
(
RESTART_INTERVAl
);
}))
this
->
_
pRosbridge
->
start
();
this
->
_
rosbridge
.
start
();
}
break
;
case
STATE
:
:
WEBSOCKET_DETECTED
:
resetDone
=
false
;
...
...
@@ -1036,8 +1025,8 @@ void NemoInterface::Impl::_doActionNotSafe() {
if
(
!
resetDone
)
{
resetDone
=
true
;
this
->
_
pRosbridge
->
stop
();
this
->
_
pRosbridge
->
start
();
this
->
_
rosbridge
.
stop
();
this
->
_
rosbridge
.
start
();
}
_dispatcher
.
stop
();
_dispatcher
.
clear
();
...
...
@@ -1048,7 +1037,7 @@ void NemoInterface::Impl::_doActionNotSafe() {
};
}
bool
Nemo
I
nterface
::
Impl
::
_callAddTiles
(
bool
Nemo
i
nterface
::
Impl
::
_callAddTiles
(
const
QVector
<
std
::
shared_ptr
<
const
Tile
>>
&
tileArray
,
Dispatcher
&
d
,
Rosbridge
&
rb
)
{
...
...
@@ -1060,7 +1049,7 @@ bool NemoInterface::Impl::_callAddTiles(
using
namespace
ros_bridge
::
messages
;
QJsonObject
jsonTile
;
if
(
!
nemo_msgs
::
tile
::
toJson
(
*
tile
,
jsonTile
))
{
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"addTiles(): not able to create json object: tile id: "
<<
tile
->
id
()
<<
" progress: "
<<
tile
->
progress
()
<<
" points: "
<<
tile
->
tile
();
...
...
@@ -1079,7 +1068,7 @@ bool NemoInterface::Impl::_callAddTiles(
if
(
o
.
contains
(
"success"
)
&&
o
[
"success"
].
isBool
())
{
promise_response
->
set_value
(
o
[
"success"
].
toBool
());
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
addTilesService
<<
" no
\"
success
\"
key or wrong type: "
<<
o
;
promise_response
->
set_value
(
false
);
}
...
...
@@ -1101,7 +1090,7 @@ bool NemoInterface::Impl::_callAddTiles(
d
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"addTiles(): Websocket not responding to request."
;
return
false
;
}
...
...
@@ -1115,7 +1104,7 @@ bool NemoInterface::Impl::_callAddTiles(
return
true
;
}
bool
Nemo
I
nterface
::
Impl
::
_callRemoveTiles
(
const
IDArray
&
pIdArray
,
bool
Nemo
i
nterface
::
Impl
::
_callRemoveTiles
(
const
IDArray
&
pIdArray
,
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
// qDebug() << "_callRemoveTiles called";
...
...
@@ -1137,7 +1126,7 @@ bool NemoInterface::Impl::_callRemoveTiles(const IDArray &pIdArray,
if
(
o
.
contains
(
"success"
)
&&
o
[
"success"
].
isBool
())
{
promise_response
->
set_value
(
o
[
"success"
].
toBool
());
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
removeTilesService
<<
" no
\"
success
\"
key or wrong type: "
<<
msg
;
promise_response
->
set_value
(
false
);
}
...
...
@@ -1159,7 +1148,7 @@ bool NemoInterface::Impl::_callRemoveTiles(const IDArray &pIdArray,
disp
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"remove_tiles(): Websocket not responding to request."
;
return
false
;
}
...
...
@@ -1172,7 +1161,7 @@ bool NemoInterface::Impl::_callRemoveTiles(const IDArray &pIdArray,
return
true
;
}
bool
Nemo
I
nterface
::
Impl
::
_callClearTiles
(
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
bool
Nemo
i
nterface
::
Impl
::
_callClearTiles
(
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
// create response handler.
auto
promise_response
=
std
::
make_shared
<
std
::
promise
<
bool
>>
();
...
...
@@ -1198,7 +1187,7 @@ bool NemoInterface::Impl::_callClearTiles(Dispatcher &disp, Rosbridge &rb) {
disp
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
<<
"Websocket not responding to request."
;
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"Websocket not responding to request."
;
return
false
;
}
...
...
@@ -1210,7 +1199,7 @@ bool NemoInterface::Impl::_callClearTiles(Dispatcher &disp, Rosbridge &rb) {
return
true
;
}
ProgressArray
Nemo
I
nterface
::
Impl
::
_callGetProgress
(
const
IDArray
&
pIdArray
,
ProgressArray
Nemo
i
nterface
::
Impl
::
_callGetProgress
(
const
IDArray
&
pIdArray
,
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
// qDebug() << "_callGetProgress called";
...
...
@@ -1238,7 +1227,7 @@ ProgressArray NemoInterface::Impl::_callGetProgress(const IDArray &pIdArray,
*
pArray
=
std
::
move
(
progressArrayMsg
.
progress_array
());
promise_response
->
set_value
(
pArray
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
<<
getProgressService
qCWarning
(
Nemo
i
nterfaceLog
)
<<
getProgressService
<<
" error while creating ProgressArray "
"from json."
;
promise_response
->
set_value
(
nullptr
);
...
...
@@ -1261,7 +1250,7 @@ ProgressArray NemoInterface::Impl::_callGetProgress(const IDArray &pIdArray,
disp
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"all_remove_tiles(): Websocket not responding to request."
;
return
ProgressArray
();
}
...
...
@@ -1270,7 +1259,7 @@ ProgressArray NemoInterface::Impl::_callGetProgress(const IDArray &pIdArray,
return
*
future_response
.
get
();
}
ProgressArray
Nemo
I
nterface
::
Impl
::
_callGetAllProgress
(
Dispatcher
&
disp
,
ProgressArray
Nemo
i
nterface
::
Impl
::
_callGetAllProgress
(
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
// qDebug() << "_callGetAllProgress called";
...
...
@@ -1288,7 +1277,7 @@ ProgressArray NemoInterface::Impl::_callGetAllProgress(Dispatcher &disp,
*
pArray
=
std
::
move
(
progressArrayMsg
.
progress_array
());
promise_response
->
set_value
(
pArray
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
<<
getAllProgressService
qCWarning
(
Nemo
i
nterfaceLog
)
<<
getAllProgressService
<<
" error while creating ProgressArray "
"from json. msg: "
<<
o
;
...
...
@@ -1312,7 +1301,7 @@ ProgressArray NemoInterface::Impl::_callGetAllProgress(Dispatcher &disp,
disp
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"_callGetAllProgress(): Websocket not responding to request."
;
return
ProgressArray
();
}
...
...
@@ -1322,7 +1311,7 @@ ProgressArray NemoInterface::Impl::_callGetAllProgress(Dispatcher &disp,
}
QVector
<
std
::
shared_ptr
<
Tile
>>
Nemo
I
nterface
::
Impl
::
_callGetAllTiles
(
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
Nemo
i
nterface
::
Impl
::
_callGetAllTiles
(
Dispatcher
&
disp
,
Rosbridge
&
rb
)
{
// qDebug() << "_callGetAllProgress called";
// create response handler.
...
...
@@ -1343,12 +1332,12 @@ NemoInterface::Impl::_callGetAllTiles(Dispatcher &disp, Rosbridge &rb) {
if
(
ros_bridge
::
messages
::
nemo_msgs
::
tile
::
fromJson
(
o
,
*
tile
))
{
pArray
->
push_back
(
tile
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
getAllTilesService
<<
" error while creating tile."
;
promise_response
->
set_value
(
nullptr
);
}
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
getAllTilesService
<<
" json array does not contain objects."
;
promise_response
->
set_value
(
nullptr
);
}
...
...
@@ -1356,7 +1345,7 @@ NemoInterface::Impl::_callGetAllTiles(Dispatcher &disp, Rosbridge &rb) {
// success!
promise_response
->
set_value
(
pArray
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
getAllTilesService
<<
" no tile_array key or wrong type."
;
promise_response
->
set_value
(
nullptr
);
}
...
...
@@ -1378,7 +1367,7 @@ NemoInterface::Impl::_callGetAllTiles(Dispatcher &disp, Rosbridge &rb) {
disp
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"all_remove_tiles(): Websocket not responding to request."
;
return
QVector
<
std
::
shared_ptr
<
Tile
>>
();
}
...
...
@@ -1386,7 +1375,7 @@ NemoInterface::Impl::_callGetAllTiles(Dispatcher &disp, Rosbridge &rb) {
return
*
future_response
.
get
();
}
QString
Nemo
I
nterface
::
Impl
::
_callGetVersion
(
Dispatcher
&
d
,
Rosbridge
&
rb
)
{
QString
Nemo
i
nterface
::
Impl
::
_callGetVersion
(
Dispatcher
&
d
,
Rosbridge
&
rb
)
{
// create response handler.
typedef
QString
ResponseType
;
...
...
@@ -1400,7 +1389,7 @@ QString NemoInterface::Impl::_callGetVersion(Dispatcher &d, Rosbridge &rb) {
const
auto
version
=
o
[
versionKey
].
toString
();
promise_response
->
set_value
(
version
);
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
getVersionService
<<
" no version key or wrong type."
;
promise_response
->
set_value
(
"error!"
);
}
...
...
@@ -1422,7 +1411,7 @@ QString NemoInterface::Impl::_callGetVersion(Dispatcher &d, Rosbridge &rb) {
d
.
isInterruptionRequested
());
if
(
abort
)
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"all_remove_tiles(): Websocket not responding to request."
;
return
"unknown_version"
;
}
...
...
@@ -1437,7 +1426,7 @@ QString NemoInterface::Impl::_callGetVersion(Dispatcher &d, Rosbridge &rb) {
return
version
;
}
bool
Nemo
I
nterface
::
Impl
::
_addTilesRemote
(
bool
Nemo
i
nterface
::
Impl
::
_addTilesRemote
(
const
QVector
<
std
::
shared_ptr
<
const
Tile
>>
tileArray
)
{
// qDebug() << "_addTilesRemote called";
...
...
@@ -1449,7 +1438,7 @@ bool NemoInterface::Impl::_addTilesRemote(
return
_addTilesRemote
(
copy
);
}
bool
Nemo
I
nterface
::
Impl
::
_addTilesRemote
(
bool
Nemo
i
nterface
::
Impl
::
_addTilesRemote
(
const
QVector
<
std
::
shared_ptr
<
Tile
>>
&
tileArray
)
{
bool
error
=
false
;
...
...
@@ -1466,7 +1455,7 @@ bool NemoInterface::Impl::_addTilesRemote(
Q_UNUSED
(
ret
);
}
else
{
if
(
pTile
->
tile
()
!=
it
->
second
->
tile
())
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"_addTilesRemote: tiles differ but have the same id."
;
error
=
true
;
}
...
...
@@ -1481,7 +1470,7 @@ bool NemoInterface::Impl::_addTilesRemote(
return
!
error
;
}
void
Nemo
I
nterface
::
Impl
::
_removeTilesRemote
(
const
IDArray
&
idArray
)
{
void
Nemo
i
nterface
::
Impl
::
_removeTilesRemote
(
const
IDArray
&
idArray
)
{
// qDebug() << "_removeTilesRemote called";
bool
anyChange
=
false
;
...
...
@@ -1492,7 +1481,7 @@ void NemoInterface::Impl::_removeTilesRemote(const IDArray &idArray) {
_remoteTiles
.
erase
(
it
);
anyChange
=
true
;
}
else
{
qCWarning
(
Nemo
I
nterfaceLog
)
qCWarning
(
Nemo
i
nterfaceLog
)
<<
"_removeTilesRemote: tile with unknown id "
<<
id
<<
"."
;
}
}
...
...
@@ -1502,24 +1491,24 @@ void NemoInterface::Impl::_removeTilesRemote(const IDArray &idArray) {
}
}
void
Nemo
I
nterface
::
Impl
::
_clearTilesRemote
()
{
void
Nemo
i
nterface
::
Impl
::
_clearTilesRemote
()
{
Lock
lk
(
this
->
_m
);
_clearTilesRemoteNotSafe
();
}
void
Nemo
I
nterface
::
Impl
::
_clearTilesRemoteNotSafe
()
{
void
Nemo
i
nterface
::
Impl
::
_clearTilesRemoteNotSafe
()
{
// qDebug() << "_clearTilesRemote called";
if
(
_remoteTiles
.
size
()
>
0
)
{
_remoteTiles
.
clear
();
}
}
bool
Nemo
I
nterface
::
Impl
::
_setStateNotSafe
(
STATE
newState
)
{
bool
Nemo
i
nterface
::
Impl
::
_setStateNotSafe
(
STATE
newState
)
{
if
(
newState
!=
this
->
_state
)
{
auto
oldState
=
this
->
_state
;
this
->
_state
=
newState
;
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"state: "
<<
_toString
(
oldState
)
<<
" -> "
<<
_toString
(
newState
);
auto
oldStatus
=
_status
(
oldState
);
auto
newStatus
=
_status
(
newState
);
...
...
@@ -1541,58 +1530,58 @@ bool NemoInterface::Impl::_setStateNotSafe(STATE newState) {
}
}
bool
Nemo
Interface
::
Impl
::
_readyNotSafe
(
NemoI
nterface
::
Impl
::
STATE
s
)
{
bool
Nemo
interface
::
Impl
::
_readyNotSafe
(
Nemoi
nterface
::
Impl
::
STATE
s
)
{
return
s
==
STATE
::
READY
;
}
bool
Nemo
Interface
::
Impl
::
_userSyncNotSafe
(
NemoI
nterface
::
Impl
::
STATE
s
)
{
bool
Nemo
interface
::
Impl
::
_userSyncNotSafe
(
Nemoi
nterface
::
Impl
::
STATE
s
)
{
return
s
==
STATE
::
USER_SYNC
;
}
bool
Nemo
Interface
::
Impl
::
_sysSyncNotSafe
(
NemoI
nterface
::
Impl
::
STATE
s
)
{
bool
Nemo
interface
::
Impl
::
_sysSyncNotSafe
(
Nemoi
nterface
::
Impl
::
STATE
s
)
{
return
s
==
STATE
::
SYS_SYNC
;
}
bool
Nemo
Interface
::
Impl
::
_runningNotSafe
(
NemoI
nterface
::
Impl
::
STATE
s
)
{
bool
Nemo
interface
::
Impl
::
_runningNotSafe
(
Nemoi
nterface
::
Impl
::
STATE
s
)
{
return
s
!=
STATE
::
STOPPED
;
}
Nemo
I
nterface
::
STATUS
Nemo
Interface
::
Impl
::
_status
(
NemoI
nterface
::
Impl
::
STATE
state
)
{
Nemo
I
nterface
::
STATUS
status
;
Nemo
i
nterface
::
STATUS
Nemo
interface
::
Impl
::
_status
(
Nemoi
nterface
::
Impl
::
STATE
state
)
{
Nemo
i
nterface
::
STATUS
status
;
switch
(
state
)
{
case
STATE
:
:
STOPPED
:
status
=
Nemo
I
nterface
::
STATUS
::
NOT_CONNECTED
;
status
=
Nemo
i
nterface
::
STATUS
::
NOT_CONNECTED
;
break
;
case
STATE
:
:
START_BRIDGE
:
status
=
Nemo
I
nterface
::
STATUS
::
NOT_CONNECTED
;
status
=
Nemo
i
nterface
::
STATUS
::
NOT_CONNECTED
;
break
;
case
STATE
:
:
WEBSOCKET_DETECTED
:
status
=
Nemo
I
nterface
::
STATUS
::
WEBSOCKET_DETECTED
;
status
=
Nemo
i
nterface
::
STATUS
::
WEBSOCKET_DETECTED
;
break
;
case
STATE
:
:
TRY_SETUP
:
status
=
Nemo
I
nterface
::
STATUS
::
WEBSOCKET_DETECTED
;
status
=
Nemo
i
nterface
::
STATUS
::
WEBSOCKET_DETECTED
;
break
;
case
STATE
:
:
READY
:
status
=
Nemo
I
nterface
::
STATUS
::
READY
;
status
=
Nemo
i
nterface
::
STATUS
::
READY
;
break
;
case
STATE
:
:
USER_SYNC
:
case
STATE
:
:
SYS_SYNC
:
status
=
Nemo
I
nterface
::
STATUS
::
SYNC
;
status
=
Nemo
i
nterface
::
STATUS
::
SYNC
;
break
;
case
STATE
:
:
SYNC_ERROR
:
status
=
Nemo
I
nterface
::
STATUS
::
ERROR
;
status
=
Nemo
i
nterface
::
STATUS
::
ERROR
;
break
;
case
STATE
:
:
WEBSOCKET_TIMEOUT
:
case
STATE
:
:
HEARTBEAT_TIMEOUT
:
status
=
Nemo
I
nterface
::
STATUS
::
TIMEOUT
;
status
=
Nemo
i
nterface
::
STATUS
::
TIMEOUT
;
break
;
}
return
status
;
}
QString
Nemo
Interface
::
Impl
::
_toString
(
NemoI
nterface
::
Impl
::
STATE
s
)
{
QString
Nemo
interface
::
Impl
::
_toString
(
Nemoi
nterface
::
Impl
::
STATE
s
)
{
switch
(
s
)
{
case
STATE
:
:
STOPPED
:
return
QString
(
"STOPPED"
);
...
...
@@ -1618,32 +1607,32 @@ QString NemoInterface::Impl::_toString(NemoInterface::Impl::STATE s) {
return
"unknown state!"
;
}
QString
Nemo
Interface
::
Impl
::
_toString
(
NemoI
nterface
::
STATUS
s
)
{
QString
Nemo
interface
::
Impl
::
_toString
(
Nemoi
nterface
::
STATUS
s
)
{
switch
(
s
)
{
case
Nemo
I
nterface
:
:
STATUS
::
NOT_CONNECTED
:
case
Nemo
i
nterface
:
:
STATUS
::
NOT_CONNECTED
:
return
QString
(
"NOT_CONNECTED"
);
case
Nemo
I
nterface
:
:
STATUS
::
ERROR
:
case
Nemo
i
nterface
:
:
STATUS
::
ERROR
:
return
QString
(
"ERROR"
);
case
Nemo
I
nterface
:
:
STATUS
::
READY
:
case
Nemo
i
nterface
:
:
STATUS
::
READY
:
return
QString
(
"READY"
);
case
Nemo
I
nterface
:
:
STATUS
::
TIMEOUT
:
case
Nemo
i
nterface
:
:
STATUS
::
TIMEOUT
:
return
QString
(
"TIMEOUT"
);
case
Nemo
I
nterface
:
:
STATUS
::
WEBSOCKET_DETECTED
:
case
Nemo
i
nterface
:
:
STATUS
::
WEBSOCKET_DETECTED
:
return
QString
(
"WEBSOCKET_DETECTED"
);
case
Nemo
I
nterface
:
:
STATUS
::
SYNC
:
case
Nemo
i
nterface
:
:
STATUS
::
SYNC
:
return
QString
(
"SYNC"
);
}
return
"unknown state!"
;
}
bool
Nemo
I
nterface
::
Impl
::
_addTilesImpl
(
bool
Nemo
i
nterface
::
Impl
::
_addTilesImpl
(
std
::
shared_ptr
<
QVector
<
std
::
shared_ptr
<
const
Tile
>>>
pTileArray
,
std
::
shared_ptr
<
const
IDArray
>
pIdArray
)
{
auto
rb
=
this
->
_pR
osbridge
;
auto
&
rb
=
this
->
_r
osbridge
;
auto
&
disp
=
this
->
_dispatcher
;
// add tiles
bool
success
=
this
->
_callAddTiles
(
*
pTileArray
,
disp
,
*
rb
);
bool
success
=
this
->
_callAddTiles
(
*
pTileArray
,
disp
,
rb
);
if
(
!
success
)
{
this
->
_setWarningString
(
"Adding tiles failed. This might indicate a poor connection."
);
...
...
@@ -1657,13 +1646,13 @@ bool NemoInterface::Impl::_addTilesImpl(
this
->
_doActionNotSafe
();
lk
.
unlock
();
this
->
_setWarningString
(
"Adding tiles failed."
);
qCDebug
(
Nemo
I
nterfaceLog
)
<<
"_addTilesImpl(): _addTilesRemote return "
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"_addTilesImpl(): _addTilesRemote return "
"false: different tiles with same id."
;
return
false
;
}
// fetch progress
auto
array
=
this
->
_callGetProgress
(
*
pIdArray
,
disp
,
*
rb
);
auto
array
=
this
->
_callGetProgress
(
*
pIdArray
,
disp
,
rb
);
if
(
array
.
size
()
!=
pIdArray
->
size
())
{
Lock
lk
(
this
->
_m
);
this
->
_setStateNotSafe
(
STATE
::
SYNC_ERROR
);
...
...
@@ -1681,7 +1670,7 @@ bool NemoInterface::Impl::_addTilesImpl(
this
->
_doActionNotSafe
();
lk
.
unlock
();
this
->
_setWarningString
(
"Getting progress failed."
);
qCDebug
(
Nemo
I
nterfaceLog
)
qCDebug
(
Nemo
i
nterfaceLog
)
<<
"_addTilesImpl(): _updateProgress failed: unknown id."
;
return
false
;
}
...
...
@@ -1689,12 +1678,12 @@ bool NemoInterface::Impl::_addTilesImpl(
return
true
;
}
bool
Nemo
I
nterface
::
Impl
::
_removeTilesImpl
(
bool
Nemo
i
nterface
::
Impl
::
_removeTilesImpl
(
std
::
shared_ptr
<
const
IDArray
>
pIdArray
)
{
auto
rb
=
this
->
_pR
osbridge
;
auto
&
rb
=
this
->
_r
osbridge
;
auto
&
disp
=
this
->
_dispatcher
;
auto
success
=
this
->
_callRemoveTiles
(
*
pIdArray
,
disp
,
*
rb
);
auto
success
=
this
->
_callRemoveTiles
(
*
pIdArray
,
disp
,
rb
);
if
(
!
success
)
{
Lock
lk
(
this
->
_m
);
this
->
_setStateNotSafe
(
STATE
::
SYNC_ERROR
);
...
...
@@ -1709,11 +1698,11 @@ bool NemoInterface::Impl::_removeTilesImpl(
return
true
;
}
bool
Nemo
I
nterface
::
Impl
::
_clearTilesImpl
()
{
auto
rb
=
this
->
_pR
osbridge
;
bool
Nemo
i
nterface
::
Impl
::
_clearTilesImpl
()
{
auto
&
rb
=
this
->
_r
osbridge
;
auto
&
disp
=
this
->
_dispatcher
;
auto
success
=
this
->
_callClearTiles
(
disp
,
*
rb
);
auto
success
=
this
->
_callClearTiles
(
disp
,
rb
);
if
(
!
success
)
{
Lock
lk
(
this
->
_m
);
this
->
_setStateNotSafe
(
STATE
::
SYNC_ERROR
);
...
...
@@ -1730,24 +1719,18 @@ bool NemoInterface::Impl::_clearTilesImpl() {
// ===============================================================
// NemoInterface
NemoInterface
::
NemoInterface
()
:
QObject
(),
pImpl
(
std
::
make_unique
<
NemoInterface
::
Impl
>
(
this
))
{}
Nemointerface
::
Nemointerface
(
const
QString
&
connectionString
)
:
QObject
(),
pImpl
(
std
::
make_unique
<
Nemointerface
::
Impl
>
(
connectionString
,
this
))
{}
Nemo
Interface
*
NemoInterface
::
createInstance
()
{
return
new
NemoInterface
();
}
Nemo
interface
::~
Nemointerface
()
{
}
NemoInterface
*
NemoInterface
::
instance
()
{
return
GenericSingelton
<
NemoInterface
>::
instance
(
NemoInterface
::
createInstance
);
}
NemoInterface
::~
NemoInterface
()
{}
void
NemoInterface
::
start
()
{
this
->
pImpl
->
start
();
}
void
Nemointerface
::
start
()
{
this
->
pImpl
->
start
();
}
void
Nemo
I
nterface
::
stop
()
{
this
->
pImpl
->
stop
();
}
void
Nemo
i
nterface
::
stop
()
{
this
->
pImpl
->
stop
();
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
addTiles
(
const
TileArray
&
tileArray
)
{
Nemo
i
nterface
::
addTiles
(
const
TileArray
&
tileArray
)
{
TilePtrArray
ptrArray
;
for
(
const
auto
&
tile
:
tileArray
)
{
ptrArray
.
push_back
(
const_cast
<
MeasurementTile
*>
(
&
tile
));
...
...
@@ -1756,59 +1739,130 @@ NemoInterface::addTiles(const TileArray &tileArray) {
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
addTiles
(
const
TilePtrArray
&
tileArray
)
{
Nemo
i
nterface
::
addTiles
(
const
TilePtrArray
&
tileArray
)
{
return
this
->
pImpl
->
addTiles
(
tileArray
);
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
removeTiles
(
const
IDArray
&
idArray
)
{
Nemo
i
nterface
::
removeTiles
(
const
IDArray
&
idArray
)
{
return
this
->
pImpl
->
removeTiles
(
idArray
);
}
std
::
shared_future
<
QVariant
>
Nemo
I
nterface
::
clearTiles
()
{
std
::
shared_future
<
QVariant
>
Nemo
i
nterface
::
clearTiles
()
{
return
this
->
pImpl
->
clearTiles
();
}
TileArray
Nemo
I
nterface
::
getTiles
(
const
IDArray
&
idArray
)
const
{
TileArray
Nemo
i
nterface
::
getTiles
(
const
IDArray
&
idArray
)
const
{
return
this
->
pImpl
->
getTiles
(
idArray
);
}
TileArray
Nemo
I
nterface
::
getAllTiles
()
const
{
TileArray
Nemo
i
nterface
::
getAllTiles
()
const
{
return
this
->
pImpl
->
getAllTiles
();
}
LogicalArray
Nemo
I
nterface
::
containsTiles
(
const
IDArray
&
idArray
)
const
{
LogicalArray
Nemo
i
nterface
::
containsTiles
(
const
IDArray
&
idArray
)
const
{
return
this
->
pImpl
->
containsTiles
(
idArray
);
}
std
::
size_t
Nemo
I
nterface
::
size
()
const
{
return
this
->
pImpl
->
size
();
}
std
::
size_t
Nemo
i
nterface
::
size
()
const
{
return
this
->
pImpl
->
size
();
}
bool
Nemo
I
nterface
::
empty
()
const
{
return
this
->
pImpl
->
empty
();
}
bool
Nemo
i
nterface
::
empty
()
const
{
return
this
->
pImpl
->
empty
();
}
ProgressArray
Nemo
I
nterface
::
getProgress
()
const
{
ProgressArray
Nemo
i
nterface
::
getProgress
()
const
{
return
this
->
pImpl
->
getProgress
();
}
ProgressArray
Nemo
I
nterface
::
getProgress
(
const
IDArray
&
idArray
)
const
{
ProgressArray
Nemo
i
nterface
::
getProgress
(
const
IDArray
&
idArray
)
const
{
return
this
->
pImpl
->
getProgress
(
idArray
);
}
Nemo
Interface
::
STATUS
NemoI
nterface
::
status
()
const
{
Nemo
interface
::
STATUS
Nemoi
nterface
::
status
()
const
{
return
this
->
pImpl
->
status
();
}
QString
Nemo
I
nterface
::
statusString
()
const
{
QString
Nemo
i
nterface
::
statusString
()
const
{
return
statusMap
.
at
(
this
->
pImpl
->
status
());
}
QString
Nemo
I
nterface
::
infoString
()
const
{
return
this
->
pImpl
->
infoString
();
}
QString
Nemo
i
nterface
::
infoString
()
const
{
return
this
->
pImpl
->
infoString
();
}
QString
Nemo
I
nterface
::
warningString
()
const
{
QString
Nemo
i
nterface
::
warningString
()
const
{
return
this
->
pImpl
->
warningString
();
}
QString
Nemo
I
nterface
::
editorQml
()
{
QString
Nemo
i
nterface
::
editorQml
()
{
return
QStringLiteral
(
"NemoInterface.qml"
);
}
bool
NemoInterface
::
running
()
const
{
return
this
->
pImpl
->
running
();
}
bool
Nemointerface
::
running
()
const
{
return
this
->
pImpl
->
running
();
}
QString
Nemointerface
::
connectionString
()
{
return
this
->
pImpl
->
connectionString
();
}
NemointerfaceFactory
*
NemointerfaceFactory
::
createInstance
()
{
return
new
NemointerfaceFactory
();
}
NemointerfaceFactory
*
NemointerfaceFactory
::
instance
()
{
return
GenericSingelton
<
NemointerfaceFactory
>::
instance
(
NemointerfaceFactory
::
createInstance
);
}
std
::
shared_ptr
<
Nemointerface
>
NemointerfaceFactory
::
create
(
const
QString
&
connectionString
)
{
auto
it
=
_map
.
find
(
connectionString
);
// If the interface was cereated, is it still in use?
if
(
it
!=
_map
.
end
())
{
auto
weak
=
it
->
second
;
if
(
!
weak
.
expired
())
{
// Still in use, can't create an other instance.
return
nullptr
;
}
else
{
// Not in use, erase map entry.
it
=
_map
.
erase
(
it
);
}
}
Q_ASSERT
(
it
==
_map
.
end
());
if
(
it
==
_map
.
end
())
{
auto
p
=
std
::
make_shared
<
Nemointerface
>
(
connectionString
);
if
(
p
)
{
QQmlEngine
::
setObjectOwnership
(
p
.
get
(),
QQmlEngine
::
CppOwnership
);
auto
ret
=
_map
.
insert
(
std
::
make_pair
(
connectionString
,
std
::
weak_ptr
<
Nemointerface
>
(
p
)));
// insert error?
Q_ASSERT
(
ret
.
second
==
true
);
if
(
ret
.
second
!=
true
)
{
qCCritical
(
NemointerfaceLog
)
<<
"NemointerfaceFactory::create() not able to insert pair."
;
return
nullptr
;
}
}
return
p
;
}
else
{
qCCritical
(
NemointerfaceLog
)
<<
"NemointerfaceFactory::create() logical error."
;
return
nullptr
;
}
}
bool
NemointerfaceFactory
::
isCreatable
(
const
QString
&
connectionString
)
{
auto
it
=
_map
.
find
(
connectionString
);
// if it was creaded, is it still in use?
if
(
it
!=
_map
.
end
())
{
if
(
it
->
second
.
expired
())
{
it
=
_map
.
erase
(
it
);
return
true
;
}
else
{
return
false
;
}
}
else
{
return
true
;
}
}
src/MeasurementComplexItem/NemoInterface.h
View file @
a4d09405
...
...
@@ -13,20 +13,20 @@
#include "TilePtrArray.h"
#include "geometry/ProgressArray.h"
// Singelton class used to interface measurement devices implementing the nemo
// interface.
class
Nemo
I
nterface
:
public
QObject
{
class
NemointerfaceFactory
;
class
Nemo
i
nterface
:
public
QObject
{
Q_OBJECT
class
Impl
;
using
PImpl
=
std
::
unique_ptr
<
Impl
>
;
NemoInterface
();
NemoInterface
(
NemoInterface
&
other
)
=
delete
;
static
NemoInterface
*
createInstance
();
Nemointerface
(
const
QString
&
connectionString
);
Nemointerface
(
Nemointerface
&
other
)
=
delete
;
friend
class
NemointerfaceFactory
;
public:
~
NemoInterface
()
override
;
static
NemoInterface
*
instance
();
~
Nemointerface
()
override
;
enum
class
STATUS
{
NOT_CONNECTED
,
...
...
@@ -90,6 +90,7 @@ public:
QString
infoString
()
const
;
QString
warningString
()
const
;
bool
running
()
const
;
QString
connectionString
();
signals:
void
statusChanged
();
...
...
@@ -103,4 +104,25 @@ private:
PImpl
pImpl
;
};
#define pNemoInterface NemoInterface::instance()
// Singelton class used for nemo interface creation.
class
NemointerfaceFactory
{
NemointerfaceFactory
();
NemointerfaceFactory
(
const
NemointerfaceFactory
&
other
)
=
delete
;
static
NemointerfaceFactory
*
createInstance
();
public:
~
NemointerfaceFactory
();
static
NemointerfaceFactory
*
instance
();
// Creates a interface with a connection string connectionString.
// Two different interfaces can't share the same connection string.
std
::
shared_ptr
<
Nemointerface
>
create
(
const
QString
&
connectionString
);
// Returns true if an interface with connection string connectionString can
// be created (i.e. doesn't exist yet), returns false either.
bool
isCreatable
(
const
QString
&
connectionString
);
private:
std
::
map
<
QString
,
std
::
weak_ptr
<
Nemointerface
>>
_map
;
};
#define pNemoInterfaceFactory NemointerfaceFactory::instance()
src/MeasurementComplexItem/json/MeasurementComplexItem.SettingsGroup.json
View file @
a4d09405
...
...
@@ -17,6 +17,13 @@
"min"
:
1
,
"decimalPlaces"
:
1
,
"default"
:
10.0
},
{
"name"
:
"ConnectionString"
,
"shrotDesc"
:
"Nemo Connection String."
,
"longDesc"
:
"Nemo Connection String (e.g. host_ip:port)."
,
"type"
:
"string"
,
"default"
:
"localhost:9090"
}
]
}
src/QGCApplication.cc
View file @
a4d09405
...
...
@@ -672,7 +672,7 @@ void QGCApplication::_initCommon() {
qmlRegisterUncreatableType
<
routing
::
LinearGenerator
>
(
"MeasurementComplexItem"
,
1
,
0
,
"LinearGenerator"
,
kRefOnly
);
qmlRegisterType
<
AreaData
>
(
"MeasurementComplexItem"
,
1
,
0
,
"AreaData"
);
qmlRegisterSingletonType
<
Nemo
I
nterface
>
(
"MeasurementComplexItem"
,
1
,
0
,
qmlRegisterSingletonType
<
Nemo
i
nterface
>
(
"MeasurementComplexItem"
,
1
,
0
,
"NemoInterface"
,
getNemoInterface
);
qmlRegisterInterface
<
routing
::
GeneratorBase
>
(
"GeneratorBase"
);
qmlRegisterUncreatableType
<
routing
::
CircularGenerator
>
(
...
...
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