Пример #1
0
def cond_state():
    if not scriptSys.GENERAL['mode'] == 'CONDITIONING' : #es llamado por 1 vez
        scriptSys.GENERAL['mode'] = 'CONDITIONING'
        scriptSys.TIME_INIT = scriptSys.TIME
        print "PAUSE"
        scriptSys.ini_Update()
        sys.exit()

    if  ((scriptSys.TIME) - (scriptSys.TIME_INIT)) >= maxTimeCond:
        if scriptSys.VOLTAGE < umbralVoltLow:
            charge_state(2)
            scriptSys.ini_Update()
            sys.exit()
        if scriptSys.VOLTAGE > umbralVoltHigh:
            discharge_state(2)
            scriptSys.ini_Update()
            sys.exit()
        if scriptSys.VOLTAGE < umbralVoltHigh and \
            scriptSys.VOLTAGE > umbralVoltLow:
            scriptInc.measure_z1()
            scriptSys.ini_Update()
            sys.exit()
    print "RUN"
    scriptSys.ini_Update()
    sys.exit()  #continua esperando
    return
Пример #2
0
def cond_state():
    if (scriptSys.TIME - scriptSys.TIME_INIT) >= maxTimeCond:
        if scriptSys.VOLTAGE < umbralVoltLow:
            scriptSys.GENERAL['mode'] = "CHARGE"
            scriptSys.TIME_INIT = scriptSys.TIME
            print "CHARGE,4.5,1.0"
            scriptSys.ini_Update()
            sys.exit()
        if scriptSys.VOLTAGE > umbralVoltHigh:
            scriptSys.GENERAL['mode'] = "DISCHARGE"
            scriptSys.TIME_INIT = scriptSys.TIME
            print "DISCHARGE,1.5"
            scriptSys.ini_Update()
            sys.exit()
        if scriptSys.VOLTAGE < umbralVoltHigh & scriptSys.VOLTAGE > umbralVoltLow:
            scriptInc.measure_z1()
            scriptSys.ini_Update()
            sys.exit()
    print "RUN"
    scriptSys.ini_Update()
    sys.exit()  #continua esperando
    return
Пример #3
0
def init_state() :
    try:
        if scriptSys.TIME >= maxTimeInit and scriptSys.VOLTAGE > vMargin:
            scriptInc.measure_z1()
            return
        if scriptSys.TIME >= maxTimeInitFail and scriptSys.VOLTAGE <= vMargin:
            scriptSys.final_report("F01",0)
            return
            # if scriptSys.VOLTAGE <= umbralVoltLow:
            #     charge_state(1)
            #     return
            # if scriptSys.VOLTAGE > umbralVoltLow:
            #     stress_state()
            #     return
            #
            # if scriptSys.VOLTAGE < umbralVoltHigh and \
            #     scriptSys.VOLTAGE > umbralVoltLow:
            #     stress_state()
            #     return
        print "RUN"
        return
    except:
        scriptSys.error_report("init_state()")
Пример #4
0
def zmeasure_state():
    scriptInc.measure_z1()

    scriptSys.ini_Update()
    sys.exit()
    return
Пример #5
0
def zmeasure_state():
    try:
        scriptInc.measure_z1()
        return
    except Exception as e:
        scriptSys.error_report(e, "zmeasure_state()")
Пример #6
0
def zmeasure_state() :
    try:
        scriptInc.measure_z1()
        return
    except: