Пример #1
0
        public void OnGpsLocationUpdate() // IGpsListener
        {
            float s = gpsProvider.GetSpeed();

            timeStampLastGps = DateTime.Now.Ticks;

            if (s > 2) // TODO make m/s configurable
            {
                // vehicle is moving
                velocityNotOkTimeout = CONDITION_NOT_OK_TIMEOUT;
            }

            if (accelerometerProvider != null)
            {
                // calibrate accelerometer with gps data
                accelerometerProvider.SetSpeed(s);
            }

            if (gpsProvider.GetStatus() == IDeviceGpsStatus.Connected)
            {
                // gps is ready to go
                if (gpsNotOkTimeout == CONDITION_NOT_OK)
                {
                    // setup final cool down
                    gpsNotOkTimeout = CONDITION_NOT_OK_TIMEOUT;
                }
            }
            else
            {
                // wait for gps
                gpsNotOkTimeout = CONDITION_NOT_OK;
            }
        }
Пример #2
0
 public void OnGpsStatusUpdate()
 {
     labelProviderStatus.Text                   = "GpsStatus: " + gpsProvider.GetStatus();
     labelGpsStatusSatellitesVisible.Text       = "GpsStatusSatellitesVisible: " + gpsProvider.GetSatellitesVisible();
     labelGpsStatusSatellitesUsedInFix.Text     = "GpsStatusSatellitesVisibleWithFix: " + gpsProvider.GetSatellitesVisibleWithFix();
     labelGpsStatusSatellitesWithEphemeris.Text = "GpsStatusSatellitesWithEphemeris: " + gpsProvider.GetSatellitesWithEphemeris();
     labelGpsStatusSatellitesWithAlmanac.Text   = "GpsStatusSatellitesWithAlmanac: " + gpsProvider.GetSatellitesWithAlmanac();
     labelGpsStatusTimeToFirstFix.Text          = "GpsStatusTimeToFirstFix: " + gpsProvider.GetTimeToFirstFix() / 1000 + " seconds";
 }