From 5eedd77c8ffea0b1abb95989829bb72f4632ad8b Mon Sep 17 00:00:00 2001 From: yanganjie Date: Thu, 6 Nov 2025 14:05:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug(=E8=A7=A3=E5=86=B3=E4=BA=86=E6=96=99?= =?UTF-8?q?=E6=96=97=E8=BF=9B=E5=BA=A6=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E7=9B=AE=E5=89=8D=E7=9A=84=E6=96=99=E6=96=97=E8=A3=85?= =?UTF-8?q?=E6=BB=A1=E6=80=BB=E9=87=8D=E9=87=8F=E8=AE=BE=E7=BD=AE=E4=B8=BA?= =?UTF-8?q?6000kg)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/widgets/conveyor_system_widget.py | 4 ++-- view/widgets/hopper_widget.py | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/view/widgets/conveyor_system_widget.py b/view/widgets/conveyor_system_widget.py index b1c1942..2eccf44 100644 --- a/view/widgets/conveyor_system_widget.py +++ b/view/widgets/conveyor_system_widget.py @@ -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): diff --git a/view/widgets/hopper_widget.py b/view/widgets/hopper_widget.py index 1dfc5f3..44dd615 100644 --- a/view/widgets/hopper_widget.py +++ b/view/widgets/hopper_widget.py @@ -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()