修改料斗重量更新逻辑
This commit is contained in:
@ -18,6 +18,9 @@ class ConveyorSystemWidget(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setWindowTitle("料斗与传送带界面")
|
||||
|
||||
self._last_upper_hopper_weight = None # 上一次的上料斗重量(初始为None)
|
||||
|
||||
self.setFixedSize(443, 190)
|
||||
self.init_ui()
|
||||
self._bind()
|
||||
@ -110,11 +113,15 @@ class ConveyorSystemWidget(QWidget):
|
||||
# 6、强制刷新UI,确保立即显示变化
|
||||
self.upper_inner_label.update()
|
||||
|
||||
def setConveyorHopperWeight(self, weight:float):
|
||||
# 1、更新传送带中的 上料斗内部进度显示
|
||||
# 假设上料斗装满之后,总的重量为 5100kg (褚工说设置为 6000kg 11/6)
|
||||
total_weight = 6000
|
||||
self._update_upper_inner_height(total_weight, weight)
|
||||
def setConveyorHopperWeight(self, weight:int):
|
||||
if weight != self._last_upper_hopper_weight:
|
||||
# 1、更新传送带中的 上料斗内部进度显示
|
||||
# 假设上料斗装满之后,总的重量为 5100kg (褚工说设置为 6000kg 11/6)
|
||||
total_weight = 6000
|
||||
self._update_upper_inner_height(total_weight, weight)
|
||||
|
||||
# 2、将self._last_upper_hopper_weight设置为当前重量
|
||||
self._last_upper_hopper_weight = weight
|
||||
|
||||
def create_conveyor(self):
|
||||
"""创建传送带组件(包含左右齿轮,group容器背景为传送带图片)"""
|
||||
|
||||
Reference in New Issue
Block a user