def checkShutdown(gpio = None, display = None): while(True): if GPIO.input(PINS["SHUTDOWN"]) == False: loffset = 10 display.fill_screen((255, 255)) shutdownDisp = TS(loffset, 26, 14, "Shutting Down", font14h) descDisp1 = TS(loffset, 42, 14, "Wait for Screen", font14h) descDisp2 = TS(loffset, 74, 14, "to Disappear", font14h) shutdownDisp.draw_string((0, 0), (255, 255), display) descDisp1.draw_string((0, 0), (255, 255), display) descDisp2.draw_string((0, 0), (255, 255), display) os.system("shutdown -h now") return True else: return False time.sleep(.5)
if user.testSignal == True: testCircuitValue = "ON" else: tesxtCircuitValue = "OFF" pllValue = "LOCKED" schrodValue = user.scrod.upper() try: while(True): if show: display = seps525.SEPS525_nhd(DC = PINS["DISPDC"], RES = PINS["DISPRES"], gpio = GPIO) display.fill_screen((255,255)) # Draw Labels loffset = 10 bmaDisp = TS(loffset, 10, 14, bmaTitle, font14h) bmbDisp = TS(loffset, 26, 14, bmbTitle, font14h) testCircuitDisp = TS(loffset, 42, 14, testCircuit, font14h) pllDisp = TS(loffset, 58, 14, pll, font14h) schrodDisp = TS(loffset, 74, 14, schrod, font14h) bmaDisp.draw_string((0, 0), (255, 255), display) bmbDisp.draw_string((0, 0), (255, 255), display) testCircuitDisp.draw_string((0, 0), (255, 255), display) pllDisp.draw_string((0, 0), (255, 255), display) schrodDisp.draw_string((0, 0), (255, 255), display) # Draw Values loffset = 20 bmaValueDisp = TS(loffset + len(bmaDisp), 10, 14, bmaValue, font14h) bmbValueDisp = TS(loffset + len(bmbDisp), 26, 14, bmbValue, font14h)
gpio.setmode(gpio.BOARD) PINS = { "AS" : 11, "CONVST" : 10, } t1 = time.time() VIMeas1 = Temp("VIMeas1", "VIMeas1.csv") VISet1 = Temp("VISet1", "VISet1.csv") VMS1 = Temp("VMS1", "VMS1.csv") IMS1 = Temp("IMS1", "IMS1.csv") t2 = time.time() VDefault = "0000.00" IDefault = "0.00000" VD1 = TS(28, 50, 14, VDefault) VD2 = TS(28, 69, 14, VDefault) VD3 = TS(28, 88, 14, VDefault) VD4 = TS(28, 107, 14, VDefault) ID1 = TS(91, 50, 14, IDefault) ID2 = TS(91, 69, 14, IDefault) ID3 = TS(91, 88, 14, IDefault) ID4 = TS(91, 107, 14, IDefault) t3 = time.time() bus = smbus.SMBus(1) CHV = ADC(PINS, 5, 12, 5, 0x23, "11111111") CHV.init_adc_address(gpio) CHV.init_adc_bus(bus) t4 = time.time() print "INITTemplate: " + str(t2 - t1) print "INITTextDefault: " + str(t3 - t2)
if user.jtag == True: jtagValue = "A" else: jtagValue = "AB" try: display = seps525.SEPS525_nhd(DC = PINS["DISPDC"], RES = PINS["DISPRES"], gpio = GPIO) display.fill_screen((255,255)) count = 50 while(True): BMB.bunchMarker(int(user.bunchMarkerB) + count) time.sleep(0.2) bmbValue = str(int(user.bunchMarkerB) + count) # Draw Labels loffset = 10 inputDisp = TS(loffset, 10, 14, inputTitle, font14h) bmaDisp = TS(loffset, 26, 14, bmaTitle, font14h) bmbDisp = TS(loffset, 42, 14, bmbTitle, font14h) testCircuitDisp = TS(loffset, 58, 14, testCircuit, font14h) pllDisp = TS(loffset, 74, 14, pllTitle, font14h) jtagDisp = TS(loffset, 90, 14, jtagTitle, font14h) IPDisp = TS(loffset, 106, 14, IPTitle, font14h) inputDisp.draw_string((0, 0), (255, 255), display) bmaDisp.draw_string((0, 0), (255, 255), display) bmbDisp.draw_string((0, 0), (255, 255), display) testCircuitDisp.draw_string((0, 0), (255, 255), display) pllDisp.draw_string((0, 0), (255, 255), display) jtagDisp.draw_string((0, 0), (255, 255), display) IPDisp.draw_string((0, 0), (255, 255), display)