12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using Aitex.Core.RT.IOCore;
- using Aitex.Core.Util;
- namespace Aitex.Core.RT.IOCore
- {
- public class Index<T> where T : class
- {
- public T this[string name]
- {
- get
- {
- return Singleton<IOGroupManager>.Instance.GetIO<T>(name);
- }
- }
- }
- public static class IO
- {
- public static Index<DIAccessor> DI = new Index<DIAccessor>();
- public static Index<DOAccessor> DO = new Index<DOAccessor>();
- public static Index<AIAccessor> AI = new Index<AIAccessor>();
- public static Index<AOAccessor> AO = new Index<AOAccessor>();
- public static bool CanSetDO(string doName, bool onOff, out string reason)
- {
- return Singleton<IOGroupManager>.Instance.CanSetDo(doName, onOff, out reason);
- }
- public static List<Tuple<int, int, string>> GetIONameList(string group, IOType ioType)
- {
- return Singleton<IOGroupManager>.Instance.GetIONameList(group, ioType);
- }
- /// <summary>
- /// IO表中的编号,数组偏移,IO名
- /// </summary>
- /// <param name="ioType"></param>
- /// <returns></returns>
- public static List<Tuple<int, int, string>> GetIONameList(IOType ioType)
- {
- return Singleton<IOGroupManager>.Instance.GetIONameList("local", ioType);
- }
- public static bool ReloadInterlockConfig(out string reason)
- {
- reason = "not implemented";
- return true;
- //return Singleton<IOGroupManager>.Instance.InitializeInterlock(out reason);
- }
- //public static void SetScale(string ioName, double logicalMin, double logicalMax, double physicalMin, double physicalMax)
- //{
- // Singleton<IOGroupManager>.Instance.SetScale(ioName, logicalMin, logicalMax, physicalMin, physicalMax);
- //}
- //public static Dictionary<string, IOScale> GetScale()
- //{
- // return Singleton<IOGroupManager>.Instance.GetScale();
- //}
- }
- }
|