You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Src/nmNum/nmSubWnd/nmSubWndUtils.cpp

96 lines
2.8 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include "zxLogInstance.h"
#include "iRibbonXmlCmd.h"
#include "nmSubWndMain.h"
#include "nmSubWndGrid.h"
#include "nmSubWndPostprocessing.h"
#include "nmSubWndUtils.h"
#include "nmNewDlg.h"
#include "nmWxNewNormalDlg.h"
#include "nmWxParaProperty.h"
#include "nmDataDemo.h"
#include<QDialog>
iSubWnd* nmSubWndUtils::createSubWnd(iRibbonXmlCmd* pCmdInfo)
{
if (NULL == pCmdInfo) {
return NULL;
}
return createSubWnd(pCmdInfo->m_sID, pCmdInfo->m_sExtInfo);
}
iSubWnd* nmSubWndUtils::createSubWnd(QString sID, QString sExt)
{
iSubWnd* pSubWnd = NULL;
// Here is your own codes
int nID = sID.toInt();
if (nID == 5101) {
// 初始化一个数据类
nmDataDemo* analyzeData = nmDataDemo::getInstance();
// TODO先弹窗做新建分析再创建subWnd
nmWxNewNormalDlg* dlg = new nmWxNewNormalDlg(analyzeData);
dlg->exec();
if(dlg->result() == QDialog::Rejected) {
// 对话框被用户显式拒绝
// 在这里处理你的逻辑
delete analyzeData;
analyzeData = NULL;
return nullptr;
}
nmSubWndMain* pSubWndDemo = new nmSubWndMain(NULL, sExt);
pSubWndDemo->setAnalyzeData(analyzeData);
pSubWnd = pSubWndDemo;
} else if (nID == 5401) {
// 初始化一个数据类
nmDataDemo* analyzeData = nmDataDemo::getInstance();
nmSubWndGrid* pSubWndGrid = new nmSubWndGrid(NULL, sExt);
pSubWndGrid->setAnalyzeData(analyzeData);
pSubWnd = pSubWndGrid;
} else if (nID == 5601) {
// 初始化一个数据类
// nmDataDemo* analyzeData = nmDataDemo::getInstance();
nmSubWndPostprocessing* pSubWndPostProcessing = new nmSubWndPostprocessing(NULL, sExt);
// pSubWndPostProcessing->setAnalyzeData(analyzeData);
pSubWnd = pSubWndPostProcessing;
}
if (NULL != pSubWnd) {
// TODO 此处根据需要设置 改变 标识
pSubWnd->setModified(true);
}
return pSubWnd;
}
bool nmSubWndUtils::runCmdBySpecial(iRibbonXmlCmd* pCmdInfo)
{
if (NULL == pCmdInfo) {
return false;
}
return runCmdBySpecial(pCmdInfo->m_sID, pCmdInfo->m_sExtInfo);
}
bool nmSubWndUtils::runCmdBySpecial(QString sID, QString sExt)
{
// Here is your own codes
if (_isSame(sID, "12345")) {
QMessageBox::information(NULL, zxAppID, QObject::tr("I am abc"));
return true;
} else {
return false;
}
}
bool nmSubWndUtils::isEnableOfID_Common(QString sID, QString sName, const bool bLicensed)
{
// 如果是5101即 新建PVT
if (sID.toInt() == 5101) {
return true;
}
// Here is your own codes
if (_isSame(sName, "NmDemo")) {
return (bLicensed);
} else {
return false;
}
}