mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Do a minimal hook-up of the dive plan tree view to the
actual planning Yes, you can actually enter your segments now. No, it's not wonderfully user-friendly. If you don't enter enough segments to create a dive plan, it will just silently fail, for example. And the <tab> key that should get you to the next editable segment doesn't. And so on. But it kind of works. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f31b836836
commit
92a8fde9c2
3 changed files with 91 additions and 22 deletions
16
planner.c
16
planner.c
|
|
@ -10,20 +10,6 @@
|
|||
|
||||
int stoplevels[] = { 3000, 6000, 9000, 12000, 15000, 21000, 30000, 42000, 60000, 90000 };
|
||||
|
||||
struct divedatapoint {
|
||||
int time;
|
||||
int depth;
|
||||
int o2;
|
||||
int he;
|
||||
struct divedatapoint *next;
|
||||
};
|
||||
|
||||
struct diveplan {
|
||||
timestamp_t when;
|
||||
int surface_pressure;
|
||||
struct divedatapoint *dp;
|
||||
};
|
||||
|
||||
/* returns the tissue tolerance at the end of this (partial) dive */
|
||||
double tissue_at_end(struct dive *dive)
|
||||
{
|
||||
|
|
@ -189,6 +175,8 @@ void plan(struct diveplan *diveplan)
|
|||
if (!diveplan->surface_pressure)
|
||||
diveplan->surface_pressure = 1013;
|
||||
dive = create_dive_from_plan(diveplan);
|
||||
if (!dive)
|
||||
return;
|
||||
record_dive(dive);
|
||||
|
||||
sample = &dive->dc.sample[dive->dc.samples - 1];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue