projectdialog.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef PROJECTDIALOG_H
  2. #define PROJECTDIALOG_H
  3. #include <QDialog>
  4. #include <QHash>
  5. #include <QJsonArray>
  6. #include <QJsonObject>
  7. #include <QStandardItem>
  8. #include "../components/MultiSelectComboBox.h"
  9. #include "hproject.h"
  10. namespace Ui {
  11. class ProjectDialog;
  12. }
  13. class ProjectDialog : public QDialog {
  14. Q_OBJECT
  15. public:
  16. explicit ProjectDialog(QWidget *parent = nullptr);
  17. ~ProjectDialog();
  18. void initComboBoxBlaster(const QJsonArray &bapoYuan);
  19. void initComboBoxOperator(const QJsonArray &anQuanYuanArray);
  20. void initComboBoxSafetyInspectors(const QJsonArray &safeGuardsArray);
  21. void SetL1AddressOptions(const QJsonArray &parentOptions);
  22. void setChildOptions(const QJsonArray &newChildOptions);
  23. void clearFormData();
  24. void setFormData(const HProject &Project);
  25. int getOperationType() const;
  26. void setOperationType(int newOperationType);
  27. private slots:
  28. void on_comboBoxAddr_currentIndexChanged(int index);
  29. void on_comboBoxAddr_2_currentIndexChanged(int index);
  30. signals:
  31. void createProject(const QMap<QString, QString> &data);
  32. void saveProject(const QMap<QString, QString> &data);
  33. private:
  34. void updateL2AddressOptions();
  35. void updateL3AddressOptions();
  36. void validateAndSaveProject();
  37. private:
  38. Ui::ProjectDialog *ui;
  39. QStringList selectedBlasters;
  40. QStringList selectedOperators;
  41. QStringList selectedSafetyInspectors;
  42. QJsonArray blasterArray;
  43. QJsonArray operatorArray;
  44. QJsonArray safeGuardsArray;
  45. QJsonArray dataOptions;
  46. QJsonArray parentOptions;
  47. QJsonArray childOptions;
  48. QJsonArray grandChildOptions;
  49. QJsonArray L1AddressOptions;
  50. QJsonArray L2AddressOptions;
  51. QJsonArray L3AddressOptions;
  52. int operationType;
  53. };
  54. #endif // PROJECTDIALOG_H