Aplikacja wykonawcza public class HighPrecisionTest { private NmeaInterpreter MyInterpreter = new NmeaInterpreter (); private int MaximumDOPAllowed = 6; private double CurrentHDOP ; public HighPrecisionTest () { // Bind events for dilution of position MyInterpreter.HDOPReceived += new System.EventHandler ( OnHDOPReceived ); MyInterpreter.PositionReceived += new System.EventHandler ( OnPositionReceived ); } public void Test() { // Parse satellite information (HDOP is 50.0) MyInterpreter.Parse ( "$GPGSA,A,1,,,,,,,,,,,,,50.0,50.0,50.0*05"); // Parse the current position MyInterpreter.Parse ( "$GPRMC,225233.990,V,3939.4000,N,10506.4000,W,0.00,51.40,280804,,*35"); // Parse satellite information (HDOP is 1.2) MyInterpreter.Parse ( "$GPGSA,A,3,11,29,07,08,19,28,26,,,,,,2.3,1.2,2.0*30"); // Parse the current position again MyInterpreter.Parse ( "$GPRMC,012558.584,A,3939.7000,N,10506.7000,W,0.00,198.07,290804,,*11"); } private void OnHDOPReceived (double value ) { // Remember the current HDOP value CurrentHDOP = value ; } private void OnPositionReceived ( string latitude , string longitude ) { // Is the HDOP at least six ? if ( CurrentHDOP <= MaximumDOPAllowed ) { // Yes . Display the current position Debug.WriteLine (" You are here : " + latitude + ", " + longitude ); } else { // No. Discard this positional measurement Debug.WriteLine (" The received location is not precise enough to use ."); } } }