Commit db401b9e authored by Valentin Valls's avatar Valentin Valls
Browse files

Add timestamp on the plotselect

parent bb2a3b61
......@@ -139,6 +139,7 @@ from typing import List
import numpy
import functools
import time
from bliss import current_session, is_bliss_shell, global_map
from bliss.common.protocols import Scannable
......@@ -280,6 +281,7 @@ def plotselect(*counters):
scan_display = ScanDisplay()
channel_names = get_channel_names(*counters)
scan_display.displayed_channels = channel_names
scan_display._displayed_channels_time = time.time()
if flint_proxy.check_flint():
flint = flint_proxy.get_flint(mandatory=False)
......
......@@ -586,7 +586,13 @@ def _select_default_counter(scan, plot):
class DisplayExtra(NamedTuple):
displayed_channels: Optional[List[str]]
"""Enforced list of channels to display for this specific scan"""
plotselect: Optional[List[str]]
"""List of name selected by plot select"""
plotselect_time: Optional[int]
"""Time from `time.time()` of the last plotselect"""
def parse_display_extra(scan_info: Dict) -> DisplayExtra:
......@@ -615,10 +621,12 @@ def parse_display_extra(scan_info: Dict) -> DisplayExtra:
)
raw = display_extra.get("plotselect", None)
plotselect = parse_optional_list_of_string(raw, "_display_extra.plotselect")
plotselect_time = display_extra.get("plotselect_time", None)
else:
displayed_channels = None
plotselect = None
return DisplayExtra(displayed_channels, plotselect)
plotselect_time = None
return DisplayExtra(displayed_channels, plotselect, plotselect_time)
def removed_same_plots(plots, remove_plots) -> List[plot_model.Plot]:
......
......@@ -1385,6 +1385,10 @@ class Scan:
if displayed_channels is not None:
# Contextual display request
display_extra["plotselect"] = displayed_channels
if self.__scan_display._displayed_channels_time is not None:
display_extra[
"plotselect_time"
] = self.__scan_display._displayed_channels_time
displayed_channels = self.__scan_display._pop_next_scan_displayed_channels()
if displayed_channels is not None:
# Structural display request specified for this scan
......
......@@ -30,6 +30,7 @@ class ScanDisplay(ParametersWardrobe):
"_extra_args": [],
"_scan_metadata": {},
"displayed_channels": [],
"_displayed_channels_time": None,
"scan_display_filter_enabled": True,
"restart_flint_if_stucked": False,
},
......@@ -38,6 +39,7 @@ class ScanDisplay(ParametersWardrobe):
"auto",
"motor_position",
"displayed_channels",
"_displayed_channels_time",
"_scan_metadata",
"scan_display_filter_enabled",
"restart_flint_if_stucked",
......
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