00001 using System; 00002 using System.Collections.Generic; 00003 using System.Linq; 00004 using System.Text; 00005 00006 namespace GpsModule { 00007 public class SharedGpsData { 00008 protected string _sentence; 00009 public string Sentance { 00010 get { return _sentence; } 00011 } 00012 public void setSentance(string sentence) { 00013 _sentence = sentence; 00014 } 00015 00016 protected DateTime _time; 00017 public DateTime Time { 00018 get { return _time; } 00019 } 00020 public void setTime(DateTime time) { 00021 _time = time; 00022 } 00023 00024 protected string _latitude = ""; 00025 public string Latitude { 00026 get { return _latitude; } 00027 } 00028 public void setLatitude(string latitude) { 00029 _latitude = latitude; 00030 } 00031 00032 protected char _northOrSouth = 'N'; 00033 public char NorthOrSouth { 00034 get { return _northOrSouth; } 00035 } 00036 public void setNorthOrSouth(char northOrSouth) { 00037 _northOrSouth = northOrSouth; 00038 } 00039 00040 protected string _longitude = ""; 00041 public string Longitude { 00042 get { return _longitude; } 00043 } 00044 public void setLongitude(string longitude) { 00045 _longitude = longitude; 00046 } 00047 00048 protected char _eastOrWest = 'W'; 00049 public char EastOrWest { 00050 get { return _eastOrWest; } 00051 } 00052 public void setEastOrWest(char eastOrWest) { 00053 _eastOrWest = eastOrWest; 00054 } 00055 00056 protected int _checksum = 0; 00057 public int Checksum { 00058 get { return _checksum; } 00059 } 00060 public void setChecksum(int checksum) { 00061 _checksum = checksum; 00062 } 00063 00064 public SharedGpsData() { 00065 } 00066 00067 private string getDeg(string l) { 00068 return l.Remove(l.IndexOf(".") - 2, l.Length - (l.IndexOf(".") - 2)); 00069 } 00070 00071 private string getMin(string l) { 00072 return l.Substring(l.IndexOf(".") - 2, l.Length - (l.IndexOf(".") - 2)); 00073 } 00074 00075 public string LatDeg { 00076 get { return getDeg(_latitude); } 00077 } 00078 00079 public string LatMin { 00080 get { return getMin(_latitude); } 00081 } 00082 00083 public string LonDeg { 00084 get { return getDeg(_longitude); } 00085 } 00086 00087 public string LonMin { 00088 get { return getMin(_longitude); } 00089 } 00090 } 00091 }