X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=parse-xml.c;h=a71ff235b4043bef4b9a8c296f3b91721f7e1f68;hb=6538e5bba00b51a7253b6cff927c8774f1b39e2b;hp=92da468f44a2f946bdada7e310a924f6141e931b;hpb=05857e0a05bc15672ddd5e835714d2cd20405b97;p=ext%2Fsubsurface.git diff --git a/parse-xml.c b/parse-xml.c index 92da468..a71ff23 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -609,7 +609,8 @@ static void divinglog_place(char *place, void *_location) static int divinglog_dive_match(struct dive *dive, const char *name, int len, char *buf) { - return MATCH(".divedate", divedate, &dive->when) || + return MATCH(".id", get_index, &dive->nr) || + MATCH(".divedate", divedate, &dive->when) || MATCH(".entrytime", divetime, &dive->when) || MATCH(".depth", depth, &dive->maxdepth) || MATCH(".tanksize", cylindersize, &dive->cylinder[0].type.size) || @@ -876,6 +877,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf) break; } + if (MATCH(".nr", get_index, &dive->nr)) + return; if (MATCH(".date", divedate, &dive->when)) return; if (MATCH(".time", divetime, &dive->when)) @@ -1053,11 +1056,12 @@ static void sanitize_cylinder_type(cylinder_type_t *type) /* Ok, we have both size and pressure: try to match a description */ match_standard_cylinder(type); - /* .. and let's assume that the 'size' was cu ft of air */ - volume_of_air = type->size.mliter * 28.317; /* milli-cu ft to milliliter */ - atm = type->workingpressure.mbar / 1013.25; /* working pressure in atm */ - volume = volume_of_air / atm; /* milliliters at 1 atm: "true size" */ - type->size.mliter = volume + 0.5; + if (input_units.volume == CUFT || import_source == SUUNTO) { + volume_of_air = type->size.mliter * 28.317; /* milli-cu ft to milliliter */ + atm = type->workingpressure.mbar / 1013.25; /* working pressure in atm */ + volume = volume_of_air / atm; /* milliliters at 1 atm: "true size" */ + type->size.mliter = volume + 0.5; + } } static void sanitize_cylinder_info(struct dive *dive)