综合平台编程器项目的远程存储
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

72 lines
2.2 KiB

  1. #pragma once
  2. #include "domain/runtime_state.h"
  3. #include "services/plc_communication_gateway.h"
  4. #include "services/software_logic_executor.h"
  5. #include <QWidget>
  6. #include <memory>
  7. #include <string>
  8. namespace Ui {
  9. class RuntimeMonitorWidget;
  10. }
  11. class FreeMonitorWidget;
  12. class HmiEditorService;
  13. class HmiEditorWidget;
  14. class HmiRuntimeService;
  15. class AlarmService;
  16. class HmiNavigationService;
  17. class LogicEditorService;
  18. class LogicEditorWidget;
  19. class RegisterMonitorService;
  20. class ProjectService;
  21. class RuntimeMonitorWidget final : public QWidget
  22. {
  23. Q_OBJECT
  24. public:
  25. RuntimeMonitorWidget(
  26. HmiEditorService &hmi_editor_service,
  27. HmiRuntimeService &hmi_runtime_service,
  28. LogicEditorService &logic_editor_service,
  29. ProjectService &project_service,
  30. HmiNavigationService &hmi_navigation_service,
  31. AlarmService &alarm_service,
  32. RegisterMonitorService &register_monitor_service,
  33. QWidget *parent = nullptr);
  34. ~RuntimeMonitorWidget() override;
  35. void setProjectObjects(const std::string &page_id, const std::string &logic_id);
  36. void setRuntimePage(const std::string &page_id);
  37. void setMode(ApplicationMode mode, PlcConnectionState plc_state);
  38. void refreshValues(ApplicationMode mode, PlcConnectionState plc_state);
  39. void setHmiWriteEnabled(bool enabled);
  40. void setFreeMonitorWriteEnabled(bool enabled);
  41. void setLogicTrace(const LogicTraceSnapshot &trace, const std::string &fault_node_id = {});
  42. FreeMonitorWidget *freeMonitorWidget() const;
  43. std::string selectedLogicId() const;
  44. signals:
  45. void navigationFailed(const QString &message);
  46. void runtimePageChanged(const QString &page_id);
  47. private:
  48. void showRuntimePage(const std::string &page_id);
  49. void selectRuntimeLogic(const std::string &logic_id);
  50. std::unique_ptr<Ui::RuntimeMonitorWidget> ui_;
  51. ProjectService &project_service_;
  52. HmiNavigationService &hmi_navigation_service_;
  53. HmiEditorWidget *hmi_view_ = nullptr;
  54. LogicEditorWidget *logic_view_ = nullptr;
  55. FreeMonitorWidget *free_monitor_widget_ = nullptr;
  56. std::string selected_logic_id_;
  57. LogicTraceSnapshot latest_trace_;
  58. std::string latest_fault_node_id_;
  59. bool has_logic_trace_ = false;
  60. };