*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
accel_counts_per_mss = ((data->accel_minus_g - data->accel_plus_g) / 2.0) / 9.80665;
state->acceleration = (data->ground_accel - data->flight_accel) / accel_counts_per_mss;
state->speed = data->flight_vel / (accel_counts_per_mss * 100.0);
- state->temperature = ((data->temp / 32767.0 * 3.3) - 0.5) / 0.01;
- state->drogue_sense = data->drogue / 32767.0 * 15.0;
- state->main_sense = data->main / 32767.0 * 15.0;
- state->battery = data->batt / 32767.0 * 5.0;
+ state->temperature = cc_thermometer_to_temperature(data->temp);
+ state->drogue_sense = cc_ignitor_to_voltage(data->drogue);
+ state->main_sense = cc_ignitor_to_voltage(data->main);
+ state->battery = cc_battery_to_voltage(data->batt);
if (!strcmp(data->state, "pad")) {
if (data->gps.gps_locked && data->gps.nsat >= 4) {
state->npad++;
aoview_table_add_row(0, "Rocket state", "%s", state->data.state);
aoview_table_add_row(0, "Callsign", "%s", state->data.callsign);
aoview_table_add_row(0, "Rocket serial", "%d", state->data.serial);
+ aoview_table_add_row(0, "Rocket flight", "%d", state->data.flight);
aoview_table_add_row(0, "RSSI", "%6ddBm", state->data.rssi);
aoview_table_add_row(0, "Height", "%6dm", state->height);
aoview_state_add_deg(1, "Longitude", state->gps.lon, 'E', 'W');
aoview_table_add_row(1, "GPS altitude", "%d", state->gps.alt);
aoview_table_add_row(1, "GPS height", "%d", state->gps_height);
+ aoview_table_add_row(1, "GPS date", "%04d-%02d-%02d",
+ state->gps.gps_time.year,
+ state->gps.gps_time.month,
+ state->gps.gps_time.day);
aoview_table_add_row(1, "GPS time", "%02d:%02d:%02d",
state->gps.gps_time.hour,
state->gps.gps_time.minute,
}
if (state->gps.gps_connected) {
int nsat_vis = 0;
- int nsat_locked = 0;
int c;
- for (c = 0; c < state->gps_tracking.channels; c++) {
- if ((state->gps_tracking.sats[c].state & 0xff) == 0xbf)
- nsat_locked++;
- }
aoview_table_add_row(2, "Satellites Visible", "%d", state->gps_tracking.channels);
- aoview_table_add_row(2, "Satellites Locked", "%d", nsat_locked);
for (c = 0; c < state->gps_tracking.channels; c++) {
- aoview_table_add_row(2, "Satellite id,state,C/N0",
- "%3d,%02x,%2d%s",
+ aoview_table_add_row(2, "Satellite id,C/N0",
+ "%3d,%2d",
state->gps_tracking.sats[c].svid,
- state->gps_tracking.sats[c].state,
- state->gps_tracking.sats[c].c_n0,
- (state->gps_tracking.sats[c].state & 0xff) == 0xbf ?
- " LOCKED" : "");
+ state->gps_tracking.sats[c].c_n0);
}
}
aoview_table_finish();