Ejemplo n.º 1
0
def test_check_final_lc_data():
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()

    setNanny(abt, 1)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/load_data.txt')
    lc_data = getLCData(file)

    assert check_lc_data(lcl, lc_data) == [0, 602, 0]
Ejemplo n.º 2
0
def test_check_final_pt_data():
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()

    setNanny(abt, 1)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/press_data.txt')
    pt_data = getPTData(file)

    assert check_pt_data(ptl, pt_data) == [0, 0, 0, 0, 0, 0, 950]
Ejemplo n.º 3
0
def test_limit_switch_final():
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()

    setNanny(abt, 1)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/limit_data.txt')
    ls_data = getLSData(file)

    check_limit_switch(abt, vst, ls_data)
    assert getAbortState(abt) == 1
Ejemplo n.º 4
0
def test_check_final_tc_data():
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()

    setNanny(abt, 1)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/therm_data.txt')
    tc_data = getTCData(file)

    assert check_tc_data(tcl,
                         tc_data) == [0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0]
Ejemplo n.º 5
0
def test_check_final_limits():
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()

    setNanny(abt, 1)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/press_data.txt')
    pt_data_1 = getLCData(file)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/therm_data_2.txt')
    tc_data_2 = getLCData(file)

    script_dir = os.path.dirname(__file__)
    file = os.path.join(script_dir, '../raw/load_data_2.txt')
    lc_data_2 = getLCData(file)

    check_limits(abt, ptl, tcl, lcl, pt_data_1, tc_data_2, lc_data_2)
    assert getAbortState(abt) == 1
Ejemplo n.º 6
0
if args.start == True:
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()
    print(' ')
    print(' ')
    print('Initialize System:')
    print('(SAFE MODE)  Valve State =', getValveState(vst, ist, abt))
    print('(SAFE MODE)  Ignitor State =', getIgnitorState(vst, ist, abt, gst))
    print('(OFF)        Nanny =', getNanny(abt))
    print('(NOGO)       GO/NOGO =', getGOState(gst))
    print('(NOMINAL)    Abort State =', getAbortState(abt))
    print(' ')
    print(' ')
elif args.nanny == True:
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()
    setNanny(abt, 1)
    print(' ')
    print(' ')
    print('Initialize System and turn "Nanny" to "ON":')
    print('(ON)         Nanny =', getNanny(abt))
    print(' ')
    print(' ')
elif args.go == True:
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()
    print(' ')
    print(' ')
    print('Initialize System:')
    print('(SAFE MODE)  Ignitor State =', getIgnitorState(vst, ist, abt, gst))
    print('(NOGO)       GO/NOGO =', getGOState(gst),)
    print(' ')
    setGOState(gst,'a',1)
Ejemplo n.º 7
0
def test_nanny_set_state():
    vst, ist, abt, gst, ptl, tcl, lcl = _init_system()
    setNanny(abt, 1)
    assert getNanny(abt) == 1