Project54 marktaipan on 29 Oct 2007 01:41 pm
XML Defined GUIs for Project54
Hello eceblogger readers!
My name is Mark Taipan, an undergraduate student here at Project54, http://project54.unh.edu/, and for the past few months, my colleague Matthew Lape and I have been working on creating a Project54 application that utilizes an XML script to define its GUI. Normally with Project54 application GUIs, one would have to define the user interface exclusively with C++. While this method works, it does have its drawbacks when developing an application for Project54. XML defined GUI scripts solve these problems and also present some advantages over the “older style” of developing Project54 application GUIs.
Markup languages such as XML, www.xml.com, identify structures within documents. These structures indicate the role of the content (such as text, images) within the document. While XML can be used for many different purposes such as building websites or Microsoft using it with the new file formats for Office 2007, Project54 utilizes XML as a way to define a GUI using a set of its own Project54 XML elements.
Prior to using XML to define a Project54 GUI, Project54 developers had to implement the GUI within the application code. Like changing functionality to the application, if a component of the GUI needed to change, the developer would have to rebuild the .dll. While this may not be a problem during the development phase of the application, once this application has been released the application GUI’s appearance and functionality could not be changed until the next Project54 release. However, with the new XML GUI framework, users now can change the GUI appearance and to an extent, the functionality without having the need to rebuild the .dll. Thus, the interface to the Project54 application can be custom-tailored to fit a user’s needs.
To learn more about utilizing XML elements in Project54, refer to the following technical papers:
- XML Elements for Defining GUI Screens for Project54 Applications
- GUI Interface for Project54 Applications Using XML Defined GUI Screens
- Developing Project54 Applications that Utilize the XML GUI Interface
- XML Elements for Defining Virtual Application Screens for the Project54 MultiApp Application
Below is an example of the differences between developing a Project54 GUI in XML and C++. The first image is a small part of the GUI to a radar application depicting a set of range setting status lights. The next two sections are the equivalent code in C++ and XML used to define these status lights for the GUI. Functionality is not implemented with just this code, but rather this code creates the objects on the screen according to the colors, text, and positions defined.
Project54 Radar Application GUI - Range Status Lights

C++ GUI Code
static int hsl_range_1;
static int hsl_range_2;
static int hsl_range_3;
static int hsl_range_4;
static int hsl_range_5;createStatuslightControl(hwRadGUI, 31, 65, L”1″, &hsl_range_1);
createStatuslightControl(hwRadGUI, 39, 65, L”2″, &hsl_range_2);
createStatuslightControl(hwRadGUI, 47, 65, L”3″, &hsl_range_3);
createStatuslightControl(hwRadGUI, 55, 65, L”4″, &hsl_range_4);
createStatuslightControl(hwRadGUI, 63, 65, L”5″, &hsl_range_5);setSLColors(hwRadGUI, hsl_range_1, GREEN, GRAY, BLACK);
setSLColors(hwRadGUI, hsl_range_2, GREEN, GRAY, BLACK);
setSLColors(hwRadGUI, hsl_range_3, GREEN, GRAY, BLACK);
setSLColors(hwRadGUI, hsl_range_4, GREEN, GRAY, BLACK);
setSLColors(hwRadGUI, hsl_range_5, GREEN, GRAY, BLACK);
XML GUI Code
<device x=”0″ y=”0″ id=”range”>
<lightset x=”31″ y=”65″ id=”range_statusLights”>
<light x=”0″ y=”0″>
<text>1</text><textcolor>BLACK</textcolor>
<oncolor>GREEN</oncolor><offcolor>GRAY</offcolor>
</light>
<light x=”8″ y=”0″>
<text>2</text><textcolor>BLACK</textcolor>
<oncolor>GREEN</oncolor><offcolor>GRAY</offcolor>
</light>
<light x=”16″ y=”0″>
<text>3</text><textcolor>BLACK</textcolor>
<oncolor>GREEN</oncolor><offcolor>GRAY</offcolor>
</light>
<light x=”24″ y=”0″>
<text>4</text><textcolor>BLACK</textcolor>
<oncolor>GREEN</oncolor><offcolor>GRAY</offcolor>
</light>
<light x=”32″ y=”0″>
<text>5</text><textcolor>BLACK</textcolor>
<oncolor>GREEN</oncolor><offcolor>GRAY</offcolor>
</light>
</lightset>
</device>
Mark Taipan

on 06 Nov 2007 at 7:49 am 1.Andrew Kun said …
So how long did it take you to create a GUI using the XML GUI code?
Andrew Kun
on 07 Nov 2007 at 9:44 pm 2.marktaipan said …
Well, considering that it was the first real Project54 application I’ve created let alone learning how to build a GUI using the XML elements it took me roughly a day or so to make a GUI. What I can say though is that once familiar with the XML elements, the overall development of the application will be much faster using the new XML framework than using the older format.
There are a few reasons to why this is the case, some directly related to XML and some related to the new Project54 base files. Once you know what elements you need and how they interact with the application and since XML is in most instances more human-readable than C++, it becomes naturally easier to develop the GUI. Also, the structure of the elements (i.e. the different tiers of elements - how there are parent elements with child elements that correspond with the parent) allows a more logical development flow to creating the GUI and making it interact with the application.
As for the non-XML related advantages, the new Project54 base files will automatically handle feedback messaging and grammar creation. From what I’ve heard, these are two big parts of the application that can sometimes be a nuisance when developing the application with C++. Thus, with these advantages with the new Project54 XML framework, I believe that developers can create not just GUIs more quickly, but also the applications themselves.
Mark Taipan