public Boolean LoadFromVPPFile(string FileName, CogRecordDisplay mCogRecordDisplay)//檔案參數載入 { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); string TempFileName = (string)FileName; try { //從CogTool裡面讀出來 string strFolderPath = @"D:\VPS_File\Product\OCRMaxTool\" + @FileName + @"\"; CogToolBlock ToolBlock1 = new CogToolBlock(); FileName = strFolderPath + FileName + "_OCR.vpp"; ToolBlock1 = (CogToolBlock)CogSerializer.LoadObjectFromFile(FileName);//開啟ToolBlock vpp檔案 //依序載入 mOCRMaxTool = (CogOCRMaxTool)ToolBlock1.Tools[TempFileName + "_OCRMaxTool_"]; this.ROI_Create(mCogRecordDisplay); SaveLog.Msg_("Data of OCRMaxTool Loaded : " + @FileName); ToolBlock1 = null; mOCRMaxTool_Status = true; return(true); } catch (Exception ex) { SaveLog.Msg_("Load OCRMaxTool Data Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); mOCRMaxTool_Status = false; return(false); } }
public bool unLoad() { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { mOCRMaxTool = null; mOCR_ROI = null; mOCRMaxTool_Status = false; return(true); } catch (Exception ex) { SaveLog.Msg_("OCRMaxTool unLoad Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }