modelPartialTextDisplay
Information
Base class of Peripherals.Display4x32 and Peripherals.Display8x32: the logic only. It is extended by the generated icon classes (Internal.Icons.TextIcon4x32, Internal.Icons.TextIcon8x32), which the displays extend in turn: the names used by a DynamicSelect are resolved in the class that carries the icon, so textCode must be in scope there.
At each message (change(displayLink.seq), i.e. each line sent by machine.Display(0).write(), or initial() for a message written by the program before its first sleep(), during the initialization; several messages of the same instant arrive together, one per line of displayLink.payload, and are written in turn by Internal.Functions.ScrollText): while the screen is not full, the message is written on the first free line, under the last written one; once all nLines lines are written, every line moves up by one and the message takes the last line, like a terminal. The text is converted into ASCII codes over Interfaces.TEXT_DISPLAY_COLS columns by Internal.Functions.StringToCharCodes from each message of displayLink.payload (the 20-column displayLink.charCode of Peripherals.Display is not used): a longer message is truncated on the icon, the full text stays in the simulation log when logReceived is true.
The screen starts empty: at initial(), it takes a message only if the program has already written one (nNew > 0).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nLines | Number of lines of the screen - fixed by the extending display, consistent with its generated icon | |
| Boolean | logReceived | true | Also write each received message in the simulation log (turn off when several displays share the same link, to avoid duplicate lines) |
| Integer | nCols | Interfaces.TEXT_DISPLAY_COLS | Number of columns |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Interfaces.DisplayLinkInput | displayLink | To be connected to MCU.Display0 (connect(mcu.Display0, display.displayLink)) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Integer[nLines*nCols] | textCode | ASCII codes shown on the icon, line after line: line i, column j at index (i - 1)*nCols + j | |
| Integer | filled | Number of lines written so far (at most nLines) |