/// <summary> /// 向系统配置中添加一个单相机视觉示教助手 /// </summary> /// <param name="name">名称必须是全局唯一的InitorName,否则会报一个参数异常</param> /// <param name="sva"></param> public void AddSVAssist(string name, JFSingleVisionAssist sva) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("JFVisionManager.AddSVAssist(string name, ... ) failed by name is null or empty"); } if (null == sva) { throw new ArgumentNullException("JFVisionManager.AddSVAssist(string name, JFSingleVisionAssist sva) failed by sva == null"); } if (ContainSVAssistName(name)) { throw new Exception("JFVisionManager.AddSVAssist(name ...) failed by name = " + name + " 's initor_object is Existed!"); } JFHubCenter.Instance.InitorManager.Add(name, sva); //////保存到配置文件 //JFXmlSortedDictionary<string, List<object>> dictInitorParam = JFHubCenter.Instance.SystemCfg.GetItemValue(JFHubCenter.CK_InitDevParams) as JFXmlSortedDictionary<string, List<object>>; //List<object> paramsInCfg = new List<object>(); //paramsInCfg.Add(sva.GetType().AssemblyQualifiedName); //for (int i = 0; i < sva.InitParamNames.Length; i++) // paramsInCfg.Add(sva.GetInitParamValue(sva.InitParamNames[i])); //dictInitorParam.Add(name, paramsInCfg); ////JFHubCenter.Instance.SystemCfg.NotifyItemChanged(JFHubCenter.CK_InitDevParams); //JFHubCenter.Instance.SystemCfg.Save(); }
public string GetSVAName(JFSingleVisionAssist assist) { if (null == assist) { return(null); } return(JFHubCenter.Instance.InitorManager.GetIDByInitor(assist)); }