11import os
22from collections import namedtuple
33
4- import PyQt5
54import serial .tools .list_ports
6- from PyQt5 import QtCore , QtWidgets , uic
5+ from PyQt5 import QtWidgets , uic
76
87from util .detail import BUNDLED_DATA , LOGGER
98from profiles .rocket_profile_list import ROCKET_PROFILES
109
11- if hasattr (QtCore .Qt , "AA_EnableHighDpiScaling" ):
12- PyQt5 .QtWidgets .QApplication .setAttribute (QtCore .Qt .AA_EnableHighDpiScaling , True )
13-
14- if hasattr (QtCore .Qt , "AA_UseHighDpiPixmaps" ):
15- PyQt5 .QtWidgets .QApplication .setAttribute (QtCore .Qt .AA_UseHighDpiPixmaps , True )
16-
1710qtCreatorFile = os .path .join (BUNDLED_DATA , "qt_files" , "com_window.ui" )
1811
1912Ui_MainWindow , QtBaseClass = uic .loadUiType (qtCreatorFile )
2619 'SIM' : ConnectionRequirements (com_port = False , baud_rate = False ),
2720}
2821
22+
2923class ComWindow (QtWidgets .QMainWindow , Ui_MainWindow ):
3024 def __init__ (self ) -> None :
3125 """
@@ -34,7 +28,7 @@ def __init__(self) -> None:
3428 QtWidgets .QMainWindow .__init__ (self )
3529 Ui_MainWindow .__init__ (self )
3630
37- self .RocketProfiles = {p .rocket_name :p for p in ROCKET_PROFILES }
31+ self .RocketProfiles = {p .rocket_name : p for p in ROCKET_PROFILES }
3832
3933 self .chosen_connection = None
4034 self .chosen_rocket = None
@@ -67,7 +61,8 @@ def doneButtonPressed(self) -> None:
6761 baud_rate = int (self .baudBox .currentText ())
6862 com_port = self .comBox .currentText ()
6963
70- LOGGER .debug (f"User has selected rocket={ rocket } , connection={ connection } , com_port={ com_port } , baud_rate={ baud_rate } " )
64+ LOGGER .debug (
65+ f"User has selected rocket={ rocket } , connection={ connection } , com_port={ com_port } , baud_rate={ baud_rate } " )
7166
7267 self .chosen_rocket = self .RocketProfiles [rocket ]
7368
0 commit comments