#ifndef PROJECTDIALOG_H #define PROJECTDIALOG_H #include #include #include #include #include #include "../components/MultiSelectComboBox.h" #include "../regex.h" #include "hproject.h" namespace Ui { class ProjectDialog; } class ProjectDialog : public QDialog { Q_OBJECT public: explicit ProjectDialog(QWidget *parent = nullptr); ~ProjectDialog(); void initComboBoxBlaster(const QJsonArray &bapoYuan); void initComboBoxOperator(const QJsonArray &anQuanYuanArray); void initComboBoxSafetyInspectors(const QJsonArray &safeGuardsArray); void SetL1AddressOptions(const QJsonArray &parentOptions); void setChildOptions(const QJsonArray &newChildOptions); void clearFormData(); void setFormData(const HProject &Project); int getOperationType() const; void setOperationType(int newOperationType); private slots: void on_comboBoxAddr_currentIndexChanged(int index); void on_comboBoxAddr_2_currentIndexChanged(int index); signals: void createProject(const QMap &data); void saveProject(const QMap &data); private: void updateL2AddressOptions(); void updateL3AddressOptions(); void validateAndSaveProject(); void extractNames(const QJsonArray &array, QStringList &names); private: Ui::ProjectDialog *ui; QStringList selectedBlasters; QStringList selectedOperators; QStringList selectedSafetyInspectors; QJsonArray blasterArray; QJsonArray operatorArray; QJsonArray safeGuardsArray; QJsonArray dataOptions; QJsonArray parentOptions; QJsonArray childOptions; QJsonArray grandChildOptions; QJsonArray L1AddressOptions; QJsonArray L2AddressOptions; QJsonArray L3AddressOptions; int operationType; }; #endif // PROJECTDIALOG_H