do_elog = True if get_exec_pars().source == CommandSource.ui: station = "STEST01" else: station = args[0] phase_set = caget(station + "-RSYS:PHASE-SET") ampli_set = caget(station + "-RSYS:AMPLT-SET") power_set = caget(station + "-RSYS:POWER-SET") n = 0 if (phase_set == 'True'): phase_offset = caget(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE-CALC") caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset) print phase_set n = n + 1 if (ampli_set == 'True'): amplitude_scale = caget(station + "-RSYS:SET-VSUM-AMPLT-SCALE-CALC") caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", amplitude_scale) print ampli_set n = n + 1 if (power_set == 'True'): power_scale = caget(station + "-RSYS:SET-VOLT-POWER-SCALE-CALC") caput(station + "-RSYS:SET-VOLT-POWER-SCALE", power_scale) print power_set n = n + 1 caput(station + "-RSYS:CMD-LOAD-CALIB-BEAM", 1) if do_elog == True and n > 0: title = "Set phase" + station log_msg = "" if (phase_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE: %0.2f" % phase_offset + " deg \n" if (ampli_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VSUM-AMPLT-SCALE: %0.3f" % amplitude_scale + " MV \n" if (power_set == 'True'): log_msg = log_msg + station + "-RSYS:SET-VOLT-POWER-SCALE: %0.5f" % power_scale + " MW/MV^2" attachments = [] elog(title, log_msg, attachments)