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