综合平台编程器项目的远程存储
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

44 Zeilen
1.4 KiB

  1. /**
  2. * @file main.cpp
  3. * @brief 综合平台编程器应用程序入口。
  4. * @version 0.1.0
  5. * @author suyu
  6. * @date 2026-08-05
  7. */
  8. #include <QApplication>
  9. #include "infrastructure/json_project_storage.h"
  10. #include "services/hmi_editor_service.h"
  11. #include "services/hmi_runtime_service.h"
  12. #include "services/logic_editor_service.h"
  13. #include "services/project_service.h"
  14. #include "services/runtime_mode_service.h"
  15. #include "ui/main_window.h"
  16. int main(int argc, char *argv[])
  17. {
  18. QApplication application(argc, argv);
  19. application.setApplicationName(QObject::tr("综合平台编程器"));
  20. application.setOrganizationName(QStringLiteral("QtProXinJe"));
  21. // 组合根负责创建具体实现并将抽象依赖注入服务和 UI
  22. JsonProjectStorage project_storage;
  23. ProjectService project_service(project_storage);
  24. HmiEditorService hmi_editor_service(project_service);
  25. LogicEditorService logic_editor_service(project_service);
  26. // 当前离线模式使用内存仓库,后续真机模式替换为 PLC 缓存实现
  27. VirtualRegisterRepository virtual_register_repository;
  28. HmiRuntimeService hmi_runtime_service(virtual_register_repository);
  29. RuntimeModeService runtime_mode_service;
  30. MainWindow main_window(
  31. runtime_mode_service,
  32. project_service,
  33. hmi_editor_service,
  34. logic_editor_service,
  35. hmi_runtime_service);
  36. main_window.show();
  37. return application.exec();
  38. }