Rev 1563 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1563 | Rev 1565 | ||
---|---|---|---|
1 | package dongfang.mkt.datatype; |
1 | package dongfang.mkt.datatype; |
2 | 2 | ||
3 | public class GPSBearingAndRange { |
3 | public class GPSBearingAndRange { |
4 | int distance; // in m/10. 16 bit unsigned. |
4 | double distance; // in m. |
5 | int bearing; // in degrees. 16 bit signed. |
5 | double bearing; // in degrees. |
- | 6 | ||
6 | public int getDistance() { |
7 | public double getDistance() { |
7 | return distance; |
8 | return distance; |
8 | } |
9 | } |
- | 10 | ||
9 | public int getBearing() { |
11 | public double getBearing() { |
10 | return bearing; |
12 | return bearing; |
11 | } |
13 | } |
- | 14 | ||
12 | public void setDistance(int distance) { |
15 | public void setDistance(double distance) { |
13 | this.distance = distance; |
16 | this.distance = distance; |
14 | } |
17 | } |
- | 18 | ||
15 | public void setBearing(int bearing) { |
19 | public void setBearing(double bearing) { |
16 | this.bearing = bearing; |
20 | this.bearing = bearing; |
17 | } |
21 | } |
- | 22 | ||
18 | public String toXML() { |
23 | public String toXML() { |
19 | String result = "distance=\"" + ((double)this.distance)/10; |
24 | String result = "distance=\"" + this.distance; |
20 | result += "\" bearing=\""; |
25 | result += "\" bearing=\""; |
21 | result += this.bearing; |
26 | result += this.bearing; |
22 | result += "\""; |
27 | result += "\""; |
23 | return result; |
28 | return result; |
24 | } |
29 | } |
- | 30 | ||
25 | public String toString() { |
31 | public String toString() { |
26 | String result = "" + ((double)this.distance)/10; |
32 | String result = this.distance + "m @"; |
27 | result += "m @"; |
- | |
28 | result += this.bearing; |
33 | result += this.bearing; |
29 | result += "deg"; |
34 | result += "deg"; |
30 | return result; |
35 | return result; |
31 | } |
36 | } |
32 | } |
37 | } |
33 | 38 |