Shearwater: Fix the Sensor and Calibration Display.#114
Open
mikeller wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Shearwater Predator/Petrel log parser to improve how ppO₂ sensor data and calibration metadata are emitted, especially in CCR bailout scenarios and when internal (setpoint-based) ppO₂ is used.
Changes:
- Suppresses ppO₂ sample callbacks while in bailout CCR mode (so sensor ppO₂ won’t drive downstream gas-loading calculations in that mode).
- Adds a “ppO₂ data source” cache field and only shows per-sensor calibration values when external ppO₂ is used.
- Refactors DiveCAN calibration estimation flow to share a single samples pass / userdata structure.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1210
to
1216
| struct dc_parser_sensor_calibration_t *out = (struct dc_parser_sensor_calibration_t *)userdata; | ||
|
|
||
| out->external_ppo2_used = true; | ||
|
|
||
| double calculated_ppo2 = data[offset + pnf + 6] / 100.0; | ||
|
|
||
| if (parser->needs_divecan_calibration_estimate) { |
|
|
||
| dc_status_t rc = shearwater_predator_parser_samples_foreach(abstract, NULL, (void *)&data); | ||
| struct dc_parser_sensor_calibration_t userdata = { 0 }; | ||
| dc_status_t rc = shearwater_predator_parser_samples_foreach(abstract, NULL, (void *)&userdata); |
Don't use ppO2 sensor readings to calculate gas loading when in bailout rebreather mode, and don't show sensor calibration information when the internal ppO2 (setpoint) is used. Signed-off-by: Michael Keller <github@ike.ch>
ccaf91a to
49410c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't use ppO2 sensor readings to calculate gas loading when in bailout
rebreather mode, and don't show sensor calibration information when the
internal ppO2 (setpoint) is used.