public async Task OnReading(IGpsReading reading) { var e = new GpsEvent { Id = Guid.NewGuid().ToString(), DateCreated = DateTimeOffset.UtcNow, Latitude = reading.Position.Latitude, Longitude = reading.Position.Longitude, Heading = reading.Heading, HeadingAccuracy = reading.HeadingAccuracy, Speed = reading.Speed, PositionAccuracy = reading.PositionAccuracy }; await this.repository.Set(e.Id, e); this.BatchSize++; var job = await this.jobManager.GetJob(Constants.GpsJobIdentifier); var config = job.GetSyncConfig(); if (this.BatchSize >= config.BatchSize) { this.BatchSize = 0; Console.WriteLine("GPS Location Sync batch size reached, will attempt to sync"); if (this.jobManager.IsRunning) { await this.jobManager.RunJobAsTask(Constants.GpsJobIdentifier); } } }
public Task OnReading(IGpsReading reading) { if (reading?.Position != null) { _locationObserver.OnLocationChanged(reading); } return(Task.CompletedTask); }
void SetValues(IGpsReading reading) { using (this.DelayChangeNotifications()) { this.Latitude = reading.Position.Latitude; this.Longitude = reading.Position.Longitude; this.Altitutde = reading.Altitude; this.PositionAccuracy = reading.PositionAccuracy; this.Heading = reading.Heading; this.HeadingAccuracy = reading.HeadingAccuracy; this.Speed = reading.Speed; } }
public async void OnReading(IGpsReading reading) { await this.conn.InsertAsync(new GpsEvent { Latitude = reading.Position.Latitude, Longitude = reading.Position.Longitude, Altitude = reading.Altitude, PositionAccuracy = reading.PositionAccuracy, Heading = reading.Heading, HeadingAccuracy = reading.HeadingAccuracy, Speed = reading.Speed, Date = reading.Timestamp.ToLocalTime() }); }
public async Task OnReading(IGpsReading reading) { // TODO: need previous state var geofences = await this.geofenceManager.GetMonitorRegions(); foreach (var geofence in geofences) { var state = geofence.IsPositionInside(reading.Position) ? GeofenceState.Entered : GeofenceState.Exited; await this.geofenceDelegate.OnStatusChanged(state, geofence); } }
public async Task OnReading(IGpsReading reading) { var geofences = await this.geofenceManager.GetMonitorRegions(); foreach (var geofence in geofences) { var state = geofence.IsPositionInside(reading.Position) ? GeofenceState.Entered : GeofenceState.Exited; var current = this.GetState(geofence.Identifier); if (state != current) { this.SetState(geofence.Identifier, state); await this.geofenceDelegate.OnStatusChanged(state, geofence); } } }
public async Task OnReading(IGpsReading reading) { }
public Task OnReading(IGpsReading reading) { return(Task.CompletedTask); }
public Task OnReading(IGpsReading reading) { (_gpsListener as GpsListener)?.UpdateReading(reading); return(Task.CompletedTask); }
void UpdateReading(IGpsReading reading) { OnReadingReceived?.Invoke(this, new GpsReadingEventArgs(reading)); }
public Task OnReading(IGpsReading reading) { throw new NotImplementedException(); }
public GpsReadingEventArgs(IGpsReading reading) { Reading = reading; }
public Task OnReading(IGpsReading reading) { //Aqui voce Pode Implementar um Delagate para o GPS return(null); }
public Task OnReading(IGpsReading reading) { MessagingCenter.Send <GpsDelegate, IGpsReading>(this, Constants.Message.LOCATION_UPDATED, reading); return(Task.CompletedTask); }
public async Task OnReading(IGpsReading reading) { // if you like your users - don't do notifications here ;) // store to a db }
public void OnLocationChanged(IGpsReading reading) { Parallel.ForEach(_observers, (o) => o.OnNext($"Latitude: {reading.Position.Latitude} | Longitude: {reading.Position.Longitude}")); }
public async Task OnReading(IGpsReading reading) { eventAggregator.GetEvent <GpsDataReceivedEvent>().Publish(reading); }