def start_dearpygui(): vp = internal_dpg.create_viewport() internal_dpg.setup_dearpygui(viewport=vp) internal_dpg.show_viewport(vp) while(internal_dpg.is_dearpygui_running()): internal_dpg.render_dearpygui_frame() internal_dpg.cleanup_dearpygui()
def serial_listener(self): # listen to what is being sent on the bus while self.running and is_dearpygui_running(): try: data = self.readline() self.parse_point(data.decode("utf-8")) except: pass self.ser.close()
def start_dearpygui(): """Prepares viewport (if not done already). sets up, cleans up, and runs main event loop. Returns: None """ if not internal_dpg.is_viewport_created(): setup_viewport() while (internal_dpg.is_dearpygui_running()): internal_dpg.render_dearpygui_frame() internal_dpg.cleanup_dearpygui()
def serial_listener(self): # generate som erandom data while self.running and is_dearpygui_running(): i = random.randint(0, len(data_names) - 1) a = data_names[i] if i > 2: b = random.randint(0, 20) else: b = random.uniform(-2, 2) self.parse_point(f"#{a}:{b};\r\n") self.parse_point(self.get_random_msg()) self.parse_point(self.get_random_error()) self.parse_point(self.get_random_warning()) time.sleep(0.01)
def is_running() -> bool: """Get the status of the GUI engine.""" return dpgcore.is_dearpygui_running()