Repository navigation
suunto_eonsteel: Report the tank count and keep imperial tanks - #154
metman-oss wants to merge 1 commit into
Conversation
add_gas_type() marks DC_FIELD_TANK_COUNT as available, but never sets cache.TANK_COUNT. dc_field_get() therefore reports zero tanks, so applications never ask for DC_FIELD_TANK. Subsurface then falls back to its default cylinder and loses the tank size and fill pressure that the EON Steel/Core stores for every gas. Set TANK_COUNT together with GASMIX_COUNT, as every gas has a tank entry. Upstream libdivecomputer also reports the number of gases as the tank count. For DC_FIELD_TANK, suunto_eonsteel_parser_get_field() filled in the tank and switched a fractional size with a fill pressure to imperial, but then called dc_field_get(), which overwrote volume, workpressure and type from the cache again. Call dc_field_get() first and apply the imperial detection afterwards. Add a synthetic test with a metric tank (15 l, 200 bar) and an imperial one (AL80, 11.1 l at 206.8 bar). Without this change it fails on the tank count and on the imperial type. See subsurface/subsurface#5170 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: metasch-oss <rene.metasch@gmail.com>
|
No actionable comments were generated in the recent review. WalkthroughThe Suunto EON Steel parser now counts each accepted gas as a tank and obtains tank fields through ChangesSuunto EON Steel tank parsing
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
mikeller
left a comment
There was a problem hiding this comment.
AI-drafted; reviewed by Michael.
The tank-count change addresses the reported zero-tank result, and moving the imperial adjustment after dc_field_get() prevents the cache from overwriting it. I found no substantiated blocker in this change. I have not independently run the new test; the visible checks do not include an autotools test run.
|
Thanks for the review. Regarding the test run: I enabled the workflows in my fork and pushed the commit of this PR as 🤖 Generated with Claude Code |
Fixes the missing tank size and fill pressure when importing dives from a Suunto EON Steel/Core, as reported in subsurface/subsurface#5170.
What changes
add_gas_type()marksDC_FIELD_TANK_COUNTas available but never setcache.TANK_COUNT, sodc_field_get()reported zero tanks. Subsurface then never asks forDC_FIELD_TANKand uses its default cylinder instead of the size and fill pressure the dive computer stores for every gas.TANK_COUNTis now set together withGASMIX_COUNT, as every gas has a tank entry. Upstream libdivecomputer also reports the number of gases as the tank count.DC_FIELD_TANK,suunto_eonsteel_parser_get_field()applied the imperial detection (fractional size with a fill pressure) and then calleddc_field_get(), which overwrote volume, workpressure and type from the cache again. It now callsdc_field_get()first and applies the imperial detection afterwards.Testing
New synthetic test
test/test_suunto_eonsteel_tanks.c(no device data). It builds a minimal SBEM dive file with two gases and checks:Without this change it fails on the tank count and on the imperial type. I built and ran it with MSVC (
contrib/msvc/libdivecomputer.vcxproj, x64 Release). The autotoolsmake distcheckrun is left to CI.Real logs: 50 EON Core dives, taken from a libdivecomputer log of a full download. Before,
DC_FIELD_TANK_COUNTwas 0 for every dive. Now each dive reports one tank whose size and fill pressure match the rawGas.TankSizeandGas.TankFillPressurevalues (27 × 12 l, 23 × 15 l, all 200 bar). All tanks are metric, so the imperial path is covered by the synthetic test only.The average ventilation value mentioned in the issue is not part of this change.
Once merged, Subsurface needs only a submodule update.
The change and test were written with Claude.
🤖 Generated with Claude Code
Fixes tank data in the Suunto EON Steel/Core parser.
DC_FIELD_TANK_COUNTwhen adding a gas, alongsideGASMIX_COUNT.dc_field_get()before tank-specific handling, so cached values no longer overwrite detected imperial tank type and measurements.test_suunto_eonsteel_tanksfor two gases and two tanks, one metric and one imperial.