1
Vote

DivideByZeroException

description

I started logging. GPSTracka recorded one point in the track successfully, then started counting down from 60. When the counter got to zero and it tried to capture a second data point, I got this exception (typed in manually as I couldn't find a way to copy the text to the clipboard):

GPSTracka.exe
DivideByZeroException
 
at System.PInvoke.PAL.Decimal_Divide()
at System.Decimal.Divide()
at GPSTracka.TrackerForm.GPSPositionReceived()
at GPSTracka.Gps.GpsProvider.OnPosition()
at GPSTracka.Gps.MSGpsWrapper.gps_LocationChanged()
at Microsoft.WindowsMobile.Samples.Location.Gps.WaitForGpsEvents()

file attachments

comments

bartduncan wrote Oct 27, 2010 at 12:22 AM

More info: to reproduce the problem you need to have GPS Time selected instead of System Time. Whenever you lose a signal, the app is unable to get a new time from GPS. It reuses the prior sample time and tries to do this calculation:
  ShowSpeed(distance.Value / 1000 / (decimal)(time - lastTimeA).TotalHours);
In this situation "time" and "lastTimeA" have the same value, which causes the divide by zero exception.

The workaround is to make sure you don't select GPS Time in settings (System Time is the default). Of course, that means that you must be extra careful to check your WinMo device's time, especially if you plan to use the track file for geotagging.

wrote Feb 13, 2013 at 11:41 PM