def loop(self): global gui a = 0 b = 0 c = 0 d = 0 while 1: e.update() self.surf.fill((0,0,0)) gui.update() self.recv.update() pygame.display.flip() self.clock.tick() self.averageFPS.append(int(self.clock.get_fps())) if len(self.averageFPS) > 100: a = 0 cnt = 1 for x in self.averageFPS: a = a + x cnt = cnt + 1 a = a / cnt gui.setValueBoxValue("FPS", int(a)) gui.addGraphEntry("APM", 0, int(a)) self.averageFPS = []
def RightBlueHandler(self, data): gui.setValueBoxValue("RightCpalBlue", data)
def RightGreenHandler(self, data): gui.setValueBoxValue("RightCpalGreen", data)
def RightRedHandler(self, data): gui.setValueBoxValue("RightCpalRed", data)
def LeftBlueHandler(self, data): gui.setValueBoxValue("LeftCpalBlue", data)
def LeftGreenHandler(self, data): gui.setValueBoxValue("LeftCpalGreen", data)
def LeftRedHandler(self, data): gui.setValueBoxValue("LeftCpalRed", data)
def ArmMtrDirection(self, data): gui.setValueBoxValue("armDirection", data)
def RightMtrDirection(self, data): gui.setValueBoxValue("rightDirection", data)
def LeftMtrDirection(self, data): gui.setValueBoxValue("leftDirection", data)
def CogsUsedHandler(self, data): gui.setValueBoxValue("CogsUsed", int(data))
def QTIORHandler(self, data): gui.setValueBoxValue("QTIOuterRightLabel", data)
def QTIMHandler(self, data): gui.setValueBoxValue("QTIMiddleLabel", data)
def QTIILHandler(self, data): gui.setValueBoxValue("QTIInnerLeftLabel", data)
def QTIOLHandler(self, data): gui.setValueBoxValue("QTIOuterLeftLabel", data)