-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_main.py
38 lines (26 loc) · 884 Bytes
/
_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QMutex
import windows._MainWindowClass as MainWindowClass
import ControllerClass
import ServerConnection
# import cProfile
def main():
mutex = QMutex()
app = QApplication(sys.argv)
main_window = MainWindowClass.MainWindow(mutex, sys.argv)
controller = ControllerClass.Controller(mutex)
mqtt_connection = ServerConnection.MQTTConnection()
# init controller
main_window.controller = controller
mqtt_connection.controller = controller
controller.main_window = main_window
controller.connection = mqtt_connection
main_window.show()
controller.connect()
main_window.init_windows()
app.exec()
controller.disconnect()
if __name__ == '__main__':
# cProfile.run("main()", sort="cumulative")
main()