Adding new function to python interface

More
11 May 2015 07:37 #58551 by sdfzz
Hi all,

I am trying to create a new GUI using GladeVCP. I found that I need a python file for NML interface. The list of available functions for python interface is provided in:

linuxcnc.org/docs/html/common/python-interface.html

However, what if I want to add a new function? For example, what if I want to create a new button on my GUI, and link my custom function to it? What is the source file for python interface functions?

Any help would be greatly appreciated

Regards,

Steve

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

More
11 May 2015 08:21 #58552 by sdfzz
well... I found from google that the source file is:

github.com/jepler/linuxcnc-mirror/blob/m...ensions/emcmodule.cc

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

More
11 May 2015 13:17 #58556 by ArcEye
That file is the one which provides python methods from C

Have you read JTs tutorial on GUI writing?
gnipsel.com/linuxcnc/gui/index.html

Also study the code in Axis, touchy, gmoccapy.

All the methods you need should already be available, primarily from importing 'linuxcnc'

regards

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

More
11 May 2015 13:21 #58557 by sdfzz
ArcEye, thank you for your reply

I will check out JTs tutorial on GUI

regards

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

More
11 May 2015 23:07 #58565 by andypugh

I am trying to create a new GUI using GladeVCP. I found that I need a python file for NML interface. The list of available functions for python interface is provided in:
linuxcnc.org/docs/html/common/python-interface.html
However, what if I want to add a new function?


I think that it is possible that you are misunderstanding the Python interface. I don't know if there is anything that could be there that isn't. (You can't just add extra members to the command or status structures if the est of linuxCNC doesn't know what to do with them.

Rather than jump straight to your solution, why not tell us your problem so we can suggest our solutions?

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

More
12 May 2015 04:12 #58575 by newbynobi
I miss the remap level, homing status is wrong IMHO, etc,

Norbert

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

More
12 May 2015 05:58 #58579 by sdfzz
Hi andypugh,

Actually, I am working on a project to create a LinuxCNC GUI which allows the users to display/adjust servo drive settings (such as filter cut-off frequencies or gains) and perform auto-tuning.

As far as I know, these features are not provided in LinuxCNC GUIs, and I understand that I may have to add a bunch of functions to LinuxCNC itself, as well as the GUI python script, to perform these tasks.

But, at this point, I'm not sure how the nml messages are handled in LinuxCNC, and which are the files that I need to modify.

I guess it is not an easy task...

Any suggestions?

regards,

Steve

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

More
12 May 2015 06:36 #58581 by andypugh

As far as I know, these features are not provided in LinuxCNC GUIs, and I understand that I may have to add a bunch of functions to LinuxCNC itself, as well as the GUI python script, to perform these tasks.


There is an auto-tuning pid HAL component:
manpage: www.linuxcnc.org/docs/html/man/man9/at_pid.9.html
Source and comments: git.linuxcnc.org/gitweb?p=linuxcnc.git;a...2ba48366a16c5e0ca67b
In principle all that needs is a few buttons to twiddle the HAL pins.

One caveat: I don't know if it actually works, it has the feel of a university project which got marked and was then forgotten.

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

Moderators: HansU
Time to create page: 0.075 seconds
Powered by Kunena Forum