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
179b17e7
Commit
179b17e7
authored
May 27, 2021
by
Valentin Valls
Browse files
Allow to specify a set of scans
parent
beeca1c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/flint/helper/style_helper.py
View file @
179b17e7
...
...
@@ -15,6 +15,7 @@ from typing import List
from
typing
import
Dict
from
typing
import
Tuple
import
logging
from
bliss.flint.model
import
scan_model
from
bliss.flint.model
import
flint_model
from
bliss.flint.model
import
plot_model
...
...
@@ -22,6 +23,9 @@ from bliss.flint.model import plot_item_model
from
bliss.flint.model
import
plot_state_model
_logger
=
logging
.
getLogger
(
__name__
)
class
DefaultStyleStrategy
(
plot_model
.
StyleStrategy
):
def
__init__
(
self
,
flintModel
:
flint_model
.
FlintState
=
None
):
super
(
DefaultStyleStrategy
,
self
).
__init__
()
...
...
@@ -30,10 +34,16 @@ class DefaultStyleStrategy(plot_model.StyleStrategy):
Tuple
[
plot_model
.
Item
,
Optional
[
scan_model
.
Scan
]],
plot_model
.
Style
]
=
{}
self
.
__cacheInvalidated
=
True
self
.
__scans
=
[]
def
setFlintModel
(
self
,
flintModel
:
flint_model
.
FlintState
):
self
.
__flintModel
=
flintModel
def
setScans
(
self
,
scans
):
self
.
__scans
.
clear
()
self
.
__scans
.
extend
(
scans
)
self
.
invalidateStyles
()
def
__getstate__
(
self
):
return
{}
...
...
@@ -214,11 +224,14 @@ class DefaultStyleStrategy(plot_model.StyleStrategy):
self
.
computeItemStyleFromImagePlot
(
plot
)
else
:
scans
:
List
[
Optional
[
scan_model
.
Scan
]]
=
[]
for
item
in
plot
.
items
():
if
isinstance
(
item
,
plot_item_model
.
ScanItem
):
scans
.
append
(
item
.
scan
())
if
scans
==
[]:
scans
.
append
(
None
)
if
len
(
self
.
__scans
)
>
0
:
scans
=
self
.
__scans
else
:
for
item
in
plot
.
items
():
if
isinstance
(
item
,
plot_item_model
.
ScanItem
):
scans
.
append
(
item
.
scan
())
if
scans
==
[]:
scans
.
append
(
None
)
self
.
computeItemStyleFromCurvePlot
(
plot
,
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