Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
ab2ca886
Commit
ab2ca886
authored
5 years ago
by
Benjamin Jakimow
Browse files
Options
Downloads
Patches
Plain Diff
fixed release of TimeSeriesViewer instance after closing main window.
parent
372a50cd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
eotimeseriesviewer/main.py
+12
-7
12 additions, 7 deletions
eotimeseriesviewer/main.py
eotimeseriesviewer/timeseriesviewerplugin.py
+17
-12
17 additions, 12 deletions
eotimeseriesviewer/timeseriesviewerplugin.py
with
29 additions
and
19 deletions
eotimeseriesviewer/main.py
+
12
−
7
View file @
ab2ca886
...
...
@@ -114,6 +114,8 @@ class AboutDialogUI(QDialog, loadUI('aboutdialog.ui')):
class
TimeSeriesViewerUI
(
QMainWindow
,
loadUI
(
'
timeseriesviewer.ui
'
)):
sigAboutToBeClosed
=
pyqtSignal
()
def
__init__
(
self
,
parent
=
None
):
"""
Constructor.
"""
super
(
TimeSeriesViewerUI
,
self
).
__init__
(
parent
)
...
...
@@ -253,6 +255,8 @@ class TimeSeriesViewerUI(QMainWindow,
self
.
optionMoveCenter
.
setEnabled
(
b
)
def
closeEvent
(
self
,
a0
:
QCloseEvent
):
self
.
sigAboutToBeClosed
.
emit
()
LUT_MESSAGELOGLEVEL
=
{
...
...
@@ -290,7 +294,7 @@ class TimeSeriesViewer(QgisInterface, QObject):
sigCurrentSpectralProfilesChanged
=
pyqtSignal
(
list
)
sigCurrentTemporalProfilesChanged
=
pyqtSignal
(
list
)
sigCloses
=
pyqtSignal
()
def
__init__
(
self
):
"""
Constructor.
...
...
@@ -308,8 +312,14 @@ class TimeSeriesViewer(QgisInterface, QObject):
import
eotimeseriesviewer.utils
eotimeseriesviewer
.
utils
.
MAP_LAYER_STORES
.
insert
(
0
,
self
.
mapLayerStore
())
TimeSeriesViewer
.
_instance
=
self
self
.
ui
=
TimeSeriesViewerUI
()
def
onClosed
():
TimeSeriesViewer
.
_instance
=
None
self
.
ui
.
sigAboutToBeClosed
.
connect
(
onClosed
)
# Save reference to the QGIS interface
import
qgis.utils
assert
isinstance
(
qgis
.
utils
.
iface
,
QgisInterface
)
...
...
@@ -463,7 +473,7 @@ class TimeSeriesViewer(QgisInterface, QObject):
eotimeseriesviewer
.
labeling
.
registerLabelShortcutEditorWidget
()
self
.
applySettings
()
TimeSeriesViewer
.
_instance
=
self
self
.
initQGISConnection
()
...
...
@@ -1107,11 +1117,6 @@ class TimeSeriesViewer(QgisInterface, QObject):
def
show
(
self
):
self
.
ui
.
show
()
def
run
(
self
):
#QApplication.processEvents()
self
.
ui
.
show
()
def
clearLayoutWidgets
(
self
,
L
):
if
L
is
not
None
:
while
L
.
count
():
...
...
This diff is collapsed.
Click to expand it.
eotimeseriesviewer/timeseriesviewerplugin.py
+
17
−
12
View file @
ab2ca886
...
...
@@ -32,8 +32,10 @@ from PyQt5.QtWidgets import *
class
TimeSeriesViewerPlugin
:
def
__init__
(
self
,
iface
):
self
.
iface
=
iface
self
.
tsv
=
None
self
.
mEOTSV
=
None
dirPlugin
=
os
.
path
.
dirname
(
__file__
)
site
.
addsitedir
(
dirPlugin
)
...
...
@@ -46,7 +48,7 @@ class TimeSeriesViewerPlugin:
eotimeseriesviewer
.
initAll
()
def
initGui
(
self
):
self
.
t
oolbarActions
=
[]
self
.
mT
oolbarActions
=
[]
assert
isinstance
(
self
.
iface
,
QgisInterface
)
...
...
@@ -57,10 +59,9 @@ class TimeSeriesViewerPlugin:
icon
=
eotimeseriesviewer
.
icon
()
action
=
QAction
(
icon
,
TITLE
,
self
.
iface
)
action
.
triggered
.
connect
(
self
.
run
)
self
.
toolbarActions
.
append
(
action
)
self
.
mToolbarActions
.
append
(
action
)
for
action
in
self
.
t
oolbarActions
:
for
action
in
self
.
mT
oolbarActions
:
self
.
iface
.
addToolBarIcon
(
action
)
self
.
iface
.
addPluginToRasterMenu
(
TITLE
,
action
)
...
...
@@ -103,20 +104,24 @@ class TimeSeriesViewerPlugin:
def
run
(
self
):
from
eotimeseriesviewer.main
import
TimeSeriesViewer
self
.
tsv
=
TimeSeriesViewer
()
self
.
tsv
.
run
()
self
.
mEOTSV
=
TimeSeriesViewer
()
self
.
mEOTSV
.
ui
.
sigAboutToBeClosed
.
connect
(
self
.
onUiClosed
)
self
.
mEOTSV
.
show
()
def
onUiClosed
(
self
):
self
.
mEOTSV
=
None
from
eotimeseriesviewer.main
import
TimeSeriesViewer
TimeSeriesViewer
.
_instance
=
None
def
unload
(
self
):
from
eotimeseriesviewer.main
import
TimeSeriesViewer
for
action
in
self
.
t
oolbarActions
:
for
action
in
self
.
mT
oolbarActions
:
self
.
iface
.
removeToolBarIcon
(
action
)
if
isinstance
(
self
.
tsv
,
TimeSeriesViewer
):
self
.
tsv
.
ui
.
close
()
self
.
tsv
=
None
self
.
onUiClosed
()
def
tr
(
self
,
message
):
return
QCoreApplication
.
translate
(
'
TimeSeriesViewerPlugin
'
,
message
)
\ No newline at end of file
return
QCoreApplication
.
translate
(
'
EOTimeSeriesViewerPlugin
'
,
message
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment