* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.AltosLib;
+package org.altusmetrum.altoslib_1;
-import java.lang.*;
import java.text.*;
public class AltosGPS {
lon = in_lon / 10.0e7;
}
- public void set_time(int hour, int minute, int second) {
- hour = hour;
- minute = minute;
- second = second;
+ public void set_time(int in_hour, int in_minute, int in_second) {
+ hour = in_hour;
+ minute = in_minute;
+ second = in_second;
}
- public void set_date(int year, int month, int day) {
- year = year;
- month = month;
- day = day;
+ public void set_date(int in_year, int in_month, int in_day) {
+ year = in_year;
+ month = in_month;
+ day = in_day;
}
- public void set_flags(int flags) {
- flags = flags;
+ /*
+ public void set_flags(int in_flags) {
+ flags = in_flags;
}
+ */
- public void set_altitude(int altitude) {
- altitude = altitude;
+ public void set_altitude(int in_altitude) {
+ alt = in_altitude;
}
public void add_sat(int svid, int c_n0) {
}
public AltosGPS(AltosGPS old) {
- nsat = old.nsat;
- locked = old.locked;
- connected = old.connected;
- lat = old.lat; /* degrees (+N -S) */
- lon = old.lon; /* degrees (+E -W) */
- alt = old.alt; /* m */
- year = old.year;
- month = old.month;
- day = old.day;
- hour = old.hour;
- minute = old.minute;
- second = old.second;
-
- ground_speed = old.ground_speed; /* m/s */
- course = old.course; /* degrees */
- climb_rate = old.climb_rate; /* m/s */
- hdop = old.hdop; /* unitless? */
- h_error = old.h_error; /* m */
- v_error = old.v_error; /* m */
-
- if (old.cc_gps_sat != null) {
- cc_gps_sat = new AltosGPSSat[old.cc_gps_sat.length];
- for (int i = 0; i < old.cc_gps_sat.length; i++) {
- cc_gps_sat[i] = new AltosGPSSat();
- cc_gps_sat[i].svid = old.cc_gps_sat[i].svid;
- cc_gps_sat[i].c_n0 = old.cc_gps_sat[i].c_n0;
+ if (old != null) {
+ nsat = old.nsat;
+ locked = old.locked;
+ connected = old.connected;
+ lat = old.lat; /* degrees (+N -S) */
+ lon = old.lon; /* degrees (+E -W) */
+ alt = old.alt; /* m */
+ year = old.year;
+ month = old.month;
+ day = old.day;
+ hour = old.hour;
+ minute = old.minute;
+ second = old.second;
+
+ ground_speed = old.ground_speed; /* m/s */
+ course = old.course; /* degrees */
+ climb_rate = old.climb_rate; /* m/s */
+ hdop = old.hdop; /* unitless? */
+ h_error = old.h_error; /* m */
+ v_error = old.v_error; /* m */
+
+ if (old.cc_gps_sat != null) {
+ cc_gps_sat = new AltosGPSSat[old.cc_gps_sat.length];
+ for (int i = 0; i < old.cc_gps_sat.length; i++) {
+ cc_gps_sat[i] = new AltosGPSSat();
+ cc_gps_sat[i].svid = old.cc_gps_sat[i].svid;
+ cc_gps_sat[i].c_n0 = old.cc_gps_sat[i].c_n0;
+ }
}
+ } else {
+ ClearGPSTime();
+ cc_gps_sat = null;
}
}
}