|
|
|
|
@ -1,16 +1,54 @@
|
|
|
|
|
#include "nmPebiResultPageInstaller.h"
|
|
|
|
|
|
|
|
|
|
#include "iSubWndFitting.h"
|
|
|
|
|
#include "iWxResult.h"
|
|
|
|
|
#include "nmDataAnalyzeManager.h"
|
|
|
|
|
#include "nmWxParaPropertyPebi.h"
|
|
|
|
|
#include "nmWxPebiResultViewWidget.h"
|
|
|
|
|
|
|
|
|
|
#include <QLayout>
|
|
|
|
|
#include <QLayoutItem>
|
|
|
|
|
#include <QList>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
|
|
void nmPebiResultPageInstaller::synchronizeVisibility(
|
|
|
|
|
iSubWndFitting* pFitting,
|
|
|
|
|
nmDataAnalyzeManager* pManager)
|
|
|
|
|
{
|
|
|
|
|
if(pFitting == nullptr || pManager == nullptr ||
|
|
|
|
|
pManager->getGridType() != NM_Grid_PEBI ||
|
|
|
|
|
nmDataAnalyzeManager::findManagerByFitting(pFitting) != pManager) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bool bHasSnapshot = pManager->hasPebiResultSnapshot();
|
|
|
|
|
// 直接查找所属分析的现有结果容器,不通过取页接口触发页签显示或激活。
|
|
|
|
|
const QList<iWxResult*> listResultWindows = pFitting->findChildren<iWxResult*>();
|
|
|
|
|
foreach(iWxResult* pResultWindow, listResultWindows) {
|
|
|
|
|
nmWxPebiResultViewWidget* pResultView =
|
|
|
|
|
pResultWindow->findChild<nmWxPebiResultViewWidget*>();
|
|
|
|
|
nmWxParaPropertyPebi* pResultParameters =
|
|
|
|
|
pResultWindow->findChild<nmWxParaPropertyPebi*>();
|
|
|
|
|
if(!bHasSnapshot) {
|
|
|
|
|
// 重新加载无成果的数据时清理旧内容;只处理结果容器内的只读参数,
|
|
|
|
|
// 不触碰左侧用于编辑当前模型的参数面板。
|
|
|
|
|
if(pResultView != nullptr) {
|
|
|
|
|
pResultView->setDataManager(pManager);
|
|
|
|
|
}
|
|
|
|
|
if(pResultParameters != nullptr) {
|
|
|
|
|
pResultParameters->setDataManager(pManager);
|
|
|
|
|
pResultParameters->rebuildResultParas();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pResultWindow->setTabItemVisibleEx(
|
|
|
|
|
iWxResult::TSI_NmRst, bHasSnapshot && pResultParameters != nullptr, false);
|
|
|
|
|
pResultWindow->setTabItemVisibleEx(
|
|
|
|
|
iWxResult::TSI_Nm3D, bHasSnapshot && pResultView != nullptr, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmPebiResultPageInstaller::installOrSynchronize(
|
|
|
|
|
iSubWndFitting* pFitting,
|
|
|
|
|
nmDataAnalyzeManager* pManager)
|
|
|
|
|
@ -22,6 +60,14 @@ bool nmPebiResultPageInstaller::installOrSynchronize(
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 保存分析输入不代表已经求解。框架反序列化会恢复结果容器及页签,
|
|
|
|
|
// 无快照时不仅要阻止创建,还必须隐藏已经恢复的两个空数值页签。
|
|
|
|
|
// 这里按快照是否存在判断;输入修改后保留的历史快照仍允许恢复查看。
|
|
|
|
|
if(!pManager->hasPebiResultSnapshot()) {
|
|
|
|
|
synchronizeVisibility(pFitting, pManager);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString sErrorMessage;
|
|
|
|
|
QWidget* p3DPage = pFitting->getFitSubRstWxOf(
|
|
|
|
|
FSRT_Nm3D, true, &sErrorMessage);
|
|
|
|
|
@ -82,11 +128,13 @@ bool nmPebiResultPageInstaller::installOrSynchronize(
|
|
|
|
|
pResultParameters->setDataManager(pManager);
|
|
|
|
|
pResultParameters->rebuildResultParas();
|
|
|
|
|
pResultLayout->addWidget(pResultParameters);
|
|
|
|
|
synchronizeVisibility(pFitting, pManager);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 参数页未监听快照状态信号,每次生产入口同步均需显式重建。
|
|
|
|
|
pResultParameters->setDataManager(pManager);
|
|
|
|
|
pResultParameters->rebuildResultParas();
|
|
|
|
|
synchronizeVisibility(pFitting, pManager);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|