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)
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) testCircuitValueDisp = TS(loffset + len(testCircuitDisp), 42, 14, testCircuitValue, font14h) pllValueDisp = TS(loffset + len(pllDisp), 58, 14, pllValue, font14h) schrodValueDisp = TS(loffset + len(schrodDisp), 74, 14, schrodValue, font14h) bmaValueDisp.draw_string((0, 0), (255, 255), display) bmbValueDisp.draw_string((0, 0), (255, 255), display)
"VMS1" : VMS1.update_oled, "IMS1" : IMS1.update_oled, } display = Oled() #try: if (True): print "Initializing" display.show() display.fill_screen((255, 255)) time.sleep(0.5) display.fill_screen((0,0)) time.sleep(0.5) print "templates" TEMPS["VIMeas1"](display) VD1.draw_string((0, 0), (175, 223), display) VD2.draw_string((0, 0), (175, 223), display) VD3.draw_string((0, 0), (175, 223), display) VD4.draw_string((0, 0), (175, 223), display) ID1.draw_string((0, 0), (175, 223), display) ID2.draw_string((0, 0), (175, 223), display) ID3.draw_string((0, 0), (175, 223), display) ID4.draw_string((0, 0), (175, 223), display) time.sleep(0.5) TEMPS["VISet1"](display) VD1.draw_string((0, 0), (95, 233), display) VD2.draw_string((0, 0), (95, 233), display) VD3.draw_string((0, 0), (95, 233), display) VD4.draw_string((0, 0), (95, 233), display) ID1.draw_string((0, 0), (95, 233), display) ID2.draw_string((0, 0), (95, 233), display)
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) # Draw Values loffset = 20 inputValueDisp = TS(loffset + len(inputDisp), 10, 14, inputValue, font14h) bmaValueDisp = TS(loffset + len(bmaDisp), 26, 14, bmaValue, font14h) bmbValueDisp = TS(loffset + len(bmbDisp), 42, 14, bmbValue, font14h) testCircuitValueDisp = TS(loffset + len(testCircuitDisp), 58, 14, testCircuitValue, font14h) pllValueDisp = TS(loffset + len(pllDisp), 74, 14, pllValue, font14h) jtagValueDisp = TS(loffset + len(jtagDisp), 90, 14, jtagValue, font14h)