adjust attribute names to TextInput -> Spinner change

This commit is contained in:
2021-06-09 14:50:51 +02:00
parent ecfe4882b4
commit 35ccbe8764
5 changed files with 13 additions and 13 deletions

View File

@ -16,8 +16,8 @@ class Actor:
self.frm = frm = Frame(plt, cfg)
self.cache = cache = src.cache.get_view()
cfg.ti_cache_size.value = cache.size
cfg.ti_cache_size.on_change("value", cb(self.do_update_cache_size))
cfg.sp_cache_size.value = cache.size
cfg.sp_cache_size.on_change("value", cb(self.do_update_cache_size))
if isinstance(cfg, ConfigDialog1D): #TODO
cfg.curves_latest.active = plt.line_latest.visible

View File

@ -6,8 +6,8 @@ from ..buki import Column
class ConfigDialog0D(Column):
def __init__(self):
self.ti_cache_size = ti_cache_size = Spinner(title="Cache size:")
super().__init__(ti_cache_size)
self.sp_cache_size = sp_cache_size = Spinner(title="Cache size:")
super().__init__(sp_cache_size)

View File

@ -8,7 +8,7 @@ from ..widgets import Checkbox
class ConfigDialog1D(Column):
def __init__(self):
self.ti_cache_size = ti_cache_size = Spinner(title="Cache size:")
self.sp_cache_size = sp_cache_size = Spinner(title="Cache size:")
self.curves_latest = curves_latest = Checkbox(label="Latest Curve")
self.curves_average = curves_average = Checkbox(label="Average Curve")
@ -17,7 +17,7 @@ class ConfigDialog1D(Column):
self.error_bands = error_bands = Checkbox(label="Error Bands")
super().__init__(
ti_cache_size,
sp_cache_size,
make_entry("Curves", curves_latest, curves_average),
make_entry("Errors", error_bars, error_bands)
)

View File

@ -13,13 +13,13 @@ CMAPS = [
class ConfigDialog2D(Column):
def __init__(self):
self.ti_cache_size = ti_cache_size = Spinner(title="Cache size:")
ti_cache_size.disabled = True # 2D plot only shows the latest image
self.sp_cache_size = sp_cache_size = Spinner(title="Cache size:")
sp_cache_size.disabled = True # 2D plot only shows the latest image
self.sel_cmap = sel_cmap = Select(title="Colormap", options=CMAPS)
self.sp_vmin = sp_vmin = Spinner(title="Minimum Value")
self.sp_vmax = sp_vmax = Spinner(title="Maximum Value")
super().__init__(
ti_cache_size,
sp_cache_size,
sel_cmap,
Row(sp_vmin, sp_vmax)
)

View File

@ -14,11 +14,11 @@ class Director:
self.doc = doc = curdoc()
doc.title = choice("👺👹") + " kabuki"
self.ti_add_pvs = ti_add_pvs = TextInput(value="", title="Add PV:")
ti_add_pvs.on_change("value", self.do_add_pvs)
self.sp_add_pvs = sp_add_pvs = TextInput(value="", title="Add PV:")
sp_add_pvs.on_change("value", self.do_add_pvs)
self.plot_container = plot_container = Column()
root_container = column(ti_add_pvs, Spacer(height=15), plot_container.layout)
root_container = column(sp_add_pvs, Spacer(height=15), plot_container.layout)
doc.add_root(root_container)
self.updates = []
@ -32,7 +32,7 @@ class Director:
def do_add_pvs(self, attr, old, new):
if not new: return # do not trigger on the following value reset
self.ti_add_pvs.value = ""
self.sp_add_pvs.value = ""
print(f"CB Add PV: attribute \"{attr}\" changed from \"{old}\" to \"{new}\"")
new = new.upper() # PV names are all upper case
grid = break_apart(new)