import context as insert

try:
    sensors = {}
    sensors.update({'load': {'FRSNTK': [0]}})
    measurements = {}
    measurements.update({'L0': 0})
    WorA = 'a'
    OT = '2017_1730'  # '2017_0010'
    whatInsert = 'B'
    nmbr = 1
    ins = insert.InsertRotor2Stator(
        typetest="insert",
        model='EVO10',
        OT=OT,
        WorA=WorA,
        sensors=sensors,
        measurements=measurements,
        )
    isOk = ins.check_is_ok(
        path='/home/pi/results/insert/{}/{}_{}.csv'.format(
            OT, nmbr, whatInsert),
        whatInsert=whatInsert,
        )
    # print('is_ok {}'.format(is_ok))
    # ins.test_csv()
except KeyboardInterrupt:
    ins.closeGPIO()
