Embedded textual LCD / keypad type UI RAD authoring / libraries? - Page 1
Forum section: electronics / general

author: evb149
author_rank: Regular Contributor
timestamp: July 19, 2016, 04:32:08 am
content: Hi all,I'm wondering what you might suggest for free tools and techniques to write embedded textual (non graphical) UIs on systems having things like multi-line character LCD screens, non-full keyboard keypads like number pads / discrete buttons / button oriented touch screens etc. Like maybe a vending machine or irrigation controller or credit card terminal or such kind of thing.Obviously it is fairly simple (but tedious) to hardcode such a UI by embedding the screen control and input event processing into application specific manually written UI state machine code and you'd end up with something like an old "curses" (UNIX) type application.That is fine but it seems a little primitive by today's standards where most UIs can be created by RAD tools and easily authored / "emulated" on PCs and then the code or at least the configuration data for the text / UI state flow generated by the authoring tool.So with certain authoring / application platforms one might use something like Microsoft Expression Blend, QtCreator, technologies like QML, XAML, WML, UML and their authoring programs, and create some kind of code from the RAD UI generator program or some UML tool to create the UI state flow model and probably bind that to the UI event / output data as well, maybe ending up with some ad-hoc generated application code or maybe some MVC type of framework with application specific UI data bound to it. Obviously there are similar authoring systems for things like FLASH etc.Hyper card authoring or interactive web page authoring could be similar in many respects.But when the target UI input devices are are embedded sorts of things that require some unique input processing besides raw HID data, and the output display is more minimal more like a serial terminal (like WML or curses might target), what's a good way to implement such a UI besides the "ad hoc" manual way or one step up and maybe manually doing UML for the whole thing followed by conversion of that model to data + code?What more modern and free UI libraries / authoring tools / methodologies can one use to target such embedded systems applications most easily to facilitate PC based authoring / preview and have the code/data end up useful to port to an embedded system?I've seen libraries like emWin but AFAIK that's not quite what I'm looking for (due to high cost and also not really oriented to my desires as far as I recall), I'm more wondering how one would use closer to "PC / web application normal" GUI / RAD / WYSIWYG hypertext page authoring tools and end up going through something like XML/WML/XAML/QML/UML or whatever to end up with something that is perhaps basically generated code / "database" (or hardcoded string atoms?) and MVC / other state machines in C or Python or something that's suitable for an embedded target.Rendering HTML pages as UI on the target seems a bit too heavyweight (though maybe WML or SIMPLE HTML/SGML might work if using some kind of super minimal rendering library) so more something that could translate into some kind of C/C++/Python MVC or whatever application with something more like a "curses" library backend might be more like it.What do you use in cases that are a few steps up from trivial but a few steps down from where you'd use an embedded GUI library stack based / or HTML UI? Particularly in cases where you might want to change the UI to customize it for various variant use cases and one would rather not just code it all manually if possible for every sort of change.Seems like there ought to be some good TUI libraries / toolkits / authoring tools.Or if the target was to support some kind of simple HTML based UI, what's a good option to render that to a text screen model and maybe handle HID UI and such events to send them back to some kind of XFORMS or whatever control stream back to the input processing view controller?Edit: I guess an XML and maybe some kinds of XFORMS or similar system would work fine for encoding the target's output text and maybe also representing what kind of inputs are expected / required and how they should be processed (input events triggering some kind of XQUERY or other scripting to change the UI state and then emit the new state's XML view data...? But even if XML or JSON or whatever was used to encode the UI MVC system how does that translate to what is easy to generate and author on a PC without writing a customish web application / application for the purpose?

author: MosherIV
author_rank: Super Contributor
timestamp: July 19, 2016, 06:52:22 am
content: HiI do not know of any library that does what you describe. I would suggest writing your own text/menu engine based on state machines. Something that embedded developers have been doing for years.Just a quick note about XML parsers in embedded enviroments, most embedded processors have very little memory and most XML parsers want to load the entire XML object into memory, so they will fail. In embedded it is best to use an XML line parser. That means that you also have to deal with XML differently because the parser can only read lines not whole sections.In addition, another trick that software programmers have been doing for ages, is to use string references to strings in a table to deal with multi-language, just switch string table to change to another language (but the string reference stays the same)

author: MosherIV
author_rank: Super Contributor
timestamp: July 19, 2016, 10:16:59 pm
content: It is possible to dvelop a combination of both. I developed a system where the menus were defined in tables in a header file, adding or changing a menu item just meant changing the tables.In the same system, we save the settings in a xml file. When the system started, it had to load and parse the xml file and restore the settings.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 20, 2016, 11:51:52 am
content: Quote from: evb149 on July 19, 2016, 04:32:08 amSo why not those? You can use Expression blend on a XAML based UWP app on Win 10 IoT, and run it a RPi2 with a HDMI display and USB keypad?The same is possible running a linux distro with Qt?It isn't as small and tight in memory as say an emWin project, nor a proper realtime environment in comparison to running on a dedicated micro but it's not a bad trade off for flexibility. Just have to separate realtime requirements and put those in a small micro.

author: rstofer
author_rank: Super Contributor
timestamp: July 20, 2016, 02:24:37 pm
content: Quote from: engineer_in_shorts on July 20, 2016, 11:51:52 amI'm coming around to the idea that all HMIs should be based on the RPi. Every feature that seems desirable is already included: graphics, touchscreen (I haven't tried this), keyboard, mouse, literally every kind of hardware/software that could be required, even networking. There is, relatively, an enormous amount of computing power for validating the user actions. The output of the RPi can be a simple SPI link to the control processor - the MCU that does the actual process control.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 20, 2016, 02:29:45 pm
content: Incidentally we are incorporating RPi and Win10 IoT into our product for this specific reason, added by the fact that the company already has .NET coders for PC apps. It's a high value, low volume product so we don't have to get every last cent out of the design. But development time is more important.The I part of Win 10 IoT is not being used at all, the RPi is not networked.