From a27eddc9ff289bfa70fdbe2802cefbc59027ab93 Mon Sep 17 00:00:00 2001 From: simonyan <315082291@qq.com> Date: Mon, 30 Sep 2024 11:53:54 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=95=B0=E5=80=BC=E8=AF=95=E4=BA=95?= =?UTF-8?q?=EF=BC=8C=E6=89=93=E5=BC=80subWnd=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Include/nmNum/nmData/nmDataLogFile.h | 2 +- Src/nmNum/nmData/nmDataLogFile.cpp | 8 ++++---- Src/nmNum/nmSubWnd/nmSubWndUtils.cpp | 19 +++++++++---------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Include/nmNum/nmData/nmDataLogFile.h b/Include/nmNum/nmData/nmDataLogFile.h index b9c28a2..2cccc35 100644 --- a/Include/nmNum/nmData/nmDataLogFile.h +++ b/Include/nmNum/nmData/nmDataLogFile.h @@ -18,7 +18,7 @@ public: // 写日志文件 void writeLog(const QString &message); private: - static nmDataLogFile* _instance; + static nmDataLogFile* s_instance; QTextStream m_textStream; QFile m_logFile; diff --git a/Src/nmNum/nmData/nmDataLogFile.cpp b/Src/nmNum/nmData/nmDataLogFile.cpp index 3e63e29..8e32af7 100644 --- a/Src/nmNum/nmData/nmDataLogFile.cpp +++ b/Src/nmNum/nmData/nmDataLogFile.cpp @@ -16,14 +16,14 @@ nmDataLogFile::~nmDataLogFile() m_logFile.close(); } -nmDataLogFile* nmDataLogFile::_instance = NULL; +nmDataLogFile* nmDataLogFile::s_instance = NULL; nmDataLogFile* nmDataLogFile::getInstance() { - if (NULL == _instance) { - _instance = new nmDataLogFile(); + if (NULL == s_instance) { + s_instance = new nmDataLogFile(); } - return _instance; + return s_instance; } void nmDataLogFile::writeLog(const QString &message) diff --git a/Src/nmNum/nmSubWnd/nmSubWndUtils.cpp b/Src/nmNum/nmSubWnd/nmSubWndUtils.cpp index a8e5c06..0145e85 100644 --- a/Src/nmNum/nmSubWnd/nmSubWndUtils.cpp +++ b/Src/nmNum/nmSubWnd/nmSubWndUtils.cpp @@ -9,6 +9,8 @@ #include "nmSubWndUtils.h" #include "nmDataLogFile.h" +#include +using namespace std; iSubWnd* nmSubWndUtils::createSubWnd(iRibbonXmlCmd* pCmdInfo) { @@ -22,12 +24,10 @@ iSubWnd* nmSubWndUtils::createSubWnd(QString sID, QString sExt) { iSubWnd* pSubWnd = NULL; int nID = sID.toInt(); - if (nID == 5001) { -#ifdef MY_OWN_GRID - pSubWnd = new iSubWndGrid(NULL, sExt); -#else + if (nID == 5101) { + // TODO,先弹窗做输入,做PVT的检查,做PVT的新建和选择 + // 基于IDlgBase pSubWnd = new nmSubWndDemo(NULL, sExt); -#endif } if (NULL != pSubWnd) { // TODO 此处根据需要设置 改变 标识 @@ -38,10 +38,9 @@ iSubWnd* nmSubWndUtils::createSubWnd(QString sID, QString sExt) bool nmSubWndUtils::isEnableOfID_Common(QString sID, QString sName, const bool bLicensed) { - nmDataLogFile::getInstance()->writeLog(sID + " " + sName); - if (_isSame(sName, "NmDemo")) { - return (bLicensed); - } else { - return false; + nmDataLogFile::getInstance()->writeLog("isEnableOfID " + sID + " " + sName); + if (sID.toInt() == 5101) { + return true; } + return false; }