Browse Source

测试算法说明

Ulricy 1 year ago
parent
commit
b30eb68532

+ 21 - 6
QFD/common/ExportReportManager.cpp

@@ -149,6 +149,7 @@ void ExportReportManager::insertProjectInfo()
 void ExportReportManager::insertDemandAlg()
 {
     // bmWeightAlg bmEvalAlg
+    // bmWeightAlgDscpt bmEvalAlgDscpt
     QList<SchemePlanManager::SchemeProcessInfo> processList;
     bool processRet = SchemeProcessService().QueryAllByProjectIdAndIndexType(processList, m_proj->id, 1);
     if (processRet == false) {
@@ -158,8 +159,10 @@ void ExportReportManager::insertDemandAlg()
     for (int i = 0; i < processList.size(); ++i) {
         if (processList[i].type == SchemePlanManager::CalculateWeight) {
             SchemePlanManager::Algorithm alg = processList[i].algorithm;
-            QString algStr                   = SchemePlanManager::stringFromAlgorithm(alg);
+            QString algStr                   = SchemePlanManager::nameOfAlgorithm(alg);
             insertText("bmWeightAlg", algStr);
+            QString dscrpt = SchemePlanManager::descriptionOfAlgorithm(alg);
+            insertText("bmWeightAlgDscpt", dscrpt);
         }
     }
 
@@ -171,8 +174,10 @@ void ExportReportManager::insertDemandAlg()
     for (int i = 0; i < processList.size(); ++i) {
         if (processList[i].type == SchemePlanManager::RunEvaluate) {
             SchemePlanManager::Algorithm alg = processList[i].algorithm;
-            QString algStr                   = SchemePlanManager::stringFromAlgorithm(alg);
+            QString algStr                   = SchemePlanManager::nameOfAlgorithm(alg);
             insertText("bmEvalAlg", algStr);
+            QString dscrpt = SchemePlanManager::descriptionOfAlgorithm(alg);
+            insertText("bmEvalAlgDscpt", dscrpt);
         }
     }
 }
@@ -859,6 +864,7 @@ void ExportReportManager::insertSchemeData()
 void ExportReportManager::insertSchemeAlgInfo()
 {
     // bmWeightAlg bmEvalAlg
+    // bmWeightAlgDscpt bmEvalAlgDscpt
     QList<SchemePlanManager::SchemeProcessInfo> processList;
     bool processRet = SchemeProcessService().QueryAllByProjectIdAndIndexType(processList, m_proj->id, 4);
     if (processRet == false) {
@@ -868,13 +874,17 @@ void ExportReportManager::insertSchemeAlgInfo()
     for (int i = 0; i < processList.size(); ++i) {
         if (processList[i].type == SchemePlanManager::CalculateWeight) {
             SchemePlanManager::Algorithm alg = processList[i].algorithm;
-            QString algStr                   = SchemePlanManager::stringFromAlgorithm(alg);
+            QString algStr                   = SchemePlanManager::nameOfAlgorithm(alg);
             insertText("bmWeightAlg", algStr);
+            QString dscrpt = SchemePlanManager::descriptionOfAlgorithm(alg);
+            insertText("bmWeightAlgDscpt", dscrpt);
         }
         if (processList[i].type == SchemePlanManager::RunEvaluate) {
             SchemePlanManager::Algorithm alg = processList[i].algorithm;
-            QString algStr                   = SchemePlanManager::stringFromAlgorithm(alg);
+            QString algStr                   = SchemePlanManager::nameOfAlgorithm(alg);
             insertText("bmEvalAlg", algStr);
+            QString dscrpt = SchemePlanManager::descriptionOfAlgorithm(alg);
+            insertText("bmEvalAlgDscpt", dscrpt);
         }
     }
 }
@@ -1084,6 +1094,7 @@ void ExportReportManager::insertEffiIndex()
 void ExportReportManager::insertEffiAlgInfo()
 {
     // bmWeightAlg bmEvalAlg
+    // bmWeightAlgDscpt bmEvalAlgDscpt
     QList<SchemePlanManager::SchemeProcessInfo> processList;
     bool processRet = SchemeProcessService().QueryAllByProjectIdAndIndexType(processList, m_proj->id, 8);
     if (processRet == false) {
@@ -1093,8 +1104,10 @@ void ExportReportManager::insertEffiAlgInfo()
     for (int i = 0; i < processList.size(); ++i) {
         if (processList[i].type == SchemePlanManager::CalculateWeight) {
             SchemePlanManager::Algorithm alg = processList[i].algorithm;
-            QString algStr                   = SchemePlanManager::stringFromAlgorithm(alg);
+            QString algStr                   = SchemePlanManager::nameOfAlgorithm(alg);
             insertText("bmWeightAlg", algStr);
+            QString dscrpt = SchemePlanManager::descriptionOfAlgorithm(alg);
+            insertText("bmWeightAlgDscpt", dscrpt);
         }
         if (processList[i].type == SchemePlanManager::RunEvaluate) {
             SchemePlanManager::Algorithm alg = processList[i].algorithm;
@@ -1103,8 +1116,10 @@ void ExportReportManager::insertEffiAlgInfo()
             } else {
                 m_schemeType = 2;
             }
-            QString algStr = SchemePlanManager::stringFromAlgorithm(alg);
+            QString algStr = SchemePlanManager::nameOfAlgorithm(alg);
             insertText("bmEvalAlg", algStr);
+            QString dscrpt = SchemePlanManager::descriptionOfAlgorithm(alg);
+            insertText("bmEvalAlgDscpt", dscrpt);
         }
     }
 }

+ 1 - 0
QFD/common/ExportReportManager.h

@@ -129,6 +129,7 @@ private:
  * 计算
  * 权重算法:bmWeightAlg,指标权重表:bmWeightTable,指标权重图:bmWeightPic
  * 评估算法:bmEvalAlg,评估结果表:bmEvalTable,评估结果图:bmEvalPic
+ * 权重算法描述:bmWeightAlgDscpt,评估算法描述:bmEvalAlgDscpt
  *
  * 主要评估结论
  * bmVITech1, bmVITech2

+ 29 - 3
QFD/common/SchemePlanManager.cpp

@@ -19,7 +19,7 @@ QString SchemePlanManager::stringFromDataSource(SchemePlanManager::SchemeDataSou
     }
 }
 
-QString SchemePlanManager::stringFromAlgorithm(SchemePlanManager::Algorithm alg)
+QString SchemePlanManager::nameOfAlgorithm(SchemePlanManager::Algorithm alg)
 {
     switch (alg) {
     case NoAlg:
@@ -43,6 +43,32 @@ QString SchemePlanManager::stringFromAlgorithm(SchemePlanManager::Algorithm alg)
     }
 }
 
+QString SchemePlanManager::descriptionOfAlgorithm(SchemePlanManager::Algorithm alg)
+{
+    switch (alg) {
+    case NoAlg:
+        return "";
+    case PrincipalComponents:
+        return "主成分分析法";
+    case Entropy:
+        return "熵值法";
+    case AHP:
+        return "第一步,产生评价值\n决策人构造评价矩阵A。A矩阵中,若因素i与因素j的比较判断值为a(ij)"
+               ",则因素i与因素j的比较判断值为a(ji)=1/"
+               "a(ij)。\n第二步,本征向量法求解\n第三步,一致性检验\n第四步,方案排序";
+    case HWM:
+        return "层次加权法";
+    case SPA:
+        return "集对分析法";
+    case MEA:
+        return "物元分析法";
+    case GCE:
+        return "灰色聚类评估法";
+    case WeightedSum:
+        return "加权求和法";
+    }
+}
+
 QString SchemePlanManager::stringFromIndexCostType(SchemePlanManager::IndexCostType t)
 {
     switch (t) {
@@ -108,12 +134,12 @@ QString SchemePlanManager::processDescription(const SchemePlanManager::SchemePro
     case OptimizeIndex:
         return "";
     case CalculateWeight: {
-        QString algName = stringFromAlgorithm(process.algorithm);
+        QString algName = nameOfAlgorithm(process.algorithm);
         return QString("使用%1计算各个指标的权重。").arg(algName);
     }
 
     case RunEvaluate: {
-        QString algName = stringFromAlgorithm(process.algorithm);
+        QString algName = nameOfAlgorithm(process.algorithm);
         if (process.indexType == ProjectManager::TechIndex) {
             return QString("使用%1进行技术措施重要度评估。").arg(algName);
         } else if (process.indexType == ProjectManager::OptimalIndex) {

+ 3 - 1
QFD/common/SchemePlanManager.h

@@ -54,7 +54,9 @@ public:
         WeightedSum,          // Weighted Sum 加权求和算法
     };
 
-    static QString stringFromAlgorithm(Algorithm alg);
+    static QString nameOfAlgorithm(Algorithm alg);
+
+    static QString descriptionOfAlgorithm(Algorithm alg);
 
     /**
      * @brief The AlgorithmCategory enum

+ 1 - 1
QFD/shemeFlow/FlowGraphNodeWidget.cpp

@@ -182,7 +182,7 @@ void FlowGraphCommonNodeWidget::loadInfo()
     m_algCombo->setHidden(algs.count() < 1);
     m_algCombo->clear();
     for (SchemePlanManager::Algorithm alg : algs) {
-        m_algCombo->addItem(SchemePlanManager::stringFromAlgorithm(alg));
+        m_algCombo->addItem(SchemePlanManager::nameOfAlgorithm(alg));
     }
     int algIndex = 0;
     if (algs.count() > 0 && m_process.algorithm != SchemePlanManager::NoAlg) {

+ 1 - 1
QFD/view/AlgorithmManageView.cpp

@@ -75,7 +75,7 @@ void AlgorithmManageView::showAlgs()
         hBox->addSpacing(10);
 
         SchemePlanManager::Algorithm alg = m_algList[i];
-        QString algStr                   = SchemePlanManager::stringFromAlgorithm(alg);
+        QString algStr                   = SchemePlanManager::nameOfAlgorithm(alg);
 
         QLabel *name = new QLabel(algStr);
         hBox->addWidget(name);

+ 1 - 1
QFD/widgets/EvalReportWidget.cpp

@@ -198,7 +198,7 @@ void EvalReportWidget::loadAlgs()
     SchemeProcessService().QueryAllByProjectIdAndIndexType(processList, m_proj->id, m_indexType);
 
     for (SchemePlanManager::SchemeProcessInfo process : processList) {
-        QString algName = SchemePlanManager::stringFromAlgorithm(process.algorithm);
+        QString algName = SchemePlanManager::nameOfAlgorithm(process.algorithm);
         if (process.type == SchemePlanManager::CalculateWeight) {
             m_weightAlg = process.algorithm;
             m_indexTitle->setText(m_indexTitle->text() + " (" + algName + ") ");