-
Notifications
You must be signed in to change notification settings - Fork 38
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
Language Variants #9
Comments
|
Basis for Change
Sample Files |
I've spent an enormous amount of time making changes to the LCNC interpreter, sometimes using remap, and sometimes directly modifying the source, and it's always difficult and painful. I can't say how many times I've wished that the interpreter and task could be rewritten in Python using proper OO architecture so that it could be easier to understand and easier to add new or modify existing G/M codes. Big +1 for this project. The code looks organized in a way that subclassing codes would be possible. Off the top of my head, here are common types of LCNC interpreter changes that I've helped people with.
|
@zultron So all of the "read" and "write" functionality of The time you spend on these changes, is that professionally, or just for yours and others' hobby projects? My time is heavily invested in another project at the moment, so I may not get to this until next year. |
@fragmuffin, very cool, allowing separate read and write dialects. My (armchair) application only requires read functionality, but there are other nifty things going on here that I've ignored. Most of my LCNC interp and task modifications were made for commercial products. However, I've been moving away from CNC and towards other types of machine controls, so ATM it seems unlikely I'll be a contributor in the future. I just hope that someday there's a community effort to replace the LCNC interpreter, and it starts with something like this project. |
@fragmuffin Use XML. It's easily human readable, structured, editable and easy to read and parse with python. This way you can make g-code definition templates that any user can create, edit, and share for different machine types etc. If the templates are designed properly, they will even make it easier to add features like editing and code highlighting etc. The more modular you make the code, the easier it will be to reuse and extend. I was checking out a gcode editor earlier where the author hard-coded the definitions for each machine type.... Not only did he have to duplicate 90% of the code for each machine, but it was in C++, so to add support for a different machine you either had to code it in yourself and recompile the whole project or request the author to make the changes... Otherwise a great editor, but not for me. Edit: |
of course! 👍
That is a good idea, XML is easily readable, and you can do some fancy formatting with XSLT to make almost all browsers render them as HTML. However, one thing that won't replace is the active nature of the classes... probably the best example is movement commands. For example, in the So although I definitely agree with you; XML is much more accessible, it won't replace the classes that are currently in place. However, I can document exactly how to create custom
No!, I didn't read it that way! but I appreciate the courtesy ❤️ All things considered, I'll definitely keep this in mind when I'm finalising the design for this change. |
I've been away from this project for a while now, and I re-read the comment above from @BillyBumbler; I think using a non code-based format to store dialects is an excellent idea. I have no idea what I was talking 😉 @dickshaydle : Taggin you in from #18 Dialects needs to be split into 2 main tasks: Dialect DesignDesigning a system to accommodate all dialects, and a way of defining a dialect in a configuration file.
It will be important to get the design right to significantly reduce future maintenance, thereby increasing this library's usefulness, and longevity. Lessons from existing bugs:
Filling & Testing DialectsPopulating the library with dialects, namely listed straight from the reprap wiki
WIll require, per above dialects:
|
I'm trying to write some code that would take a file of Gcode from GibbsCAM and then send that through python to my haas 3 axis milling machine via ethernet connection. Will this code allow me to do that? If you have time I would appreciate a quick example of the proper formatting to put this in as well. Thanks in advance For reference, below is a basic Gcode file from Gibbs I've previously made:
|
Hi @nrosie!
In a word: no To use an analogy, |
Allow multiple GCode languages to be supported
(that's the only way this library is going to be practical)
pygcode.lang
pygcode.set_lang("reprap")
To make this possible, I'll first have to:
Change discovery mapping method to registration as opposed to on-demand class search
root problem identified by @revarbat in #8
Workaround
It's likely you're coming across this problem:
What the interpreter does is finds all valid
G
orM
codes, then loops though all otherWords
from right to left, assigning them to their nearest validG
orM
code as a parameter.This error is saying that it could not attach 'M80' as a parameter to any valid gcode (because it was not identified as a valid gcode itself)
Upon closure of this issue, the
M80
code will be defined in 1 or more gcode dialects, then it will just be a matter of switching to the correct dialect.In the meantime this workaround may get you out of trouble in some cases.
You can create your own
G
orM
codes to be interpreted.Tasklist
linuxcnc
as a selectable "dialect"reprap
(Add Dialect: reprap #13)marlin
(Add Dialect: marlin #14)The text was updated successfully, but these errors were encountered: