diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-20 14:39:02 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-20 17:32:54 -0700 |
commit | 11a0c0cc701806ccec975c67d27dec97fbb13b1f (patch) | |
tree | 15a3ace16588b80a88fea76cec30386414bfc3f7 /core/parse-xml.c | |
parent | 94d8abd1a292ac0b02064c906da3a66ccf9e6737 (diff) | |
download | subsurface-11a0c0cc701806ccec975c67d27dec97fbb13b1f.tar.gz |
Unify sample pressure and o2pressure as pressure[2] array
We currently carry two pressures around for all the samples and plot
info, but the second pressure is reserved for CCR dives as the O2
cylinder pressure.
That's kind of annoying when we *could* use it for regular sidemount
dives as the secondary pressure.
So start prepping for that instead: don't make it "pressure" and
"o2pressure", make it just be an array of two pressure values.
NOTE! This is purely mindless prepwork. It literally just does a
search-and-replace, keeping the exact same semantics, so "pressure[1]"
is still just O2 pressure.
But at some future date, we can now start using it for a second sensor
value for sidemount instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r-- | core/parse-xml.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c index e5556d53f..dd3e1cc0b 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -712,7 +712,7 @@ static int divinglog_fill_sample(struct sample *sample, const char *name, char * return MATCH("time.p", sampletime, &sample->time) || MATCH("depth.p", depth, &sample->depth) || MATCH("temp.p", fahrenheit, &sample->temperature) || - MATCH("press1.p", psi_or_bar, &sample->cylinderpressure) || + MATCH("press1.p", psi_or_bar, &sample->pressure[0]) || 0; } @@ -731,7 +731,7 @@ static int uddf_fill_sample(struct sample *sample, const char *name, char *buf) return MATCH("divetime", sampletime, &sample->time) || MATCH("depth", depth, &sample->depth) || MATCH("temperature", temperature, &sample->temperature) || - MATCH("tankpressure", pressure, &sample->cylinderpressure) || + MATCH("tankpressure", pressure, &sample->pressure[0]) || MATCH("ref.switchmix", uddf_gasswitch, sample) || 0; } @@ -927,13 +927,13 @@ static void try_to_fill_sample(struct sample *sample, const char *name, char *bu int in_deco; start_match("sample", name, buf); - if (MATCH("pressure.sample", pressure, &sample->cylinderpressure)) + if (MATCH("pressure.sample", pressure, &sample->pressure[0])) return; - if (MATCH("cylpress.sample", pressure, &sample->cylinderpressure)) + if (MATCH("cylpress.sample", pressure, &sample->pressure[0])) return; - if (MATCH("pdiluent.sample", pressure, &sample->cylinderpressure)) + if (MATCH("pdiluent.sample", pressure, &sample->pressure[0])) return; - if (MATCH("o2pressure.sample", pressure, &sample->o2cylinderpressure)) + if (MATCH("o2pressure.sample", pressure, &sample->pressure[1])) return; if (MATCH("cylinderindex.sample", get_cylinderindex, &sample->sensor)) return; @@ -2364,7 +2364,7 @@ extern int dm4_dive(void *param, int columns, char **data, char **column) if (data[18] && data[18][0]) cur_sample->temperature.mkelvin = C_to_mkelvin(tempBlob[i]); if (data[19] && data[19][0]) - cur_sample->cylinderpressure.mbar = pressureBlob[i]; + cur_sample->pressure[0].mbar = pressureBlob[i]; sample_end(); } @@ -2498,7 +2498,7 @@ extern int dm5_dive(void *param, int columns, char **data, char **column) if (temp >= -10 && temp < 50) cur_sample->temperature.mkelvin = C_to_mkelvin(temp); if (pressure >= 0 && pressure < 350000) - cur_sample->cylinderpressure.mbar = pressure; + cur_sample->pressure[0].mbar = pressure; sample_end(); } @@ -2526,7 +2526,7 @@ extern int dm5_dive(void *param, int columns, char **data, char **column) if (data[18] && data[18][0]) cur_sample->temperature.mkelvin = C_to_mkelvin(tempBlob[i]); if (data[19] && data[19][0]) - cur_sample->cylinderpressure.mbar = pressureBlob[i]; + cur_sample->pressure[0].mbar = pressureBlob[i]; sample_end(); } } @@ -2687,7 +2687,7 @@ extern int shearwater_profile_sample(void *handle, int columns, char **data, cha /* We don't actually have data[3], but it should appear in the * SQL query at some point. if (data[3]) - cur_sample->cylinderpressure.mbar = metric ? atoi(data[3]) * 1000 : psi_to_mbar(atoi(data[3])); + cur_sample->pressure[0].mbar = metric ? atoi(data[3]) * 1000 : psi_to_mbar(atoi(data[3])); */ sample_end(); @@ -3137,7 +3137,7 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu if (data[2]) { memcpy(pres, &data[2][i * 11 + 3], 4); - cur_sample->cylinderpressure.mbar = atoi(pres) * 100; + cur_sample->pressure[0].mbar = atoi(pres) * 100; } if (data[3] && strlen(data[3])) { |