コード例 #1
0
        public static DataPointsBase Instance()
        {
            if (instance == null)
            {
                instance = new DataPointsBase();
            }

            return(instance);
        }
コード例 #2
0
        public static DataPointDef GetDataItem(ProtocolDef protocolId, DataModelType identifier)
        {
            var dataPointItem = DataPointsBase.Instance(identifier).GetItem(protocolId);

            if (dataPointItem == null)
            {
                return(null);
            }
            return(dataPointItem);
        }
コード例 #3
0
        public static string GetDataPoint(ProtocolDef protocolId, DataModelType identifier)
        {
            var dataPointItem = DataPointsBase.Instance(identifier).GetItem(protocolId);

            if (dataPointItem == null)
            {
                return(string.Empty);
            }
            return(dataPointItem.DataPath);
        }
コード例 #4
0
        public static ProtocolDef GetProtocolId(ref PathAndType item, DataModelType identifier)
        {
            var dataPointItem = DataPointsBase.Instance(identifier).GetItem(item.Path);

            if (dataPointItem == null)
            {
                return(0);
            }
            if (item.Type == "")
            {
                item.Type = dataPointItem.DataType;
            }
            return(dataPointItem.ProtocolId);
        }
コード例 #5
0
        private DataPointsBase()
        {
            if (dataPoints == null)
            {
                dataPoints = new List <DataPointsBase>();
                DataPointsBase delta = new DataPointsBase(DataModelType.DeltaData);
                DataPointsBase eltek = new DataPointsBase(DataModelType.EltekData);
                dataPoints.Add(eltek);
                dataPoints.Add(delta);

                if (Items == null)
                {
                    Items = new List <DataPointDef>();
                }

                Items.AddRange(eltek.Items);
                Items.AddRange(delta.Items);
            }
        }