1、修改分析基础数据获取的方式为单例;

feature/ribbon-menu-20240927
simonyan 2 weeks ago
parent 6c82d054b2
commit ad6e208835

@ -49,7 +49,7 @@ nmSubWndGrid::nmSubWndGrid(QWidget *parent, QString sExt) :
iSubWndBaseAF(parent, sExt) iSubWndBaseAF(parent, sExt)
{ {
m_sMdiWndType = s_MdiType_DataNum; m_sMdiWndType = s_MdiType_DataNum;
m_pAnalyzeData = NULL; m_pAnalyzeData = nmDataDemo::getInstance();
setWindowTitle(tr("nmSubWndGrid")); setWindowTitle(tr("nmSubWndGrid"));
} }

@ -67,7 +67,7 @@ nmSubWndMain::nmSubWndMain(QWidget *parent, QString sExt) :
m_pDataWell = zxCurWell; m_pDataWell = zxCurWell;
} }
m_sMdiWndType = s_MdiType_DataNum; m_sMdiWndType = s_MdiType_DataNum;
// m_analyzeData = new nmDataDemo(); m_pAnalyzeData = nmDataDemo::getInstance();
setWindowTitle(tr("nmSubWndMain")); setWindowTitle(tr("nmSubWndMain"));
} }

@ -26,31 +26,26 @@ iSubWnd* nmSubWndUtils::createSubWnd(QString sID, QString sExt)
int nID = sID.toInt(); int nID = sID.toInt();
if (nID == 5101) { if (nID == 5101) {
// 初始化一个数据类 // 初始化一个数据类
nmDataDemo* analyzeData = nmDataDemo::getInstance(); //nmDataDemo* analyzeData = nmDataDemo::getInstance();
// TODO先弹窗做新建分析再创建subWnd // TODO先弹窗做新建分析再创建subWnd
nmWxNewNormalDlg* dlg = new nmWxNewNormalDlg(analyzeData); nmWxNewNormalDlg* dlg = new nmWxNewNormalDlg(NULL);
dlg->exec(); //dlg->show();
if(dlg->result() == QDialog::Rejected) { /*QDialog* dlg = new QDialog;
dlg->show();*/
if(dlg->exec() == QDialog::Rejected) {
// 对话框被用户显式拒绝 // 对话框被用户显式拒绝
// 在这里处理你的逻辑 // 在这里处理你的逻辑
delete analyzeData;
analyzeData = NULL;
return nullptr; return nullptr;
} }
nmSubWndMain* pSubWndDemo = new nmSubWndMain(NULL, sExt); nmSubWndMain* pSubWndDemo = new nmSubWndMain(NULL, sExt);
pSubWndDemo->setAnalyzeData(analyzeData); pSubWnd = pSubWndDemo;
pSubWnd = pSubWndDemo;
} else if (nID == 5401) { } else if (nID == 5401) {
// 初始化一个数据类 // 网格
nmDataDemo* analyzeData = nmDataDemo::getInstance();
nmSubWndGrid* pSubWndGrid = new nmSubWndGrid(NULL, sExt); nmSubWndGrid* pSubWndGrid = new nmSubWndGrid(NULL, sExt);
pSubWndGrid->setAnalyzeData(analyzeData);
pSubWnd = pSubWndGrid; pSubWnd = pSubWndGrid;
} else if (nID == 5601) { } else if (nID == 5601) {
// 初始化一个数据类 // 后处理
// nmDataDemo* analyzeData = nmDataDemo::getInstance();
nmSubWndPostprocessing* pSubWndPostProcessing = new nmSubWndPostprocessing(NULL, sExt); nmSubWndPostprocessing* pSubWndPostProcessing = new nmSubWndPostprocessing(NULL, sExt);
// pSubWndPostProcessing->setAnalyzeData(analyzeData);
pSubWnd = pSubWndPostProcessing; pSubWnd = pSubWndPostProcessing;
} }
if (NULL != pSubWnd) { if (NULL != pSubWnd) {

@ -19,7 +19,7 @@
nmWxNewNormalDlg::nmWxNewNormalDlg(nmDataDemo* dataPtr) nmWxNewNormalDlg::nmWxNewNormalDlg(nmDataDemo* dataPtr)
{ {
this->m_pAnalyzeData = dataPtr; this->m_pAnalyzeData = nmDataDemo::getInstance();
m_mainLayout = NULL; m_mainLayout = NULL;
m_nameEdit = NULL; m_nameEdit = NULL;
m_checkboxWater = NULL; m_checkboxWater = NULL;

Loading…
Cancel
Save