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
9b4b86ce
Commit
9b4b86ce
authored
8 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
separated TSV classes and QGIS Plugin loader
parent
bf41e51d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
timeseriesviewerplugin.py
+75
-0
75 additions, 0 deletions
timeseriesviewerplugin.py
with
75 additions
and
0 deletions
timeseriesviewerplugin.py
0 → 100644
+
75
−
0
View file @
9b4b86ce
from
__future__
import
absolute_import
import
inspect
import
os
import
six
import
traceback
import
sys
import
importlib
import
re
import
site
from
qgis.gui
import
*
from
qgis.core
import
*
from
PyQt4.QtCore
import
*
from
PyQt4.QtGui
import
*
DIR_REPO
=
os
.
path
.
normpath
(
os
.
path
.
split
(
inspect
.
getfile
(
inspect
.
currentframe
()))[
0
])
DIR_SITE_PACKAGES
=
None
class
TSVPlugin
:
def
__init__
(
self
,
iface
):
self
.
iface
=
iface
self
.
tsv
=
None
def
initGui
(
self
):
self
.
toolbarActions
=
[]
syspaths
=
[
os
.
path
.
normpath
(
p
)
for
p
in
sys
.
path
]
if
DIR_REPO
not
in
syspaths
:
sys
.
path
.
append
(
DIR_REPO
)
# add platform independent site-packages
if
DIR_SITE_PACKAGES
:
site
.
addsitedir
(
DIR_SITE_PACKAGES
)
from
timeseriesviewer.main
import
TimeSeriesViewer
"""
Create the menu entries and toolbar icons inside the QGIS GUI.
"""
icon
=
TimeSeriesViewer
.
icon
()
action
=
QAction
(
icon
,
self
.
tr
(
u
'
SenseCarbon Time Series Viewer
'
),
self
.
iface
.
mainWindow
())
action
.
triggered
.
connect
(
self
.
run
)
self
.
toolbarActions
.
append
(
action
)
for
action
in
self
.
toolbarActions
:
self
.
iface
.
addToolBarIcon
(
action
)
def
run
(
self
):
from
timeseriesviewer.main
import
TimeSeriesViewer
# open QGIS python console. this is required to allow for print() statements in the source code.
if
isinstance
(
self
.
iface
,
QgisInterface
):
import
console
c
=
console
.
show_console
()
c
.
setVisible
(
True
)
self
.
tsv
=
TimeSeriesViewer
(
self
.
iface
)
self
.
tsv
.
run
()
def
unload
(
self
):
from
timeseriesviewer
import
dprint
from
timeseriesviewer.main
import
TimeSeriesViewer
dprint
(
'
UNLOAD SenseCarbon TimeSeriesViewer Plugin
'
)
for
action
in
self
.
toolbarActions
:
print
(
action
)
self
.
iface
.
removeToolBarIcon
(
action
)
if
isinstance
(
self
.
tsv
,
TimeSeriesViewer
):
self
.
tsv
.
dlg
.
close
()
self
.
tsv
=
None
def
tr
(
self
,
message
):
return
QCoreApplication
.
translate
(
'
EnMAPBoxPlugin
'
,
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