MotorLogger.py

The MotorLogger creates a history of changes of motor attributes.

The MotorLogger creates new versions of the files

/online_dir/MotorLogs/motorLog.lis

/online_dir/MotorLogs/motorLog.py

$ MotorLogger.py 
Usage: MotorLogger.py -x [-q] [-c <progName>]
  Creates new versions of /online_dir/MotorLogs/motorLog.lis and ~.py
  Device names are printed, if stdout is a TTY AND -q is not supplied.
 <progName> is written to the log-file, if supplied.

Options:
  -h, --help  show this help message and exit
  -x          execute
  -q          quiet
  -c CALLER   name of the calling program, e.g. 'spock' or 'cron'

The MotorLogger is invoked by a cron job, 3 times a day, and during the startup of each Spock session (launched from 00-start.py).

TipsAndTricks: the MotorLogger can be invoked 'by hand' to check motor response times.

Excerpt for motorLog.lis:

#
# Created at 13.10.2015 12:03h by cron 
#
# Notice that there is a corresponding version of motorLog.py 
# which can be used to restore the attribute values 
#
...
#
dcm_bragg p09/dcmmotor/mono.01 Conversion: 200000
dcm_bragg p09/dcmmotor/mono.01 Position: 13.7282
dcm_bragg p09/dcmmotor/mono.01 SlewRate: 500000
dcm_bragg p09/dcmmotor/mono.01 UnitCalibration: 0.02498
dcm_bragg p09/dcmmotor/mono.01 UnitLimitMax: 54.025
dcm_bragg p09/dcmmotor/mono.01 UnitLimitMin: 0.02498
#
...

Excerpt for motorLog.py:

#
# Created at 13.10.2015 12:03h by cron 
#
# Notice that there is a corresponding version of motorLog.py 
# which can be used to restore the attribute values 
#
...
#
# dcm_bragg 
print " restoring haspp09mono:10000/p09/dcmmotor/mono.01 (dcm_bragg) "
proxy = PyTango.DeviceProxy( "haspp09mono:10000/p09/dcmmotor/mono.01")
print "  conversion: 200000.0"
proxy.write_attribute( "conversion", 200000.0)
# proxy.write_attribute( "position", 13.72823)
print "  slewrate: 500000.0"
proxy.write_attribute( "slewrate", 500000.0)
print "  unitcalibration: 0.02498"
proxy.write_attribute( "unitcalibration", 0.02498)
print "  unitlimitmax: 54.0249786377"
proxy.write_attribute( "unitlimitmax", 54.0249786377)
print "  unitlimitmin: 0.0249800011516"
proxy.write_attribute( "unitlimitmin", 0.0249800011516)
...

Question: do we need both files, .py and .lis?