diff --git a/script/jitter_scan.py b/script/jitter_scan.py index e8ce393..1fcc85e 100644 --- a/script/jitter_scan.py +++ b/script/jitter_scan.py @@ -9,6 +9,38 @@ stop = 180.0 step = 10.0 +def elogllrf(subject, message, attachments = [], system, subsystem, section, machine = "SwissFEL", logbook = "LLRF", encoding=1): + """ + Add entry to ELOG. + """ + if author is None: + author = "pshell" + controller.getUser().name + entry = "" + + cmd = 'G_CS_ELOG_add -l "' + logbook+ '" ' + cmd = cmd + '-a "Author=' + author + '" ' + cmd = cmd + '-a "Entry=' + entry + '" ' + cmd = cmd + '-a "Subject=' + subject + '" ' + cmd = cmd + '-a "Section=' + section + '" ' + cmd = cmd + '-a "System=' + system + '" ' + cmd = cmd + '-a "Subsystem=' + subsystem + '" ' + cmd = cmd + '-a "Machine=' + machine + '" ' + cmd = cmd + '-a "Domain=All"' + for attachment in attachments: + cmd = cmd + '-f "' + attachment + '" ' + cmd = cmd + '-x -n ' + str(encoding) + cmd = cmd + ' "' + message + '"' + print cmd + #os.system (cmd) + #print os.popen(cmd).read() + import subprocess + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) + (out, err) = proc.communicate() + if (err is not None) and err!="": + raise Exception(err) + print out + + print "SECTION = ", SECTION print "Start = ", start