diff --git a/script/FeCrXPS.py b/script/FeCrXPS.py index b39235ff..79a66535 100644 --- a/script/FeCrXPS.py +++ b/script/FeCrXPS.py @@ -25,7 +25,7 @@ cur_iteration = 0 Scienta.acquisitionMode = Scienta.AcquisitionMode.Swept ret=[] -set_context(open = True) +set_exec_pars(open = True) #Global arguments Scienta.passEnergy = pass_energy @@ -39,7 +39,7 @@ spectrum_series = plots[0].getSeries(0) def plot_cur_spectrum(): global spectrum_series try: - while context.state.running: + while get_context().state.running: y = Scienta.spectrum.take(100) x = Scienta.spectrumX spectrum_series.setData(x, y) diff --git a/script/ScriptingExample.py b/script/ScriptingExample.py index 9be60e53..3d0eb610 100644 --- a/script/ScriptingExample.py +++ b/script/ScriptingExample.py @@ -5,7 +5,7 @@ set_adc_averaging() #ascan((ManipulatorPhi, ManipulatorTheta, Scienta.centerEnergy), (Counts, Scienta.image), (-1,-1,50), (1,1,70), (5,5,1), relative = True, zigzag = True, before_read=before_readout, after_read = after_readout) -set_context(name = "test") +set_exec_pars(name = "test") class PseudoDevice(Writable): def write(self, val): diff --git a/script/XPSSpectrum.py b/script/XPSSpectrum.py index 15c0b45a..2b4f0852 100644 --- a/script/XPSSpectrum.py +++ b/script/XPSSpectrum.py @@ -14,7 +14,7 @@ if Scienta.acquisitionMode != Scienta.AcquisitionMode.Swept: ret=[] -set_context(open = True) +set_exec_pars(open = True) #Global arguments Scienta.passEnergy = pass_energy @@ -28,7 +28,7 @@ spectrum_series = plots[0].getSeries(0) def plot_cur_spectrum(): global spectrum_series try: - while context.state.running: + while get_context().state.running: y = Scienta.spectrum.take(100) x = Scienta.spectrumX spectrum_series.setData(x, y) diff --git a/script/local.py b/script/local.py index 585ee287..466f5866 100644 --- a/script/local.py +++ b/script/local.py @@ -202,14 +202,14 @@ def print_diag(): def create_diag_datasets(parent = None): if parent is None: - parent = get_context().group + parent = get_exec_pars().group group = parent + "attrs/" for f in diag_channels: create_dataset(group+get_diag_name(f) , 's' if (type(f) is ch.psi.pshell.epics.ChannelString) else 'd') def append_diag_datasets(parent = None): if parent is None: - parent = get_context().group + parent = get_exec_pars().group group = parent + "attrs/" for f in diag_channels: x = f.read() @@ -241,7 +241,7 @@ def before_readout(): def after_readout(rec): - if get_context().persist: + if get_exec_pars().persist: if rec.index == 0: create_diag_datasets() append_diag_datasets() @@ -273,7 +273,7 @@ def adjust_sensors(): SENSORS=[SENSORS.pop(SENSORS.index(dev))] + SENSORS if "Scienta.dataMatrix" in SENSORS or Scienta.dataMatrix in SENSORS: print "Not ACC" - set_context(accumulate = False) + set_exec_pars(accumulate = False) #Device aliases for data files set_device_alias(Scienta.dataMatrix, "ScientaImage") @@ -328,7 +328,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom Add entry to ELOG. """ if author is None: - author = "pshell" #context.getUser().name + author = "pshell" #get_context().getUser().name typ = "pshell" entry = "" @@ -353,7 +353,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom raise Exception(err) print out -def get_plot_snapshots(title = None, file_type = "jpg", temp_path = context.setup.getContextPath()): +def get_plot_snapshots(title = None, file_type = "jpg", temp_path = get_context().setup.getContextPath()): """ Returns list with file names of plots snapshots from a plotting context. """ diff --git a/script/test/monitoring.py b/script/test/monitoring.py index a78d55bc..ffa193a1 100644 --- a/script/test/monitoring.py +++ b/script/test/monitoring.py @@ -1,9 +1,9 @@ -if context.state == State.Ready: +if get_context().state == State.Ready: print "Testing..." if not Scienta.state.isInitialized(): print "Try initialize Scienta..." try: - context.evalLine("Scienta.initialize()") + get_context().evalLine("Scienta.initialize()") print "Scienta reinit ok" except: print "Scienta reinit failure" @@ -17,7 +17,7 @@ if context.state == State.Ready: if i >= retries-1: print "Scienta timeout, try initialize..." try: - context.evalLine("Scienta.initialize()") + get_context().evalLine("Scienta.initialize()") print "Scienta reinit ok" except: print "Scienta reinit failure"