fix: send decimal channel mask for SD card logging instead of binary#446
Merged
fix: send decimal channel mask for SD card logging instead of binary#446
Conversation
StartSdCardLogging() used Convert.ToString(analogChannelMask, 2) which produced a binary string (e.g. "111" for channels 0-2). The firmware's SCPI_ParamInt32 parses this as decimal 111, enabling the wrong channels. Changed to analogChannelMask.ToString() to send the correct decimal bitmask (e.g. "7" for channels 0-2). This matches AddChannel/ RemoveChannel which already use decimal via Convert.ToString() without a base parameter. Fixes #439 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
/agentic_review |
Contributor
Code Review by Qodo
1.
|
Ensures the decimal channel mask sent to firmware via SCPI is always formatted with ASCII digits, regardless of the user's locale. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📊 Code Coverage ReportSummarySummary
CoverageDAQiFi - 18.9%
Daqifi.Desktop.Common - 33.3%
Daqifi.Desktop.IO - 100%
Coverage report generated by ReportGenerator • View full report in build artifacts |
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.
Summary
StartSdCardLogging()usedConvert.ToString((long)analogChannelMask, 2)which converted the bitmask to a binary string (e.g."111"for channels 0,1,2). The firmware'sSCPI_ParamInt32parses this as decimal111=0b1101111, enabling channels 0,1,2,3,5,6 instead of the intended 0,1,2.analogChannelMask.ToString()which sends the correct decimal value (e.g."7"for channels 0,1,2). This matchesAddChannel()/RemoveChannel()which already use decimal format."21"instead of binary"10101"for the channels 0,2,4 test case.Fixes #439
Related core docs fix: daqifi/daqifi-core#160
Test plan
🤖 Generated with Claude Code