|
@@ -0,0 +1,117 @@
|
|
|
+#include "DataEvaluator.h"
|
|
|
+
|
|
|
+#include <ProjectManager.h>
|
|
|
+#include <SchemePlanManager.h>
|
|
|
+#include <CMind.h>
|
|
|
+
|
|
|
+#include <dbService/ClassSet.h>
|
|
|
+#include <dbService/NodeMatrixService.h>
|
|
|
+#include <dbService/CNodeDataService.h>
|
|
|
+
|
|
|
+#include <QMap>
|
|
|
+
|
|
|
+DataEvaluator::DataEvaluator(QObject *parent) : QObject(parent) { }
|
|
|
+
|
|
|
+void DataEvaluator::setProcess(SchemePlanManager::SchemeProcessInfo process)
|
|
|
+{
|
|
|
+ m_process = process;
|
|
|
+}
|
|
|
+
|
|
|
+SchemePlanManager::SchemeProcessInfo DataEvaluator::process() const
|
|
|
+{
|
|
|
+ return m_process;
|
|
|
+}
|
|
|
+
|
|
|
+void DataEvaluator::setGatherType(DataEvaluator::GatherType type)
|
|
|
+{
|
|
|
+ m_gatherType = type;
|
|
|
+}
|
|
|
+
|
|
|
+DataEvaluator::GatherType DataEvaluator::gatherType() const
|
|
|
+{
|
|
|
+ return m_gatherType;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluate()
|
|
|
+{
|
|
|
+ if (m_process.type == SchemePlanManager::ImportWeightData) {
|
|
|
+ if (m_process.dSource == SchemePlanManager::FromExpert) {
|
|
|
+ return evaluateWeightFromExpert();
|
|
|
+ } else if (m_process.dSource == SchemePlanManager::FromMeasurement) {
|
|
|
+ return evaluateWeightFromMeasure();
|
|
|
+ }
|
|
|
+ } else if (m_process.type == SchemePlanManager::ImportEvalData) {
|
|
|
+ if (m_process.indexType == ProjectManager::TechIndex) {
|
|
|
+ if (m_process.dSource == SchemePlanManager::FromExpert) {
|
|
|
+ return evaluateTechFromExpert();
|
|
|
+ } else if (m_process.dSource == SchemePlanManager::FromMeasurement) {
|
|
|
+ return evaluateTechFromMeasure();
|
|
|
+ }
|
|
|
+ } else if (m_process.indexType == ProjectManager::OptimalIndex) {
|
|
|
+ return evaluateScheme();
|
|
|
+ } else if (m_process.indexType == ProjectManager::EfficiencyIndex) {
|
|
|
+ return evaluateEfficiencyMEA();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateWeightFromExpert()
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateWeightFromMeasure()
|
|
|
+{
|
|
|
+ /// 获取权重分析数据
|
|
|
+ QString indexName = ProjectManager::nameOfIndexType((ProjectManager::IndexType)m_process.indexType);
|
|
|
+ QList<NodeMatrixInfo *> dataList;
|
|
|
+ bool ret = NodeMatrixService().QueryMeaureDataByProjectAndIndex(&dataList, indexName, m_process.projectId);
|
|
|
+ if (ret == false) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 使用 uuid 将数据分组
|
|
|
+ QStringList m_uuidList;
|
|
|
+ QMap<QString, QList<NodeMatrixInfo *>> m_nodeData;
|
|
|
+ for (NodeMatrixInfo *info : dataList) {
|
|
|
+ if (m_uuidList.contains(info->strUuid) == false) {
|
|
|
+ m_uuidList.append(info->strUuid);
|
|
|
+ QList<NodeMatrixInfo *> list;
|
|
|
+ m_nodeData[info->strUuid] = list;
|
|
|
+ }
|
|
|
+ m_nodeData[info->strUuid].append(info);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 获取指标体系
|
|
|
+
|
|
|
+ /// 根据指标体系层级, 构造算法需要的数据
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateTechFromExpert()
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateTechFromMeasure()
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateScheme()
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateEfficiencyMEA()
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool DataEvaluator::evaluateEfficiencyGCE()
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|