From b155ef7c2ffba8d1b064394bbf5cf695f9e2bb66 Mon Sep 17 00:00:00 2001 From: wyj <157651241@qq.com> Date: Mon, 8 Jul 2024 18:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=93=9D=E8=89=B2=E8=BD=AF=E4=BB=B6=E5=8D=A1?= =?UTF-8?q?=E6=8E=A7Recipe=E5=90=8D=E7=A7=B0=E7=9A=84=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LaiPuLaser/LaiPuLaser/DlgAddControlJob.cpp | 12 ++++++++ LaiPuLaser/LaiPuLaser/RecipeMgr.cpp | 34 ++++++++++++++++++++++ LaiPuLaser/LaiPuLaser/RecipeMgr.h | 1 + 3 files changed, 47 insertions(+) diff --git a/LaiPuLaser/LaiPuLaser/DlgAddControlJob.cpp b/LaiPuLaser/LaiPuLaser/DlgAddControlJob.cpp index a6c772a..6673301 100644 --- a/LaiPuLaser/LaiPuLaser/DlgAddControlJob.cpp +++ b/LaiPuLaser/LaiPuLaser/DlgAddControlJob.cpp @@ -272,6 +272,18 @@ void CDlgAddControlJob::OnBnClickedOk() MsgBox.Show("FoupID 不能为空"); return; } + CString LotCheck = gRecipeMgr->CheckInvalidChar(m_LotID); + if (!LotCheck.IsEmpty()) + { + MsgBox.Show("LotID:"+LotCheck); + return; + } + CString FoupCheck = gRecipeMgr->CheckInvalidChar(m_FoupID); + if (!FoupCheck.IsEmpty()) + { + MsgBox.Show("FoupID:" + FoupCheck); + return; + } CString s("创建job ?"); s += "\nRecipe : "+m_CurSelRecipeName; s += "\nLotID : "+m_LotID; diff --git a/LaiPuLaser/LaiPuLaser/RecipeMgr.cpp b/LaiPuLaser/LaiPuLaser/RecipeMgr.cpp index c8e2f37..b6eb6d2 100644 --- a/LaiPuLaser/LaiPuLaser/RecipeMgr.cpp +++ b/LaiPuLaser/LaiPuLaser/RecipeMgr.cpp @@ -2138,6 +2138,40 @@ CString CRecipeMgr::GetRecipePathByName(CString RecipeName) //没找到 return ""; } +CString CRecipeMgr::CheckInvalidChar(CString Str) +{ + CString RetStr = ""; + int Len = Str.GetLength(); + const char* CheckCh = (LPCTSTR)Str; + char ch; + for (int i = 0; i < Len; i++) + { + ch = *(CheckCh + i); + if ((ch >= 'a' && ch <= 'z') + || (ch >= 'A' && ch <= 'Z') + || ('%' == ch) + || (ch >= '0' && ch <= '9') + || ('_' == ch) + || ('.' == ch&&i != 0 && i != Len - 1)) + { + continue; + } + else + { + if ('.' == ch) + { + RetStr = "'.'不能位于首尾!"; + } + else + { + RetStr = "含无效字符!(有效字符含字母大小写、数字、小数点、下划线、百分号)"; + } + break; + } + + } + return RetStr; +} //获取所有recipe 文件的名称("TEST-RCP-PATICO.rcp") void CRecipeMgr::GetAllRecipeNameVec(vector &RcpNameVec) { diff --git a/LaiPuLaser/LaiPuLaser/RecipeMgr.h b/LaiPuLaser/LaiPuLaser/RecipeMgr.h index aef26cc..8290d70 100644 --- a/LaiPuLaser/LaiPuLaser/RecipeMgr.h +++ b/LaiPuLaser/LaiPuLaser/RecipeMgr.h @@ -219,6 +219,7 @@ public: CString GetRecipePath(); bool DeletRecipe(CString RecipeName); CString GetRecipePathByName(CString RecipeName); + CString CheckInvalidChar(CString Str); CString GetOffsetTablePath(CString TabName); bool CheckRecipeLinkFileExsit(CRecipe &Recipe); private: