AXIS: How to set up python code generator in a tab?

More
6 years 6 months ago #164866 by jmr
Hi,
I do not see direct info about this anywhere, I believed it can be done with pyngcgui but after looking it does not seem possible. I know it can be done with gremlin, however I do not have any experience with it and since the machine is already running I would like to just add a tab there...
Ok I need some help, or an example to start from.
Basically I want input like in pyngcgui but instead of pushing the values to .ngc file I want it to run a python script. Of course there needs to be a way to pass the gcode, having it saved with known fixed filename and reloading after generation is good enough. Or maybe I can be crazy and call python script from gcode called from pyngcgui, but how?
Thanks

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #164877 by cmorley
Axis can 'filter' a program through another program before running it.
linuxcnc.org/docs/2.8/html/gui/axis.html#_program_filters

Is that what you want to do?

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #164880 by jmr
Thanks, it could do the job, but it is not the perfect solution. The cycle time is rather short, and it should not require a lot of clicking. We got a HD display so it would be best to embed the generator somehow in the interface, we plan to get a touchscreen. Other option is just another window on the screen and ctrl+R to reload. Not that pretty but workable, this is propably my next stage, as currently the generator runs on another machine and writes to NFS.
Having it embedded would make it easily retain previously entered data.
It would be "good enough" if there is any way to bind "load file1.ext" on a vcp panel or in any other place. This way the generator would start after one hit of the button (i can make it remember last setting), otherwise it requires to file->open->scroll... all the time.
Best option I see is to use EMBED_TAB_COMMAND, however I do not know what can be embedded this way, and if it is possible to use this multiple times in ini file.
I want to save as much "keyboard monkey" time as possible, it ran 5 cycles during writing of this post.

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #164882 by cmorley
Being embedded has nothing to do with being filtered.
Embedded requires X window id forwarding.
Gladevcp and qtvcp can do this (gladevcp works better)
so by extension GTK2 based programs can be embedded easily..
GTK3 probably could, I have no experience.

What I am not sure of is if loading a program in AXIS externally will get it filtered.

Chris

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #164883 by cmorley
I guess I should mention how to control AXIS externally:

linuxcnc.org/docs/2.8/html/gui/axis.html#_axis_remote

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #164884 by jmr
I think I will use axis_remote to load the generated file.
Should I look straight at gladevcp in order to make such "tab", or is there any other not complicated example?
More crazy way would be to use gladevcp panel for data input, and then an userspace component to call the script with values it got via hal... Would you call that wrong way?

Please Log in or Create an account to join the conversation.

Time to create page: 0.287 seconds
Powered by Kunena Forum