diff --git a/motorHist.py b/motorHist.py index c2426a71294e99e2b3beb53814ebafed2ba76921..309b11150c2bb6018d71d974594c603144878a70 100755 --- a/motorHist.py +++ b/motorHist.py @@ -108,7 +108,19 @@ def main(log_file): # Assume every record name is a motor, add to list if name is new if name not in motor_dict.keys(): - motor_dict[name] = {"MSTA" : -1, "MIP" : -1} + motor_dict[name] = {"MSTA" : -1, "MIP" : -1, "VAL" : None} + + # Check for VAL change + if field == "VAL": + # Catch error here? + current_val = float(value) + last_val = motor_dict[name]["VAL"] + if last_val == None: + print "[%s %s] %s's %s field starts at %0.4f" % (date, time, name, field, current_val) + else: + print "[%s %s] %s's %s field changed from %0.4f to %0.4f" % (date, time, name, field, last_val, current_val) + motor_dict[name]["VAL"] = current_val + print # Check for MSTA change if field == "MSTA":