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]
import numpy as np from argparse import ArgumentParser as ap import os # local imports from pyign.functions.core import getPTData, getTCData, getLCData, getLSData, getGOState, getAbortState, getNanny, getValveState, getIgnitorState, setValveState, setIgnitorState, setGOState, setAbortState, setNanny, _init_system, pt_index, tc_index, lc_index, check_limits, check_limit_switch, check_go, check_abort, check_pt_data, check_tc_data, check_lc_data ''' # local imports from core import getPTData, getTCData, getLCData, getLSData, getGOState, getAbortState, getNanny, getValveState, getIgnitorState, setValveState, setIgnitorState, setGOState, setAbortState, setNanny, _init_system, pt_index, tc_index, lc_index, check_limits, check_limit_switch, check_go, check_abort, check_pt_data, check_tc_data, check_lc_data ''' script_dir = os.path.dirname(__file__) file_1 = os.path.join(script_dir, '../raw/press_data.txt') file_2 = os.path.join(script_dir, '../raw/therm_data.txt') file_3 = os.path.join(script_dir, '../raw/load_data.txt') pt_data = getTCData(file_1) tc_data = getTCData(file_2) lc_data = getTCData(file_3) parser = ap(description='Test Stand System State') parser.add_argument('-s','--start',action = 'store_true',required = False, help = 'Initialize and output initial system state') parser.add_argument('-n','--nanny',action = 'store_true',required = False, help = 'Turn "Nanny" to "ON"') parser.add_argument('-g','--go',action = 'store_true',required = False, help = 'Turn "GO/NOGO" to "GO" and change ignitor state') parser.add_argument('-t','--test',action = 'store_true',required = False, help = 'Tests system with input sensor data') args = parser.parse_args()
def test_check_tc_data(): script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/therm_data.txt') data = getTCData(file) assert check_tc_data(tcl, data) == [0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0, 0]
def test_tc_index(): script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/therm_data.txt') data = getTCData(file) assert tc_index(tcl, data) == [0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0]
def test_getTCData_final(): script_dir = os.path.dirname(__file__) file = os.path.join(script_dir, '../raw/therm_data.txt') assert getTCData(file)[11] == 572