예제 #1
0
        /// <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);
            }
        }
예제 #2
0
파일: ConfigLog.cs 프로젝트: Gz1d/Gz
 /// <summary>
 /// 加载配置
 /// </summary>
 /// <returns></returns>
 public static ConfigLog Load()
 {
     try
     {
         ConfigLog obj = (ConfigLog)Serializition.LoadFromFile(typeof(ConfigLog), ConfigName);
         return(obj);
     }
     catch (Exception ex)
     {
         throw new LoadException(ConfigName, ex.Message);
     }
 }