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

[Feature] Cura support #6

Closed
varazir opened this issue May 5, 2019 · 8 comments
Closed

[Feature] Cura support #6

varazir opened this issue May 5, 2019 · 8 comments
Labels
enhancement New feature or request new slicer

Comments

@varazir
Copy link

varazir commented May 5, 2019

Please support: Cura
I know there are previous post about adding settings to your start/exit code.
It's it better to get it right with the correct regexp?

Sample gcode:
https://gist.github.com/varazir/4a290275cc2b8da43feea4a9ba982493

I'm trying to understand how the parser works, I used this site to test my regexp ( and get help) https://regex101.com

If I understand correct n\ is replaced with a New line before the file get parsed ?
If that is the case this should remove the ;SETTING_3 garbage and this should pick the correct values.

If it's not the case that \n get replaced before parsing this should get the correct values after this

I added this as well to get only the data that is needed.

Tested both but the SlicerSettingsTab can't find any settings.

;End of Gcode[\s\S]+
\n?;SETTING_3 
(?P<key>\w+) = (?P<val>[^\\]+)
@varazir varazir added enhancement New feature or request new slicer labels May 5, 2019
@tjjfvi
Copy link
Owner

tjjfvi commented May 6, 2019

@varazir: Please use the g-code script for Cura support located here. There are more details in the original issue (#1), but there are two core problems:

  1. It only shows settings that were changed.
  2. JSON cannot be parsed with regular expressions.

However, you are correct that \\n is equivalent to a newline in their format.
Also, SlicerSettingsTab just taps off of the settings parsed by this plugin.

If you do find a regex way to parse this, please let me know!

For now, I am closing this; feel free to follow up and/or reopen.

@tjjfvi tjjfvi closed this as completed May 6, 2019
@varazir
Copy link
Author

varazir commented May 6, 2019

I don't want to add that amount of data in the exit/start code. If I reinstall Cura I nee dto remember to add it.
If you look at the regexp I posted I managed to extract the values from orginal Cura settings information.

@tjjfvi
Copy link
Owner

tjjfvi commented May 6, 2019

@varazir: Relative to gcode, the script is tiny. However, I'll take a look at your regexes.

@tjjfvi
Copy link
Owner

tjjfvi commented May 6, 2019

@varazir: While it seems that, combined, your regexes would work, it currently only supports a single regex.

@varazir
Copy link
Author

varazir commented May 6, 2019

@tjjfvi ya need of 2 atleast. One to remove the \n?;SETTING_3 and second (?P\w+) = (?P[^\\]+) to get the data. The first one is just to lower the amout of data needed to process

@varazir
Copy link
Author

varazir commented May 7, 2019

@tjjfvi could you add support for more then one regexp ?

@tjjfvi
Copy link
Owner

tjjfvi commented May 7, 2019

@varazir: I'm sorry, but I'm too busy with other projects right now, but if you submit a PR, I can merge & release it.

@varazir
Copy link
Author

varazir commented May 7, 2019

@tjjfvi I wish I could code. can take a look see if I can make heads and tail. Not it's bed code just I'm bad it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new slicer
Projects
None yet
Development

No branches or pull requests

2 participants