NEWS
LinuxCNC 2.5.2 Release
LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum Configuring LinuxCNC pyVCP Pyvcp With Python File

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Pyvcp With Python File

Pyvcp With Python File 21 Jan 2012 00:38 #16998

  • grokhehe
  • grokhehe's Avatar
Hi, can anybody help me?
I've already create xml file (ex : test.xml) and hal file (ex: test.hal)
and append the command to .ini file so it can be clicked..

And when i open axis it appears on the right side of the program..

But the quesiton now is when the button clicked , I want to show Tkinter Frame..
My Tkinter Frame file is like this :

class GUI:
def __init__(self, master=None):
self.master = master
self.master.title('L-System')
self.master.geometry('540x450+400+100')
self.master.resizable(0, 0)

self.objframe = Tkinter.Frame(self.master, borderwidth = 1, width = 550, height = 550)
self.objframe.pack(fill = Tkinter.BOTH)

root = Tkinter.Tk()
gui = GUI(root)
root.mainloop()

I've tested the Tkinter Frame on windows with python cmd and also in linux and it run well
But when i integrate into Axis it cannot show..

Could you please show some example?
Thx for the help..
The administrator has disabled public write access.

Re:Pyvcp With Python File 21 Jan 2012 13:29 #17006

  • cmorley
  • cmorley's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1489
  • Thank you received: 40
  • Karma: 89
Where are you placing this code?

What are you trying to do?

I'm guessing that you are trying to create a pyvcp object then control it with a separate python program?
The administrator has disabled public write access.

Re:Pyvcp With Python File 22 Jan 2012 20:09 #17032

  • grokhehe
  • grokhehe's Avatar
I'm placing in /home/<username>/emc2/nc_files

What I mean is like this :
1. I place the pyvcp object on the right side
2. When I click the pyvcp object (button), I want to show my Tkinter Frame
3. After that I want to generate G-Code and it can be drawn to AXIS interface

I'm using Linux 10.04 LTS that I've downloaded from this site
Can I know which Python version used in AXIS?
Because I using library such as import xml.etree.ElementTree.SubElement and it can't work because it was implemented in Python 2.7

Thanks
The administrator has disabled public write access.

Re:Pyvcp With Python File 22 Jan 2012 20:58 #17034

  • cmorley
  • cmorley's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1489
  • Thank you received: 40
  • Karma: 89
Well AFAIK there is no way to have pyvcp call external user events or vice versa.
In other words you can't extend pyvcp with out changing it's source code.
You could have your button change a HAL pin and then have your python program listen to that HAL pin and respond.
but then you could only open a new window not anything inside pyVCP panel.

Two thoughts come to my mind.:
- Use gladeVCP it IS extendable with out going into the source code.
- Do not use pyVCP or gladeVCP at all. Code your program as stand alone and then embed it's window into AXIS. This is how gladevcp and webcams
and ncgui work.

Hopefully someone more in the know can give more ideas.
Chris M
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.868 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.