Example #1
0
        public void Save()
        {
            string strPath = VisionMgr.GetInstance().CurrentVisionProcessDir + "\\" + "VisionMgr" + ".xml";

            dicVisionType.Clear();

            foreach (var temp in dicVision)
            {
                StepVisionInfo stepVisionInfo = new StepVisionInfo();
                stepVisionInfo.VisionType = temp.Value.GetType().ToString();
                stepVisionInfo.CamParam   = temp.Value.m_camparam;
                dicVisionType.Add(temp.Key, stepVisionInfo);
                dicVision[temp.Key].Save();
                if (PrItemChangedEvent != null)
                {
                    PrItemChangedEvent(temp.Key);
                }
            }
            AccessXmlSerializer.ObjectToXml(strPath, dicVisionType);
        }
Example #2
0
 public void Add(string strName, VisionSetpBase visionSetpBase, StepVisionInfo stepVisionInfo)
 {
     if (dicVisionType.ContainsKey(strName))
     {
         dicVisionType[strName] = stepVisionInfo;
     }
     else
     {
         dicVisionType.Add(strName, stepVisionInfo);
     }
     if (dicVision.ContainsKey(strName))
     {
         dicVision[strName] = visionSetpBase;
     }
     else
     {
         dicVision.Add(strName, visionSetpBase);
     }
     dicVision[strName].m_camparam = stepVisionInfo.CamParam;
     if (PrItemChangedEvent != null)
     {
         PrItemChangedEvent(strName);
     }
 }