-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
81 lines (59 loc) · 2.37 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
This file creates an empty window with the title "Hello World".
Run this file to see the window.
"""
import sys
from PySide6.QtWidgets import *
# from PySide6.QtWidgets import QApplication, QMainWindow
# from PySide6.QtWidgets import QLabel, QVBoxLayout, QWidget
# from PySide6.QtWidgets import QLabel, QHBoxLayout, QWidget
# from PySide6.QtWidgets import QGridLayout
from WheelImage import wheelImage
from Widgets.TextWidget import TextWidget
from Widgets.CameraWidget import CameraWidget
from Widgets.PushButtonWidget import PushButtonWidget
from Widgets.FieldWidget import MapWidget
# Every UI has a MainWindows that contains everything.
class GRT2025DriverUI(QMainWindow):
# We setup the window's title, size, and show it.
def __init__(self):
super().__init__()
self.setWindowTitle("GRT 2025 Driver UI")
self.resize(1920, 630)
self.setMaximumHeight(630)
self.centralWidget = QWidget(self)#magic
self.mainLayout = QHBoxLayout(self)
self.centralWidget.setLayout(self.mainLayout)
self.setCentralWidget(self.centralWidget)
self.infoBoxWidget = QWidget(self)
self.infoBoxLayout = QVBoxLayout(self)
self.infoBoxWidget.setMaximumWidth(100)
self.infoBoxWidget.setLayout(self.infoBoxLayout)
self.topRightText = TextWidget()
self.infoBoxLayout.addWidget(self.topRightText)
self.t = TextWidget()
self.infoBoxLayout.addWidget(self.t)
self.mainLayout.addWidget(self.infoBoxWidget)
self.mapWidget = MapWidget("RED")
self.mainLayout.addWidget(self.mapWidget)
# self.cameraWidget = CameraWidget()
# self.mainLayout.addWidget(self.cameraWidget)
# self.topRightWheel = wheelImage()
# self.mainLayout.addWidget(self.topRightWheel,0,0)#y x
# self.buttonWidget = PushButtonWidget()
# self.buttonWidget.buttonClass =self.bottomLeftWheel
# self.mainLayout.addWidget(self.buttonWidget,0,3)
self.show()
# This is the tamplate to start the UI, just copy it.
if __name__ == "__main__":
app = QApplication(sys.argv)
window = GRT2025DriverUI()
window.showFullScreen()
window.setGeometry(0, 0, 1920, 780)
# Replace this with the URL of your image stream
# stream_url = "https://via.placeholder.com/800x600.png"
# # Create and show the widget
# viewer = ImageStreamWidget(stream_url, refresh_interval=1000)
# viewer.resize(800, 600)
# viewer.show()
sys.exit(app.exec())