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
6422cf5c
Commit
6422cf5c
authored
8 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
various changes to handel profile visualization
DateAxis ProfilePoint test case for ProfileDock()
parent
278db6e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
make/make.py
+4
-3
4 additions, 3 deletions
make/make.py
timeseriesviewer/ui/docks.py
+17
-94
17 additions, 94 deletions
timeseriesviewer/ui/docks.py
with
21 additions
and
97 deletions
make/make.py
+
4
−
3
View file @
6422cf5c
...
...
@@ -132,6 +132,7 @@ def make(ROOT):
for
i
in
range
(
includeNodes
.
count
()):
attr
=
getDOMAttributes
(
includeNodes
.
item
(
i
).
toElement
())
if
'
location
'
in
attr
.
keys
():
print
((
ui_file
,
str
(
attr
[
'
location
'
])))
qrcs
.
add
((
pathDir
,
str
(
attr
[
'
location
'
])))
#compile Qt resource files
...
...
@@ -141,7 +142,7 @@ def make(ROOT):
for
root_dir
,
f
in
resourcefiles
:
#dn = os.path.dirname(f)
pathQrc
=
os
.
path
.
normpath
(
jp
(
root_dir
,
f
))
assert
os
.
path
.
exists
(
pathQrc
)
assert
os
.
path
.
exists
(
pathQrc
)
,
pathQrc
bn
=
os
.
path
.
basename
(
f
)
bn
=
os
.
path
.
splitext
(
bn
)[
0
]
pathPy2
=
os
.
path
.
join
(
DIR_UI
,
bn
+
'
_py2.py
'
)
...
...
@@ -410,10 +411,10 @@ if __name__ == '__main__':
createCreditsHTML
()
if
Tru
e
:
if
Fals
e
:
#convert SVG to PNG and link them into the resource file
svg2png
(
icondir
,
overwrite
=
False
)
if
Tru
e
:
if
Fals
e
:
#add png icons to qrc file
png2qrc
(
icondir
,
pathQrc
)
if
True
:
...
...
This diff is collapsed.
Click to expand it.
timeseriesviewer/ui/docks.py
+
17
−
94
View file @
6422cf5c
import
os
import
os
,
time
,
datetime
from
qgis.core
import
*
from
qgis.gui
import
*
from
PyQt4
import
uic
...
...
@@ -8,14 +8,16 @@ import PyQt4.QtWebKit
import
sys
,
re
,
os
,
six
from
timeseriesviewer
import
jp
,
SETTINGS
from
timeseriesviewer.ui
import
loadUIFormClass
,
DIR_UI
from
timeseriesviewer.main
import
SpatialExtent
import
pyqtgraph
as
pg
load
=
lambda
p
:
loadUIFormClass
(
jp
(
DIR_UI
,
p
))
class
TsvDockWidgetBase
(
QgsDockWidget
):
def
__init__
(
self
,
parent
):
...
...
@@ -33,96 +35,6 @@ class TsvDockWidgetBase(QgsDockWidget):
return
states
class
ProfileViewDockUI
(
TsvDockWidgetBase
,
load
(
'
profileviewdock.ui
'
)):
def
__init__
(
self
,
parent
=
None
):
super
(
ProfileViewDockUI
,
self
).
__init__
(
parent
)
self
.
setupUi
(
self
)
from
timeseriesviewer.pixelloader
import
PixelLoader
from
timeseriesviewer.viewmodels
import
PixelCollection
from
timeseriesviewer
import
OPENGL_AVAILABLE
,
SETTINGS
if
OPENGL_AVAILABLE
:
l
=
self
.
page3D
.
layout
()
l
.
removeWidget
(
self
.
labelDummy3D
)
from
pyqtgraph.opengl
import
GLViewWidget
self
.
plotWidget3D
=
GLViewWidget
(
self
.
page3D
)
l
.
addWidget
(
self
.
plotWidget3D
)
else
:
self
.
plotWidget3D
=
None
self
.
baseTitle
=
self
.
windowTitle
()
self
.
TS
=
None
self
.
PxCollection
=
None
self
.
progressBar
.
setMinimum
(
0
)
self
.
progressBar
.
setMaximum
(
100
)
self
.
progressBar
.
setValue
(
0
)
self
.
progressInfo
.
setText
(
''
)
self
.
pixelLoader
=
PixelLoader
()
self
.
pixelLoader
.
sigPixelLoaded
.
connect
(
self
.
onPixelLoaded
)
self
.
pixelLoader
.
sigLoadingFinished
.
connect
(
self
.
refresh2D
)
self
.
PxModel
=
None
self
.
btnRefresh2D
.
setDefaultAction
(
self
.
actionRefresh2D
)
self
.
actionRefresh2D
.
triggered
.
connect
(
self
.
refresh2D
)
def
connectTimeSeries
(
self
,
TS
):
from
timeseriesviewer.timeseries
import
TimeSeries
from
timeseriesviewer.viewmodels
import
PixelCollection
,
PixelCollectionSensorExpressionModel
assert
isinstance
(
TS
,
TimeSeries
)
self
.
TS
=
TS
self
.
PxCollection
=
PixelCollection
(
self
.
TS
)
self
.
PxModel
=
PixelCollectionSensorExpressionModel
(
self
.
PxCollection
)
self
.
tableView2DBands
.
setModel
(
self
.
PxModel
)
self
.
tableView2DBands
.
horizontalHeader
().
setResizeMode
(
QHeaderView
.
ResizeToContents
)
def
refresh2D
(
self
,
*
arg
):
from
timeseriesviewer.viewmodels
import
PixelCollection
,
PixelCollectionSensorExpressionModel
if
isinstance
(
self
.
PxModel
,
PixelCollectionSensorExpressionModel
):
for
sw
in
self
.
PxModel
.
items
:
assert
isinstance
(
sw
,
PixelCollectionSensorExpressionModel
.
SensorView
)
if
sw
.
isVisible
:
values
=
self
.
PxCollection
.
values
(
sw
.
sensor
,
sw
.
expression
)
for
t
in
values
:
tsdStr
,
v
=
t
s
=
""
def
onPixelLoaded
(
self
,
nDone
,
nMax
,
d
):
self
.
progressBar
.
setValue
(
nDone
)
self
.
progressBar
.
setMaximum
(
nMax
)
t
=
''
if
len
(
d
)
>
0
:
self
.
PxCollection
.
addPixel
(
d
)
t
=
'
Last loaded from {}.
'
.
format
(
os
.
path
.
basename
(
d
[
'
path
'
]))
QgsApplication
.
processEvents
()
self
.
progressInfo
.
setText
(
t
)
def
loadCoordinate
(
self
,
coordinate
,
crs
):
assert
isinstance
(
coordinate
,
QgsPoint
)
assert
isinstance
(
crs
,
QgsCoordinateReferenceSystem
)
from
timeseriesviewer.timeseries
import
TimeSeries
assert
isinstance
(
self
.
TS
,
TimeSeries
)
self
.
setWindowTitle
(
'
{} | {} {}
'
.
format
(
self
.
baseTitle
,
str
(
coordinate
),
crs
.
authid
()))
self
.
pixelLoader
.
setNumberOfThreads
(
SETTINGS
.
value
(
'
n_threads
'
,
1
))
#shoudl we allow to keep pixels in memory, e.g. limited by buffer?
self
.
PxCollection
.
clear
()
self
.
pixelLoader
.
removeFinishedThreads
()
files
=
[
d
.
pathImg
for
d
in
self
.
TS
.
data
]
self
.
progressInfo
.
setText
(
'
Start loading from {} images...
'
.
format
(
len
(
files
)))
self
.
pixelLoader
.
startLoading
(
files
,
coordinate
,
crs
)
class
SensorDockUI
(
TsvDockWidgetBase
,
load
(
'
sensordock.ui
'
)):
def
__init__
(
self
,
parent
=
None
):
super
(
SensorDockUI
,
self
).
__init__
(
parent
)
...
...
@@ -469,8 +381,19 @@ if __name__ == '__main__':
#d = AboutDialogUI()
#d.show()
d
=
ProfileDockUI
()
from
timeseriesviewer.tests
import
*
TS
=
TestObjects
.
TimeSeries
()
ext
=
TS
.
getMaxSpatialExtent
()
d
=
ProfileViewDockUI
()
d
.
connectTimeSeries
(
TS
)
d
.
show
()
d
.
loadCoordinate
(
ext
.
center
(),
ext
.
crs
())
#close QGIS
qgsApp
.
exec_
()
try
:
qgsApp
.
exec_
()
except
:
s
=
""
qgsApp
.
exitQgis
()
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