Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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");
 }
Exemplo n.º 4
0
        private void OnNextSensor(SensorsDataEventArgs e)
        {
            AddEvent(e);

            DetectMoveLeftRight();
        }
Exemplo n.º 5
0
        private void OnNextSensor(SensorsDataEventArgs e)
        {
            AddEvent(e);

            DetectMoveLeftRight();
        }
Exemplo n.º 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");
 }