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
1a58aa83
Commit
1a58aa83
authored
Jul 16, 2021
by
Julia Garriga Ferrer
Browse files
[orangecontrib][transformation] Save settings for magnification and rsm values
parent
802a3048
Pipeline
#50695
passed with stage
in 2 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
orangecontrib/darfix/widgets/transformation.py
View file @
1a58aa83
...
...
@@ -26,9 +26,10 @@
__authors__
=
[
"J. Garriga"
]
__license__
=
"MIT"
__date__
=
"1
4
/0
6
/2021"
__date__
=
"1
6
/0
7
/2021"
from
Orange.widgets.settings
import
Setting
from
silx.gui
import
qt
from
Orange.widgets.widget
import
OWWidget
,
Input
,
Output
from
darfix.gui.magnificationWidget
import
MagnificationWidget
...
...
@@ -52,8 +53,13 @@ class TransformationWidgetOW(OWWidget):
class
Outputs
:
dataset
=
Output
(
"dataset"
,
tuple
)
magnification
=
Setting
(
float
(),
schema_only
=
True
)
pixelSize
=
Setting
(
str
(),
schema_only
=
True
)
rotate
=
Setting
(
bool
(),
schema_only
=
True
)
def
__init__
(
self
):
super
().
__init__
()
qt
.
QLocale
.
setDefault
(
qt
.
QLocale
(
"en_US"
))
self
.
_widget
=
None
@
Inputs
.
dataset
...
...
@@ -71,8 +77,13 @@ class TransformationWidgetOW(OWWidget):
else
:
if
dataset
[
0
].
dims
.
ndim
==
1
:
self
.
_widget
=
RSMWidget
(
parent
=
self
)
if
self
.
pixelSize
:
self
.
_widget
.
pixelSize
=
self
.
pixelSize
self
.
_widget
.
rotate
=
self
.
rotate
else
:
self
.
_widget
=
MagnificationWidget
(
parent
=
self
)
if
self
.
magnification
:
self
.
_widget
.
magnification
=
self
.
magnification
self
.
_widget
.
sigComputed
.
connect
(
self
.
_sendSignal
)
self
.
controlArea
.
layout
().
addWidget
(
self
.
_widget
)
self
.
_widget
.
setDataset
(
*
dataset
)
...
...
@@ -86,5 +97,10 @@ class TransformationWidgetOW(OWWidget):
"""
Emits the signal with the new dataset.
"""
if
hasattr
(
self
.
_widget
,
'magnification'
):
self
.
magnification
=
self
.
_widget
.
magnification
elif
hasattr
(
self
.
_widget
,
'pixelSize'
):
self
.
pixelSize
=
self
.
_widget
.
pixelSize
self
.
rotate
=
self
.
_widget
.
rotate
self
.
close
()
self
.
Outputs
.
dataset
.
send
(
self
.
_widget
.
getDataset
())
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