Quantcast
Channel: DotSpatial Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1128

Closed Issue: Positioning GpvtgSentence::OnSentenceChanged() does not parse correctly (wrong array index) [399]

$
0
0
The index it uses for the data in the Speed parsing is incorrect. It is using index 5 for knows when it should use index 4. For Km/H it uses 7 when it should be using 6. Here is the code fixed:

if (wordCount > 5 && words[4].Length != 0)
{
_speed = new Speed(
// Parse the numeric portion
double.Parse(words[4], NmeaCultureInfo),
// Use knots
SpeedUnit.Knots);
}
else if (wordCount > 7 && words[6].Length != 0)
{
_speed = new Speed(
// Parse the numeric portion
double.Parse(words[6], NmeaCultureInfo),
// Use knots
SpeedUnit.KilometersPerHour);
}


This may have been caused because of the documentation. It states everything base 1 when it should be base 0. You could change the comments also to be base 0 to make it a little more clear for the future.

Viewing all articles
Browse latest Browse all 1128

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>