Skip to content

Commit

Permalink
0.0.6
Browse files Browse the repository at this point in the history
[*] Getting started on the route construction system.
[+] Optimization Data system.
  • Loading branch information
ANameSpace committed Jan 19, 2024
1 parent 02b45e3 commit b576814
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 122 deletions.
12 changes: 6 additions & 6 deletions ui/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(self, str_name="None"):
# temp
self.origin = None
self.task_num = 0
self.str_name_len = 15 * len(str(str_name)) + 8
self.floor_btns = []

# zoom
Expand Down Expand Up @@ -111,7 +110,8 @@ def __init__(self, str_name="None"):
self.name_label.setFont(QFont("Arial", 16, weight=QFont.Bold))
self.name_label.setStyleSheet("color: white; border-radius: 10px; background-color: rgb(49, 51, 56);")
self.name_label.setAlignment(Qt.AlignTop | Qt.AlignRight)
self.name_label.setGeometry(self.width() - (self.str_name_len + 7), 7, self.str_name_len, 25)
self.str_name_len = self.name_label.fontMetrics().boundingRect(self.name_label.text()).width() + 15
self.name_label.setGeometry(self.width() - self.str_name_len, 7, self.str_name_len, 25)

# info frame
self.info_frame = QFrame(self)
Expand Down Expand Up @@ -268,13 +268,13 @@ def paintEvent(self, event):
painter.drawRect(scaled_x, scaled_y, scaled_width, scaled_height)

for ladder in Data().get_ladders(self.current_floor):
ladder_id, x, y, width, height = ladder
x, y, width, height = ladder.getLocation()
scaled_x = x * self.zoom_factor + self.offset.x()
scaled_y = y * self.zoom_factor + self.offset.y()
scaled_width = width * self.zoom_factor
scaled_height = height * self.zoom_factor
if self.has_result:
if self.route_ladders.count(str(ladder_id)) == 1:
if self.route_ladders.count(str("123")) == 1:
painter.setBrush(QBrush(QColor(238, 255, 46)))
else:
painter.setBrush(QBrush(QColor(183, 194, 64)))
Expand All @@ -283,13 +283,13 @@ def paintEvent(self, event):
painter.drawRect(scaled_x, scaled_y, scaled_width, scaled_height)

for room in Data().get_rooms(self.current_floor):
name, x, y, width, height, x222 = room
x, y, width, height = room.getLocation()
scaled_x = x * self.zoom_factor + self.offset.x()
scaled_y = y * self.zoom_factor + self.offset.y()
scaled_width = width * self.zoom_factor
scaled_height = height * self.zoom_factor
if self.has_result:
if self.input_field.text() == name:
if self.input_field.text() == "1":
painter.setBrush(QBrush(QColor(59, 196, 57)))
else:
painter.setBrush(QBrush(QColor(37, 73, 115)))
Expand Down
Loading

0 comments on commit b576814

Please sign in to comment.