蓝色软件卡控Recipe名称的特殊字符

main
wyj 3 months ago
parent 78068989fb
commit b155ef7c2f

@ -272,6 +272,18 @@ void CDlgAddControlJob::OnBnClickedOk()
MsgBox.Show("FoupID 不能为空"); MsgBox.Show("FoupID 不能为空");
return; 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 ?"); CString s("创建job ?");
s += "\nRecipe : "+m_CurSelRecipeName; s += "\nRecipe : "+m_CurSelRecipeName;
s += "\nLotID : "+m_LotID; s += "\nLotID : "+m_LotID;

@ -2138,6 +2138,40 @@ CString CRecipeMgr::GetRecipePathByName(CString RecipeName)
//没找到 //没找到
return ""; 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") //获取所有recipe 文件的名称("TEST-RCP-PATICO.rcp")
void CRecipeMgr::GetAllRecipeNameVec(vector<CString> &RcpNameVec) void CRecipeMgr::GetAllRecipeNameVec(vector<CString> &RcpNameVec)
{ {

@ -219,6 +219,7 @@ public:
CString GetRecipePath(); CString GetRecipePath();
bool DeletRecipe(CString RecipeName); bool DeletRecipe(CString RecipeName);
CString GetRecipePathByName(CString RecipeName); CString GetRecipePathByName(CString RecipeName);
CString CheckInvalidChar(CString Str);
CString GetOffsetTablePath(CString TabName); CString GetOffsetTablePath(CString TabName);
bool CheckRecipeLinkFileExsit(CRecipe &Recipe); bool CheckRecipeLinkFileExsit(CRecipe &Recipe);
private: private:

Loading…
Cancel
Save