|
|
|
@ -1,10 +1,13 @@
|
|
|
|
#include "zxLogInstance.h"
|
|
|
|
#include "zxLogInstance.h"
|
|
|
|
#include "iRibbonXmlCmd.h"
|
|
|
|
#include "iRibbonXmlCmd.h"
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include <QMdiArea>
|
|
|
|
|
|
|
|
#include <QMdiSubWindow>
|
|
|
|
#include "zxSysUtils.h"
|
|
|
|
#include "zxSysUtils.h"
|
|
|
|
#include "ZxUiBase.h"
|
|
|
|
#include "ZxUiBase.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "ZxMainWindow.h"
|
|
|
|
#include "ZxMainWindow.h"
|
|
|
|
|
|
|
|
#include "ZxMdiSubWindow.h"
|
|
|
|
#include "ZxTabWidget.h"
|
|
|
|
#include "ZxTabWidget.h"
|
|
|
|
#include "TreeWxMain.h"
|
|
|
|
#include "TreeWxMain.h"
|
|
|
|
#include "iDockBaseWx.h"
|
|
|
|
#include "iDockBaseWx.h"
|
|
|
|
@ -416,6 +419,10 @@ bool nmSubWndUtils::fillNmDockWxs(iSubWnd* pSubWnd)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 每个成果窗口只需要绑定一次外层MDI激活信号。
|
|
|
|
|
|
|
|
// 后续切换成果窗口时,通过激活事件同步对应的数据中心和左侧面板。
|
|
|
|
|
|
|
|
nmSubWndUtils::getInstance()->connectMdiActivation(pSubWndF);
|
|
|
|
|
|
|
|
|
|
|
|
// 设置当前分析窗体
|
|
|
|
// 设置当前分析窗体
|
|
|
|
nmDataAnalyzeManager::setCurrentFitting(pSubWndF);
|
|
|
|
nmDataAnalyzeManager::setCurrentFitting(pSubWndF);
|
|
|
|
|
|
|
|
|
|
|
|
@ -802,6 +809,9 @@ bool nmSubWndUtils::loadRsts(iSubWnd* pSubWnd, \
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 监听外层成果窗口切换,保证重新激活已经打开过的成果时可以同步数据中心。
|
|
|
|
|
|
|
|
pUtilsInstance->connectMdiActivation(pSubWndF);
|
|
|
|
|
|
|
|
|
|
|
|
// 设置当前操作的是哪一个分析
|
|
|
|
// 设置当前操作的是哪一个分析
|
|
|
|
nmDataAnalyzeManager::setCurrentFitting(pSubWndF);
|
|
|
|
nmDataAnalyzeManager::setCurrentFitting(pSubWndF);
|
|
|
|
|
|
|
|
|
|
|
|
@ -809,8 +819,6 @@ 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);
|
|
|
|
@ -1092,3 +1100,73 @@ void nmSubWndUtils::slotHandleTabChange(int index)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 监听外层MDI成果窗口切换
|
|
|
|
|
|
|
|
void nmSubWndUtils::connectMdiActivation(iSubWndFitting* pSubWndF)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(pSubWndF == nullptr) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ZxMdiSubWindow* pMdiChild = pSubWndF->getMdiChild();
|
|
|
|
|
|
|
|
ZxMainWindow* pMainWnd = pSubWndF->getMainWindow();
|
|
|
|
|
|
|
|
if(pMdiChild == nullptr || pMainWnd == nullptr || pMdiChild->mdiArea() == nullptr) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_pMainWnd = pMainWnd;
|
|
|
|
|
|
|
|
// 一个QMdiArea中可以同时存在多个成果窗口。
|
|
|
|
|
|
|
|
// 使用UniqueConnection避免每次打开成果时重复绑定同一个激活信号。
|
|
|
|
|
|
|
|
connect(pMdiChild->mdiArea(), SIGNAL(subWindowActivated(QMdiSubWindow*)),
|
|
|
|
|
|
|
|
this, SLOT(slotHandleMdiSubWindowActivated(QMdiSubWindow*)),
|
|
|
|
|
|
|
|
Qt::UniqueConnection);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 切换外层MDI成果窗口后,同步当前流动段分析窗口
|
|
|
|
|
|
|
|
void nmSubWndUtils::slotHandleMdiSubWindowActivated(QMdiSubWindow* pSubWindow)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ZxMdiSubWindow* pMdiChild = qobject_cast<ZxMdiSubWindow*>(pSubWindow);
|
|
|
|
|
|
|
|
if(pMdiChild == nullptr || m_pMainWnd == nullptr) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ZxTabWidget* pTabWx = m_pMainWnd->getTabWxOf(pMdiChild);
|
|
|
|
|
|
|
|
if(pTabWx == nullptr) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 每个成果窗口内部都有自己的页签容器。
|
|
|
|
|
|
|
|
// 切换外层成果后,保存当前容器并继续监听该成果内部的页签切换。
|
|
|
|
|
|
|
|
m_pTabWx = pTabWx;
|
|
|
|
|
|
|
|
connect(m_pTabWx, SIGNAL(currentChanged(int)),
|
|
|
|
|
|
|
|
this, SLOT(slotHandleTabChange(int)),
|
|
|
|
|
|
|
|
Qt::UniqueConnection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 找到当前成果中的流动段分析窗口。
|
|
|
|
|
|
|
|
// 窗口ID为3004,后续的数据中心和左侧面板都属于这个分析窗口。
|
|
|
|
|
|
|
|
QVector<iSubWnd*> vecSubWnds = m_pMainWnd->getAllSubWndsOf(m_pTabWx, "3004", true);
|
|
|
|
|
|
|
|
if(vecSubWnds.isEmpty()) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iSubWndFitting* pSubWndF = dynamic_cast<iSubWndFitting*>(vecSubWnds.first());
|
|
|
|
|
|
|
|
if(pSubWndF == nullptr || nmDataAnalyzeManager::findManagerByFitting(pSubWndF) == nullptr) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 先切换数据中心,再刷新左侧面板。
|
|
|
|
|
|
|
|
// 下拉框填充函数会读取getCurrentInstance(),顺序不能颠倒。
|
|
|
|
|
|
|
|
nmDataAnalyzeManager::setCurrentFitting(pSubWndF);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iDockBaseWx* pWxDockNm1 = pSubWndF->getNmDockWx(0);
|
|
|
|
|
|
|
|
if(pWxDockNm1 == nullptr) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nmWxNumericalDesign* pAnalWx = dynamic_cast<nmWxNumericalDesign*>(pWxDockNm1->widget());
|
|
|
|
|
|
|
|
if(pAnalWx != nullptr) {
|
|
|
|
|
|
|
|
// 已经打开过的成果会复用旧面板,不会再次进入构造函数。
|
|
|
|
|
|
|
|
// 主动更新活动面板指针,保证静态通知刷新的是当前成果中的下拉框。
|
|
|
|
|
|
|
|
pAnalWx->activateCurrentInstance();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|