graphical user interfaces for embedded systems niall murphy panelsoft 1-day tutorial

16
Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Upload: angelina-dean

Post on 26-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Graphical User Interfaces for Embedded Systems

Niall Murphy

Panelsoft1-day tutorial

Page 2: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Purpose of tutorial

“...intended to introduce the programmer to the concepts required to design graphics software on embedded systems. Many of these systems use non-VGA graphics hardware, and since third party support may not be available the engineer may have to write the low level drawing routines as well as the application specific code.”

Page 3: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Hardware for Embedded Graphics

CPU + Screen + ControllerController

can constantly refresh the screen Video RAM can be on Controller built-in to screen / standalone / integrated

with processors (from 2 bit/pixel to full VGA)Bits and Pixels, Layers for effectsPerformance: commercial toolkits on 32

bit platform

Page 4: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Starting to Draw

Typical Primitives Dots (Pixels) Lines

Horizontal / VerticalSloped => Bresenham (fast and no floating point)

Boxes (outline or filled) Bitmaps Strings set Color

Page 5: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

More Flexible Drawing

Drawing Modes (XOR-invert, OR transp.)Context (foreground, background, mode,

penwidth) + functionsColor map (lookup table) + flash/animateClipping (post- usually in Controller HW)Antialiasing

in ES not at runtime in bitmaps prepared by desktop application

Dithering on high-res screens

Page 6: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Software Levels

Primitive LevelObjects (object draws itself, grouping)

shapes, interactive buttons etc.Polymorphism (manipulate lists of objects)

C: struct with common fields (area, color...) C++: inheritance

Containers in ES not as advanced as windows e.g. area for graph, buttons => list of objects

Page 7: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Refreshing the Display

why? modify object = modify datastruct, refresh screen later to combine updates

Moving an object (erase + redraw, tag “dirty”)

Refresh by object vs. by area (slow but overlapping objects allowed)

Page 8: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Touchscreens

Technology (short)Ergonomics

e.g. audio/visual feedback when button selected

Touch sensitive objects sensitive area bigger than object activate on release

Page 9: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Other topics

Memory management allocate static objects or during init.

Compound objects using a container or separate object type

Multiple Dialogs Moving Objects e.g. line graphFonts and bitmapsThird Party Toolkits

Page 10: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Designing UI Software for Embedded Systems

Niall Murphy

Panelsoft

class

Page 11: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Topics

Framework for input: event queueDevice driver (e.g. VCR) posts eventsApplication receives and processes eventsFocus (e.g. pointer to data)Callbacks (C: pointer-to-function)entry and exit functions for modesManaging the output (select visible info)Model-View-Controller Pattern

“in ES is code more integrated”

Page 12: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Graphics in ES: Assessing the Choice

Alex Wilson

Wind River Systems

class

Page 13: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Topics

Introduction HW more powerful and cheap => Graphical

UI affordable SW requirements of GUIs in ES: portability,

scalability, real-time operation etc.Core graphic requirementsChoice

Native GUI Java HTML (+ JavaScript / Java Applets)

Page 14: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Topics (continued)

Native GUI on top of 2D graphics library, in C/C++ windowing and widgets e.g. Windows CE, Zinc Native Graphical User Interface Decision

MatricsLack of portability (at least recompile/link)

Page 15: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Topics (continued)

JAVA Platform JVM solution to lack of portability characteristics of Java (API, packages...) different Java Platforms: PersonalJava,

EmbeddedJava (fig.) Java for Embedded Systems

features that make it well suited for ES (list)but issues: speed,...,not real-time!!!

Java Platform Decision Matrix

Page 16: Graphical User Interfaces for Embedded Systems Niall Murphy Panelsoft 1-day tutorial

Topics (continued)

HTML basic HTML for GUI + technologies for

dynamic pages Connectivity! JavaScript vs. Java Applets Web Thin Client Decision Matrix