1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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<BeckhoffManager>
- {
- #region 内部常量
- #endregion
- #region 内部变量
- BeckhoffCfg _cfg = null;
- #endregion
- #region 属性
- public BeckhoffCfg BeckhoffCfg
- {
- get { return _cfg; }
- set { _cfg = value; }
- }
- #endregion
- /// <summary>
- /// 初始化
- /// </summary>
- public void Initialize()
- {
- string xmlPath = "";
-
- xmlPath = Directory.GetParent(Directory.GetCurrentDirectory()).FullName + "\\net8.0-windows\\Config\\Beckhoffcfg.xml";
-
- BeckhoffModuleIOManager.Instance.Initialize(Directory.GetParent(Directory.GetCurrentDirectory()).FullName + "\\net8.0-windows\\Config\\ModuleIoCfg.xml");
- _cfg = CustomXmlSerializer.Deserialize<BeckhoffCfg>(new FileInfo(xmlPath));
- if (_cfg != null)
- {
- BeckhoffIOManager.Instance.Initialize(_cfg);
- }
- }
- }
- }
|