217 lines
4.6 KiB
C++
217 lines
4.6 KiB
C++
#pragma once
|
||
|
||
/**
|
||
* 空基十三五微波算法组件界面组件类集
|
||
* @file KJ135WBJYAlgWidgetComponet.h
|
||
* @brief KJ135WBJYAlgWidgetComponet.h
|
||
* @details
|
||
* 空基十三五微波算法组件界面组件类集
|
||
*/
|
||
|
||
#ifndef __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
||
#define __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
||
|
||
#include "KJ135WBJYAlgInterfaceToolbox_global.h"
|
||
#include <QObject>
|
||
#include <QWidget>
|
||
#include <QFileDialog>
|
||
#include <QMessageBox>
|
||
#include <QDebug>
|
||
#include <QToolButton>
|
||
#include <QLineEdit>
|
||
#include <QLabel>
|
||
#include <QComboBox>
|
||
#include <QSpinBox>
|
||
#include <QDoubleSpinBox>
|
||
#include <QCheckBox>
|
||
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// 参数类型枚举
|
||
/// </summary>
|
||
enum ComponentType{
|
||
UNKNOW = 0, // 未知类型
|
||
FileSelect , // 文件选择
|
||
FolderSelect, // 文件夹选择
|
||
ComboxSelect,// 枚举多选
|
||
IntInput,// 整数输入
|
||
DoubleInput,// 浮点数输入
|
||
MultipleSelect,// 多选
|
||
ScopeIntInput,// 整数范围输入
|
||
ScopeDoubleInput,// 浮点数范围输入
|
||
};
|
||
|
||
|
||
|
||
|
||
|
||
/**
|
||
<Parameter>
|
||
<ParaName>CoveringIDs</ParaName>
|
||
<ParaChsName>地表覆盖类型数据的类别id</ParaChsName>
|
||
<Description>地表覆盖类型数据中植被区域、裸土区域的类别id,多个id使用“;”分割。示例:GlobeLand30数据的cover_roi_ids = 10;20;30;40;50;70;71;72;83;74;90</Description>
|
||
<ParaType>Value</ParaType>
|
||
<DataType>string</DataType>
|
||
<ParaSource>Man</ParaSource>
|
||
<ParaValue>1;4;5;6;7;11;10;20;30;50;60;70;71;72;73;74;80;90;255</ParaValue>
|
||
<EnModification>True</EnModification>
|
||
<EnMultipleChoice>False</EnMultipleChoice>
|
||
<Control>UploadInput</Control>
|
||
<InputType>Aux</InputType>
|
||
<InputNum>0</InputNum>
|
||
<DateFrom>Aux</DateFrom>
|
||
<OptionValue>DEFAULT</OptionValue>
|
||
<MinValue>DEFAULT</MinValue>
|
||
<MaxValue>DEFAULT</MaxValue>
|
||
<NoDataValue>DEFAULT</NoDataValue>
|
||
<filePath>DEFAULT</filePath>
|
||
</Parameter>
|
||
|
||
**/
|
||
|
||
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;
|
||
};
|
||
|
||
/// <summary>
|
||
/// File 文件选择组件
|
||
/// </summary>
|
||
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;
|
||
};
|
||
|
||
/// <summary>
|
||
/// int输入组件
|
||
/// </summary>
|
||
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;
|
||
|
||
};
|
||
|
||
/// <summary>
|
||
/// double 输入组件
|
||
/// </summary>
|
||
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;
|
||
};
|
||
|
||
/// <summary>
|
||
/// 整数值 数据范围输入组件
|
||
/// </summary>
|
||
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;
|
||
};
|
||
|
||
|
||
/// <summary>
|
||
/// 浮点数值 数据范围输入组件
|
||
/// </summary>
|
||
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__
|
||
|