added nice print for collected histories

This commit is contained in:
2022-04-18 11:17:00 +02:00
parent cbbd4d5613
commit 11e1f8f386

View File

@ -9,6 +9,7 @@ from slic.core.adjustable import Adjustable, PVAdjustable
from slic.devices.general.motor import Motor
from slic.devices.device import Device
from slic.devices.simpledevice import SimpleDevice
from slic.utils.printing import printable_table
INDICES = {
@ -220,6 +221,19 @@ class HistoryDummy(Adjustable):
return False
def print_history(*adjs, enumerate_lines=True, make_legend=True):
labels = []
histories = []
for a in adjs:
try:
h = a.history
except AttributeError:
continue
labels.append(repr(a))
histories.append(h)
print(printable_table(histories, labels, enumerate_lines=enumerate_lines, make_legend=make_legend))
# these point to the different motors
mu = Motor("SATES30-RIXS:MOT_SRY.VAL")