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
Bliss
bliss
Commits
28416b43
Commit
28416b43
authored
May 21, 2021
by
Valentin Valls
Browse files
Add test to check user selection on curve plot
parent
d9a6a07e
Pipeline
#47122
passed with stages
in 108 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/qt/flint/manager/test_manager.py
View file @
28416b43
...
...
@@ -6,6 +6,7 @@ from bliss.flint.model import flint_model
from
bliss.flint.model
import
plot_item_model
from
bliss.flint.widgets.curve_plot
import
CurvePlotWidget
from
bliss.flint.helper
import
scan_info_helper
from
bliss.flint.helper
import
model_helper
SCAN_INFO_LIMA_ROIS
=
{
...
...
@@ -150,6 +151,50 @@ def test_consecutive_scans__loopscan_ascan(local_flint):
assert
item
.
xChannel
().
name
()
==
"axis:sx"
def
test_consecutive_scans__user_selection
(
local_flint
):
"""
Test plot state with consecutive scans and a user selection in between
We expect the user selection to be restored
"""
flint
=
flint_model
.
FlintState
()
workspace
=
flint_model
.
Workspace
()
flint
.
setWorkspace
(
workspace
)
widget
=
CurvePlotWidget
()
workspace
.
addWidget
(
widget
)
manager
=
ManageMainBehaviours
()
manager
.
setFlintModel
(
flint
)
loopscan_info
=
_create_loopscan_scan_info
()
scan
=
scan_info_helper
.
create_scan_model
(
loopscan_info
)
plots
=
scan_info_helper
.
create_plot_model
(
loopscan_info
,
scan
)
plot
=
[
p
for
p
in
plots
if
isinstance
(
p
,
plot_item_model
.
CurvePlot
)][
0
]
manager
.
updateWidgetWithPlot
(
widget
,
scan
,
plot
,
useDefaultPlot
=
True
)
model
=
widget
.
plotModel
()
assert
len
(
model
.
items
())
==
1
# user selection
model_helper
.
updateDisplayedChannelNames
(
plot
,
scan
,
[
"simulation_diode_sampling_controller:diode1"
,
"simulation_diode_sampling_controller:diode2"
,
],
)
plot
.
tagUserEditTime
()
ascan_info
=
_create_ascan_scan_info
(
"axis:sx"
)
scan
=
scan_info_helper
.
create_scan_model
(
ascan_info
)
plots
=
scan_info_helper
.
create_plot_model
(
ascan_info
,
scan
)
plot
=
[
p
for
p
in
plots
if
isinstance
(
p
,
plot_item_model
.
CurvePlot
)][
0
]
manager
.
updateWidgetWithPlot
(
widget
,
scan
,
plot
,
useDefaultPlot
=
True
)
model
=
widget
.
plotModel
()
assert
len
(
model
.
items
())
==
2
def
test_consecutive_scans__ascan_ascan
(
local_flint
):
"""
Test plot state with consecutive scans
...
...
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