mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fill up plot_data with temperature all the way
This will fill out the gaps of temperature data between all the points so we always have a temperature to show in the info box. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bdd4dff02c
commit
dbd4a471ec
1 changed files with 5 additions and 2 deletions
|
@ -707,7 +707,7 @@ void calculate_max_limits(struct dive *dive, struct divecomputer *dc, struct gra
|
||||||
static struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi)
|
static struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi)
|
||||||
{
|
{
|
||||||
int idx, maxtime, nr, i;
|
int idx, maxtime, nr, i;
|
||||||
int lastdepth, lasttime;
|
int lastdepth, lasttime, lasttemp = 0;
|
||||||
struct plot_data *plot_data;
|
struct plot_data *plot_data;
|
||||||
|
|
||||||
maxtime = pi->maxtime;
|
maxtime = pi->maxtime;
|
||||||
|
@ -774,7 +774,10 @@ static struct plot_data *populate_plot_entries(struct dive *dive, struct divecom
|
||||||
/* FIXME! sensor index -> cylinder index translation! */
|
/* FIXME! sensor index -> cylinder index translation! */
|
||||||
entry->cylinderindex = sample->sensor;
|
entry->cylinderindex = sample->sensor;
|
||||||
SENSOR_PRESSURE(entry) = sample->cylinderpressure.mbar;
|
SENSOR_PRESSURE(entry) = sample->cylinderpressure.mbar;
|
||||||
entry->temperature = sample->temperature.mkelvin;
|
if (sample->temperature.mkelvin)
|
||||||
|
entry->temperature = lasttemp = sample->temperature.mkelvin;
|
||||||
|
else
|
||||||
|
entry->temperature = lasttemp;
|
||||||
|
|
||||||
lasttime = time;
|
lasttime = time;
|
||||||
lastdepth = depth;
|
lastdepth = depth;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue