mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:53:24 +00:00
Create a version of create_graph_info that doesn't depend on GC.
This version of the create plot info is the same as before, with the difference that it doesn't depends on the gc. Also fixed a crash. The Pressure Index, Information and interpolated seems wrong, I'm getting only zeroes. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0787347691
commit
779c1b6738
4 changed files with 21 additions and 1 deletions
18
profile.c
18
profile.c
|
@ -1300,6 +1300,24 @@ struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, s
|
||||||
return analyze_plot_info(pi);
|
return analyze_plot_info(pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi)
|
||||||
|
{
|
||||||
|
if (prefs.profile_calc_ceiling) /* reset deco information to start the calculation */
|
||||||
|
init_decompression(dive);
|
||||||
|
if (last_pi_entry) /* Create the new plot data */
|
||||||
|
free((void *)last_pi_entry);
|
||||||
|
last_pi_entry = populate_plot_entries(dive, dc, pi);
|
||||||
|
check_gas_change_events(dive, dc, pi); /* Populate the gas index from the gas change events */
|
||||||
|
setup_gas_sensor_pressure(dive, dc, pi); /* Try to populate our gas pressure knowledge */
|
||||||
|
populate_pressure_information(dive, dc, pi);/* .. calculate missing pressure entries */
|
||||||
|
calculate_sac(dive, pi); /* Calculate sac */
|
||||||
|
if (prefs.profile_calc_ceiling) /* Then, calculate deco information */
|
||||||
|
calculate_deco_information(dive, dc, pi, false);
|
||||||
|
calculate_gas_information(dive, pi); /* And finaly calculate gas partial pressures */
|
||||||
|
pi->meandepth = dive->dc.meandepth.mm;
|
||||||
|
analyze_plot_info(pi);
|
||||||
|
}
|
||||||
|
|
||||||
/* make sure you pass this the FIRST dc - it just walks the list */
|
/* make sure you pass this the FIRST dc - it just walks the list */
|
||||||
static int nr_dcs(struct divecomputer *main)
|
static int nr_dcs(struct divecomputer *main)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,6 +52,7 @@ int get_cylinder_pressure_range(struct graphics_context *gc);
|
||||||
void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int bufsize, int sum);
|
void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int bufsize, int sum);
|
||||||
struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi);
|
struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi);
|
||||||
struct plot_info *analyze_plot_info(struct plot_info *pi);
|
struct plot_info *analyze_plot_info(struct plot_info *pi);
|
||||||
|
void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi);
|
||||||
|
|
||||||
struct ev_select {
|
struct ev_select {
|
||||||
char *ev_name;
|
char *ev_name;
|
||||||
|
|
|
@ -51,7 +51,7 @@ void DiveCartesianAxis::updateTicks()
|
||||||
double currValue = min;
|
double currValue = min;
|
||||||
|
|
||||||
// Remove the uneeded Ticks / Texts.
|
// Remove the uneeded Ticks / Texts.
|
||||||
if (ticks.size() > steps) {
|
if (!ticks.isEmpty() && ticks.size() > steps) {
|
||||||
while (ticks.size() > steps) {
|
while (ticks.size() > steps) {
|
||||||
DiveLineItem *removedLine = ticks.takeLast();
|
DiveLineItem *removedLine = ticks.takeLast();
|
||||||
removedLine->animatedHide();
|
removedLine->animatedHide();
|
||||||
|
|
|
@ -277,6 +277,7 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
* shown.
|
* shown.
|
||||||
*/
|
*/
|
||||||
struct plot_info pInfo = calculate_max_limits_new(d, currentdc);
|
struct plot_info pInfo = calculate_max_limits_new(d, currentdc);
|
||||||
|
create_plot_info_new(d, currentdc, &pInfo);
|
||||||
int maxtime = get_maxtime(&pInfo);
|
int maxtime = get_maxtime(&pInfo);
|
||||||
int maxdepth = get_maxdepth(&pInfo);
|
int maxdepth = get_maxdepth(&pInfo);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue