modelPartialTextDisplay

Behaviour of the large text screens: each message received through displayLink is written under the last written line, the screen scrolls up once full

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

TypeNameDefaultDescription
IntegernLinesNumber of lines of the screen - fixed by the extending display, consistent with its generated icon
BooleanlogReceivedtrueAlso write each received message in the simulation log (turn off when several displays share the same link, to avoid duplicate lines)
IntegernColsInterfaces.TEXT_DISPLAY_COLSNumber of columns

Connectors

TypeNameDefaultDescription

Components

TypeNameDefaultDescription
Integer[nLines*nCols]textCodeASCII codes shown on the icon, line after line: line i, column j at index (i - 1)*nCols + j
IntegerfilledNumber of lines written so far (at most nLines)