From 0999cea491ea68c6e594012e6bea10c63c97bd12 Mon Sep 17 00:00:00 2001
From: "FR@29iduser" <rodolakis@anl.gov>
Date: Tue, 4 Oct 2022 15:17:48 -0500
Subject: [PATCH] fixed logging in octupole

---
 iexcode/instruments/Logfile.py    |  1 +
 iexcode/instruments/Octupole.py   |  4 ++--
 iexcode/instruments/m3r.py        | 12 ++++++------
 iexcode/instruments/scanRecord.py |  2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/iexcode/instruments/Logfile.py b/iexcode/instruments/Logfile.py
index cc949dc..7f992a5 100644
--- a/iexcode/instruments/Logfile.py
+++ b/iexcode/instruments/Logfile.py
@@ -35,6 +35,7 @@ def log_update(d=None,**kwargs):
 def log_name_set(file_name):
     try: 
         iex.BL.mda.log.name_set(filename=file_name)
+        iex.BL.mda.filename = filename
     except:
         print('No logfile name change')
 
diff --git a/iexcode/instruments/Octupole.py b/iexcode/instruments/Octupole.py
index 569614f..77b2476 100644
--- a/iexcode/instruments/Octupole.py
+++ b/iexcode/instruments/Octupole.py
@@ -353,8 +353,8 @@ def _Octupole_log_dictionary():
 
     Previously: scanlog
     """
-    tey.get()
-    mesh.get()
+    tey.get(verbose=False)
+    mesh.get(verbose=False)
     #header: pv, format
     d={
         "x":(Octupole_Motors.get('x'),".2f"),
diff --git a/iexcode/instruments/m3r.py b/iexcode/instruments/m3r.py
index 04aef80..5de10c0 100644
--- a/iexcode/instruments/m3r.py
+++ b/iexcode/instruments/m3r.py
@@ -116,22 +116,22 @@ def m3r_switch_branch(branch,verbose=True):
 ################################             M3R alignment             ##############################
 ##############################################################################################################
 
-def m3r_centroid(t=None,q=1): 
+def m3r_centroid(acq_time=None,verbose=False): 
     '''
     Return position of centroid, sigma, m3r:RY (mirror pitch)
     Optional argument t to set camera intergration time.
     '''
-    if t is not None:
-        caput(M3R_cam1+'AcquireTime',t)
+    if acq_time is not None:
+        caput(M3R_cam1+'AcquireTime',acq_time)
     else:
-        t=caget(M3R_cam1+'AcquireTime')
+        acq_time=caget(M3R_cam1+'AcquireTime')
     position =  round(caget(M3R_stats+'CentroidX_RBV'),2)
     sigma = round(caget(M3R_stats+'SigmaX_RBV'),2)
     intensity = round(caget(M3R_stats+'CentroidTotal_RBV'),2)
     m3rRY = round(caget(M3R_pitch),4)
-    if q != None:
+    if verbose:
         print('(position, sigma, total intensity, integration time (s), mirror pitch):')
-    return position,sigma,intensity,t,m3rRY
+    return position,sigma,intensity,acq_time,m3rRY
 
 def _m3r_align_start(pxl=None):
     if pxl == None:
diff --git a/iexcode/instruments/scanRecord.py b/iexcode/instruments/scanRecord.py
index be573f4..f0b2d4b 100644
--- a/iexcode/instruments/scanRecord.py
+++ b/iexcode/instruments/scanRecord.py
@@ -73,7 +73,7 @@ def mda_user_name():
     """
     return iex.BL.mda.user_name()
 
-def mda_user_name():
+def mda_run_cycle():
     """
     returns the run cycle form the mda filepath
     """
-- 
GitLab