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