This commit is contained in:
2025-11-17 00:05:40 +08:00
parent f860c5a216
commit e3ecd0550f
55 changed files with 3204 additions and 528 deletions

View File

@ -1,22 +1,29 @@
from PySide6.QtCore import QTimer, Signal, QObject # 导入Qt核心类
from PySide6.QtWidgets import QApplication # 用于获取主线程
import threading
from hardware import transmitter
from view.main_window import MainWindow
from .camera_controller import CameraController
from .bottom_control_controller import BottomControlController
from .hopper_controller import HopperController
from service.msg_recorder import MessageRecorder
from config.settings import Settings
from core.system import FeedingControlSystem
from opc.opcua_server import SimpleOPCUAServer
class MainController:
def __init__(self):
# 主界面
self.main_window = MainWindow()
self.settings = Settings()
self.system = FeedingControlSystem(self.settings)
self.system.initialize()
self.system.state.state_updated.connect(self.update_ui_notify)
self.opcua_server = SimpleOPCUAServer(self.system.state)
self.opcua_server.start()
self.msg_recorder = MessageRecorder()
self.msg_recorder.normal_record("开始自动智能浇筑系统")
# 初始化子界面和控制器
self._initSubViews()
self._initSubControllers()
@ -53,7 +60,10 @@ class MainController:
def _initSubViews(self):
pass
def update_ui_notify(self, prop:str,value):
"""更新UI状态"""
print(f"更新UI状态: {prop} = {value}")
def __connectSignals(self):
self.main_window.about_to_close.connect(self.handleMainWindowClose) # 处理主界面关闭