diff --git a/dive.h b/dive.h index e61d1e917..69a01125e 100644 --- a/dive.h +++ b/dive.h @@ -176,6 +176,7 @@ struct sample // BASE TYPE BYTES UNITS RANGE DE duration_t stoptime; // uint32_t 4 seconds (0-18 h) time duration of next deco stop duration_t ndl; // uint32_t 4 seconds (0-18 h) time duration before no-deco limit duration_t tts; // uint32_t 4 seconds (0-18 h) time duration to reach the surface + duration_t rbt; // uint32_t 4 seconds (0-18 h) remaining bottom time depth_t depth; // int32_t 4 mm (0-2000 km) dive depth of this sample depth_t stopdepth; // int32_t 4 mm (0-2000 km) depth of next deco stop temperature_t temperature; // int32_t 4 mdegrK (0-2 MdegK) ambient temperature @@ -191,7 +192,7 @@ struct sample // BASE TYPE BYTES UNITS RANGE DE bool in_deco; // bool 1 y/n y/n this sample is part of deco bool manually_entered; // bool 1 y/n y/n this sample was entered by the user, // not calculated when planning a dive -}; // Total size of structure: 53 bytes, excluding padding at end +}; // Total size of structure: 57 bytes, excluding padding at end struct divetag { /* diff --git a/libdivecomputer.c b/libdivecomputer.c index edefaab14..64e76e389 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -246,7 +246,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata) handle_event(dc, sample, value); break; case DC_SAMPLE_RBT: - printf(" %u\n", value.rbt); + sample->rbt.seconds = (!strncasecmp(dc->model, "suunto", 6)) ? value.rbt : value.rbt * 60; break; case DC_SAMPLE_HEARTBEAT: sample->heartbeat = value.heartbeat; diff --git a/profile.c b/profile.c index 74382b074..51f322cfd 100644 --- a/profile.c +++ b/profile.c @@ -637,7 +637,8 @@ struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer * entry->heartbeat = sample->heartbeat; entry->bearing = sample->bearing.degrees; entry->sac = sample->sac.mliter; - + if (sample->rbt.seconds) + entry->rbt = sample->rbt.seconds; /* skip events that happened at this time */ while (ev && ev->time.seconds == time) ev = ev->next; @@ -1197,6 +1198,8 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me } if (entry->tts_calc) put_format(b, translate("gettextFromC", "TTS: %umin (calc)\n"), DIV_UP(entry->tts_calc, 60)); + if (entry->rbt) + put_format(b, translate("gettextFromC", "RBT: %umin\n"), DIV_UP(entry->rbt, 60)); if (entry->ceiling) { depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit); put_format(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit); diff --git a/profile.h b/profile.h index 36b8aa767..a6dbfcf5f 100644 --- a/profile.h +++ b/profile.h @@ -34,6 +34,7 @@ struct plot_data { int percentages[16]; int ndl; int tts; + int rbt; int stoptime; int stopdepth; int cns;