-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (41 loc) · 1.55 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from PyQt6.QtWidgets import QApplication
from PyQt6.QtGui import QFontDatabase
from interface import pi_comms
from gui.rov import MainWindow
import logging
import sys
import os
if __name__ == "__main__":
try:
os.mkdir("gui/captures")
print("Directory gui/captures has been created")
except FileExistsError:
print("Directory gui/captures exists")
try:
os.mkdir("gui/captures/images")
print("Directory gui/captures/images has been created")
except FileExistsError:
print("Directory gui/captures/images exists")
try:
os.mkdir("gui/captures/videos")
print("Directory gui/captures/videos has been created")
except FileExistsError:
print("Directory gui/captures/videos exists")
try:
with open("gui/logs.log", "x") as f:
print("File gui/logs.log has been created")
except FileExistsError:
print("File gui/logs.log exists")
app = QApplication(sys.argv)
QFontDatabase.addApplicationFont("gui/assets/fonts/Montserrat/static/Montserrat-Bold.ttf")
QFontDatabase.addApplicationFont("gui/assets/fonts/Inter/Inter-Regular.ttf")
comms = None
if input("Connect comms (y/n)? ") == "y":
print("Searching for serial...")
comms = pi_comms.PIClient((input("enter ip: "), 7772))
window = MainWindow(comms, 1, 2)
window.show()
window.showMaximized()
logging.info("One Degree North R&D GUI has launched successfully")
print("\033[92mOne Degree North R&D GUI has launched successfully\033[0m")
app.exec()