[PATCH v2 1/2] Use the right event type
Anton Lundin
glance at acc.umu.se
Wed Sep 18 00:06:37 UTC 2013
11 is SAMPLE_EVENT_GASCHANGE, and thats the one that doesn't contain any
He-part. The type where He and O2 is packed togeather is 25,
SAMPLE_EVENT_GASCHANGE2.
Left to implement is to figure out the type of the event when we read
the xml, so we can create the right type there.
Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
dive.c | 2 +-
parse-xml.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dive.c b/dive.c
index 5194ff1..f9f78d6 100644
--- a/dive.c
+++ b/dive.c
@@ -1074,7 +1074,7 @@ static void add_initial_gaschange(struct dive *dive, struct divecomputer *dc)
he = (he + 5) / 10;
value = o2 + (he << 16);
- add_event(dc, 0, 11, 0, value, "gaschange");
+ add_event(dc, 0, 25, 0, value, "gaschange"); /* SAMPLE_EVENT_GASCHANGE2 */
}
static void dc_cylinder_renumber(struct dive *dive, struct divecomputer *dc, int mapping[])
diff --git a/parse-xml.c b/parse-xml.c
index aa2f737..5c031fc 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -776,7 +776,7 @@ void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int second
he = (he+5) / 10;
value = o2 + (he << 16);
- add_event(dc, seconds, 11, 0, value, "gaschange");
+ add_event(dc, seconds, 25, 0, value, "gaschange"); /* SAMPLE_EVENT_GASCHANGE2 */
}
static void get_cylinderindex(char *buffer, void *_i)
--
1.8.1.2
More information about the subsurface
mailing list