using FestoDebugger.Service; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FestoDebugger.Beckoff { public class BeckhoffManager : Singleton { #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 /// /// 初始化 /// public void Initialize() { string xmlPath = ""; xmlPath = Directory.GetParent(Directory.GetCurrentDirectory()).FullName + "Config\\Beckhoffcfg.xml"; BeckhoffModuleIOManager.Instance.Initialize(Directory.GetParent(Directory.GetCurrentDirectory()).FullName + "Config\\ModuleIoCfg.xml"); _cfg = CustomXmlSerializer.Deserialize(new FileInfo(xmlPath)); if (_cfg != null) { BeckhoffIOManager.Instance.Initialize(_cfg); } } } }