/// <summary> /// 加载所有配置 /// </summary> public void Load() { try { //日志 this.ConfigLog = ConfigLog.Load(); //系统参数 this.ConfigSystem = ConfigSystem.Load(); //生产报表 this.ConfigReport = ConfigReport.Load(); //网络客户端 this.ConfigSocketC = ConfigSocketC.Load(); this.ConfigSocketS = ConfigSocketS.Load(); //串口 this.ConfigSerial = ConfigSerial.Load();; //PLC this.ConfigPlc = ConfigPlc.Load(); //相机 //this.ConfigCamera = ConfigCamera.Load(); //视觉 //this.ConfigVision = ConfigVision.Load(); this.Configbusiness01 = Configbusiness01.Load(); } catch (LoadException ex) { //写日志 Log.LogWriter.WriteLog(ex.ToString()); Log.LogWriter.WriteException(ex); } }
/// <summary> /// 加载配置 /// </summary> /// <returns></returns> public static ConfigPlc Load() { try { ConfigPlc obj = (ConfigPlc)Serializition.LoadFromFile(typeof(ConfigPlc), ConfigName); return(obj); } catch (Exception ex) { throw new LoadException(ConfigName, ex.Message); } }