Example #1
0
        private bool disposedValue = false; // 要检测冗余调用

        #endregion Fields

        #region Constructors

        static PlcManager()
        {
            if (!File.Exists(PlcsCfgFile))
            {
                try
                {
                    PlcsCfg = new APXDoc();
                    PlcsCfg.Create(PlcsCfgFile);
                    PlcsCfg.Save();
                }
                catch (Exception e)
                {
                    throw new APXExeception(e.ToString());
                }
            }
            else
            {
                PlcsCfg = new APXDoc(PlcsCfgFile);
            }
            _plcInfo = new List<PlcInfo>();
            PlcDict = new Dictionary<int, PlcInstanceInfo>();
            try
            {
                Load();
                ReinInstance();
            }
            catch (Exception e)
            {
                APXlog.Write(APXlog.BuildLogMsg(e.Message));
            }
        }
Example #2
0
 public CameraManager()
 {
     if (!File.Exists(CamerasCfgFile))
     {
         try
         {
             CameraCfg = new APXDoc();
             CameraCfg.Create(CamerasCfgFile);
             CameraCfg.Save();
         }
         catch (Exception e)
         {
             throw new APXExeception(e.ToString());
         }
     }
     else
     {
         CameraCfg = new APXDoc(CamerasCfgFile);
     }
     Cameras = new List<CameraInstanceInfo>();
     try
     {
         Load();
         ReinInstance();
     }
     catch(Exception e)
     {
         APXlog.Write(APXlog.BuildLogMsg(e.Message));
     }
 }
Example #3
0
        private bool disposedValue = false; // 要检测冗余调用

        #endregion Fields

        #region Constructors

        static LaserManager()
        {
            if (!File.Exists(LaserCfgFile))
            {
                try
                {
                    LaserCfg = new APXDoc();
                    LaserCfg.Create(LaserCfgFile);
                    LaserCfg.Save();
                }
                catch (Exception e)
                {
                    throw new APXExeception(e.ToString());
                }
            }
            else
            {
                LaserCfg = new APXDoc(LaserCfgFile);
            }
            _laserInfo = new List<LaserInfo>();
            LaserDict = new Dictionary<int, LaserInstanceInfo>();
            try
            {
                Load();
                ReinInstance();
            }
            catch (Exception e)
            {
                APXlog.Write(APXlog.BuildLogMsg(e.Message));
            }
        }
Example #4
0
 static CognexManager()
 {
     if (!File.Exists(CognexClientCfgFile))
     {
         try
         {
             CognexClientCfg = new APXDoc();
             CognexClientCfg.Create(CognexClientCfgFile);
             CognexClientCfg.Save();
         }
         catch (Exception e)
         {
             throw new APXExeception(e.ToString());
         }
     }
     else
     {
         CognexClientCfg = new APXDoc(CognexClientCfgFile);
     }
     CognexCilentDict = new Dictionary<int, CognexClientInfo>();
     Load();
 }
Example #5
0
        public IOCardManager()
        {
            if (!File.Exists(IOCardCfgFile))
            {
                try
                {
                    IOCardCfg = new APXDoc();
                    IOCardCfg.Create(IOCardCfgFile);
                    IOCardCfg.Save();
                }
                catch (Exception e)
                {
                    throw new APXExeception(e.ToString());
                }
            }
            else
            {
                _ioCardCfg = new APXDoc(IOCardCfgFile);
            }

            IOInfo = new List<IODesc>();
            Load();
        }
Example #6
0
 static XComManager()
 {
     if (!File.Exists(IOCardCfgFile))
     {
         try
         {
             XComCfg = new APXDoc();
             XComCfg.Create(IOCardCfgFile);
             XComCfg.Save();
         }
         catch (Exception e)
         {
             throw new APXExeception(e.ToString());
         }
     }
     else
     {
         XComCfg = new APXDoc(IOCardCfgFile);
         _xComInfo = new List<XComInfo>();
         XComsDict = new Dictionary<string, XComInstanceInfo>();
     }
     Load();
     ReinInstance();
 }