25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
896 B

  1. #ifndef PROJECT_H
  2. #define PROJECT_H
  3. #include <QString>
  4. #include <QList>
  5. #include <QSizeF>
  6. // PLC工程数据模型
  7. class Project
  8. {
  9. public:
  10. struct ItemData {
  11. QString type;
  12. double x, y;
  13. QString registerId = "";
  14. QString registerId2 = "";
  15. QString compare = "";
  16. QString imagePath; // 按钮的图片路径
  17. QString onImagePath; // 指示灯的ON状态图片路径
  18. QString offImagePath; // 指示灯的OFF状态图片路径
  19. QSizeF size = QSizeF(50, 50); // 当前尺寸
  20. };
  21. struct ConnectionData {
  22. int from, to;
  23. int fromType, toType;
  24. };
  25. void clear() { items_.clear(); connections_.clear(); }
  26. bool saveToFile(const QString& filePath) const;
  27. bool loadFromFile(const QString& filePath);
  28. QList<ItemData> items_;
  29. QList<ConnectionData> connections_;
  30. };
  31. #endif // PROJECT_H