1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #ifndef GREYCLUSTERINGSAMPLETABLE_H
- #define GREYCLUSTERINGSAMPLETABLE_H
- #include <QStandardItemModel>
- #include <QTableView>
- #include <QVector>
- #include <QSharedPointer>
- class CMind;
- struct GreyRange
- {
- QString name;
- bool leftClose; // 左闭合
- double leftValue;
- bool rightClose; // 右闭合
- double rightValue;
- };
- struct GreyClusteringValue
- {
- QString units; // 单位
- double weiget;
- QVector<GreyRange> greyRanges; // 灰类
- double leftExtension; // 延拓值左
- double rightExtension; // 延拓值右
- double oldValue; // 实现值改前
- double newValue; // 实现值改后
- };
- struct GreyClusteringItem
- {
- QString indexName; // 指标名字
- int row;
- int col;
- int rowSpan;
- int colSpan;
- QSharedPointer<GreyClusteringValue> value;
- };
- class GreyClusteringSampleTable : public QTableView
- {
- Q_OBJECT
- public:
- GreyClusteringSampleTable(CMind *mind, int grayNumber, QWidget *parent = nullptr);
- void refreshData();
- void compute();
- private:
- void init();
- void loadData();
- void loadSchemeData();
- void initClusteringItems();
- void refreshTableView();
- private slots:
- void itemChanged(QStandardItem *item);
- private:
- QVector<GreyClusteringItem> m_greyClusterings;
- QStandardItemModel *m_model;
- CMind *m_mind;
- int m_nodeDepth; // 节点深度
- int m_rowCount; // 行数
- QStringList m_grayNames;
- const int nodeDepth = 2; // 节点深度
- int m_grayNumber;
- bool m_isFillingData = false;
- bool m_tableHeaderInitialized = false;
- QMap<QString, QMap<QString, QString>> m_schemeData;
- };
- #endif // GREYCLUSTERINGSAMPLETABLE_H
|