|
@@ -14,6 +14,8 @@
|
|
|
#include <dbService/MindScoreService.h>
|
|
|
#include <dbService/EffectResultService.h>
|
|
|
#include <dbService/GradeInfoService.h>
|
|
|
+#include <dbService/UserConfigService.h>
|
|
|
+#include <dbService/NodeMatrixService.h>
|
|
|
|
|
|
#include <QLabel>
|
|
|
#include <QBoxLayout>
|
|
@@ -30,7 +32,6 @@ EvalReportWidget::EvalReportWidget(ProjectInfo *proj, int indexType, QWidget *pa
|
|
|
|
|
|
loadAlgs();
|
|
|
loadData();
|
|
|
- loadWeightData();
|
|
|
}
|
|
|
|
|
|
void EvalReportWidget::exportReport()
|
|
@@ -38,6 +39,8 @@ void EvalReportWidget::exportReport()
|
|
|
qDebug() << "=====>exportReport";
|
|
|
if (m_proj->id != 113)
|
|
|
return;
|
|
|
+
|
|
|
+ return;
|
|
|
if (m_indexType == ProjectManager::OptimalIndex) { // 方案优选
|
|
|
QString path = "D:/FireFly/QFD2/bin/dataset/方案优选评估报告.docx";
|
|
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
|
@@ -192,6 +195,10 @@ void EvalReportWidget::loadData()
|
|
|
m_mind = new CMind(this);
|
|
|
m_mind->setNodeList(nodeList);
|
|
|
|
|
|
+ if (checkDataComplete() == false) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (m_indexType != ProjectManager::TechIndex) {
|
|
|
showIndexWeight();
|
|
|
} else {
|
|
@@ -207,6 +214,34 @@ void EvalReportWidget::loadData()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+bool EvalReportWidget::checkDataComplete()
|
|
|
+{
|
|
|
+ QString indexName = ProjectManager::nameOfIndexType((ProjectManager::IndexType)m_indexType);
|
|
|
+
|
|
|
+ bool ret = NodeMatrixService().hasMeasureData(m_proj->id, indexName);
|
|
|
+
|
|
|
+ if (ret == true) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ QList<UserConfig *> cfgList;
|
|
|
+ ret = UserConfigService().QueryUserConfigListInfoByEngineerId(&cfgList, m_proj->id);
|
|
|
+ if (ret == false || cfgList.size() <= 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool expertDataComplete = true;
|
|
|
+ for (UserConfig *cfg : cfgList) {
|
|
|
+ ret = NodeMatrixService().hasExpertData(m_proj->id, indexName, cfg->userId);
|
|
|
+ if (ret == false) {
|
|
|
+ expertDataComplete = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return expertDataComplete;
|
|
|
+}
|
|
|
+
|
|
|
void EvalReportWidget::showIndexWeight()
|
|
|
{
|
|
|
int levels = m_mind->levels();
|
|
@@ -584,11 +619,15 @@ void EvalReportWidget::showEffiResult()
|
|
|
}
|
|
|
|
|
|
for (int r = 0; r < model->rowCount(); ++r) {
|
|
|
+ QStandardItem *vHeader = model->verticalHeaderItem(r);
|
|
|
+ QList<double> rowValues = effData[effData.keys()[i]][vHeader->text()];
|
|
|
for (int c = 0; c < model->columnCount(); ++c) {
|
|
|
- QStandardItem *vHeader = model->verticalHeaderItem(r);
|
|
|
- QStandardItem *item = new QStandardItem();
|
|
|
- if (effData.keys().size() > i && effData[effData.keys()[i]][vHeader->text()].size() > c) {
|
|
|
- QString text = QString("%1").arg(effData[effData.keys()[i]][vHeader->text()][c]);
|
|
|
+ QStandardItem *item = new QStandardItem();
|
|
|
+ if (effData.keys().size() > i && rowValues.size() > c) {
|
|
|
+ QString text = QString("%1").arg(rowValues[c]);
|
|
|
+ if (std::isnan(rowValues[c])) {
|
|
|
+ text = "0";
|
|
|
+ }
|
|
|
item->setText(text);
|
|
|
}
|
|
|
|
|
@@ -609,41 +648,6 @@ void EvalReportWidget::makePlotClear(PlotView *plotView)
|
|
|
plotView->clearPlottables();
|
|
|
}
|
|
|
|
|
|
-void EvalReportWidget::loadWeightData()
|
|
|
-{
|
|
|
- bool rightProj = m_proj->id == kDemoProjId2;
|
|
|
- if (!rightProj) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- QTableView *table = (QTableView *)m_indexTab->widget(0);
|
|
|
- DataTableItemModel *model = (DataTableItemModel *)table->model();
|
|
|
-
|
|
|
- QList<SchemePlanManager::SchemeProcessInfo> processList;
|
|
|
- SchemeProcessService().QueryAllByProjectIdAndIndexType(processList, m_proj->id, m_indexType);
|
|
|
-
|
|
|
- for (SchemePlanManager::SchemeProcessInfo process : processList) {
|
|
|
- if (process.algorithm == SchemePlanManager::PrincipalComponents) {
|
|
|
- double values[6] = { 0.223841, 0.243793, 0.209692, 0.16775, 0.088213, 0.0701681 };
|
|
|
- for (int i = 0; i < 6; i++) {
|
|
|
- QStandardItem *item = new QStandardItem(QString("%1").arg(values[i]));
|
|
|
- item->setEditable(false);
|
|
|
- model->setItem(i, 0, item);
|
|
|
- }
|
|
|
-
|
|
|
- } else if (process.algorithm == SchemePlanManager::Entropy) {
|
|
|
- double values[6] = { 0.167234, 0.126622, 0.153871, 0.227901, 0.13719, 0.187182 };
|
|
|
- for (int i = 0; i < 6; i++) {
|
|
|
- QStandardItem *item = new QStandardItem(QString("%1").arg(values[i]));
|
|
|
- item->setEditable(false);
|
|
|
- model->setItem(i, 0, item);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- showIndexWeightPlot();
|
|
|
-}
|
|
|
-
|
|
|
void EvalReportWidget::slotSelectIndexPlotType(int)
|
|
|
{
|
|
|
showIndexWeightPlot();
|
|
@@ -687,6 +691,8 @@ void EvalReportWidget::slotEffiTabIndexChanged(int index)
|
|
|
QStandardItem *item = model->item(0, i);
|
|
|
PlotView::Data data { header->text(), item->text().toDouble() };
|
|
|
qDebug() << __FUNCTION__ << __LINE__ << data.name << data.value << endl;
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << std::isnan(data.value) << endl;
|
|
|
+
|
|
|
values.append(data);
|
|
|
}
|
|
|
|