unified Plot*.set(), always accept times and values

This commit is contained in:
2021-06-03 10:16:34 +02:00
parent bd9150fb1a
commit 123b7987fd
2 changed files with 5 additions and 4 deletions

View File

@@ -7,8 +7,8 @@ from sources import Camera, Source
def update_all(plt, cache):
plt.set(*cache.xy)
def update_latest(plt, cache):
plt.set(cache.latest)
#def update_latest(plt, cache):
# plt.set(cache.latest)
def decide_src_plt_cache_update(pvname):
@@ -19,7 +19,7 @@ def decide_src_plt_cache_update(pvname):
src = Camera(pvname)
plt = Plot2D
cache_size = 1
update = update_latest
update = update_all
if not src.is_connected:
raise RuntimeError(f"{pvname} is not connected")

View File

@@ -28,7 +28,8 @@ class Plot2D(Object):
super().__init__(fig)
def set(self, image):
def set(self, times, values):
image = values[-1]
self.source.data.update(image=[image])