split a method in two, some tests on callback performance
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
#from functools import partial
|
||||
from random import choice
|
||||
|
||||
from bokeh.layouts import column
|
||||
@ -28,19 +29,25 @@ class Director:
|
||||
def periodic_update(self):
|
||||
for func in self.updates:
|
||||
func()
|
||||
# self.doc.add_next_tick_callback(func) #TODO: would this be an improvement?
|
||||
|
||||
|
||||
def do_add_pvs(self, attr, old, new):
|
||||
if not new: return # do not trigger on the following value reset
|
||||
self.sp_add_pvs.value = ""
|
||||
print(f"CB Add PV: attribute \"{attr}\" changed from \"{old}\" to \"{new}\"")
|
||||
self.add_pvs(new)
|
||||
# self.doc.add_next_tick_callback(partial(self.add_pvs, new)) #TODO: would this be an improvement?
|
||||
|
||||
|
||||
def add_pvs(self, new):
|
||||
new = new.upper() # PV names are all upper case
|
||||
grid = break_apart(new)
|
||||
print(normalized_string(grid))
|
||||
self.add_pvs(grid)
|
||||
self.add_pvs_grid(grid)
|
||||
|
||||
|
||||
def add_pvs(self, pvnames_grid):
|
||||
def add_pvs_grid(self, pvnames_grid):
|
||||
for pvnames in reversed(pvnames_grid):
|
||||
pvs_row = self.make_pvs_row(pvnames)
|
||||
if not pvs_row.children:
|
||||
|
Reference in New Issue
Block a user