Update to V2

This commit is contained in:
gac-x07mb
2026-03-02 13:49:55 +01:00
parent 67cee074cb
commit 405e5daf9f
27 changed files with 144 additions and 142 deletions
-4
View File
@@ -27,7 +27,6 @@ imp.reload(PL) # always reload module
NoRead=0
def before_pass():
get_context().dataManager.provider.embeddedAtributes = False
# Called at begining pf scan
print('before_pass')
SC.PerformActions('Pre_Actions')
@@ -248,9 +247,6 @@ p=set_exec_pars(name=SD['filename'])
# save scan definition
get_context().dataManager.provider.embeddedAtributes = False
# .. now make individual scan for all positioners as defiens in GUI
# as we like want to have separete datasets for each scan \
#
+6 -6
View File
@@ -35,7 +35,7 @@ maintenance_mode = False
#Reading Energy Scan configuration file
def getPars(element):
f = open(get_context().setup.getConfigPath() + '/energy_scan.properties')
f = open(Setup.getConfigPath() + '/energy_scan.properties')
try:
for line in f:
tokens = line.split("=")
@@ -170,7 +170,7 @@ def convert_file(input_file_name, output_file_name, pol = None):
out.write(Ecrbk + s + CADC1 + s + CADC2 + s + CADC3 + s + CADC4 + s + CADC5 + s + MCurr + s + time + s + MAGX + s + MAGZ + s + str(pol) + s + EXPT + s + normtey + s + normdiode + line_sep)
except:
traceback.print_exc()
os.rename(input_file_name, get_context().setup.expandPath("{data}/OTF/" + ntpath.basename(input_file_name)))
os.rename(input_file_name, Setup.expandPath("{data}/OTF/" + ntpath.basename(input_file_name)))
def plot_file(file_name, title = None):
"""
@@ -184,7 +184,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom
Add entry to ELOG.
"""
if author is None:
author = "pshell" #get_context().user.name
author = "pshell" #Context.getUserName()
typ = "pshell"
entry = ""
@@ -209,7 +209,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom
raise Exception(err)
print out
def get_plot_snapshots(title = None, file_type = "png", temp_path = get_context().setup.getContextPath()):
def get_plot_snapshots(title = None, file_type = "png", temp_path = Setup.getContextPath()):
"""
Returns list with file names of plots snapshots from a plotting context.
"""
@@ -601,7 +601,7 @@ def otf(start, end, time, delay=0.0, mode = None, offset = None, alpha = None, n
"""
if name is None:
name = get_exec_pars().name
folder = get_context().setup.expandPath("{year}_{month}/{date}");
folder = Setup.expandPath("{year}_{month}/{date}");
if len(name)> 38:
name = name[:38]
@@ -615,7 +615,7 @@ def otf2(start, end, time, delay=0.0, mode = None, offset = None, alpha = None,
"""
if name is None:
name = get_exec_pars().name
folder = get_context().setup.expandPath("{year}_{month}/{date}");
folder = Setup.expandPath("{year}_{month}/{date}");
if len(name)> 38:
name = name[:38]
@@ -59,7 +59,7 @@ if move_mono == True:
caput('E1', E1)
caput('E2', E2)
caput('TIME', TIME)
caput('FOLDER', "OTF/" + get_context().setup.expandPath("OTF/{year}_{month}/{date}"))
caput('FOLDER', "OTF/" + Setup.expandPath("OTF/{year}_{month}/{date}"))
caput('FILE', NAME)
#endif
time.sleep(max(DELAY, 0.1))
-2
View File
@@ -39,7 +39,6 @@ NoRead=0
def before_pass():
get_context().dataManager.provider.embeddedAtributes = False
# Called at begining pf scan
print('before_pass')
SC.PerformActions('Pre_Actions')
@@ -256,7 +255,6 @@ print(' ')
p=set_exec_pars(name=SD['filename'])
get_context().dataManager.provider.embeddedAtributes = False
time.sleep(.2)
print(' -')
-3
View File
@@ -27,7 +27,6 @@ imp.reload(PL) # always reload module
NoRead=0
def before_pass():
get_context().dataManager.provider.embeddedAtributes = False
# Called at begining pf scan
print('before_pass')
SC.PerformActions('Pre_Actions')
@@ -249,8 +248,6 @@ p=set_exec_pars(name=SD['filename'])
# save scan definition
get_context().dataManager.provider.embeddedAtributes = False
asd
# .. now make individual scan for all positioners as defiens in GUI
# as we like want to have separete datasets for each scan \
#stop