Skip to content

Add Resolution and Range Validation #267

@tylerkron

Description

@tylerkron

Type: Feature
Priority: Medium
Epic: Enhanced Resolution & Range Support

Description

Add comprehensive validation for resolution and voltage range configurations to prevent invalid configurations and provide helpful error messages.

Acceptance Criteria

  • Validate resolution values are powers of 2 (or reasonable ADC resolutions)
  • Validate voltage ranges are physically reasonable
  • Add bounds checking for calibration coefficients
  • Provide informative error messages for invalid configurations
  • Log warnings for unusual but valid configurations
  • Unit tests for all validation scenarios

Validation Rules

  • Resolution: 8-bit to 24-bit (256 to 16,777,216)
  • Voltage ranges: ±50V maximum, minimum 100mV span
  • Calibration coefficients: reasonable bounds (0.1x to 10x scale factors)

Files to Modify

  • Daqifi.Desktop/Channel/AnalogChannel.cs (validation methods)
  • Daqifi.Desktop/Device/AbstractStreamingDevice.cs (device validation)

Value

Prevents configuration errors and provides clear feedback when device capabilities are outside expected parameters

Testing Requirements

  • Test valid resolution and range configurations
  • Test invalid configurations produce appropriate errors
  • Test boundary conditions
  • Verify error messages are user-friendly

Dependencies

  • Can be done in parallel with other resolution/range work

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions