Extending AXIS with pyVCP

Maybe the most popular GUI for EMC is called AXIS. It shows a number of useful buttons, the 3D view, G-code file view etc. But depending on machine configuration and hardware, users might want to display different things on the screen and have customized controls. There's been some previous work on virtual control panels, or VCP. That was done in C using GTK widgets which I am not at all familiar with... I really want this kind of control panel for the new mill setup, so I've put together two Python programs that create Tkinter widgets that are connected to HAL pins. I call it pyVCP (Python Virtual Control Panel). Here's the first test from yesterday:


The uppermost widget is a slider that controls a HAL_FLOAT. Next is a button which sets a HAL_BIT true when pressed. The small rectangle is a checkbutton, which stays down when pressed, also for controlling a HAL_BIT. The status of a bit can be shown with a LED (red circle). HAL_FLOAT values can be indicated either by bars (green), or as a number.

To enable users to individually configure their extra bells and whistles it makes sense to have a text file that describes the panel setup. The easiest way I found to read and write structured data in Python was XML. Here I've used a number of the different widgets and ways to pack them to demonstrate what's possible:

Finally the best part. Since AXIS is also written in Python/Tkinter, AXIS author Jeff Epler was quickly able to integrate my work with the current AXIS, so you can have your custom control panel right next to the familiar view:

There's a bit more (including source files) in the EMC Wiki, and the latest versions are committed to CVS.