Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tomwer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Olof Svensson
tomwer
Commits
02f43201
Commit
02f43201
authored
5 years ago
by
payno
Browse files
Options
Downloads
Patches
Plain Diff
[gui][axis] add ShiftMode to edit ony x shift, y shift or both
parent
7607f09e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tomwer/gui/ftserie/axis/axis.py
+36
-7
36 additions, 7 deletions
tomwer/gui/ftserie/axis/axis.py
with
36 additions
and
7 deletions
tomwer/gui/ftserie/axis/axis.py
+
36
−
7
View file @
02f43201
...
@@ -33,7 +33,7 @@ from tomwer.core.log import TomwerLogger
...
@@ -33,7 +33,7 @@ from tomwer.core.log import TomwerLogger
from
tomwer.core.utils
import
image
from
tomwer.core.utils
import
image
import
functools
import
functools
import
numpy
import
numpy
import
enum
from
silx.gui.plot.CompareImages
import
VisualizationMode
from
silx.gui.plot.CompareImages
import
VisualizationMode
from
tomwer.core.scan.scanbase
import
ScanBase
from
tomwer.core.scan.scanbase
import
ScanBase
from
tomwer.core.scan.scanfactory
import
ScanFactory
from
tomwer.core.scan.scanfactory
import
ScanFactory
...
@@ -325,7 +325,8 @@ class _AxisGUIControl(qt.QWidget):
...
@@ -325,7 +325,8 @@ class _AxisGUIControl(qt.QWidget):
self
.
_main_widget_recons_params
=
QReconsParams
(
empty
=
True
)
self
.
_main_widget_recons_params
=
QReconsParams
(
empty
=
True
)
self
.
_main_widget_recons_params
.
copy
(
self
.
_axis
)
self
.
_main_widget_recons_params
.
copy
(
self
.
_axis
)
self
.
_manualSelectionWidget
=
_AxisManualSelection
(
parent
=
self
)
self
.
_manualSelectionWidget
=
_AxisManualSelection
(
parent
=
self
,
shift_mode
=
ShiftMode
.
x_only
)
self
.
_manualSelectionWidget
.
layout
().
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
_manualSelectionWidget
.
layout
().
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
_displacementSelector
=
self
.
_manualSelectionWidget
.
_displacementSelector
self
.
_displacementSelector
=
self
.
_manualSelectionWidget
.
_displacementSelector
...
@@ -441,13 +442,13 @@ class _AxisGUIControl(qt.QWidget):
...
@@ -441,13 +442,13 @@ class _AxisGUIControl(qt.QWidget):
class
_AxisManualSelection
(
qt
.
QWidget
):
class
_AxisManualSelection
(
qt
.
QWidget
):
def
__init__
(
self
,
parent
):
def
__init__
(
self
,
parent
,
shift_mode
):
qt
.
QWidget
.
__init__
(
self
,
parent
)
qt
.
QWidget
.
__init__
(
self
,
parent
)
self
.
setLayout
(
qt
.
QVBoxLayout
())
self
.
setLayout
(
qt
.
QVBoxLayout
())
self
.
_displacementSelector
=
_DisplacementSelector
(
parent
=
self
)
self
.
_displacementSelector
=
_DisplacementSelector
(
parent
=
self
)
self
.
layout
().
addWidget
(
self
.
_displacementSelector
)
self
.
layout
().
addWidget
(
self
.
_displacementSelector
)
self
.
_shiftControl
=
_ShiftControl
(
parent
=
self
)
self
.
_shiftControl
=
_ShiftControl
(
parent
=
self
,
shift_mode
=
shift_mode
)
self
.
layout
().
addWidget
(
self
.
_shiftControl
)
self
.
layout
().
addWidget
(
self
.
_shiftControl
)
self
.
_roiControl
=
_ROIControl
(
parent
=
self
)
self
.
_roiControl
=
_ROIControl
(
parent
=
self
)
...
@@ -578,6 +579,13 @@ class _ROIDefinition(qt.QWidget):
...
@@ -578,6 +579,13 @@ class _ROIDefinition(qt.QWidget):
self
.
__roiChanged
()
self
.
__roiChanged
()
@enum.unique
class
ShiftMode
(
enum
.
Enum
):
x_only
=
0
y_only
=
1
x_and_y
=
2
class
_ShiftControl
(
qt
.
QWidget
):
class
_ShiftControl
(
qt
.
QWidget
):
"""
"""
Widget to control the shift step we want to apply
Widget to control the shift step we want to apply
...
@@ -595,7 +603,12 @@ class _ShiftControl(qt.QWidget):
...
@@ -595,7 +603,12 @@ class _ShiftControl(qt.QWidget):
sigAuto
=
qt
.
Signal
()
sigAuto
=
qt
.
Signal
()
"""
Signal emitted when the auto button is activated
"""
"""
Signal emitted when the auto button is activated
"""
def
__init__
(
self
,
parent
):
def
__init__
(
self
,
parent
,
shift_mode
):
"""
:param parent: qt.QWidget
:param ShiftMode shift_mode: what are the shift we want to control
"""
qt
.
QWidget
.
__init__
(
self
,
parent
)
qt
.
QWidget
.
__init__
(
self
,
parent
)
self
.
setLayout
(
qt
.
QGridLayout
())
self
.
setLayout
(
qt
.
QGridLayout
())
self
.
layout
().
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
layout
().
setContentsMargins
(
0
,
0
,
0
,
0
)
...
@@ -635,6 +648,20 @@ class _ShiftControl(qt.QWidget):
...
@@ -635,6 +648,20 @@ class _ShiftControl(qt.QWidget):
self
.
_updateShiftInfo
=
self
.
_shiftInfo
.
_updateShiftInfo
self
.
_updateShiftInfo
=
self
.
_shiftInfo
.
_updateShiftInfo
self
.
sigShiftChanged
=
self
.
_shiftInfo
.
sigShiftChanged
self
.
sigShiftChanged
=
self
.
_shiftInfo
.
sigShiftChanged
self
.
setShiftMode
(
shift_mode
)
def
setShiftMode
(
self
,
shift_mode
):
show_x_shift
=
shift_mode
in
(
ShiftMode
.
x_only
,
ShiftMode
.
x_and_y
)
show_y_shift
=
shift_mode
in
(
ShiftMode
.
y_only
,
ShiftMode
.
x_and_y
)
self
.
_leftButton
.
setVisible
(
show_x_shift
)
self
.
_rightButton
.
setVisible
(
show_x_shift
)
self
.
_topButton
.
setVisible
(
show_y_shift
)
self
.
_bottomButton
.
setVisible
(
show_y_shift
)
self
.
_shiftInfo
.
_xLE
.
setVisible
(
show_x_shift
)
self
.
_shiftInfo
.
_xLabel
.
setVisible
(
show_x_shift
)
self
.
_shiftInfo
.
_yLE
.
setVisible
(
show_y_shift
)
self
.
_shiftInfo
.
_yLabel
.
setVisible
(
show_y_shift
)
class
_ShiftInformation
(
qt
.
QWidget
):
class
_ShiftInformation
(
qt
.
QWidget
):
"""
"""
...
@@ -658,12 +685,14 @@ class _ShiftInformation(qt.QWidget):
...
@@ -658,12 +685,14 @@ class _ShiftInformation(qt.QWidget):
self
.
setLayout
(
qt
.
QHBoxLayout
())
self
.
setLayout
(
qt
.
QHBoxLayout
())
self
.
layout
().
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
layout
().
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
layout
().
setSpacing
(
0
)
self
.
layout
().
setSpacing
(
0
)
self
.
layout
().
addWidget
(
qt
.
QLabel
(
'
x=
'
))
self
.
_xLabel
=
qt
.
QLabel
(
'
x=
'
,
parent
=
self
)
self
.
layout
().
addWidget
(
self
.
_xLabel
)
self
.
_xLE
=
_ShiftInformation
.
_ShiftLineEdit
(
''
,
parent
=
self
)
self
.
_xLE
=
_ShiftInformation
.
_ShiftLineEdit
(
''
,
parent
=
self
)
self
.
layout
().
addWidget
(
self
.
_xLE
)
self
.
layout
().
addWidget
(
self
.
_xLE
)
self
.
layout
().
addWidget
(
qt
.
QLabel
(
'
y=
'
))
self
.
_yLabel
=
qt
.
QLabel
(
'
y=
'
,
parent
=
self
)
self
.
layout
().
addWidget
(
self
.
_yLabel
)
self
.
_yLE
=
_ShiftInformation
.
_ShiftLineEdit
(
''
,
parent
=
self
)
self
.
_yLE
=
_ShiftInformation
.
_ShiftLineEdit
(
''
,
parent
=
self
)
self
.
layout
().
addWidget
(
self
.
_yLE
)
self
.
layout
().
addWidget
(
self
.
_yLE
)
...
...
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