| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 | 
							- using Aitex.Common.Util;
 
- using Aitex.Core.RT.DataCenter;
 
- using Aitex.Core.RT.Event;
 
- using Aitex.Core.RT.IOCore;
 
- using Aitex.Core.RT.OperationCenter;
 
- using Aitex.Core.RT.SCCore;
 
- using Aitex.Core.Util;
 
- using MECF.Framework.Common.Beckhoff.IOAxis;
 
- using MECF.Framework.Common.Beckhoff.ModuleIO;
 
- using MECF.Framework.Common.CommonData;
 
- using MECF.Framework.Common.IOCore;
 
- using MECF.Framework.Common.Utilities;
 
- using MECF.Framework.RT.Core.IoProviders;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.IO;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- namespace MECF.Framework.Common.TwinCat
 
- {
 
-     public class BeckhoffManager : Singleton<BeckhoffManager>
 
-     {
 
-         #region 内部常量
 
-         private const string DI_ITEMLIST = "System.DIItemList";
 
-         private const string DO_ITEMLIST = "System.DOItemList";
 
-         private const string AI_ITEMLIST = "System.AIItemList";
 
-         private const string AO_ITEMLIST = "System.AOItemList";
 
-         private const string DIGITAL = "Digital";
 
-         private const string ANALOG = "Analog";
 
-         #endregion
 
-         #region 内部变量
 
-         BeckhoffCfg _cfg = null;
 
-         #endregion
 
-         #region 属性
 
-         public BeckhoffCfg BeckhoffCfg
 
-         {
 
-             get { return _cfg; }
 
-             set { _cfg = value; }
 
-         }
 
-         #endregion
 
-         /// <summary>
 
-         /// 初始化
 
-         /// </summary>
 
-         public void Initialize(List<string> lst)
 
-         {
 
-             string xmlPath = "";
 
-             bool isSimulate = SC.GetValue<bool>("System.IsSimulatorMode");
 
-             if (isSimulate)
 
-             {
 
-                 xmlPath =  PathManager.GetCfgDir() + "Devices\\Beckhoffcfg - plctask.xml";
 
-             }
 
-             else
 
-             {
 
-                 xmlPath = PathManager.GetCfgDir() + "Devices\\Beckhoffcfg.xml";
 
-             }
 
-             BeckhoffModuleIOManager.Instance.Initialize(PathManager.GetCfgDir() + "Devices\\ModuleIoCfg.xml");
 
-             _cfg = CustomXmlSerializer.Deserialize<BeckhoffCfg>(new FileInfo(xmlPath));
 
-             if(_cfg!=null)
 
-             {
 
-                 BeckhoffIOManager.Instance.Initialize(_cfg,lst);
 
-                 BeckhoffAxisManager.Instance.Initialize(_cfg);
 
-                 BeckhoffCounterManager.Instance.Initialize(_cfg);
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |