How do they code the logic of a user interface running on embedded hardware. Microwave ovens, flat screen televisions, portable DVD players and even a digital watches these days have complex user interfaces. Are there tools / frameworks available to remove all the dirty work or are the developers using IF ELSE kind of constructs.
I’m not asking for user interface toolkits in the sense of QT or WxWidgets. I am more interested in knowing if there are frameworks to handle the logic behind the controls.
if (mTemperature > maxTemperature)
temperatureDialControl.Enabled = false;
I’ve used the Quantum Platform family of frameworks from Quantum Leaps for several embedded products with user interfaces (and those without UIs as well).
The QP is a framework for event-driven programming (which essentially all embedded systems are). User interfaces in particular are a good match, because most user interfaces consist of “widgets” which can be customized, and the widgets typically receive events (timeout, button press, movement, etc.) from an event dispatcher. This “inversion of control” is very typical with user interfaces. Most (embedded) user interfaces that I’ve come across in my career are either event-driven state machines, or they should have been implemented that way.
You asked specifically about handling the logic & controls. What’s nice about the QP is that the active-object model of computing that it embraces lends itself to very natural & straightforward implementation of state machines (flat or hierarchical). So in your example above, you’d probably receive a “temperature update” event with a new temperature, and your state handler would perform the logic & decide what action is necessary. With a framework, you create the logic behind the controls, but the infrastructure handles almost everything else.
The Quantum Platform is pretty slick. It’s also very easy to see the connection (traceability) between the design (statechart) and the implementation/code. Best of all, the framework implements all the infrastructure (event queueing & dispatching, state transitions, garbage collection, memory pools, etc..) so all you have to do is focus on your application.
I’ve used Nokia’s Qt on non-embedded platforms, but your question seems to suggest you’re already aware of it. I think there’s a smaller “embeddedable” version of Qt but I’ve never used it.