/** * @file main.cpp * @brief 综合平台编程器应用程序入口。 * @version 0.1.0 * @author suyu * @date 2026-08-05 */ #include #include "infrastructure/json_project_storage.h" #include "services/hmi_editor_service.h" #include "services/hmi_runtime_service.h" #include "services/logic_editor_service.h" #include "services/project_service.h" #include "services/runtime_mode_service.h" #include "ui/main_window.h" int main(int argc, char *argv[]) { QApplication application(argc, argv); application.setApplicationName(QObject::tr("综合平台编程器")); application.setOrganizationName(QStringLiteral("QtProXinJe")); // 组合根负责创建具体实现并将抽象依赖注入服务和 UI JsonProjectStorage project_storage; ProjectService project_service(project_storage); HmiEditorService hmi_editor_service(project_service); LogicEditorService logic_editor_service(project_service); // 当前离线模式使用内存仓库,后续真机模式替换为 PLC 缓存实现 VirtualRegisterRepository virtual_register_repository; HmiRuntimeService hmi_runtime_service(virtual_register_repository); RuntimeModeService runtime_mode_service; MainWindow main_window( runtime_mode_service, project_service, hmi_editor_service, logic_editor_service, hmi_runtime_service); main_window.show(); return application.exec(); }