A little description what data we need to transfer to the Teensy (TCD-Editor =
Teensy
Controlled
Display -
Editor ...)
1. Several pages will be possible
2. a page contains the following:
- page ID (unique)
- background image or CSS style
- optional title
- opt. page browser (first/prev/next/last)
- list of multiple control items
3. a control items contains the following:
- item ID (unique)
- (multiple) state images or CSS style (e.g. two images for "button pressed" and "button not pressed")
- (multiple) dynamic bitmap snippets to allow moved controls like knobs, sliders etc.
- label text (if not rendered in the image)
- getter/setter for "value" (value is the data represented by the item)
- validation for "value" (maxVal/minVal, zero pos, data type)
- methods to hide/show
- methods to add/remove
So there will be several steps of loading a new GUI (e.g. one page only):
- at first load the page data (id, image, text, pagebrowser)
- then add the items one by one (id, images, text)
- instanciate and arrange all items (the "sceleton" of the items must be implemented in the Teensy)
- start the "watchdog" (wait for items value changes or item value requests)
The essential will be a value change, which will result in a change on the screen - a switch toggles, a slider moves it's knob, a progressbar moves on etc.)
The communication between the operating Teensy and the TCD will be very lean (example for discussion):
Protocol description:
- "<command>" start/stop - starts or stops the reaction on commands
- "<command> <page ID> <item ID> <new value>" - "set_val pag2 but3 45" will write the value of button 3 to 45, showing page 2
- "<command> <page ID> <item ID> <new value>" - "get_val pag2 but3" will read the value of button 3 on page 2
- "<command> <page ID>" - "set_val pag3" will just change the page
- "<command> <page ID> <item ID>" - "hide pag3 slid3" will hide the Slider slid3 on page 3 (show will do the opposite)
With this little set of commands I believe we may create already good displays!
One question: is the Teensy powerfull enough to render a fast turning arrow by itself? (Drawing routines or small bitmap rotated in real time)?
Let's start to brainstorm ...
... and we need to define the data structure to be loaded into the Teensy ...