Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GEPARD
GEPARD
Commits
3ca5cc5e
Commit
3ca5cc5e
authored
Mar 15, 2019
by
Lars Bittrich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved and renamed Legend from analysisWidgets to colorlegend in main module where it is imported
parent
f458c65b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
analysis/analysisview.py
analysis/analysisview.py
+2
-4
colorlegend.py
colorlegend.py
+9
-1
gepard.py
gepard.py
+2
-2
No files found.
analysis/analysisview.py
View file @
3ca5cc5e
...
@@ -822,15 +822,13 @@ class ParticleAnalysis(QtWidgets.QMainWindow):
...
@@ -822,15 +822,13 @@ class ParticleAnalysis(QtWidgets.QMainWindow):
self
.
parent
.
contouritem
.
colorList
=
colorList
self
.
parent
.
contouritem
.
colorList
=
colorList
self
.
parent
.
contouritem
.
update
()
self
.
parent
.
contouritem
.
update
()
self
.
parent
.
imparent
.
legend
.
items
=
legendItems
self
.
parent
.
imparent
.
legend
.
setTextColorItems
(
legendItems
)
self
.
parent
.
imparent
.
legend
.
update
()
self
.
parent
.
imparent
.
legend
.
show
()
self
.
parent
.
imparent
.
legend
.
show
()
else
:
else
:
self
.
parent
.
contouritem
.
colorList
=
[]
self
.
parent
.
contouritem
.
colorList
=
[]
self
.
parent
.
contouritem
.
update
()
self
.
parent
.
contouritem
.
update
()
self
.
parent
.
imparent
.
legend
.
items
=
[]
self
.
parent
.
imparent
.
legend
.
setTextColorItems
([])
self
.
parent
.
imparent
.
legend
.
update
()
self
.
parent
.
imparent
.
legend
.
hide
()
self
.
parent
.
imparent
.
legend
.
hide
()
def
show_hide_labels
(
self
):
def
show_hide_labels
(
self
):
...
...
analysis/analysisWidgets
.py
→
colorlegend
.py
View file @
3ca5cc5e
...
@@ -24,7 +24,7 @@ import numpy as np
...
@@ -24,7 +24,7 @@ import numpy as np
WX
,
WY
=
1024
,
200
WX
,
WY
=
1024
,
200
class
Legend
(
QtWidgets
.
QMdiSubWindow
):
class
Color
Legend
(
QtWidgets
.
QMdiSubWindow
):
def
__init__
(
self
,
parent
=
None
):
def
__init__
(
self
,
parent
=
None
):
super
().
__init__
(
parent
)
super
().
__init__
(
parent
)
...
@@ -38,6 +38,14 @@ class Legend(QtWidgets.QMdiSubWindow):
...
@@ -38,6 +38,14 @@ class Legend(QtWidgets.QMdiSubWindow):
self
.
fontSize
=
15
self
.
fontSize
=
15
self
.
spacer
=
10
self
.
spacer
=
10
def
setTextColorItems
(
self
,
items
):
for
text
,
color
in
items
:
print
(
text
,
color
)
assert
type
(
text
)
==
str
or
type
(
text
)
==
np
.
str_
,
"items must be tuples of text and QColor"
assert
type
(
color
)
==
QtGui
.
QColor
or
type
(
color
)
==
QtCore
.
Qt
.
GlobalColor
,
"items must be tuples of text and QColor"
self
.
items
=
items
self
.
update
()
def
mousePressEvent
(
self
,
event
):
def
mousePressEvent
(
self
,
event
):
if
event
.
button
()
==
QtCore
.
Qt
.
LeftButton
:
if
event
.
button
()
==
QtCore
.
Qt
.
LeftButton
:
self
.
drag
=
event
.
pos
()
self
.
drag
=
event
.
pos
()
...
...
gepard.py
View file @
3ca5cc5e
...
@@ -23,7 +23,7 @@ from sampleview import SampleView
...
@@ -23,7 +23,7 @@ from sampleview import SampleView
from
scalebar
import
ScaleBar
from
scalebar
import
ScaleBar
from
ramancom.ramancontrol
import
defaultPath
from
ramancom.ramancontrol
import
defaultPath
from
ramancom.ramanSwitch
import
RamanSwitch
from
ramancom.ramanSwitch
import
RamanSwitch
from
analysis.analysisWidgets
import
Legend
from
colorlegend
import
Color
Legend
import
os
import
os
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -39,7 +39,7 @@ class MeasureParticleWindow(QtWidgets.QMainWindow):
...
@@ -39,7 +39,7 @@ class MeasureParticleWindow(QtWidgets.QMainWindow):
self
.
view
.
imparent
=
self
self
.
view
.
imparent
=
self
self
.
view
.
ScalingChanged
.
connect
(
self
.
scalingChanged
)
self
.
view
.
ScalingChanged
.
connect
(
self
.
scalingChanged
)
self
.
scalebar
=
ScaleBar
(
self
)
self
.
scalebar
=
ScaleBar
(
self
)
self
.
legend
=
Legend
(
self
)
self
.
legend
=
Color
Legend
(
self
)
self
.
ramanSwitch
=
RamanSwitch
(
self
)
self
.
ramanSwitch
=
RamanSwitch
(
self
)
self
.
view
.
ScalingChanged
.
connect
(
self
.
scalebar
.
updateScale
)
self
.
view
.
ScalingChanged
.
connect
(
self
.
scalebar
.
updateScale
)
...
...
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