Commit 179b17e7 authored by Valentin Valls's avatar Valentin Valls
Browse files

Allow to specify a set of scans

parent beeca1c4
......@@ -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,6 +224,9 @@ class DefaultStyleStrategy(plot_model.StyleStrategy):
self.computeItemStyleFromImagePlot(plot)
else:
scans: List[Optional[scan_model.Scan]] = []
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())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment