Skip to content

Shearwater: Fix the Sensor and Calibration Display.#114

Open
mikeller wants to merge 1 commit into
subsurface:Subsurface-DS9from
mikeller:fix_shearwater_calibration_display
Open

Shearwater: Fix the Sensor and Calibration Display.#114
mikeller wants to merge 1 commit into
subsurface:Subsurface-DS9from
mikeller:fix_shearwater_calibration_display

Conversation

@mikeller
Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings May 21, 2026 09:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread src/shearwater_predator_parser.c Outdated
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>
@mikeller mikeller force-pushed the fix_shearwater_calibration_display branch from ccaf91a to 49410c5 Compare May 21, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants