Here's the patches.

I splitted them into two, so Jef can cherry-pick the first one, and a
second one which adds a strings that says the source of the PPO2 values.


//Anton


On 18 June, 2018 - Dirk Hohndel wrote:

> As I said before, I can't seem to find that patch. No idea why. If someone 
> sends it to me I'll be happy to add it. I said that before as well.
> If hate to see Davide abandon Subsurface over this...
> 
> /D
> 
> On June 18, 2018 5:39:43 AM GMT+09:00, "Long, Martin" <[email protected]> 
> wrote:
> >Dirk,
> >
> >I would say that Anton's patch would do it as an interim solution. Jef
> >isn't keen, as he has a better solution, but doesn't have the time to
> >work
> >on it yet. However, it does remove the regression, and prevent further
> >loss
> >of data in imports, until the *ideal* solution can be added. Data is
> >still
> >being lost, which is frustrating - I can't seem my actual ppO2 from
> >dives I
> >did yesterday, and now I never will, for those dives.
> >
> >Rather take an imperfect patch, which works now, than leave it broken
> >waiting for the perfect one (and no idea of how long it will take).
> >
> >On 17 June 2018 at 12:02, Dirk Hohndel <[email protected]> wrote:
> >
> >>
> >> On Jun 17, 2018, at 6:52 PM, Davide DB <[email protected]> wrote:
> >>
> >> On Thu, Jun 14, 2018, 15:34 Long, Martin <[email protected]>
> >wrote:
> >>
> >>> I'm in agreement with Davide that any interim solution we can get
> >running
> >>> is better than the way it is working now. It's a regression, and tbh
> >if
> >>> there isn't an interim solution then it ought to be reverted to the
> >old
> >>> behaviour. At the moment I'm having to use Shearwater desktop for
> >reviewing
> >>> all my logs.
> >>>
> >>
> >> I had to stop using Subsurface for the time being. First time in so
> >many
> >> years.
> >>
> >> If the bug will be solved I would have to transfer and compile from
> >> scratch more than 60 dives (until now). I don't know if I will have
> >the
> >> time or will to do all this work and frankly speaking I'm tired to be
> >> always a minority.
> >>
> >> Farewell my friends. It has been a nice journey. Thank you all for
> >the
> >> amazing work.
> >>
> >>>
> >> Sorry to see you leave and thank you for all the great contributions.
> >> Subsurface-mobile wouldn't be anywhere near where it is today if it
> >wasn't
> >> for you.
> >>
> >> I'll admit that I completely tune out rebreather discussions - I
> >assume
> >> that those who care about rebreathers will figure things out and will
> >send
> >> me pull requests.
> >>
> >> Since I'd hate to see you go, is there actually something that we can
> >do
> >> to fix this? Or are we (as in so many small odd corner cases) at a
> >point
> >> where we just don't have the right person to work on something (like
> >the
> >> FTDI download on Android)?
> >>
> >> /D
> >>
> >>
> 
> -- 
> from my phone.

> _______________________________________________
> subsurface mailing list
> [email protected]
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


-- 
Anton Lundin    +46702-161604
>From c60d498661bac58e4182dfaab8d7e3e27b968b5b Mon Sep 17 00:00:00 2001
From: Anton Lundin <[email protected]>
Date: Wed, 20 Jun 2018 20:04:55 +0200
Subject: [PATCH 1/2] shearwater: Fallback to average/voted ppo2

If we can't find any calibration values for the individual sensors,
fallback to emitting the average/voted ppo2 instead, so users always get
a ppo2 value.

Signed-off-by: Anton Lundin <[email protected]>
---
 src/shearwater_predator_parser.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c
index dda042c..6b1ae43 100644
--- a/src/shearwater_predator_parser.c
+++ b/src/shearwater_predator_parser.c
@@ -669,19 +669,19 @@ shearwater_predator_parser_samples_foreach (dc_parser_t *abstract, dc_sample_cal
 		if ((status & OC) == 0) {
 			// PPO2
 			if ((status & PPO2_EXTERNAL) == 0) {
-#ifdef SENSOR_AVERAGE
-				sample.ppo2 = data[offset + 6] / 100.0;
-				if (callback) callback (DC_SAMPLE_PPO2, sample, userdata);
-#else
-				sample.ppo2 = data[offset + 12] * parser->calibration[0];
-				if (callback && (parser->calibrated & 0x01)) callback (DC_SAMPLE_PPO2, sample, userdata);
-
-				sample.ppo2 = data[offset + 14] * parser->calibration[1];
-				if (callback && (parser->calibrated & 0x02)) callback (DC_SAMPLE_PPO2, sample, userdata);
-
-				sample.ppo2 = data[offset + 15] * parser->calibration[2];
-				if (callback && (parser->calibrated & 0x04)) callback (DC_SAMPLE_PPO2, sample, userdata);
-#endif
+				if (!parser->calibrated) {
+					sample.ppo2 = data[offset + 6] / 100.0;
+					if (callback) callback (DC_SAMPLE_PPO2, sample, userdata);
+				} else {
+					sample.ppo2 = data[offset + 12] * parser->calibration[0];
+					if (callback && (parser->calibrated & 0x01)) callback (DC_SAMPLE_PPO2, sample, userdata);
+
+					sample.ppo2 = data[offset + 14] * parser->calibration[1];
+					if (callback && (parser->calibrated & 0x02)) callback (DC_SAMPLE_PPO2, sample, userdata);
+
+					sample.ppo2 = data[offset + 15] * parser->calibration[2];
+					if (callback && (parser->calibrated & 0x04)) callback (DC_SAMPLE_PPO2, sample, userdata);
+				}
 			}
 
 			// Setpoint
-- 
2.17.1

>From f7fef628697a84d5ff89a455a68844209daaec0a Mon Sep 17 00:00:00 2001
From: Anton Lundin <[email protected]>
Date: Wed, 20 Jun 2018 20:12:03 +0200
Subject: [PATCH 2/2] shearwater: Emit a string saying the source of ppo2
 values

Signed-off-by: Anton Lundin <[email protected]>
---
 src/shearwater_predator_parser.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c
index 6b1ae43..3e17e19 100644
--- a/src/shearwater_predator_parser.c
+++ b/src/shearwater_predator_parser.c
@@ -502,8 +502,12 @@ shearwater_predator_parser_cache (shearwater_predator_parser_t *parser)
 		// uncalibrated).
 		WARNING (abstract->context, "Disabled all O2 sensors due to a default calibration value.");
 		parser->calibrated = 0;
+		if (mode != DC_DIVEMODE_OC)
+			add_string(parser, "PPO2 values are voted/averaged");
 	} else {
 		parser->calibrated = data[86];
+		if (mode != DC_DIVEMODE_OC)
+			add_string(parser, "PPO2 values are from cells");
 	}
 
 	// Cache the data for later use.
-- 
2.17.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to