diff --git a/script/local.py b/script/local.py index ef9daac..ce52603 100644 --- a/script/local.py +++ b/script/local.py @@ -15,7 +15,8 @@ class DataLayout( ch.psi.pshell.data.LayoutTable): def getDatasetName(self, scan): global FILENAME, data_file - name = get_context().name if (FILENAME is None) else FILENAME + #name = get_context().name if (FILENAME is None) else FILENAME + name = get_context().name data_file = time.strftime('%Y%m%d_%H%M') + '_' + name + '_' + str(get_context().index).zfill(4) print FILENAME print "Opened data file: " + get_context().path + "/" + data_file @@ -147,12 +148,12 @@ def plot_file(file_name, title = None): # Controller state listener ################################################################################################### -class Listener(ControllerListener): - def onControllerStateChanged(self, state, former): - global FILENAME - if former == State.Busy: - FILENAME = None -controller.addListener(Listener()) #Old listeners are cleande in startup +#class Listener(ControllerListener): +# def onControllerStateChanged(self, state, former): +# global FILENAME +# if former == State.Busy: +# FILENAME = None +#controller.addListener(Listener()) #Old listeners are cleande in startup ################################################################################################### @@ -347,8 +348,9 @@ def wait_inj (value, delay=0.5): def set_file(file_name): """ """ - global FILENAME - FILENAME = file_name + #global FILENAME + #FILENAME = file_name + set_context(name = file_name) class pol_mod(Readable): def read(self):