-
Notifications
You must be signed in to change notification settings - Fork 0
/
Satellite.py
58 lines (49 loc) · 1.72 KB
/
Satellite.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
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QFont
from PyQt6.QtWidgets import QLabel, QVBoxLayout, QHBoxLayout
class Satellite(QLabel):
def __init__(self, value):
super().__init__()
self.setFixedSize(150, 150)
self.setStyleSheet("""
background-color: #000;
color: white;
font-weight: bold;
padding: 2px;
border-radius: 10px;
border: 1.5px solid rgba(120, 54, 31, 0.7);
""")
self.sat_label = QLabel()
self.label2 = QLabel()
self.sat_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label2.setAlignment(Qt.AlignmentFlag.AlignCenter)
font = QFont()
font.setPointSize(30)
self.sat_label.setFixedSize(120, 50)
self.sat_label.setFont(font)
self.sat_label.setStyleSheet("""
color: white;
background-color: #000;
border: 2px solid #000;
font-weight: bold;
""")
font = QFont()
font.setPointSize(18)
self.label2.setFont(font)
self.label2.setText("UYDU\nSTATÜSÜ")
self.label2.setStyleSheet("""
color: white;
background-color: #000;
border: 2px solid #000;
font-weight: bold;
""")
self.label2.setFixedSize(120, 60)
vbox2 = QVBoxLayout()
vbox2.addWidget(self.label2)
vbox2.addWidget(self.sat_label)
self.setLayout(vbox2)
self.sat_label.setText(value)
def update_status(self, value):
data = str(int(value))
self.setAlignment(Qt.AlignmentFlag.AlignCenter)
return self.sat_label.setText(data)