add (增加了main_controller 和 位置设定的点位上移和下移)

This commit is contained in:
2025-09-02 18:26:43 +08:00
parent 17abd13df7
commit 3c9784b362
4 changed files with 690 additions and 57 deletions

View File

@ -0,0 +1,53 @@
from ...view.mi_an_main_window import Window as MainWindow
from ...view.cood_forms_interface import CoordinateFormsWidget
from typing import TypedDict
# 子界面管理
class SubViewsDict(TypedDict):
position: CoordinateFormsWidget
class MainController:
def __init__(self):
# 主界面
self.main_window = MainWindow()
# 初始化子界面
self._initSubViews()
# 初始化子控制器
self._initSubControllers()
self.__connectSignals()
def _initSubViews(self):
self.sub_views: SubViewsDict = {
"system": self.main_window.system, # 系统设置
"product": self.main_window.product, # 生产界面
"robot": self.main_window.robot, # 机器臂基础设置
"io": self.main_window.io, # io面板
"position": self.main_window.position.formsWidget, # 点位设置
"basic": self.main_window.basic, # 基础设置
"point": self.main_window.point, # 点位调试
"other": self.main_window.other, # 其他设置
"data": self.main_window.data, # 数据采集
}
def _initSubControllers(self):
# self.sub_controllers = {
# "system": SystemController(self.sub_views["system"]),
# "produce": ProduceController(self.sub_views["produce"]),
# }
pass
def showMainWindow(self):
self.main_window.show()
def __connectSignals(self):
pass
self.sub_views["position"].form_move_signal.connect(self.handleMove)
def handleMove(self, pos_list: list):
print("handleMove 移动:", pos_list)