GUI Module Integration
31 October 2008, 09:00 by Chad Reynoldson
GUI module development is often over-looked during the development phase. It is not merely a mechanism to write some test code for the comm module. On the contrary, it can be more important than the comm module. If the GUI fails to be intuitive, than it brings down the entire system.
It is important to point out to module developers that 99% of the time, the GUI they create is simply dropped into an existing touch panel with as few changes as possible. This may seem irresponsible , but it is a fact. After all, we are probably using a module for one of two reasons: 1) We cannot get our hands on the device protocol, or 2) We wish to save time by using some existing code. Note that in either case, we can’t or don’t want to learn too much about a device, we just want to “drop it in”, just like it was sold.
Now you should start to see why the GUI module is extremely important to get right.
Now that you understand the copy/paste nature of consuming modules here are some ways to make them easier to integrate.
First up, wrap all of the module parameters and definitions in an include file. It is much easier to “drop in” an include file and define it. Also, this isolates it from the rest of the code base.
Next, don’t define GUI buttons as integer arrays and pass them into the GUI module (see Button Arrays). This may seem like a brilliant idea and one that promotes customization. But if you view this is a “drop it in” approach, you will see that the programmer is not going to be changing channel codes on individual buttons. The programmer will copy/paste the pages/popups, do a CTRL-A and select all buttons, then change the device number (not the channel number).
Next, write a GUI module to support an array of touch panels, and not a single panel. Again, considering the “drop it in” approach, the designer is going to minimize work and develop all of the GUIs the same anyway. There are some code design issues to consider here (GUI array sizes for example) but you do take back more control of GUI execution within netlinx.
Finally, please read my previous article on modules playing nicely. There are some good tips.
Comments
Comments are turned off for this article.
