Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tick Mark bug #11

Merged
merged 17 commits into from
Jul 23, 2024
Merged

Tick Mark bug #11

merged 17 commits into from
Jul 23, 2024

Conversation

gbakeman
Copy link

@gbakeman gbakeman commented May 8, 2024

Overall goal of this PR is to fix a bug (closes #10) which causes gauge tick marks to extend beyond the end of the gauge. The way this is done is by causing the gauge to draw only one major step (min and max only) if invalid properties are given.

Additional changes

  • ⚠️Breaking change: main AGauge control is now found in AGaugeClassic, other components may be found in the same namespace.
  • Upgraded both projects to .NET Framework 4.8
  • Hiding some unused default Control properties
  • When an attempt is made to set Value, MinValue or MaxValue to an invalid state, the attempt will be ignored instead of modified to fit within the valid range.
  • Adding a couple of helper functions to determine if given values are valid in a given major scale line step value.
  • Reorganized the gauge scale/number drawing code
  • Updates to the Demo form to test invalid inputs.
  • Moving app demo screenshot to top repository directory in preparation for potentially consolidating demo/testing Form apps

Moving app demo screenshot to top repository directory in preparation for potentially consolidating demo/testing Form apps.
@gbakeman gbakeman added the bug Something isn't working label May 8, 2024
gbakeman added 7 commits May 8, 2024 16:07
- Move gauge and other components into a custom `AGauge` namespace, rather than inserting into the .Forms namespace. Better practice as I understand it.
- Cleanup and add `using`s as needed
- Updated main AGauge class xmldoc description
- Moved DefaultSize definiton into property override per `Control` documentation from Microsoft (better performance.)
This app had a self-contained version of the AGauge control in it, which appears to be outdated. Removing entire project.
Creating an easy launcher profile that will launch a Visual Studio process with the current solution, in order to debug the control. This is a debug profile for the AGauge library; debugging the Demo form is still available as well.
- Organized default/constant variables into their own section
- Comment center cross control variable, toggle depending on DEBUG flag
- Apply Intellisense suggestions to correct numeric variable types
- Change some variables/properties from float types to integer types (min, max and step values)
- Make a few properties browsable and bindable in the Designer, make others hidden
- Added a ValueRange property that calculates the difference between Min and Max values.
- Improve the ScaleLineMajorStepValue property so that it ensures new values are a multiple of the total range, ensuring that major step values fit evenly on the gauge (corrects bug of major step values extending beyond the end of the gauge.)
- Added dedicated function that calculates the greatest common factor between the requested value and the gauge range.
- Simplified MinValue and MaxValue setters to ensure only sane values are set, and reduce automated and potentially unexpected modification of expected values.
- Utilize data binding capabilities to remove old slider, and replace a more modular property interface control grouping. Made sure value is bound properly.
@gbakeman gbakeman marked this pull request as ready for review May 17, 2024 16:44
gbakeman added 7 commits May 17, 2024 16:00
AGauge control class is now in AGauge.Controls namespace.
Aiming for organization and modularization here. Also planning to create some useful composite controls.
Also returned overridden properties region name.
Help with namespace/class confusion. Planning on modularizing the AGauge control further, so more breaking changes ahead.
- Removed static copyright header in some code files in favor of root-level copyright
- Removed header comment
- Removed ISupportInitialize support - handled by below changes.
- Added second set of variables for critical properties that we may want to be out of range, which will then update "displayed" variables which is what the gauge ultimately renders. Allows us to handle cases where we want to alert the user to the issue in one way or another. Also prevents invalid states from being displayed in the first place.
- Added IDataErrorInfo support which allows for querying the control to find out which values are incorrectly set and preventing the control from updating. May add further support in the future to indicate this to the user.
- Some code for determing if the MajorStepValue is set correctly and to automatically adjust it in the future.
- Created a NumericInput component that wraps up several controls into a convenient number input composite control.
- Created a UserInputAGauge composite control that has a few inputs pre-added for testing AGauges with manual input.
- Updated these changes on the main Demo form, removing the old major ticks test gauge in favor of a newer one.
- Removed layer of displayed values, in favor of drawing the scale with only a min and max major tick mark & label when the scale is in an invalid state.
Cleaned up code and rearranged the label drawing code
I'm deciding on renaming the main project, namespace and assembly to "AGaugeClassic" to differentiate it from the previous iteration of AGauge. The control its self will now be AGauge instead of AGaugeControl.

Also doing some small cleanup in files as I correct references. Applying changes to workflow files.
gbakeman added 2 commits July 22, 2024 17:19
Upgrading to latest version of DNF that hasn't made a major change in OS support.
@gbakeman gbakeman merged commit afaea9e into main Jul 23, 2024
1 check passed
@gbakeman gbakeman deleted the 10-scale-lines branch July 23, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gauge tick marks are extended beyond the maximum under certain conditions
1 participant