コード例 #1
0
        public void AddSensor(string name, float value, int type)
        {
            bool found = false;

            foreach (var s in _sensors)
            {
                if (s.name == name)
                {
                    found = true;
                }
            }
            if (found == false)
            {
                var sensor = new StatSensorItem(name, type);
                _sensors.Add(sensor);
                sessionID = DateTime.Now.Ticks;
            }
            foreach (var s in _sensors)
            {
                if (s.name == name)
                {
                    var ss = new SensorStatQueue
                    {
                        SampleID = historyIndex,
                        Value    = value
                    };
                    s.history.Enqueue(ss);
                }
            }
        }
コード例 #2
0
 public void AddSensor(string name, float value, int type)
 {
     bool found = false;
         foreach (var s in _sensors){
             if(s.name == name){
                 found = true;
             }
         }
         if(found == false){
             var sensor = new StatSensorItem(name, type);
             _sensors.Add(sensor);
             sessionID = DateTime.Now.Ticks;
         }
         foreach (var s in _sensors){
             if(s.name == name){
                  var ss = new SensorStatQueue
                  {
                      SampleID = historyIndex,
                      Value = value
                  };
                 s.history.Enqueue(ss);
             }
         }
 }