packageFunctions

Text/display helpers and path resolution (no C state)

Extends from Modelica.Icons.FunctionsPackage (Icon for packages containing functions).

Contents

NameDescription
StringToCharCodesConverts the first n characters of s into ASCII codes (0-255), padded with spaces (32) if s is shorter - shared helper (independent of PyRuntime) for the character-by-character display on Peripherals.Display, see requirements.md decision Périphérique d'affichage pédagogique
ResolvePathResolves a URI (modelica://..., file://...) into a file path, and returns any other path unchanged (relative: resolved later from the simulation folder) - loadResource fails on an empty string or a plain path, hence this sorting, see requirements.md decision Système de fichiers
DisplayMessageMessage i (1 = the oldest) of a payload of the display link (messages separated by line feeds)
DisplayMessageCountNumber of messages in a payload of the display link (messages separated by line feeds)
PreviousMessageCodesASCII codes of line 2 of a 20x2 display after k new messages: the message before the last when k >= 2, otherwise the former line 1
ScrollTextWrites the k last messages of a payload on a large text screen, one line each: under the last written line, then scrolling up once the screen is full
LogDisplayMessagesWrites the k last messages of a payload of the display link in the simulation log, one line each, and returns k - to be assigned to a variable, so that the call survives the initialization