Exemplo n.º 1
0
def getTaskReturn():
    smpStat = []
    stat, exception = PV("SW:LastTaskInfo").get()[4:6]
    if stat.startswith("ABORT"):
        stat, exception = stat.split(": ")

    if stat.startswith("Done") and stat.find("/") >= 0:
        stat, tmp = stat.split(" ")
        smpStat = [s == "True" for s in tmp.split("/")]

    if stat not in ("Done", "ABORT") and exception not in ("", "null"):
        stat = "ABORT"
    return stat, smpStat, exception
Exemplo n.º 2
0
    show_usage()
    sys.exit(1)

pvPrefix = sys.argv[1]
inputN = sys.argv[2]
pid = os.getpid()

msgPV = PV(pvPrefix + ':INP' + inputN + ':MSG')
filenamePV = PV(pvPrefix + ':INP' + inputN + ':FILENAME')
dataInt = PV(pvPrefix + ':INP' + inputN + ':DATAINT').get()
monitorTime = PV(pvPrefix + ':INP' + inputN + ':TOTALTIME').get()
caMonFlag = PV(pvPrefix + ':INP' + inputN + ':USEMONITOR').get()
#pidStatusPv=PV(pvPrefix + ':INP' + inputN + ':PIDSTATUS')

pvName = PV(pvPrefix + ':INP' + inputN + '.INP').get()
pv1 = PV(pvName.split()[0])

##################################################################################################################


class Writer(object):
    def __init__(self, name, mode):
        self.file = open(name, mode)

    def __del__(self):
        self.file.close()

    def write(self, data):
        self.file.write(data + '\n')