- Posts: 53
- Thank you received: 0
Run shell commands from GUI
9 years 4 months ago #94263
by Cpk_Rbt
Run shell commands from GUI was created by Cpk_Rbt
It would be great if I could add a custom button to the GUI that would execute a specific script, for special sub-routines and shell commands.
I think I can use custom M-codes M100-199 for user-defined functions, and the action could be to run a shell script, which might work just fine. I was just wondering if there was a way to do the same type of thing with a e.g. PyVCP button.
Any thoughts?
I think I can use custom M-codes M100-199 for user-defined functions, and the action could be to run a shell script, which might work just fine. I was just wondering if there was a way to do the same type of thing with a e.g. PyVCP button.
Any thoughts?
Please Log in to join the conversation.
9 years 4 months ago #94267
by cmorley
Replied by cmorley on topic Run shell commands from GUI
A pyvcp button could be used to run an MDI command which could call a M command.
Chris M
Chris M
Please Log in to join the conversation.
9 years 4 months ago #94290
by andypugh
Replied by andypugh on topic Run shell commands from GUI
It is easier with a GladeVCP button, the MDI-action buttons call a bit of G-code that is a property of the button. Optionally with hal-pin values substituted in.
Please Log in to join the conversation.
9 years 4 months ago #94298
by Cpk_Rbt
Replied by Cpk_Rbt on topic Run shell commands from GUI
Thanks Chris and Andy for your input!
Please Log in to join the conversation.
9 years 4 months ago #94424
by andypugh
Replied by andypugh on topic Run shell commands from GUI
Incidentally: If you want to run shell-commands directly without going through the MDI interface, you can use a normal GTK button and have the Python handler call the shell script.
Doing it this way means that it can happen at any time, whereas the MDI buttons only work when MDI mode is possible (ie, when the machine is not already running G-code).
Doing it this way means that it can happen at any time, whereas the MDI buttons only work when MDI mode is possible (ie, when the machine is not already running G-code).
Please Log in to join the conversation.
Time to create page: 0.152 seconds
