aggertroll 12
I am not sure how to "execute a certain g-code".
Load model, but instead of loading an stl-file, load a g-code, and then just print?
I am not sure how to "execute a certain g-code".
Load model, but instead of loading an stl-file, load a g-code, and then just print?
That is what the code you need to write to get this to work should do.
That is what the code you need to write to get this to work should do.
Sorry, I wanted to know: How do I print a g-code file? I usually input stl files and Cura does the rest.
I just tried it - load a g-code file and print that. Duh.
Solved.
First lesson learned: Don't edit code with a text editor. Not even with saving as txt. Anytime I tried to edit the script the interface would not load. Got a python editor. Works.
Picked a nice interface script, re-appropriated an existing button to execute my abort routine.
So if you are looking for a way to
- lower the platform,
- retract,
- return to home,
- switch off heater, bed and fan
- and say 'Aborted' on the little screen
at the click of a button when you cancel/abort a print, this is one way: Pick one of the Pronterfan print interfaces in the thread mentioned in the first post, open it with one of the many script editors available for free and do some tweaking. Its fun, actually.
Edited by GuestNot even with saving as txt. Anytime I tried to edit the script the interface would not load. Got a python editor. Works.
This is probably caused due to spaces and tabs. Some text editors set tabs to two spaces, some to four. Python is quite particular in this regard.
... Python is quite particular in this regard.
Yes, now I know. I kept looking at my changes searching for the error there. A few hours of frustration, but I learned something in return.
Can someone help me with a Python question please?
Right now I changed an existing button in a Pronterfan UI to send some gcode commands after I cancel a print, i.e. click cancel in the Ui, then click the changed button.
The cancel part of the code says:
if id == 140:
# cancel
self.frame._printerConnection.cancelPrint()
Can I somehow attach the gcode commands to this cancel command so that they are triggered on cancel? I always want those commands to be sent when I cancel a print.
Edited by GuestSo you should either change the function printerConnection.cancelPrint() to send the right g-codes before the connection is actually terminated, or you add the g-code sending before;
if id == 140:
#send g-code here
self.frame._printerConnection.cancelPrint()
So you should either change the function printerConnection.cancelPrint() to send the right g-codes before the connection is actually terminated, or you add the g-code sending before;
if id == 140:
#send g-code here
self.frame._printerConnection.cancelPrint()
Brilliant - thanks!
Recommended Posts
nallath 1,117
Technically it should suffice to let abort do the same thing that it does now and once that is completed execute a certain g-code that does all of these operations.
I have no idea how the customization of pronterface works, so I can't help you there.
Link to post
Share on other sites