#pragma once /** * 空基十三五微波算法组件界面组件类集 * @file KJ135WBJYAlgWidgetComponet.h * @brief KJ135WBJYAlgWidgetComponet.h * @details * 空基十三五微波算法组件界面组件类集 */ #ifndef __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__ #define __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__ #include "KJ135WBJYAlgInterfaceToolbox_global.h" #include #include #include #include #include #include #include #include #include #include #include #include /// /// 参数类型枚举 /// enum ComponentType{ UNKNOW = 0, // 未知类型 FileSelect , // 文件选择 FolderSelect, // 文件夹选择 ComboxSelect,// 枚举多选 IntInput,// 整数输入 DoubleInput,// 浮点数输入 MultipleSelect,// 多选 ScopeIntInput,// 整数范围输入 ScopeDoubleInput,// 浮点数范围输入 }; /** CoveringIDs 地表覆盖类型数据的类别id 地表覆盖类型数据中植被区域、裸土区域的类别id,多个id使用“;”分割。示例:GlobeLand30数据的cover_roi_ids = 10;20;30;40;50;70;71;72;83;74;90 Value string Man 1;4;5;6;7;11;10;20;30;50;60;70;71;72;73;74;80;90;255 True False UploadInput Aux 0 Aux DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT **/ class AbstractComponentWidget : public QWidget { Q_OBJECT public: AbstractComponentWidget(QWidget* parent = nullptr); ~AbstractComponentWidget(); protected: QString ParaName; // 参数名称 QString ParaChsName;// 参数中文名称 QString Description;// 参数描述 QString Datatype;// 数据类型 Value // 决定参数的输入类型 QString ParaType;// 参数类型 string ComponentType componentType = ComponentType::UNKNOW; // 组件类型 public://属性操作 QString getParaName() const; void setParaName(const QString& name); // 设置参数中文名称 QString getParaChsName() const; void setParaChsName(const QString& name); // 设置参数描述 QString getDescription() const; void setDescription(const QString& description); // 设置数据类型 QString getDatatype() const; void setDatatype(const QString& datatype); // 设置参数类型 QString getParaType() const; void setParaType(const QString& type); void setComponentType(ComponentType type); ComponentType getComponentType() const; }; /// /// File 文件选择组件 /// class FileSelectWidget : public AbstractComponentWidget { Q_OBJECT public: FileSelectWidget(QWidget* parent = nullptr); ~FileSelectWidget(); void initUI(); private: QLabel* fileNameLabel=nullptr; // 文件名称 QLineEdit* filePathEdit = nullptr; QToolButton* fileSelectButton = nullptr; public slots: void onFileSelectButtonClicked(); public: QString getValue() const; }; /// /// int输入组件 /// class IntInputWidget : public AbstractComponentWidget { Q_OBJECT public: IntInputWidget(QWidget* parent = nullptr); ~IntInputWidget(); void initUI(); private: QLabel* fileNameLabel = nullptr; // 文件名称 QSpinBox* intInput = nullptr; public: QString getValue() const; }; /// /// double 输入组件 /// class DoubleInputWidget : public AbstractComponentWidget { Q_OBJECT public: DoubleInputWidget(QWidget* parent = nullptr); ~DoubleInputWidget(); void initUI(); private: QLabel* fileNameLabel = nullptr; // 文件名称 QDoubleSpinBox* doubleInput = nullptr; public: QString getValue() const; }; /// /// 整数值 数据范围输入组件 /// class ScopeIntInputWidget : public AbstractComponentWidget { Q_OBJECT public: ScopeIntInputWidget(QWidget* parent = nullptr); ~ScopeIntInputWidget(); void initUI(); private: QLabel* fileNameLabel = nullptr; // 文件名称 QLabel* scopeConnectStr = nullptr; // 文件名称 QSpinBox* intInputMin = nullptr; QSpinBox* intInputMax = nullptr; public: QString getValue() const; }; /// /// 浮点数值 数据范围输入组件 /// class ScopeDoubleInputWidget : public AbstractComponentWidget { Q_OBJECT public: ScopeDoubleInputWidget(QWidget* parent = nullptr); ~ScopeDoubleInputWidget(); void initUI(); private: QLabel* fileNameLabel = nullptr; // 文件名称 QLabel* scopeConnectStr = nullptr; // 文件名称 QDoubleSpinBox* doubleInputMin = nullptr; QDoubleSpinBox* doubleInputMax = nullptr; public: QString getValue() const; }; #endif// __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__