Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
21b79202
Commit
21b79202
authored
Jul 16, 2021
by
Julia Garriga Ferrer
Browse files
[gui][magnification] Add value class for magnification values
parent
17d9c976
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/magnificationWidget.py
View file @
21b79202
...
...
@@ -26,10 +26,19 @@
__authors__
=
[
"J. Garriga"
]
__license__
=
"MIT"
__date__
=
"
04
/0
6
/2021"
__date__
=
"
16
/0
7
/2021"
from
silx.gui
import
qt
from
silx.utils.enum
import
Enum
as
_Enum
class
Value
(
_Enum
):
"""
Methods available to compute the background.
"""
PIXEL_2X
=
3.75
PIXEL_10X
=
0.75
class
MagnificationWidget
(
qt
.
QMainWindow
):
...
...
@@ -43,6 +52,8 @@ class MagnificationWidget(qt.QMainWindow):
widget
=
qt
.
QWidget
()
layout
=
qt
.
QVBoxLayout
()
self
.
_magnification
=
Value
.
PIXEL_2X
.
value
self
.
_checkbox2x
=
qt
.
QCheckBox
(
"2x magnification"
)
self
.
_checkbox10x
=
qt
.
QCheckBox
(
"10x magnification"
)
self
.
_checkboxManual
=
qt
.
QCheckBox
(
"Manual magnification:"
)
...
...
@@ -116,9 +127,9 @@ class MagnificationWidget(qt.QMainWindow):
def
_saveMagnification
(
self
):
if
self
.
_checkbox2x
.
isChecked
():
d
=
3.75
magnification
=
Value
.
PIXEL_2X
.
value
elif
self
.
_checkbox10x
.
isChecked
():
d
=
0.75
magnification
=
Value
.
PIXEL_10X
.
value
else
:
magnification
=
self
.
_manualLE
.
text
()
if
magnification
==
""
:
...
...
@@ -127,7 +138,8 @@ class MagnificationWidget(qt.QMainWindow):
msg
.
setText
(
"Magnification value has to be entered when choosing manual"
)
msg
.
exec_
()
return
self
.
_magnification
=
float
(
magnification
)
self
.
dataset
.
compute_transformation
(
d
)
self
.
dataset
.
compute_transformation
(
self
.
magnification
)
self
.
sigComputed
.
emit
()
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment