Esempio n. 1
0
        private void OnPhoneAccelerometerReading(AccelerometerReadingChangedEventArgs args)
        {
            AccelerometerReading reading = args.Reading;
            DateTimeOffset ts = reading.Timestamp;
            EventItem accX = new EventItem { Stream = StreamsEnum.PhoneAccelerometerX, Timestamp = ts, Value = reading.AccelerationX };
            EventItem accY = new EventItem { Stream = StreamsEnum.PhoneAccelerometerY, Timestamp = ts, Value = reading.AccelerationY };
            EventItem accZ = new EventItem { Stream = StreamsEnum.PhoneAccelerometerZ, Timestamp = ts, Value = reading.AccelerationZ };

            //IList<EventItem> events = new[] { accX };
            IList<EventItem> events = new[] { accX, accY, accZ };
            //Debug.WriteLine(DateTime.Now);
            SendToQueue(events);
        }
Esempio n. 2
0
        public void OnPhoneGeopositionReading(PositionChangedEventArgs args)
        {
            Geoposition geo = args.Position;

            double lat = geo.Coordinate.Point.Position.Latitude;
            double lng = geo.Coordinate.Point.Position.Longitude;

            DateTimeOffset ts = geo.Coordinate.Timestamp;

            EventItem latEvent = new EventItem { Stream = StreamsEnum.GeopositionLatitude, Timestamp = ts, Value = lat };
            EventItem lngEvent = new EventItem { Stream = StreamsEnum.GeopositionLongitude, Timestamp = ts, Value = lng };

            IList<EventItem> events = new[] { latEvent, lngEvent };

            //SendToQueue(events);
        }