LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Note: This is a time-line of PyVCP development and perhaps not a good introduction to the current pyVCP for a beginner. The [Integrator Manual] contains a better introduction to pyVCP (HTML format here: http://www.linuxcnc.org/docs/2.2/html/hal_pyvcp.html)

To Do

2007 02 13

A big DRO from Goslowjimbo

upload:goslowjimbodro.png maybe it doesnt look too big here, but it was 1180x974 on my system!

jmkasunich talks about the technique used

the way it works is:
 loadusr runs and starts pyvcp
   loadusr -W means it waits until pyvcp is _started_
 then it continues with your hal script (link commands)
 then after everything is set up, it hits waitusr
  and waits for pyvcp to exit
 when you are all done (20 mins later, or whatever), you close pyvcp
  and the waitusr stops
 at that point halrun cleans up everything

here's the file's needed
  1. upload:pyvcp-dro2.hal
  2. upload:pyvcp-dro.xml

for a different way to get a large DRO in AXIS, modify the coordinate display font as shown here: http://linuxcnc.org/docs/devel/html/gui_axis.html#r1_11_2

lots of new stuff (1Feb2007)

Jepler and Tomp have been busy enhancing pyvcp. At least the following things are new:

code snippets for many widgets can be found here http://linuxcnc.org/docs/2.2/html/hal_vcp.html

Here's a sample grid layout: upload:pyvcp-table-labelframe.png

Tabs widget by Jepler

new Dial widget (21jan2007)

tomp has contributed a new Dial widget. Dial looks similar to jogwheel, but its output is a FLOAT, and the resolution (how much the output changes per 'tick') can be changed. The mouse-bindings are currently:

Started on documentation (11jan2007)

There is now a bit of text about pyVCP and some screenshots in the [Integrator Manual]

The pyVCP text from the manual is now also available in HTML format at http://www.linuxcnc.org/docs/2.2/html/hal_vcp.html

new widgets: Jogwheel and Meter (9jan2007)

Jogwheel is a round thing which reacts to both the mouse-wheel, and dragging with the mouse. It outputs a HAL_FLOAT corresponding to the wheel position. Markup like this:

            [ <cpr>33</cpr> ]                       (counts per revolution)
            [ <halpin>"myjogwheel"</halpin> ]
            [ <size>300</size> ]

Meter resembles an analog voltmeter, and is used to display the value of a HAL_FLOAT:

            [ <size>300</size> ]
            [ <halpin>"mymeter"</halpin> ]
            [ <text>"My Voltage"</text> ]
            [ <min_>-22</min_> ]
            [ <max_>123</max_> ]

a note on BIG fonts (8jan2007)

For a DRO, you might like really big fonts. The maximum size of a font is predetermined by what X fonts you have installed, the phase of the moon etc. etc.

It looks like a standard font like 'Helvetica' or 'Arial' or 'Roman' wont show as the correct size when trying to size it abouve 40-50 or so.

On the standard Ubuntu 6.06 install which most EMCers use 'courier 10 pitch' seems to be a font that's available in big size. So for a big label or number widget you might specify:

 <font>('courier 10 pitch',100)</font>

also see here for how to modify the coordinate display font in AXIS: http://linuxcnc.org/docs/devel/html/gui_axis.html#r1_11_2

new widget: Radiobutton (7jan2007)

will create a radiobutton which sets one of the defined BITs true. The pins in the example will be named

new syntax for calling pyVCP (4jan2007)

The syntax is now
 pyvcp -c halcomp_name myfile.xml
and the created hal pins will be named with the prefix halcomp_name, i.e. halcomp_name.led halcomp_name.number etc.

This also means that it's possible to simultaneously open two or more panels if you want to:

 pyvcp -c mypanel1 myfile1.xml
 pyvcp -c mypanel2 myfile2.xml
ans so on.

running pyVCP standalone (3jan2007)

It's now possible to run pyVCP both as a part of AXIS (see instructions below), and standalone.

running pyVCP standalone might be useful when developing a new panel (you don't want to start and restart emc every time to see the effect of changes in the XML), or for RT applications where only HAL is required (simple DRO display etc.)

to run standalone enter the command

 pyvcp myfile.xml
that will create a pyvcp panel with the widgets described in myfile.xml

new jognumber widget (2jan2007)

A jognumber controls a HAL_FLOAT. When you point the mouse over the jognumber and spin the mouse wheel the number will increment or decrement by a set value(=resolution)

running pyVCP from the .ini file (2jan2007)

The latest HEAD now supports running pyVCP with AXIS by specifying:
 PYVCP = your_pyvcp.xml
in the [DISPLAY] section of the ini file.

You can also run a HAL file after the GUI has started by specifying:

 POSTGUI_HALFILE = hookup_pyvcp_pins.hal
in the [HAL] section of the ini.

This is demonstrated in the sim/lathe config which shows the spindle speed with a pyVCP bar widget. It looks like this: upload:lathe_sim_pyvcp.png

integrating pyVCP with AXIS (1jan2007)

jepler made some small changes to vcpparse.py (http://pastebin.ca/299178), and suggested the following content for ~/.axisrc:
 import vcpparse2
 f = Tkinter.Frame(root_window)
 f.grid(row=0, column=4, rowspan=6)
 vcpparse2.create_vcp(f, comp)

This way we can get the pyVCP widgets alongside AXIS!: upload:axis_pyvcp.png

pyVCP with an XML file controlling layout (29dec2006)

Here's a development of the pyVCP idea. The widgets and their placement are specified in an XML file, and there's a parser which reads through the XML file and generates the pyVCP widgets. upload:pyvcp2.png

wiki uploads are still not working for me so I use pastebin:

To see that I am not fooling you, here are the HAL pins generated from the example above:


pyVCP (28dec2006)

a first trial at generating Tkinter widgets that are connected to HAL pins:


upload:pyvcp.py is a linbrary of widgets that are basically inherited from Tkinter, but the HAL functionality has been added

upload:pyvcp_test.py is a test program that will generate the screenshot shown above

upload:mpvcp.xml example of XML file(20jun2011)

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited June 22, 2011 10:30 am by Piasdom (diff)
Published under a Creative Commons License