RiverRat  - An MIT iCampus project http://web.mit.edu/riverrat/

Main Page | Software Documentation | Hardware Documentation | People | Contact | Wiki

Main Page | Class Hierarchy | Class List | File List | Class Members

Fix.java

00001 package riverrat;
00002 
00010 public class Fix {
00011         float lat;      //required
00012         float lon;      //required
00013         long t;         //required
00014         float heel; //optional
00015         float hdg;      //optional
00016         float vel;      //optional
00017         
00026         public Fix() {
00027                 lat = 0.0f; lon = 0.0f; t = (long) -1; heel = 0.0f; vel = -1.0f; hdg = -1.0f;   // -1 denotes missing data
00028         }
00029         
00038         public Fix(float latitude, float longitude) {
00039                 heel = 0.0f; vel = -1.0f; hdg = -1.0f; t = (long) -1;
00040                 lat = latitude;
00041                 lon = longitude;
00042         }
00043         
00054         public Fix(float latitude, float longitude, long time) {
00055                 heel = 0.0f; vel = -1.0f; hdg = -1.0f;  // -1 denotes missing data
00056                 t = time;
00057                 lat = latitude;
00058                 lon = longitude;
00059         }
00060         
00075         public Fix(float latitude, float longitude, long time, float velocity, float heading, float heel_angle) {
00076                 heel = heel_angle;
00077                 vel = velocity;
00078                 hdg = heading;
00079                 t = time;
00080                 lat = latitude;
00081                 lon = longitude;                
00082         }
00083         
00090         public synchronized String fixToString() {
00091                 return ("( "+lat+" , "+lon+" )");
00092         }
00093         
00100         public synchronized float getLat() {
00101                 return lat;
00102         }
00103         
00110         public synchronized float getLon() {
00111                 return lon;
00112         }
00113 
00120         public synchronized long getTime() {
00121                 return t;
00122         }
00123 
00130         public synchronized float getHeel() {
00131                 return heel;
00132         }
00133         
00140         public synchronized float getHeading() {
00141                 return hdg;
00142         }
00143         
00150         public synchronized float getVelocity() {
00151                 return vel;
00152         }
00153         
00159         public synchronized void setLat(float latitude) {
00160                 lat = latitude;
00161         }
00162 
00168         public synchronized void setLon(float longitude) {
00169                 lon = longitude;
00170         }
00171         
00177         public synchronized void setTime(long time) {
00178                 t = time;
00179         }
00180         
00187         public synchronized void setHeading(float heading) {
00188                 hdg = heading;
00189         }
00190         
00196         public synchronized void setVelocity(float velocity) {
00197                 vel = velocity;
00198         }
00199         
00205         public synchronized void setHeel(float heel_angle) {
00206                 heel = heel_angle;
00207         }
00208 }
 

Brought to you by the RiverRat team.