private void storeOrientationSensorDataCallback(object sender, OrientationSensorDataUpdatedEventArgs e) { checkUpdateCurrentLogStream(); logStreamWriter.Flush(); lock (logStreamWriter) { logStreamWriter.WriteLine($"wearable-tizen,{new DateTimeOffset(DateTime.Now).ToUnixTimeMilliseconds()},{Tools.ORIENTATION},OrientationSensor,-1,{e.Azimuth}, {e.Pitch}, {e.Roll}"); } }
private void Orientation_DataUpdated(object sender, OrientationSensorDataUpdatedEventArgs e) { Model.Azimuth = e.Azimuth; Model.Pitch = e.Pitch; Model.Roll = e.Roll; long ticks = DateTime.UtcNow.Ticks; foreach (var serie in canvas.Series) { switch (serie.Name) { case "Azimuth": serie.Points.Add(new Extensions.Point() { Ticks = ticks, Value = e.Azimuth }); break; case "Pitch": serie.Points.Add(new Extensions.Point() { Ticks = ticks, Value = e.Pitch }); break; case "Roll": serie.Points.Add(new Extensions.Point() { Ticks = ticks, Value = e.Roll }); break; } } canvas.InvalidateSurface(); }
void DataUpdated(object sender, OrientationSensorDataUpdatedEventArgs e) { RaiseReadingChanged(new CompassData(e.Azimuth)); }
/// <summary> /// Handles "DataUpdated" event of the orientation sensor. /// Invokes "OrientationSensorDataUpdated" event. /// </summary> /// <param name="sender">Instance of the object which invokes the event.</param> /// <param name="eventArgs">Event data.</param> private void OnDataUpdated(object sender, OrientationSensorDataUpdatedEventArgs eventArgs) { OrientationSensorDataUpdated?.Invoke(this, eventArgs.Azimuth); }