综合平台编程器项目的远程存储
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

47 строки
1.6 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/offline_simulation_service.h"
  14. #include "services/project_service.h"
  15. #include "services/runtime_mode_service.h"
  16. #include "ui/main_window.h"
  17. int main(int argc, char *argv[])
  18. {
  19. QApplication application(argc, argv);
  20. application.setApplicationName(QObject::tr("综合平台编程器"));
  21. application.setOrganizationName(QStringLiteral("QtProXinJe"));
  22. // 组合根负责创建具体实现并将抽象依赖注入服务和 UI
  23. JsonProjectStorage project_storage;
  24. ProjectService project_service(project_storage);
  25. HmiEditorService hmi_editor_service(project_service);
  26. LogicEditorService logic_editor_service(project_service);
  27. // 当前离线模式使用内存仓库,后续真机模式替换为 PLC 缓存实现
  28. VirtualRegisterRepository virtual_register_repository;
  29. HmiRuntimeService hmi_runtime_service(virtual_register_repository);
  30. OfflineSimulationService offline_simulation_service(virtual_register_repository);
  31. RuntimeModeService runtime_mode_service(
  32. project_service, offline_simulation_service);
  33. MainWindow main_window(
  34. runtime_mode_service,
  35. project_service,
  36. hmi_editor_service,
  37. logic_editor_service,
  38. hmi_runtime_service);
  39. main_window.show();
  40. return application.exec();
  41. }