|
@@ -4,6 +4,7 @@
|
|
|
#include "ConfigExpertDataWidget.h"
|
|
|
#include "ConfigMeasureDataWidget.h"
|
|
|
#include "ConfigSchemeDataWidget.h"
|
|
|
+#include "AddSchemeWidget.h"
|
|
|
|
|
|
#include "EvalDataManager.h"
|
|
|
#include "algorithm/HierarchicalAnalysis.h"
|
|
@@ -18,6 +19,7 @@
|
|
|
#include "dbService/CNodeDataService.h"
|
|
|
#include "dbService/NodeMatrixService.h"
|
|
|
#include "dbService/UserService.h"
|
|
|
+#include "dbService/SchemeInfoService.h"
|
|
|
|
|
|
#include <xlsxdocument.h>
|
|
|
|
|
@@ -60,6 +62,9 @@ DataCollectionWidget::DataCollectionWidget(ProjectInfo *proj, QWidget *parent) :
|
|
|
m_topLayout->addWidget(m_comboBox);
|
|
|
m_topLayout->addSpacing(10);
|
|
|
m_topLayout->addWidget(m_calcBtn);
|
|
|
+
|
|
|
+ m_addSchemeWidget = new AddSchemeWidget(this);
|
|
|
+
|
|
|
connect(m_calcBtn, &PushButton::clicked, this, &DataCollectionWidget::slotCalc);
|
|
|
|
|
|
connect(m_tab, &QTabWidget::currentChanged, this, &DataCollectionWidget::slotTabCurrentChanged);
|
|
@@ -68,6 +73,8 @@ DataCollectionWidget::DataCollectionWidget(ProjectInfo *proj, QWidget *parent) :
|
|
|
&DataCollectionWidget::slotConfigSelected);
|
|
|
connect(m_configScheme, &ConfigSchemeDataWidget::sigAddScheme, this, &DataCollectionWidget::slotAddScheme);
|
|
|
connect(m_configMeasure, &ConfigMeasureDataWidget::sigAddData, this, &DataCollectionWidget::slotAddData);
|
|
|
+ connect(m_addSchemeWidget, &AddSchemeWidget::sigSchemeInfoConfirmed, this,
|
|
|
+ &DataCollectionWidget::slotAddSchemeInfo);
|
|
|
}
|
|
|
|
|
|
void DataCollectionWidget::setType(int type)
|
|
@@ -157,6 +164,11 @@ void DataCollectionWidget::setupTabWidget()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void DataCollectionWidget::refreshSchemeData()
|
|
|
+{
|
|
|
+ m_configScheme->loadData();
|
|
|
+}
|
|
|
+
|
|
|
void DataCollectionWidget::slotTabCurrentChanged(int index)
|
|
|
{
|
|
|
DataTableWidget *table = dynamic_cast<DataTableWidget *>(m_tab->widget(index));
|
|
@@ -167,17 +179,18 @@ void DataCollectionWidget::slotTabCurrentChanged(int index)
|
|
|
}
|
|
|
m_configExpert->setVisible(expert);
|
|
|
|
|
|
- bool meaure = (table->process().dSource == SchemePlanManager::FromMeasurement);
|
|
|
- if (meaure) {
|
|
|
- m_configMeasure->setProcess(table->process());
|
|
|
- }
|
|
|
- m_configMeasure->setVisible(meaure);
|
|
|
-
|
|
|
- bool scheme = (table->process().dSource == SchemePlanManager::FromScheme);
|
|
|
+ bool scheme = (table->process().indexType != ProjectManager::TechIndex
|
|
|
+ && table->process().type == SchemePlanManager::ImportEvalData);
|
|
|
if (scheme) {
|
|
|
m_configScheme->setProcess(table->process());
|
|
|
}
|
|
|
m_configScheme->setVisible(scheme);
|
|
|
+
|
|
|
+ bool meaure = (table->process().dSource == SchemePlanManager::FromMeasurement) && !scheme;
|
|
|
+ if (meaure) {
|
|
|
+ m_configMeasure->setProcess(table->process());
|
|
|
+ }
|
|
|
+ m_configMeasure->setVisible(meaure);
|
|
|
}
|
|
|
|
|
|
if (table == nullptr) {
|
|
@@ -196,6 +209,17 @@ void DataCollectionWidget::slotCalc()
|
|
|
if (gcSample != nullptr) {
|
|
|
gcSample->compute();
|
|
|
}
|
|
|
+
|
|
|
+ QTableView *tableView = (QTableView *)table->tabWidget()->currentWidget();
|
|
|
+
|
|
|
+ DataTableItemModel *model = (DataTableItemModel *)tableView->model();
|
|
|
+
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << tableView << model << endl;
|
|
|
+
|
|
|
+ GreyClusteringConfigWidget *gc = dynamic_cast<GreyClusteringConfigWidget *>(m_tab->currentWidget());
|
|
|
+ if (gc != nullptr) {
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << "gc" << endl;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void DataCollectionWidget::slotImportData(UserConfig *config)
|
|
@@ -344,9 +368,7 @@ void DataCollectionWidget::slotConfigSelected(UserConfig *config)
|
|
|
QList<NodeMatrixInfo *> data;
|
|
|
NodeMatrixService().QueryNodeMatrixListByExpertIdAndEngineerId(&data, config->userId, config->engineerId,
|
|
|
indexName);
|
|
|
-
|
|
|
- qDebug() << __FUNCTION__ << __LINE__ << config->engineerId << config->userId << indexName << data.size() << endl;
|
|
|
- table->setData(data);
|
|
|
+ table->setNodeMatrixData(data);
|
|
|
}
|
|
|
|
|
|
void DataCollectionWidget::slotAddScheme()
|
|
@@ -354,7 +376,36 @@ void DataCollectionWidget::slotAddScheme()
|
|
|
DataTableWidget *table = (DataTableWidget *)m_tab->currentWidget();
|
|
|
QString indexName = ProjectManager::nameOfIndexType((ProjectManager::IndexType)table->process().indexType);
|
|
|
QString processName = SchemePlanManager::processName(table->process());
|
|
|
- qDebug() << __FUNCTION__ << __LINE__ << indexName << processName << endl;
|
|
|
+
|
|
|
+ // 判断是否效能评估数据导入
|
|
|
+ bool isScheme = table->process().indexType == ProjectManager::EfficiencyIndex
|
|
|
+ || table->process().indexType == ProjectManager::OptimalIndex;
|
|
|
+
|
|
|
+ if (isScheme) {
|
|
|
+ m_addSchemeWidget->show();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void DataCollectionWidget::slotAddSchemeInfo(const QString name, const QString remark, const QString path)
|
|
|
+{
|
|
|
+ DataTableWidget *table = (DataTableWidget *)m_tab->currentWidget();
|
|
|
+
|
|
|
+ int type = 0;
|
|
|
+ if (table->process().indexType == ProjectManager::EfficiencyIndex) {
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ SchemaEval *scheme = new SchemaEval();
|
|
|
+ scheme->engineerId = m_proj->id;
|
|
|
+ scheme->name = name;
|
|
|
+ scheme->remark = remark;
|
|
|
+ scheme->filePath = path;
|
|
|
+ scheme->type = type;
|
|
|
+ bool ret = SchemeInfoService().AddSchemeInfoList({ scheme });
|
|
|
+ if (ret) {
|
|
|
+ refreshSchemeData();
|
|
|
+ table->addScheme(scheme);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void DataCollectionWidget::slotAddData()
|