示例#1
0
        private void AddEvent(SensorsDataEventArgs e)
        {
            _events.Enqueue(new Event
            {
                Time = DateTime.Now,
                Data = e
            });

            // Drop oldies
            while (true)
            {
                if (_events.Peek().Time > DateTime.Now.AddSeconds(-1))
                {
                    break;
                }
                _events.Dequeue();
            }
        }
示例#2
0
        private void AddEvent(SensorsDataEventArgs e)
        {
            _events.Enqueue(new Event
            {
                Time = DateTime.Now,
                Data = e
            });

            // Drop oldies
            while (true)
            {
                if (_events.Peek().Time > DateTime.Now.AddSeconds(-1))
                {
                    break;
                }
                _events.Dequeue();
            }
        }
示例#3
0
 private void OnNextEvent(SensorsDataEventArgs e)
 {
     _counter++;
     File.AppendAllText("Data.csv", $"{_counter}, {e.GyroscopeX.ToInvString()}, {e.GyroscopeY.ToInvString()}, {e.GyroscopeZ.ToInvString()}, {e.AccelerationX.ToInvString()}, {e.AccelerationY.ToInvString()}, {e.AccelerationZ.ToInvString()}\r\n");
 }
示例#4
0
        private void OnNextSensor(SensorsDataEventArgs e)
        {
            AddEvent(e);

            DetectMoveLeftRight();
        }
示例#5
0
        private void OnNextSensor(SensorsDataEventArgs e)
        {
            AddEvent(e);

            DetectMoveLeftRight();
        }
示例#6
0
 private void OnNextEvent(SensorsDataEventArgs e)
 {
     _counter++;
     File.AppendAllText("Data.csv", $"{_counter}, {e.GyroscopeX.ToInvString()}, {e.GyroscopeY.ToInvString()}, {e.GyroscopeZ.ToInvString()}, {e.AccelerationX.ToInvString()}, {e.AccelerationY.ToInvString()}, {e.AccelerationZ.ToInvString()}\r\n");
 }