Browse Source

添加各种数据收集页面

chengxr 1 year ago
parent
commit
efd88f5f0a

+ 4 - 0
QFD/common/SchemePlanManager.cpp

@@ -81,9 +81,13 @@ QString SchemePlanManager::processName(const SchemeProcessInfo &process)
 QList<SchemePlanManager::SchemeDataSource>
 SchemePlanManager::processOptionalDataSource(const SchemeProcessInfo &process)
 {
+    if (process.type == ImportEvalData && process.indexType == ProjectManager::EfficiencyIndex) {
+        return { FromMeasurement };
+    }
     if (process.type == ImportWeightData || process.type == ImportEvalData) {
         return { FromExpert, FromMeasurement };
     }
+
     return {};
 }
 

+ 5 - 4
QFD/shemeFlow/FlowGraphNodeWidget.cpp

@@ -236,7 +236,8 @@ void FlowGraphCommonNodeWidget::slotAlgComboChanged(int index)
 
     if (m_isLoaded) {
         m_process.algorithm = list.at(index);
-        emit sigProcessChanged(m_process);
+        qDebug() << __FUNCTION__ << __LINE__ << m_process.algorithm << endl;
+        emit sigProcessEdited(m_process);
     }
 }
 
@@ -249,7 +250,7 @@ void FlowGraphCommonNodeWidget::slotDataComboChanged(int index)
 
     if (m_isLoaded) {
         m_process.dSource = list.at(index);
-        emit sigProcessChanged(m_process);
+        emit sigProcessEdited(m_process);
     }
 }
 
@@ -261,7 +262,7 @@ void FlowGraphCommonNodeWidget::slotSpinBoxChanged(int value)
 
     if (m_isLoaded) {
         m_process.efficiencyGrades = value;
-        emit sigProcessChanged(m_process);
+        emit sigProcessEdited(m_process);
     }
 }
 
@@ -273,6 +274,6 @@ void FlowGraphCommonNodeWidget::slotCheckBoxChanged()
 
     if (m_isLoaded) {
         m_process.isChecked = m_checkBox->isChecked();
-        emit sigProcessChanged(m_process);
+        emit sigProcessEdited(m_process);
     }
 }

+ 1 - 1
QFD/shemeFlow/FlowGraphNodeWidget.h

@@ -98,7 +98,7 @@ public:
     bool isTitleHidden() const;
 
 signals:
-    void sigProcessChanged(SchemePlanManager::SchemeProcessInfo process);
+    void sigProcessEdited(SchemePlanManager::SchemeProcessInfo process);
 
 protected:
     void initWidget();

+ 3 - 1
QFD/widgets/ConfigExpertDataWidget.cpp

@@ -165,7 +165,9 @@ void ConfigExpertDataWidget::loadData()
 void ConfigExpertDataWidget::showEvent(QShowEvent *event)
 {
     Q_UNUSED(event)
-    loadData();
+    if (m_isProcessChanged) {
+        loadData();
+    }
 }
 
 void ConfigExpertDataWidget::hideEvent(QHideEvent *event)

+ 38 - 5
QFD/widgets/DataCollectionWidget.cpp

@@ -4,6 +4,10 @@
 #include "ConfigExpertDataWidget.h"
 #include "ConfigMeasureDataWidget.h"
 
+#include "GreyClusteringConfigWidget.h"  // 灰色聚类配置
+#include "GreyClusteringSampleTable.h"   // 灰色聚类评估
+#include "MatterElementConfigWidget.h"   // 物元分析配置
+
 #include "dbService/SchemeProcessService.h"
 #include "dbService/ClassSet.h"
 #include "dbService/CNodeDataService.h"
@@ -58,8 +62,38 @@ void DataCollectionWidget::setupTabWidget()
             return;
         }
 
+        ProjectManager::IndexType t = (ProjectManager::IndexType)i;
+        QString indexName           = ProjectManager::nameOfIndexType(t);
+
         for (SchemePlanManager::SchemeProcessInfo process : processList) {
+            /// 效能评估 - 灰色聚类
+            if (process.algorithm == SchemePlanManager::GCE && process.indexType == ProjectManager::EfficiencyIndex) {
+                GreyClusteringConfigWidget *gc = new GreyClusteringConfigWidget(process.efficiencyGrades);
+                m_tab->addTab(gc, indexName + " - " + "灰色聚类评估配置");
+
+                QVector<GreyClusteringItem> items;
+                GreyClusteringSampleTable *gs = new GreyClusteringSampleTable(items, 2, 10);
+                m_tab->addTab(gs, indexName + " - " + "收集效能评估数据");
+            }
+
+            /// 效能评估 - 物元分析
+            if (process.algorithm == SchemePlanManager::MEA && process.indexType == ProjectManager::EfficiencyIndex) {
+                QList<MEConfigItem> items;
+                MatterElementConfigWidget *w = new MatterElementConfigWidget(items, process.efficiencyGrades);
+                m_tab->addTab(w, indexName + "-" + "物元分析评估配置");
+
+                DataTableWidget *table = new DataTableWidget(process, this);
+                table->mind1()->setNodeList(nodeListMap[i]);
+                table->setCurrentPage(1);
+                m_tab->addTab(table, indexName + " - " + "收集效能评估数据");
+            }
+
             if (process.dSource >= 0) {
+                if (process.type == SchemePlanManager::ImportEvalData
+                    && process.indexType == ProjectManager::EfficiencyIndex) {
+                    continue;
+                }
+
                 DataTableWidget *table = new DataTableWidget(process, this);
                 table->mind1()->setNodeList(nodeListMap[i]);
                 if (i == ProjectManager::TechIndex) {
@@ -67,9 +101,7 @@ void DataCollectionWidget::setupTabWidget()
                 }
                 table->setCurrentPage(1);
 
-                ProjectManager::IndexType t = (ProjectManager::IndexType)i;
-                QString indexName           = ProjectManager::nameOfIndexType(t);
-                QString processName         = SchemePlanManager::processName(process);
+                QString processName = SchemePlanManager::processName(process);
                 m_tab->addTab(table, indexName + " - " + processName);
             }
         }
@@ -78,8 +110,9 @@ void DataCollectionWidget::setupTabWidget()
 
 void DataCollectionWidget::slotTabCurrentChanged(int index)
 {
-    DataTableWidget *table = (DataTableWidget *)m_tab->widget(index);
-    if (index >= 0) {
+
+    DataTableWidget *table = dynamic_cast<DataTableWidget *>(m_tab->widget(index));
+    if (index >= 0 && table != nullptr) {
         bool expert = (table->process().dSource == SchemePlanManager::FromExpert);
         if (expert) {
             m_configExpert->setProcess(table->process());

+ 1 - 1
QFD/widgets/SchemeFlowWidget.cpp

@@ -127,7 +127,7 @@ void SchemeFlowWidget::loadSchemes(const QList<SchemePlanManager::SchemeProcessI
         NodeId id = m_graphModel->addNode(FlowCommonData().type().id);
         m_graphModel->setNodeData(id, NodeRole::Position, QPointF(0, y));
         FlowGraphCommonNodeWidget *w = new FlowGraphCommonNodeWidget();
-        connect(w, &FlowGraphCommonNodeWidget::sigProcessChanged, this, &SchemeFlowWidget::slotSchemeProcessEdited);
+        connect(w, &FlowGraphCommonNodeWidget::sigProcessEdited, this, &SchemeFlowWidget::slotSchemeProcessEdited);
         SchemePlanManager::SchemeProcessInfo process = schems[i];
 
         w->setProcess(process);

+ 1 - 0
QFD/widgets/SchemePlanWidget.cpp

@@ -120,5 +120,6 @@ void SchemePlanWidget::slotExportClicked()
 
 void SchemePlanWidget::slotSchemeProcessEdited(const SchemePlanManager::SchemeProcessInfo &process)
 {
+    qDebug() << __FUNCTION__ << __LINE__ << process.algorithm << endl;
     SchemeProcessService().UpdateSchemeProcess(process);
 }