Pyvcp With Python File

  • grokhehe
  • grokhehe's Avatar Topic Author
  • Visitor
  • Visitor
21 Jan 2012 08:38 #16998 by grokhehe
Pyvcp With Python File was created by grokhehe
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..

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

More
21 Jan 2012 21:29 #17006 by cmorley
Replied by cmorley on topic Re:Pyvcp With Python File
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?

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

  • grokhehe
  • grokhehe's Avatar
  • Visitor
  • Visitor
23 Jan 2012 04:09 #17032 by grokhehe
Replied by grokhehe on topic Re:Pyvcp With Python File
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

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

More
23 Jan 2012 04:58 #17034 by cmorley
Replied by cmorley on topic Re:Pyvcp With Python File
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

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

Time to create page: 0.104 seconds
Powered by Kunena Forum