Revert "修复切换成果后下拉框和曲线显示错误的问题"

This reverts commit c6eaa7940b.
feature/UI-20260528
lvjunjie 2 weeks ago
parent 91f0fdd86c
commit b92403c904

@ -18,7 +18,6 @@ class QToolBar;
class nmDataWellBase; class nmDataWellBase;
class nmDataAnalyzeManager; class nmDataAnalyzeManager;
class nmCalculationDllPebiSolverTask; class nmCalculationDllPebiSolverTask;
class iSubWndFitting;
class QWidget; class QWidget;
class QObject; class QObject;
@ -119,8 +118,6 @@ class NM_SUB_WND_EXPORT nmSubWndMain : public iSubWndBaseFit {
// 根据分析数据绘制对应的地图信息 // 根据分析数据绘制对应的地图信息
void updateMapByDataManager(nmDataAnalyzeManager* pDataManager); void updateMapByDataManager(nmDataAnalyzeManager* pDataManager);
// 绑定所属流动段分析窗口,避免多成果切换时使用错误的数据中心
void setOwnerFitting(iSubWndFitting* pSubWndF);
signals: signals:
void sigFreshRnStates(QStringList list); void sigFreshRnStates(QStringList list);
@ -224,8 +221,6 @@ class NM_SUB_WND_EXPORT nmSubWndMain : public iSubWndBaseFit {
bool initloglog(QVector<QVector<double >> & vvecLogPreData, QVector<iCurveDesc>& vecDescs,bool isHistoryData); bool initloglog(QVector<QVector<double >> & vvecLogPreData, QVector<iCurveDesc>& vecDescs,bool isHistoryData);
// 压力历史曲线数据 // 压力历史曲线数据
bool initPreHistory(QVector<QVector<double >> & vvecHistoryData, QVector<iCurveDesc>& vecDescs,bool isHistoryData); bool initPreHistory(QVector<QVector<double >> & vvecHistoryData, QVector<iCurveDesc>& vecDescs,bool isHistoryData);
// 操作前切回所属分析窗口,保证刷新和计算落到当前成果
void activateOwnerFitting();
// 根据原始压力数据、计算出半对数、双对数数据 // 根据原始压力数据、计算出半对数、双对数数据
//void calculationLogData(nmDataWellBase* pWellData,QVector<QVector<double>>& vvecHistoryData,QVector<QVector<double>>& vvecLogPreData,QVector<QVector<double>>& vvecSemiLogPreData); //void calculationLogData(nmDataWellBase* pWellData,QVector<QVector<double>>& vvecHistoryData,QVector<QVector<double>>& vvecLogPreData,QVector<QVector<double>>& vvecSemiLogPreData);
@ -234,8 +229,6 @@ class NM_SUB_WND_EXPORT nmSubWndMain : public iSubWndBaseFit {
// 绘图相关 // 绘图相关
nmGuiPlot* m_pWxPlot; nmGuiPlot* m_pWxPlot;
// 本对象服务的流动段分析窗口
iSubWndFitting* m_pOwnerFitting;
// 锁定状态 // 锁定状态
bool m_lockState; bool m_lockState;

@ -23,7 +23,6 @@ class nmDataDiagnostic;
class nmDataReservoir; class nmDataReservoir;
class nmGUIComponentLineEdit; class nmGUIComponentLineEdit;
class nmDataAnalyzeManager; class nmDataAnalyzeManager;
class iSubWndFitting;
class NM_SUB_WXS_EXPORT nmWxNumericalDesign : public iDlgBase class NM_SUB_WXS_EXPORT nmWxNumericalDesign : public iDlgBase
{ {
@ -36,8 +35,6 @@ public:
static void notifyTimeDependentSkinChanged(const QString& wellName, bool checked); static void notifyTimeDependentSkinChanged(const QString& wellName, bool checked);
// 刷新查看井结果下拉框 // 刷新查看井结果下拉框
static void notifyResultWellSelectorChanged(const QString& wellName = QString()); static void notifyResultWellSelectorChanged(const QString& wellName = QString());
// 绑定所属流动段分析窗口,避免多个成果面板共用静态当前实例时串数据
void setOwnerFitting(iSubWndFitting* pSubWndF);
signals: signals:
void sigGenerateClicked(); // 点击生成按钮时发出的信号 void sigGenerateClicked(); // 点击生成按钮时发出的信号
@ -102,8 +99,6 @@ private:
void updateDataFromUi(); void updateDataFromUi();
// 填充查看井结果下拉框 // 填充查看井结果下拉框
void fillResultWellCombo(const QString& selectedWellName = QString()); void fillResultWellCombo(const QString& selectedWellName = QString());
// 操作前切回所属分析窗口,保证界面读取的是自己的数据中心
void activateOwnerFitting();
private: private:
@ -120,8 +115,6 @@ private:
QGroupBox* m_pResultWellGroup; QGroupBox* m_pResultWellGroup;
QComboBox* m_pResultWellCombo; QComboBox* m_pResultWellCombo;
bool m_bFillingResultWellCombo; bool m_bFillingResultWellCombo;
// 本面板所属的流动段分析窗口
iSubWndFitting* m_pOwnerFitting;
// 输出组组件 (新) // 输出组组件 (新)
QGroupBox* m_pOutputGroup; // 输出分组框 QGroupBox* m_pOutputGroup; // 输出分组框

@ -99,7 +99,6 @@ nmSubWndMain::nmSubWndMain(QWidget *parent, QString sExt) :
iSubWndBaseFit(parent, sExt) iSubWndBaseFit(parent, sExt)
{ {
m_pWxPlot = NULL; m_pWxPlot = NULL;
m_pOwnerFitting = nullptr;
m_pWxDockParas = NULL; m_pWxDockParas = NULL;
m_pWxParas = NULL; m_pWxParas = NULL;
m_pWxDockData1 = NULL; m_pWxDockData1 = NULL;
@ -1449,8 +1448,6 @@ void nmSubWndMain::generationMesh()
void nmSubWndMain::solveAndAnalyze() void nmSubWndMain::solveAndAnalyze()
{ {
activateOwnerFitting();
// 强制清理旧的(以防万一上次没删掉) // 强制清理旧的(以防万一上次没删掉)
if (m_pProgressDlg != nullptr) { if (m_pProgressDlg != nullptr) {
delete m_pProgressDlg; delete m_pProgressDlg;
@ -1551,8 +1548,6 @@ void nmSubWndMain::triggerToolBarAction(int index)
void nmSubWndMain::mergeAnaResultToFitting() void nmSubWndMain::mergeAnaResultToFitting()
{ {
activateOwnerFitting();
//QMessageBox::information(this, tr("solver success"), tr("solver succeed!")); //QMessageBox::information(this, tr("solver success"), tr("solver succeed!"));
/*if (m_parameterPropertyWindow != nullptr) { /*if (m_parameterPropertyWindow != nullptr) {
@ -1935,8 +1930,6 @@ void nmSubWndMain::geoLayering()
void nmSubWndMain::on_calculationFinished(NM_Calculation_Result result) void nmSubWndMain::on_calculationFinished(NM_Calculation_Result result)
{ {
activateOwnerFitting();
// 1. 立即停止模拟定时器(防止它在处理结果时继续触发) // 1. 立即停止模拟定时器(防止它在处理结果时继续触发)
if (m_pFakeProgressTimer) { if (m_pFakeProgressTimer) {
m_pFakeProgressTimer->stop(); m_pFakeProgressTimer->stop();
@ -2120,20 +2113,6 @@ nmGuiPlot * nmSubWndMain::getWxPlot() const
return m_pWxPlot; return m_pWxPlot;
} }
// 绑定所属流动段分析窗口,后续生成和刷新结果都以它为准
void nmSubWndMain::setOwnerFitting(iSubWndFitting* pSubWndF)
{
m_pOwnerFitting = pSubWndF;
}
// 多成果切换后全局CurrentFitting可能已变化操作前切回本对象所属窗口
void nmSubWndMain::activateOwnerFitting()
{
if(m_pOwnerFitting != nullptr) {
nmDataAnalyzeManager::setCurrentFitting(m_pOwnerFitting);
}
}
void nmSubWndMain::onProgressUpdated(int progress) void nmSubWndMain::onProgressUpdated(int progress)
{ {
if (!m_pProgressDlg) { if (!m_pProgressDlg) {
@ -2162,8 +2141,6 @@ void nmSubWndMain::onProgressUpdated(int progress)
void nmSubWndMain::onWellSelected(const QString& wellName) void nmSubWndMain::onWellSelected(const QString& wellName)
{ {
activateOwnerFitting();
nmDataAnalyzeManager* pInstance = nmDataAnalyzeManager::getCurrentInstance(); nmDataAnalyzeManager* pInstance = nmDataAnalyzeManager::getCurrentInstance();
if(pInstance == nullptr) { if(pInstance == nullptr) {
return; return;
@ -2354,14 +2331,7 @@ void nmSubWndMain::onGenerateButtonClicked()
{ {
//QString sDir = ZxBaseUtil::getCurWellDirOf("Nm/PreProcessing"); //QString sDir = ZxBaseUtil::getCurWellDirOf("Nm/PreProcessing");
activateOwnerFitting(); if(nmDataAnalyzeManager::getCurrentInstance()->getGridType() == NM_Grid_PEBI) {
nmDataAnalyzeManager* pInstance = nmDataAnalyzeManager::getCurrentInstance();
if(pInstance == nullptr) {
return;
}
if(pInstance->getGridType() == NM_Grid_PEBI) {
nmCalculationPebiGrid* pPebiGridGeneratorInstance = nmCalculationPebiGrid::getInstance(); nmCalculationPebiGrid* pPebiGridGeneratorInstance = nmCalculationPebiGrid::getInstance();
if(pPebiGridGeneratorInstance->getGridOutput2().Trinodexy.size() <= 0) { if(pPebiGridGeneratorInstance->getGridOutput2().Trinodexy.size() <= 0) {
// 没有可用PEBI网格时才重新生成 // 没有可用PEBI网格时才重新生成

@ -163,8 +163,6 @@ iSubWnd* nmSubWndUtils::makesureSubWnd(QString sID, QString sExt, \
// TODO2、没有流动段分析 // TODO2、没有流动段分析
if(nmDataAnalyzeManager::getCurrentFitting() != nullptr) { if(nmDataAnalyzeManager::getCurrentFitting() != nullptr) {
nmSubWndMain* pSubWndMain = new nmSubWndMain(NULL, sExt); nmSubWndMain* pSubWndMain = new nmSubWndMain(NULL, sExt);
// 地图窗口绑定当前分析,后续生成/刷新使用同一数据中心
pSubWndMain->setOwnerFitting(nmDataAnalyzeManager::getCurrentFitting());
pSubWnd = pSubWndMain; pSubWnd = pSubWndMain;
} else { } else {
ZxMainWindow* pMainWnd1 = const_cast<ZxMainWindow*>(pMainWnd); ZxMainWindow* pMainWnd1 = const_cast<ZxMainWindow*>(pMainWnd);
@ -386,11 +384,6 @@ bool nmSubWndUtils::fillNmDockWxs(iSubWnd* pSubWnd)
Q_ASSERT (nullptr != pWxDockNm2); Q_ASSERT (nullptr != pWxDockNm2);
if (pWxDockNm1->widget() != nullptr && pWxDockNm2->widget() != nullptr) if (pWxDockNm1->widget() != nullptr && pWxDockNm2->widget() != nullptr)
{ {
nmWxNumericalDesign* pAnalWx = dynamic_cast<nmWxNumericalDesign*>(pWxDockNm1->widget());
if(pAnalWx != nullptr) {
// 已有面板也重新绑定,保证切换成果后指向当前分析
pAnalWx->setOwnerFitting(pSubWndF);
}
return true; //已经设定的话,则不再处理 return true; //已经设定的话,则不再处理
} }
@ -590,8 +583,6 @@ bool nmSubWndUtils::fillNmDockWxs(iSubWnd* pSubWnd)
ZxMainWindow* pMainWnd = pSubWndF->getMainWindow(); ZxMainWindow* pMainWnd = pSubWndF->getMainWindow();
// 设置当前窗口到Map // 设置当前窗口到Map
pSubWndMain->setMainWindow(pMainWnd); pSubWndMain->setMainWindow(pMainWnd);
// 求解辅助窗口绑定当前分析避免多个成果间串用CurrentFitting
pSubWndMain->setOwnerFitting(pSubWndF);
pWxDockNm1->setWindowTitle(tr("Generate numerical model")); //改变Title pWxDockNm1->setWindowTitle(tr("Generate numerical model")); //改变Title
pWxDockNm2->setWindowTitle(tr("Parameters")); pWxDockNm2->setWindowTitle(tr("Parameters"));
@ -599,8 +590,6 @@ bool nmSubWndUtils::fillNmDockWxs(iSubWnd* pSubWnd)
//QTextEdit* pWx1 = new QTextEdit("This is demo for upper"); //QTextEdit* pWx1 = new QTextEdit("This is demo for upper");
//QTextEdit* pWx2 = new QTextEdit("This is demo for lower"); //QTextEdit* pWx2 = new QTextEdit("This is demo for lower");
nmWxNumericalDesign* pAnalWx = new nmWxNumericalDesign(); nmWxNumericalDesign* pAnalWx = new nmWxNumericalDesign();
// 数值解面板绑定当前分析,下拉框和生成按钮都按该分析取数据
pAnalWx->setOwnerFitting(pSubWndF);
nmWxParameterProperty* pParaWx = new nmWxParameterProperty(); nmWxParameterProperty* pParaWx = new nmWxParameterProperty();
// 建立求解调用连接 // 建立求解调用连接
@ -820,6 +809,9 @@ bool nmSubWndUtils::loadRsts(iSubWnd* pSubWnd, \
pDataManager->loadNmResult(sDir); pDataManager->loadNmResult(sDir);
// 加载当前分析中的PVT数据 // 加载当前分析中的PVT数据
pDataManager->initPvtParaFromSubFit(); pDataManager->initPvtParaFromSubFit();
// 成果加载完成后刷新查看井下拉框
nmWxNumericalDesign::notifyResultWellSelectorChanged();
// 切换左侧参数视图 // 切换左侧参数视图
pSubWndF->swapAnaNmDocks(true); pSubWndF->swapAnaNmDocks(true);
@ -832,11 +824,6 @@ bool nmSubWndUtils::loadRsts(iSubWnd* pSubWnd, \
} }
if(pWxDockNm1->widget() != nullptr && pWxDockNm2->widget() != nullptr) { if(pWxDockNm1->widget() != nullptr && pWxDockNm2->widget() != nullptr) {
nmWxNumericalDesign* pAnalWx = dynamic_cast<nmWxNumericalDesign*>(pWxDockNm1->widget());
if(pAnalWx != nullptr) {
// 加载成果后重新绑定当前分析,避免刷新到其他成果面板
pAnalWx->setOwnerFitting(pSubWndF);
}
return true; //已经设定的话,则不再处理 return true; //已经设定的话,则不再处理
} }
@ -844,8 +831,6 @@ bool nmSubWndUtils::loadRsts(iSubWnd* pSubWnd, \
nmSubWndMain* pSubWndMain = new nmSubWndMain(NULL, ""); nmSubWndMain* pSubWndMain = new nmSubWndMain(NULL, "");
ZxMainWindow* pMainWnd1 = const_cast<ZxMainWindow*>(pMainWnd); ZxMainWindow* pMainWnd1 = const_cast<ZxMainWindow*>(pMainWnd);
pSubWndMain->setMainWindow(pMainWnd1); pSubWndMain->setMainWindow(pMainWnd1);
// 求解辅助窗口绑定当前分析,计算完成后刷新当前成果
pSubWndMain->setOwnerFitting(pSubWndF);
//pWxDockNm1->setWindowTitle(tr("Dock1's Title")); //pWxDockNm1->setWindowTitle(tr("Dock1's Title"));
//pWxDockNm2->setWindowTitle(tr("Dock2's Title")); //pWxDockNm2->setWindowTitle(tr("Dock2's Title"));
@ -854,8 +839,6 @@ bool nmSubWndUtils::loadRsts(iSubWnd* pSubWnd, \
// 自定义窗体指针 // 自定义窗体指针
nmWxNumericalDesign* pAnalWx = new nmWxNumericalDesign(); nmWxNumericalDesign* pAnalWx = new nmWxNumericalDesign();
// 数值解面板绑定当前分析,下拉框按当前成果的数据中心刷新
pAnalWx->setOwnerFitting(pSubWndF);
nmWxParameterProperty* pParaWx = new nmWxParameterProperty(); nmWxParameterProperty* pParaWx = new nmWxParameterProperty();
Q_ASSERT(nullptr != pAnalWx); Q_ASSERT(nullptr != pAnalWx);
Q_ASSERT(nullptr != pParaWx); Q_ASSERT(nullptr != pParaWx);

@ -49,7 +49,6 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
m_pResultWellGroup = nullptr; m_pResultWellGroup = nullptr;
m_pResultWellCombo = nullptr; m_pResultWellCombo = nullptr;
m_bFillingResultWellCombo = false; m_bFillingResultWellCombo = false;
m_pOwnerFitting = nullptr;
// 初始化图标路径 // 初始化图标路径
m_sIconDir = QCoreApplication::applicationDirPath(); m_sIconDir = QCoreApplication::applicationDirPath();
@ -125,23 +124,6 @@ nmWxNumericalDesign::~nmWxNumericalDesign()
} }
} }
// 绑定所属流动段分析窗口,刷新下拉框时使用对应的数据中心
void nmWxNumericalDesign::setOwnerFitting(iSubWndFitting* pSubWndF)
{
m_pOwnerFitting = pSubWndF;
activateOwnerFitting();
fillResultWellCombo();
}
// 多成果切换后全局CurrentFitting可能已变化操作前切回本面板所属窗口
void nmWxNumericalDesign::activateOwnerFitting()
{
s_pCurrentInstance = this;
if(m_pOwnerFitting != nullptr) {
nmDataAnalyzeManager::setCurrentFitting(m_pOwnerFitting);
}
}
// 外部刷新当前查看井下拉框 // 外部刷新当前查看井下拉框
void nmWxNumericalDesign::notifyResultWellSelectorChanged(const QString& wellName) void nmWxNumericalDesign::notifyResultWellSelectorChanged(const QString& wellName)
{ {
@ -174,8 +156,6 @@ void nmWxNumericalDesign::initResultWellGroup()
// 按参与计算井刷新下拉框 // 按参与计算井刷新下拉框
void nmWxNumericalDesign::fillResultWellCombo(const QString& selectedWellName) void nmWxNumericalDesign::fillResultWellCombo(const QString& selectedWellName)
{ {
activateOwnerFitting();
if(m_pResultWellCombo == nullptr) { if(m_pResultWellCombo == nullptr) {
return; return;
} }
@ -699,8 +679,6 @@ void nmWxNumericalDesign::setupConnections()
void nmWxNumericalDesign::onTimeDependentCheck(bool checked) void nmWxNumericalDesign::onTimeDependentCheck(bool checked)
{ {
activateOwnerFitting();
// 更新当前井的时间变表皮状态 // 更新当前井的时间变表皮状态
nmDataWellBase* pCurrentWell = nmDataAnalyzeManager::getCurrentInstance()->getCurWellData(); nmDataWellBase* pCurrentWell = nmDataAnalyzeManager::getCurrentInstance()->getCurWellData();
@ -712,8 +690,6 @@ void nmWxNumericalDesign::onTimeDependentCheck(bool checked)
// 切换查看井后同步当前井,并刷新结果曲线 // 切换查看井后同步当前井,并刷新结果曲线
void nmWxNumericalDesign::onResultWellChanged(int index) void nmWxNumericalDesign::onResultWellChanged(int index)
{ {
activateOwnerFitting();
if(m_bFillingResultWellCombo || index < 0 || m_pResultWellCombo == nullptr) { if(m_bFillingResultWellCombo || index < 0 || m_pResultWellCombo == nullptr) {
return; return;
} }
@ -737,8 +713,6 @@ void nmWxNumericalDesign::onResultWellChanged(int index)
void nmWxNumericalDesign::onGenerateClicked() void nmWxNumericalDesign::onGenerateClicked()
{ {
activateOwnerFitting();
updateDataFromUi(); updateDataFromUi();
nmDataTimeStepSetting* p = nmDataAnalyzeManager::getCurrentInstance()->getTimeStep(); nmDataTimeStepSetting* p = nmDataAnalyzeManager::getCurrentInstance()->getTimeStep();
@ -833,8 +807,6 @@ void nmWxNumericalDesign::onOutputResultFieldsManualToggled(bool checked)
void nmWxNumericalDesign::onOptionsIconClicked() void nmWxNumericalDesign::onOptionsIconClicked()
{ {
activateOwnerFitting();
nmWxIncludeOtherWells dlg(this); // 创建"包含其他井"对话框实例 nmWxIncludeOtherWells dlg(this); // 创建"包含其他井"对话框实例
if(dlg.exec() == QDialog::Accepted) { // 如果对话框被接受(点击了确定) if(dlg.exec() == QDialog::Accepted) { // 如果对话框被接受(点击了确定)

Loading…
Cancel
Save