Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KStars
Commits
6bef4f9c
Commit
6bef4f9c
authored
Jul 11, 2017
by
Jasem Mutlaq
Browse files
Check if wcsWatcher is not running first before running a job
parent
c0823cc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
kstars/ekos/align/alignview.cpp
View file @
6bef4f9c
...
...
@@ -50,9 +50,13 @@ bool AlignView::createWCSFile(const QString &newWCSFile, double orientation, dou
return
false
;
}
// Load WCS async
QFuture
<
bool
>
future
=
QtConcurrent
::
run
(
imageData
,
&
FITSData
::
loadWCS
);
wcsWatcher
.
setFuture
(
future
);
if
(
wcsWatcher
.
isRunning
()
==
false
)
{
// Load WCS async
QFuture
<
bool
>
future
=
QtConcurrent
::
run
(
imageData
,
&
FITSData
::
loadWCS
);
wcsWatcher
.
setFuture
(
future
);
}
return
true
;
}
...
...
kstars/fitsviewer/fitsview.cpp
View file @
6bef4f9c
...
...
@@ -165,7 +165,7 @@ void FITSView::setMouseMode(int mode)
}
if
(
mode
==
FITSView
::
scopeMouse
&&
imageHasWCS
())
{
if
(
imageData
->
isWCSLoaded
()
==
false
)
if
(
imageData
->
isWCSLoaded
()
==
false
&&
wcsWatcher
.
isRunning
()
==
false
)
{
QFuture
<
bool
>
future
=
QtConcurrent
::
run
(
imageData
,
&
FITSData
::
loadWCS
);
wcsWatcher
.
setFuture
(
future
);
...
...
@@ -288,7 +288,7 @@ bool FITSView::loadFITS(const QString &inFilename, bool silent)
setAlignment
(
Qt
::
AlignCenter
);
// Load WCS data now if selected and image contains valid WCS header
if
(
imageData
->
hasWCS
()
&&
Options
::
autoWCS
()
&&
(
mode
==
FITS_NORMAL
||
mode
==
FITS_ALIGN
))
if
(
imageData
->
hasWCS
()
&&
Options
::
autoWCS
()
&&
(
mode
==
FITS_NORMAL
||
mode
==
FITS_ALIGN
)
&&
wcsWatcher
.
isRunning
()
==
false
)
{
QFuture
<
bool
>
future
=
QtConcurrent
::
run
(
imageData
,
&
FITSData
::
loadWCS
);
wcsWatcher
.
setFuture
(
future
);
...
...
@@ -1166,7 +1166,7 @@ void FITSView::toggleEQGrid()
{
showEQGrid
=
!
showEQGrid
;
if
(
imageData
->
isWCSLoaded
()
==
false
)
if
(
imageData
->
isWCSLoaded
()
==
false
&&
wcsWatcher
.
isRunning
()
==
false
)
{
QFuture
<
bool
>
future
=
QtConcurrent
::
run
(
imageData
,
&
FITSData
::
loadWCS
);
wcsWatcher
.
setFuture
(
future
);
...
...
@@ -1181,7 +1181,7 @@ void FITSView::toggleObjects()
{
showObjects
=
!
showObjects
;
if
(
imageData
->
isWCSLoaded
()
==
false
)
if
(
imageData
->
isWCSLoaded
()
==
false
&&
wcsWatcher
.
isRunning
()
==
false
)
{
QFuture
<
bool
>
future
=
QtConcurrent
::
run
(
imageData
,
&
FITSData
::
loadWCS
);
wcsWatcher
.
setFuture
(
future
);
...
...
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