Associate
- Joined
- 29 Dec 2007
- Posts
- 1,414
- Location
- London
Hey guys. im currently making a game for a windows mobile
The problem im having is probably very very simple just I just cant seem to work it out
Its a treasurehunt game, i need to be able to read gps info from the device. The two files im having problems with are:
form3.cs
gpsMonitor.cs
from form3.cs i need to get the latitude and longitude values from gpsMonitor.cs
gpsMonitor.cs is split into two classes: gpsMonitor() and gpsCoordinate(lat, lng)
the class gpsMonitor opens a serial port, validates sentences, along with aload of other stuff (unimportant atm). when it has a valid sentence it will extract the lat and long decimal values and call gpsCoordinate() with the two values as parameters
gpsCoordinate class looks like this:
public class GpsCoordinate
{
private decimal latitude;
private decimal longitude;
private const string strFormat = "Latitude: {0} degrees /t Longitude: {1} degrees";
public GpsCoordinate(decimal lat, decimal lng)
{
Latitude = lat;
Longitude = lng;
}
public decimal Latitude
{
get { return latitude; }
set { latitude = value; }
}
public decimal Longitude
{
get { return longitude; }
set { longitude = value; }
}
public override string ToString ()
{
return String.Format(strFormat, latitude, longitude);
}
}
what i do from form3.cs is make a new instance of gpsMonitor (threaded by the way) then what i need to do is collect lat and long from the gpsCoordinate class. But since its in this set,get,override stuff i have no idea what to do
i can get info from the gpsMonitor class but since it is receiving invalid sentences 95% of the time its abit useless
Anyone albe to shed some light? thanks
The problem im having is probably very very simple just I just cant seem to work it out
Its a treasurehunt game, i need to be able to read gps info from the device. The two files im having problems with are:
form3.cs
gpsMonitor.cs
from form3.cs i need to get the latitude and longitude values from gpsMonitor.cs
gpsMonitor.cs is split into two classes: gpsMonitor() and gpsCoordinate(lat, lng)
the class gpsMonitor opens a serial port, validates sentences, along with aload of other stuff (unimportant atm). when it has a valid sentence it will extract the lat and long decimal values and call gpsCoordinate() with the two values as parameters
gpsCoordinate class looks like this:
public class GpsCoordinate
{
private decimal latitude;
private decimal longitude;
private const string strFormat = "Latitude: {0} degrees /t Longitude: {1} degrees";
public GpsCoordinate(decimal lat, decimal lng)
{
Latitude = lat;
Longitude = lng;
}
public decimal Latitude
{
get { return latitude; }
set { latitude = value; }
}
public decimal Longitude
{
get { return longitude; }
set { longitude = value; }
}
public override string ToString ()
{
return String.Format(strFormat, latitude, longitude);
}
}
what i do from form3.cs is make a new instance of gpsMonitor (threaded by the way) then what i need to do is collect lat and long from the gpsCoordinate class. But since its in this set,get,override stuff i have no idea what to do

i can get info from the gpsMonitor class but since it is receiving invalid sentences 95% of the time its abit useless

Anyone albe to shed some light? thanks
