Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
kmap
xsocs
Commits
9cc84717
Commit
9cc84717
authored
Feb 07, 2017
by
Damien Naudet
Browse files
More python3 fixes.
parent
cb346a35
Changes
2
Hide whitespace changes
Inline
Side-by-side
kmap/gui/silx_imports/ImageRois.py
View file @
9cc84717
...
...
@@ -130,10 +130,12 @@ class RoiItemBase(qt.QObject):
def
_remove
(
self
,
handles
=
True
,
shape
=
True
):
if
handles
:
{
self
.
_plot
.
removeMarker
(
item
)
for
item
in
self
.
_handles
}
for
item
in
self
.
_handles
:
self
.
_plot
.
removeMarker
(
item
)
if
shape
:
self
.
_plot
.
removeItem
(
self
.
_name
)
{
self
.
_plot
.
removeItem
(
item
)
for
item
in
self
.
_items
}
for
item
in
self
.
_items
:
self
.
_plot
.
removeItem
(
item
)
def
_interactiveModeChanged
(
self
,
source
):
if
source
is
not
self
or
source
is
not
self
.
parent
():
...
...
@@ -545,7 +547,8 @@ class ImageRoiManager(qt.QObject):
def
_editRois
(
self
):
# TODO : should we call stop first?
{
item
.
edit
(
True
)
for
item
in
self
.
_rois
.
values
()}
for
item
in
self
.
_rois
.
values
():
item
.
edit
(
True
)
def
_startRoi
(
self
):
"""
...
...
@@ -556,7 +559,8 @@ class ImageRoiManager(qt.QObject):
self
.
_stopRoi
()
{
item
.
edit
(
False
)
for
item
in
self
.
_rois
.
values
()}
for
item
in
self
.
_rois
.
values
():
item
.
edit
(
False
)
self
.
showRois
(
True
)
klass
=
self
.
_klassInfos
[
self
.
_currentKlass
]
...
...
@@ -677,11 +681,13 @@ class ImageRoiManager(qt.QObject):
toolBar
=
qt
.
QToolBar
(
'Roi'
)
# toolBar.addWidget(qt.QLabel('Roi'))
{
toolBar
.
addAction
(
action
)
for
action
in
keepRoiActions
}
for
action
in
keepRoiActions
:
toolBar
.
addAction
(
action
)
toolBar
.
addSeparator
()
{
toolBar
.
addAction
(
action
)
for
action
in
keepOptionActions
}
for
action
in
keepOptionActions
:
toolBar
.
addAction
(
action
)
return
toolBar
...
...
@@ -790,8 +796,8 @@ class RectRoiItem(RoiItemBase):
# function to get data in the _xData, _yData, ... arrays.
# this only works because we re not adding or removing vertices
# when editing
{
self
.
_registerHandle
(
corner
,
(
xcoords
[
i
],
ycoords
[
i
]))
for
i
,
corner
in
enumerate
(
corners
)}
for
i
,
corner
in
enumerate
(
corners
):
self
.
_registerHandle
(
corner
,
(
xcoords
[
i
],
ycoords
[
i
]))
self
.
_registerHandle
(
center
,
self
.
center
)
def
_handleMoved
(
self
,
name
,
x
,
y
,
index
):
...
...
@@ -800,9 +806,8 @@ class RectRoiItem(RoiItemBase):
c_x
,
c_y
=
self
.
center
self
.
_xData
+=
x
-
c_x
self
.
_yData
+=
y
-
c_y
{
self
.
_setHandleData
(
corner
,
(
self
.
_xData
[
i
],
self
.
_yData
[
i
]))
for
i
,
corner
in
enumerate
(
self
.
_corners
)}
for
i
,
corner
in
enumerate
(
self
.
_corners
):
self
.
_setHandleData
(
corner
,
(
self
.
_xData
[
i
],
self
.
_yData
[
i
]))
else
:
# see the comment about the index value
# (in the finished method)
...
...
@@ -829,9 +834,9 @@ class RectRoiItem(RoiItemBase):
self
.
_yData
[
index
]
=
y
self
.
_setHandleData
(
self
.
_center
,
self
.
center
)
{
self
.
_setHandleData
(
self
.
_corners
[
i
],
(
self
.
_xData
[
i
],
self
.
_yData
[
i
]
))
for
i
in
(
v_op
,
h_op
)}
for
i
in
(
v_op
,
h_op
):
self
.
_setHandleData
(
self
.
_corners
[
i
]
,
(
self
.
_xData
[
i
],
self
.
_yData
[
i
]))
self
.
_updateSides
()
...
...
kmap/gui/view/fitview/ResultPlot.py
0 → 100644
View file @
9cc84717
Write
Preview
Supports
Markdown
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