Commit c6ebfc3e authored by Emmanuel Papillon's avatar Emmanuel Papillon
Browse files

icepap_log added

parent 07515c3d
def icepos_log(quiet=True):
import time
import bliss.common.session
current_session = bliss.common.session.get_current_session()
global_map = bliss.common.session.global_map
logpath = "/users/opid11/logfiles/"
logname = current_session.name + time.strftime("%Y%m%dT%Hh%M")
print("Logging motor positions to:",logpath+logname)
with open(logpath+logname,"a") as f:
for ax in global_map.get_axes_iter():
if hasattr(ax.controller, "read_encoder_all_types" ):
msg = "Name %s user %f dial %f limits %f %f %s\n"%(
ax.name,
ax.position,
ax.dial,
ax.limits[0],
ax.limits[1],
ax.controller.read_encoder_all_types(ax),
)
f.write( msg )
if not quiet:
print(msg,end=" ")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment