Fix Position Problem

Dec 31, 2008 at 11:10 AM
I had some problems to get the GPS position. While debugging I found out there is decimal  parsing problem if no Culture Info is add to the Parse method of decimal.

To Fix this problem I add into Global.cs (GriffinNav.GPS)

using System.Globalization;

 private static  CultureInfo mCultureInfo = null;

public static CultureInfo MCultureInfo
     get   {
          try    {
                 if ( mCultureInfo == null )
                    mCultureInfo = new CultureInfo( "en-US" );
           catch ( Exception ex )   {
                 LogError( "Create CultureInfo en-US" , ex );
       return ( mCultureInfo );

And change every decimal.Parse()  into mLongitudeMinutes = decimal.Parse( lm , Global.MCultureInfo );

This files you need to change : GPGGA.cs, GPVTG.cs, GPRMC.cs
I hope this changes get back to the source head.



Jul 27, 2009 at 11:25 PM

This doesn't work for me because mi decimal char is comma  not dot,. but you were right that the problem was here, thanks, I'm novice and never would found it..


I solve using System.Globalization as you said but forcing to parse every decimal in usa way, for example :


<font size="2">

mLatitudeMinutes =


decimal.Parse((mGgaParams[1].Substring(2, mGgaParams[1].Length - 2)), System.Globalization.NumberStyles.Float, new System.Globalization.CultureInfo( "en-US"));


Thank you very much and congratulations to developper for this great tool.


Best Regards