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
Bliss
bliss
Commits
c3723876
Commit
c3723876
authored
May 21, 2021
by
Valentin Valls
Browse files
Handle ImagePlot update in specific way
parent
fe72c259
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/flint/manager/manager.py
View file @
c3723876
...
...
@@ -535,6 +535,7 @@ class ManageMainBehaviours(qt.QObject):
self
.
__updateFocus
(
defaultWidget
,
usedWidgets
)
def
updateWidgetWithPlot
(
self
,
widget
,
scan
,
plotModel
,
useDefaultPlot
):
# FIXME: useDefaultPlot is probably not much useful
def
reusePreviousPlotItems
(
previousWidgetPlot
,
plotModel
,
scan
):
with
previousWidgetPlot
.
transaction
():
# Clean up temporary items
...
...
@@ -552,10 +553,10 @@ class ManageMainBehaviours(qt.QObject):
previousWidgetPlot
,
plotModel
,
scan
)
# FIXME: This if-else branches should be the same, but for now
# make it safe for BLISS 1.8
# FIXME: This looks to became business model
# This have to be refactored in order to answer to each cases the way
# people expect to retrieve the selection
if
isinstance
(
plotModel
,
plot_item_model
.
CurvePlot
):
# For BLISS 1.8
previousPlotModel
=
widget
.
plotModel
()
if
previousPlotModel
is
None
:
...
...
@@ -584,6 +585,13 @@ class ManageMainBehaviours(qt.QObject):
if
plotModel
.
styleStrategy
()
is
None
:
plotModel
.
setStyleStrategy
(
DefaultStyleStrategy
(
self
.
__flintModel
))
widget
.
setPlotModel
(
plotModel
)
elif
isinstance
(
plotModel
,
plot_item_model
.
ImagePlot
):
previousPlotModel
=
widget
.
plotModel
()
if
previousPlotModel
is
not
None
:
model_helper
.
copyItemsFromRoiNames
(
previousPlotModel
,
plotModel
)
if
plotModel
.
styleStrategy
()
is
None
:
plotModel
.
setStyleStrategy
(
DefaultStyleStrategy
(
self
.
__flintModel
))
widget
.
setPlotModel
(
plotModel
)
else
:
previousWidgetPlot
=
widget
.
plotModel
()
if
previousWidgetPlot
is
not
None
:
...
...
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