Part 2

Creating a Simple Panel

Simple Panel

  1. Open Glade Interface Designer from the Applications > Programming menu. The first thing you see is the Set options in your project and nothing needs to be changed so just click on Close.

    images/gladevcp-02-01.png
  2. Next you have a blank project. On the left side of the Interface Designer is the palette which contains the widgets that can be used to build a user interface. Scroll down to make sure you see the HAL Python and EMC Actions groups. Create the directory gladevcp1 in the linuxcnc/configs directory and save your project as gladevcp1.

    Your project should look like this now.

    images/gladevcp-02-02.png
  3. The first thing you need is a Toplevel Window so in the palette click on Window in the Toplevels group.

    Your project should look like this now.

    images/gladevcp-02-03.png
  4. Next put a Vertical Container into the widow with 2 items.

    Your project should look like this now.

    images/gladevcp-02-04.png
  5. Next put a HAL Meter in the lower container and a HAL LED in the upper container.

    1. I changed the HAL LED Pick off color: to Red: 255, Green: 255, Blue: 255 using the color picker box on the right side or you can just type in the color with #ffffffffffff.

    2. I changed the Pick on color: to Red: 0, Green: 255, Blue: 0, to just type it in use #0000ffff0000

    3. I changed the the hal_meter1 Major scale: to 250 and the Max: to 3000.

    Your project should look like this now.

    images/gladevcp-02-05.png
  6. Now we need to test run our panel and in order to do that we need to add the following files to our linuxcnc/configs/gladevcp1 directory. Look in the gladevcp1.ini file in the [DISPLAY] section to see the ini entries I used to embed our panel into a tab in Axis.

  7. From the Applications > CNC menu run LinuxCNC and navigate to the gladevcp1 configuration and pick that one to run.

    Your Axis GUI should look like this now.

    images/gladevcp-02-06.png

Now that we have created and embedded our panel into Axis, next we will explore the python and HAL connections needed to make it actually do something.