def mainloop(self): if self.initialize() == False: self._running = False count = 0 while self._running: self.on_render() self.on_loop() drive.serial_interact() for event in pygame.event.get(): self.on_event(event) count += 1
def on_loop(self): if self.modes[self.mode].is_complete(): if abort_test: self.mode = self.abort_transition[self.mode] else: self.mode = self.normal_transition[self.mode] self.modes[self.mode].start() ## update widgets drive.serial_interact(1) cuff_pressure = last_cuff_pressure self.cuff_pressure.update(int(cuff_pressure)) # self.text.set_text('%3d' % cuff_pressure, 30) self.last_loop_time = time.time()