From 725fda3cd10120241c9f1369c5c44474d1cba056 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 4 Dec 2021 21:04:26 +0100 Subject: [PATCH] profile: don't add excessive depth The old get_maxdepth() function in profile.c was accounting for two things: - the partial pressure graphs - rounding to sane value Both are now taken care of by the profile itself. This leads to excessive max-depths. Remove the code from profile.c. Signed-off-by: Berthold Stoeger --- core/profile.c | 19 ++++--------------- core/profile.h | 4 +--- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/core/profile.c b/core/profile.c index d6eb855c2..0445542c5 100644 --- a/core/profile.c +++ b/core/profile.c @@ -75,23 +75,12 @@ int get_maxtime(const struct plot_info *pi) return MAX(min, seconds); } -/* get the maximum depth to which we want to plot - * take into account the additional vertical space needed to plot - * partial pressure graphs */ +/* get the maximum depth to which we want to plot */ int get_maxdepth(const struct plot_info *pi) { - unsigned mm = pi->maxdepth; - int md; - - if (prefs.zoomed_plot) { - /* Rounded up to 10m, with at least 3m to spare */ - md = ROUND_UP(mm + 3000, 10000); - } else { - /* Minimum 30m, rounded up to 10m, with at least 3m to spare */ - md = MAX((unsigned)30000, ROUND_UP(mm + 3000, 10000)); - } - md += lrint(pi->maxpp * 9000); - return md; + /* 3m to spare */ + int mm = pi->maxdepth + 3000; + return prefs.zoomed_plot ? mm : MAX(30000, mm); } /* UNUSED! */ diff --git a/core/profile.h b/core/profile.h index 04953b888..637f56fb0 100644 --- a/core/profile.h +++ b/core/profile.h @@ -95,9 +95,7 @@ extern void free_plot_info_data(struct plot_info *pi); */ extern int get_maxtime(const struct plot_info *pi); -/* get the maximum depth to which we want to plot - * take into account the additional verical space needed to plot - * partial pressure graphs */ +/* get the maximum depth to which we want to plot */ extern int get_maxdepth(const struct plot_info *pi); static inline int get_plot_pressure_data(const struct plot_info *pi, int idx, enum plot_pressure sensor, int cylinder)