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

Replacer #1158 and Second Typo #1645 #1652

Closed
wants to merge 12 commits into from
Closed

Conversation

AndyCXL
Copy link
Contributor

@AndyCXL AndyCXL commented Aug 5, 2021

Replacer #1158 (PatternRemover enhancement) and Second Typo #1645 (ABC Step Multiply)

PatternRemover has been enhanced to support 'replace with' and %macro% expansion by introducing 'sed' syntax to the preferences/UGS/Contoller Options. 'sed' syntax is "s/regex to match/replacement text" so the following now all work;

  • M6T1 in code, "M6T[0-9]+" enabled will REMOVE M6T1 as per original functionality
  • M6T1 in code, "s/M6T[0-9]+/G21" enabled will REPLACE M6T1 with G21 if that is what the user desires
  • M6T1 in code, "s/M6T[0-9]+/%1%" enabled will REPLACE M6T1 with whatever macro "1" is defined as by the user in the Gcode column. User must be aware that the result from macro 1 will be passed through as-is.
  • All REMOVES or REPLACES are logged under INFO to assist user debugging regex and %macro% settings.
    Confirmed working (Apple and RPi).

Found a typo in jog service.java where getStepSizeZ() was errantly against multiplyABCStepSize(), should have been getStepSizeABC(), which is corrected.
Confirmed working (Apple and RPi).

Fixes winder#1645 Menu Multiply XY by 10 issue
Replacer without %macros%
Edge case debugged, no %macro% as yet until backend instance can be obtained (to get to the current Macros() definitions)
Sorted %macro% blockage using SettingsFactory vs Settings
Fixed typo in multiplyABCStepSize(), was using getStepSizeZ() and should have been getStepSizeABC(). Now fixed.
Replacer functionality with %macro% expansion via sed syntax extensively tested and working as intended
@AndyCXL
Copy link
Contributor Author

AndyCXL commented Aug 5, 2021

Not sure what, if anything, I am supposed to do with the CodeBeat response. Nothing wrong with the code aside from style and brevity as-per it's assessment???

AndyCXL and others added 5 commits August 6, 2021 21:27
More_Typos in JogService.java, fixing divideABCStepSize()
Code Style Tweaks, adding "" to surround log entries to make more legible
Copy link
Contributor Author

@AndyCXL AndyCXL left a comment

Choose a reason for hiding this comment

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

Tidied some comments to improve code style

@AndyCXL AndyCXL closed this Aug 24, 2021
@AndyCXL AndyCXL reopened this Aug 24, 2021
@AndyCXL
Copy link
Contributor Author

AndyCXL commented Aug 24, 2021

As CodeBeat didn't like my coding style, I re-wrote the main PatternRemover loop to be more elegant - it is more legible and has fewer nesting levels. I also tested the Macro expansion against macros named '1' or 'Macro #1' as these could both exist, and it successfully identifies and expands either form.
Hopefully this can merge into the base now...

@AndyCXL AndyCXL closed this Aug 24, 2021
@AndyCXL AndyCXL deleted the Replacer branch August 24, 2021 18:37
@AndyCXL AndyCXL restored the Replacer branch August 24, 2021 18:38
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.

1 participant