- void copy(AltosState old) {
-
- if (old == null) {
- init();
- return;
- }
-
- received_time = old.received_time;
- time = old.time;
- time_change = old.time_change;
- prev_time = old.time;
-
- tick = old.tick;
- prev_tick = old.tick;
- boost_tick = old.boost_tick;
-
- state = old.state;
- flight = old.flight;
- landed = old.landed;
- ascent = old.ascent;
- boost = old.boost;
- rssi = old.rssi;
- status = old.status;
- device_type = old.device_type;
- config_major = old.config_major;
- config_minor = old.config_minor;
- apogee_delay = old.apogee_delay;
- main_deploy = old.main_deploy;
- flight_log_max = old.flight_log_max;
-
- set = 0;
-
- ground_pressure.copy(old.ground_pressure);
- ground_altitude.copy(old.ground_altitude);
- altitude.copy(old.altitude);
- pressure.copy(old.pressure);
- speed.copy(old.speed);
- acceleration.copy(old.acceleration);
- orient.copy(old.orient);
-
- battery_voltage = old.battery_voltage;
- pyro_voltage = old.pyro_voltage;
- temperature = old.temperature;
- apogee_voltage = old.apogee_voltage;
- main_voltage = old.main_voltage;
- ignitor_voltage = old.ignitor_voltage;
-
- kalman_height.copy(old.kalman_height);
- kalman_speed.copy(old.kalman_speed);
- kalman_acceleration.copy(old.kalman_acceleration);
-
- if (old.gps != null)
- gps = old.gps.clone();
- else
- gps = null;
- if (old.temp_gps != null)
- temp_gps = old.temp_gps.clone();
- else
- temp_gps = null;
- temp_gps_sat_tick = old.temp_gps_sat_tick;
- gps_sequence = old.gps_sequence;
- gps_pending = old.gps_pending;
-
- if (old.imu != null)
- imu = old.imu.clone();
- else
- imu = null;
-
- if (old.mag != null)
- mag = old.mag.clone();
- else
- mag = null;
-
- npad = old.npad;
- gps_waiting = old.gps_waiting;
- gps_ready = old.gps_ready;
- ngps = old.ngps;
-
- if (old.from_pad != null)
- from_pad = old.from_pad.clone();
- else
- from_pad = null;
-
- elevation = old.elevation;
- range = old.range;
-
- gps_height = old.gps_height;
-
- gps_altitude.copy(old.gps_altitude);
- gps_ground_altitude.copy(old.gps_ground_altitude);
-
- pad_lat = old.pad_lat;
- pad_lon = old.pad_lon;
- pad_alt = old.pad_alt;
-
- speak_tick = old.speak_tick;
- speak_altitude = old.speak_altitude;
-
- callsign = old.callsign;
-
- accel_plus_g = old.accel_plus_g;
- accel_minus_g = old.accel_minus_g;
- accel = old.accel;
- ground_accel = old.ground_accel;
- ground_accel_avg = old.ground_accel_avg;
-
- log_format = old.log_format;
- serial = old.serial;
- receiver_serial = old.receiver_serial;
-
- baro = old.baro;
- companion = old.companion;
- }
-