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
47586728
Commit
47586728
authored
Jan 20, 2021
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
22c1b55e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
196 additions
and
68 deletions
+196
-68
NemoInterface.cpp
src/MeasurementComplexItem/NemoInterface.cpp
+184
-59
MeasurementArea.cc
src/MeasurementComplexItem/geometry/MeasurementArea.cc
+0
-7
FutureWatcher.h
src/MeasurementComplexItem/nemo_interface/FutureWatcher.h
+11
-2
TaskDispatcher.cpp
src/MeasurementComplexItem/nemo_interface/TaskDispatcher.cpp
+1
-0
No files found.
src/MeasurementComplexItem/NemoInterface.cpp
View file @
47586728
This diff is collapsed.
Click to expand it.
src/MeasurementComplexItem/geometry/MeasurementArea.cc
View file @
47586728
...
...
@@ -325,22 +325,15 @@ bool MeasurementArea::isCorrect() {
void
MeasurementArea
::
updateProgress
(
const
ProgressArray
&
array
)
{
if
(
ready
()
&&
!
_holdProgress
&&
array
.
size
()
>
0
)
{
bool
anyChanges
=
false
;
long
counter
=
0
;
for
(
const
auto
&
lp
:
array
)
{
qDebug
()
<<
"MeasurementArea::updateProgress: counter = "
<<
counter
++
;
auto
it
=
_indexMap
.
find
(
lp
.
id
());
if
(
it
!=
_indexMap
.
end
())
{
int
tileIndex
=
it
->
second
;
auto
*
tile
=
_tiles
->
value
<
MeasurementTile
*>
(
tileIndex
);
qDebug
()
<<
"MeasurementArea::updateProgress: progress before = "
<<
tile
->
progress
();
if
(
!
qFuzzyCompare
(
lp
.
progress
(),
tile
->
progress
()))
{
tile
->
setProgress
(
lp
.
progress
());
anyChanges
=
true
;
}
qDebug
()
<<
"MeasurementArea::updateProgress: progress after = "
<<
tile
->
progress
();
}
}
...
...
src/MeasurementComplexItem/nemo_interface/FutureWatcher.h
View file @
47586728
...
...
@@ -28,7 +28,10 @@ public:
_init
();
}
FutureType
future
()
const
{
return
_future
;
}
FutureType
future
()
const
{
Q_ASSERT
(
this
->
_state
!=
STATE
::
EMPTY
);
return
_future
;
}
void
setFuture
(
const
FutureType
&
future
)
{
_future
=
future
;
...
...
@@ -37,9 +40,13 @@ public:
emit
started
();
}
T
result
()
{
return
_future
.
get
();
}
T
result
()
{
Q_ASSERT
(
this
->
_state
!=
STATE
::
EMPTY
);
return
_future
.
get
();
}
virtual
void
waitForFinished
()
override
{
Q_ASSERT
(
this
->
_state
!=
STATE
::
EMPTY
);
if
(
_state
==
STATE
::
STARTED
)
{
_timer
.
stop
();
_future
.
wait
();
...
...
@@ -53,9 +60,11 @@ public:
private:
void
_onTimeout
()
{
Q_ASSERT
(
this
->
_state
==
STATE
::
STARTED
);
if
(
_state
==
STATE
::
STARTED
)
{
auto
status
=
_future
.
wait_for
(
std
::
chrono
::
seconds
(
0
));
if
(
status
==
std
::
future_status
::
ready
)
{
_timer
.
stop
();
_state
=
STATE
::
FINISHED
;
emit
finished
();
}
...
...
src/MeasurementComplexItem/nemo_interface/TaskDispatcher.cpp
View file @
47586728
...
...
@@ -91,6 +91,7 @@ void TaskDispatcher::run() {
ULock
lk1
(
this
->
_mutex
);
if
(
this
->
_taskQueue
.
size
()
>
0
&&
this
->
_running
)
{
Q_ASSERT
(
this
->
_taskQueue
.
size
()
==
this
->
_promiseQueue
.
size
());
// pop task and promise
auto
pTask
=
std
::
move
(
this
->
_taskQueue
.
front
());
auto
promise
=
std
::
move
(
this
->
_promiseQueue
.
front
());
...
...
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