fix bug(解决了料斗进度显示问题,目前的料斗装满总重量设置为6000kg)
This commit is contained in:
@ -112,8 +112,8 @@ class ConveyorSystemWidget(QWidget):
|
||||
|
||||
def setConveyorHopperWeight(self, weight:float):
|
||||
# 1、更新传送带中的 上料斗内部进度显示
|
||||
# 假设上料斗装满之后,总的重量为 5100kg
|
||||
total_weight = 5100
|
||||
# 假设上料斗装满之后,总的重量为 5100kg (褚工说设置为 6000kg 11/6)
|
||||
total_weight = 6000
|
||||
self._update_upper_inner_height(total_weight, weight)
|
||||
|
||||
def create_conveyor(self):
|
||||
|
||||
@ -326,10 +326,11 @@ class HopperWidget(QWidget):
|
||||
self.upper_inner_label.setFixedHeight(target_height)
|
||||
|
||||
# 5、计算标签位置(确保标签底部与父容器底部对齐)
|
||||
container_bottom = self.upper_bg_widget.y() + self.upper_bg_widget.height()
|
||||
# container_bottom = self.upper_bg_widget.y() + self.upper_bg_widget.height()
|
||||
container_bottom = 117 # 容器的高固定为了 117px (背景图片"料斗1"的高)
|
||||
label_y = container_bottom - target_height - 8 # 标签顶部y坐标 (减去底部8px)
|
||||
self.upper_inner_label.move(14, label_y) # x固定,y动态计算
|
||||
# print("label_y", label_y)
|
||||
# print("current_weight",current_weight, "label_y", label_y)
|
||||
|
||||
# 6、强制刷新UI,确保立即显示变化
|
||||
self.upper_inner_label.update()
|
||||
@ -340,8 +341,8 @@ class HopperWidget(QWidget):
|
||||
self.upper_weight_label.setText(f"{weight}kg")
|
||||
|
||||
# 2、更新上料斗内部进度显示
|
||||
# 假设上料斗装满之后,总的重量为 5100kg
|
||||
total_weight = 5100
|
||||
# 假设上料斗装满之后,总的重量为 5100kg (褚工说设置为 6000kg 11/6)
|
||||
total_weight = 6000
|
||||
self._update_upper_inner_height(total_weight, weight)
|
||||
|
||||
# 上料斗方量设置
|
||||
@ -365,8 +366,8 @@ class HopperWidget(QWidget):
|
||||
self.lower_weight_label.setText(f"{weight}kg")
|
||||
|
||||
# 2、更新下料斗的进度显示
|
||||
# 假设下料斗装满之后 总重量为 5100kg
|
||||
total_weight = 5100
|
||||
# 假设下料斗装满之后 总重量为 5100kg (褚工说设置为 6000kg 11/6)
|
||||
total_weight = 6000
|
||||
self._update_lower_inner_height(total_weight, weight)
|
||||
|
||||
def _update_lower_inner_height(self, total_weight, current_weight: float):
|
||||
@ -384,9 +385,11 @@ class HopperWidget(QWidget):
|
||||
self.lower_inner_label.setFixedHeight(target_height)
|
||||
|
||||
# 5、计算标签位置
|
||||
container_bottom = self.lower_bg_widget.y() + self.lower_bg_widget.height()
|
||||
# container_bottom = self.lower_bg_widget.y() + self.lower_bg_widget.height()
|
||||
container_bottom = 117 # 容器的高固定为了 117px (背景图片"料斗1"的高)
|
||||
label_y = container_bottom - target_height - 8
|
||||
self.lower_inner_label.move(14, label_y)
|
||||
# print("_update_lower_inner_height", container_bottom)
|
||||
|
||||
# 6、强制刷新UI,确保立即显示变化
|
||||
self.lower_inner_label.update()
|
||||
|
||||
Reference in New Issue
Block a user