|
|
|
|
@ -6,7 +6,6 @@
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QtCore/qnumeric.h>
|
|
|
|
|
#include "nmCalculationDllPebiSolverTask.h"
|
|
|
|
|
#include "nmGUIComponentLineEdit.h"
|
|
|
|
|
@ -14,7 +13,6 @@
|
|
|
|
|
|
|
|
|
|
nmWxForecast::nmWxForecast(QWidget *parent, nmDataAnalyzeManager* manager)
|
|
|
|
|
: iDlgBase(parent)
|
|
|
|
|
, m_loading(false)
|
|
|
|
|
, m_manager(manager ? manager : nmDataAnalyzeManager::getCurrentInstance())
|
|
|
|
|
, m_task(NULL)
|
|
|
|
|
, m_calculationRunning(false)
|
|
|
|
|
@ -56,18 +54,11 @@ nmWxForecast::nmWxForecast(QWidget *parent, nmDataAnalyzeManager* manager)
|
|
|
|
|
|
|
|
|
|
// 根据加载的数据更新界面
|
|
|
|
|
updateParametersForOption();
|
|
|
|
|
// 初始化完成后再同步编辑,避免加载项目时被标记为修改。
|
|
|
|
|
connect(m_rateTableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(saveDataToManager()));
|
|
|
|
|
connect(m_rDurationUnitCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(saveDataToManager()));
|
|
|
|
|
connect(m_rRateUnitCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(saveDataToManager()));
|
|
|
|
|
const QList<QLineEdit*> edits = m_initialPressureComponent->findChildren<QLineEdit*>();
|
|
|
|
|
foreach(QLineEdit* edit, edits)
|
|
|
|
|
connect(edit, SIGNAL(textEdited(QString)), this, SLOT(saveDataToManager()));
|
|
|
|
|
// 编辑内容保留在窗口中,点击生成后再提交到数据中心。
|
|
|
|
|
const QList<QComboBox*> units = m_initialPressureComponent->findChildren<QComboBox*>();
|
|
|
|
|
foreach(QComboBox* unit, units) {
|
|
|
|
|
const int index = unit->findData(m_forecastData.getMultipleRatesData().pressureUnit);
|
|
|
|
|
if(index >= 0) unit->setCurrentIndex(index);
|
|
|
|
|
connect(unit, SIGNAL(currentIndexChanged(QString)), this, SLOT(saveDataToManager()));
|
|
|
|
|
}
|
|
|
|
|
if(m_manager) {
|
|
|
|
|
connect(m_manager, SIGNAL(sigPebiResultSnapshotChanged()), this, SLOT(onModelChanged()));
|
|
|
|
|
@ -116,18 +107,15 @@ void nmWxForecast::loadDataFromManager()
|
|
|
|
|
|
|
|
|
|
void nmWxForecast::reloadInputData()
|
|
|
|
|
{
|
|
|
|
|
// 保留输入窗口,模型或项目读取通知后同步数据中心配置,不触发反向保存。
|
|
|
|
|
// 保留输入窗口,模型或项目读取通知后同步数据中心配置。
|
|
|
|
|
if(m_calculationRunning) return;
|
|
|
|
|
m_loading = true;
|
|
|
|
|
loadDataFromManager();
|
|
|
|
|
updateParametersForOption();
|
|
|
|
|
m_loading = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxForecast::saveDataToManager()
|
|
|
|
|
{
|
|
|
|
|
if(m_loading) return;
|
|
|
|
|
// 先从界面更新数据
|
|
|
|
|
// 生成前统一收集输入,编辑和关闭窗口时不提交到数据中心。
|
|
|
|
|
updateDataFromUI();
|
|
|
|
|
|
|
|
|
|
const QList<QComboBox*> units = m_initialPressureComponent->findChildren<QComboBox*>();
|
|
|
|
|
|