示例#1
0
        public SensorNode GetSensor(string source, string Identifier)
        {
            SensorNode result = null;

            if (source_id != source)
            {
                return(null);
            }
            foreach (SensorNodeBase node in children)
            {
                if (node.GetType() == typeof(SensorGroup))
                {
                    SensorGroup g = node as SensorGroup;
                    result = g.GetSensor(source, Identifier);
                }
                else
                {
                    SensorNode sens = node as SensorNode;
                    if (sens != null)
                    {
                        if (sens.identifier == Identifier)
                        {
                            result = sens;
                        }
                    }
                }
                if (result != null)
                {
                    break;
                }
            }
            return(result);
        }
示例#2
0
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 'SensorNodeBase.GetSensor(string, string)'
        public SensorNode GetSensor(string source, string Identifier)
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 'SensorNodeBase.GetSensor(string, string)'
        {
            SensorNode result = null;

            if (source_id != source)
            {
                return(null);
            }
            foreach (SensorNodeBase node in children)
            {
                if (node.GetType() == typeof(SensorGroup))
                {
                    SensorGroup g = node as SensorGroup;
                    result = g.GetSensor(source, Identifier);
                }
                else
                {
                    SensorNode sens = node as SensorNode;
                    if (sens != null)
                    {
                        if (sens.identifier == Identifier)
                        {
                            result = sens;
                        }
                    }
                }
                if (result != null)
                {
                    break;
                }
            }
            return(result);
        }