'------------------------------------------------------------------------------------------------------------------------------ ' JMS ISA LCD Matrix - Umgeschrieben für die HHA LAWO '------------------------------------------------------------------------------------------------------------------------------ ' ' Lizenz: CC BY-NC ' Autor: Teneberus ' ' 20.08.2018: Version 1.2 ' - Wechselziele sind nun erweitert über vier Zeilen möglich (Font zwei / Seite Zwei) ' - Der bekannte Befehl *B in der .hof ist in allen möglichen Kombinatioen im Script möglich ' - Setvar: Switchen zwischen ISA Fonts und Krüger Fonts möglich ' 13.04.2018: Version 1.1 ' - Bei zweizeiligen Zielen kann die zweite Zeile nicht mehr größer geschrieben werden als die erste. ' - Die Liniennummer wird erst eine Sekunde nach dem Zieltext geändert. ' - Unterstützung von Wechselzielen ' Wechselziele für "x" sind in der Hofdatei unter "x + 10000 + n * 1000" einzutragen. ' 27.11.2016: Version 1.0 ' - KI, Seitenschild, Steckschild von Marcel Kuhnt (übernommen aus der Original OMSI 2 Krüger Matrix) ' - Rest von Teneberus ' ' Verwendet: Cockpit (Batterietrennschalter) 'IBIS '------------------------------------------------------------------------------------------------------------------------------ ' Initialisierung '------------------------------------------------------------------------------------------------------------------------------ {macro:Matrix_init} 0 (S.L.Matrix_Modul) 0 (S.L.Matrix_Cursor) 0 (S.L.Matrix_Status) -1 (S.L.matrix_steckschild_Termindex) 0 (S.L.matrix_steckschild_vis) {end} '------------------------------------------------------------------------------------------------------------------------------ ' Hauptteil (Frame) '------------------------------------------------------------------------------------------------------------------------------ {macro:Matrix_frame} ' Übergabe von dem Elektrik Wert, für eigene Funktion der Elektronik der Matrix (L.L.elec_busbar_main) {if} 1 (S.L.Matrix_elec) {endif} ' Timer für verzögerte Darstellung von Liniennummer, Ziele und Wechselziele: 3 (S.L.Matrix_PageDuration) ' Fonts "aesys_8_1" (M.V.GetFontIndex) (S.L.Font_8_1) "aesys_8_1_F" (M.V.GetFontIndex) (S.L.Font_8_1B) "aesys_16_0" (M.V.GetFontIndex) (S.L.Font_16_0) "aesys_16_0_F" (M.V.GetFontIndex) (S.L.Font_16_0B) "aesys_16x6_num" (M.V.GetFontIndex) (S.L.Font_16x6) ' Zielcodetabelle: "Linienlisten\" (L.$.yard) "_ANX.jpg" $+ $+ (S.$.Matrix_Linelist) (L.L.Matrix_Status) 1 = {if} ' Schritt 1: Speicherbitmap mit neuen Daten beschreiben (oder Bitmap laden). ' Initialisieren der Bitmap: 0 (M.V.STNewTex) 0 (M.V.STLock) ' Setzen der Farbe: 0 0 255 0 0 (M.V.STSetColor) ' Bitmap beschreiben: ' Front: 0 (S.L.Matrix_Modul) (M.L.Matrix_SetCoords) (M.L.Matrix_WriteNr) (M.L.Matrix_WriteTerminus) ' Linie: 1 (S.L.Matrix_Modul) (M.L.Matrix_SetCoords) (M.L.Matrix_WriteNr) ' Ziel: 2 (S.L.Matrix_Modul) (M.L.Matrix_SetCoords) (M.L.Matrix_WriteNr) (M.L.Matrix_WriteTerminus) ' Entsperren der Bitmap: 0 (M.V.STUnlock) 2 (S.L.Matrix_Status) {endif} (L.L.Matrix_Status) 2 = {if} ' Schritt 2: Texturen für die Bearbeitung sperren. 0 (M.V.STLock) 1 (M.V.STLock) 0 (S.L.Matrix_Modul) 3 (S.L.Matrix_Status) {endif} (L.L.Matrix_Status) 3 = {if} ' Schritt 3: Pro Frame eine Anzeige auf die Haupttextur übertragen. (M.L.Matrix_SetCoords) (M.L.Matrix_PrintBitmap) (L.L.Matrix_Modul) 1 + (S.L.Matrix_Modul) (L.L.Matrix_Modul) 2 > {if} 4 (S.L.Matrix_Status) {endif} {endif} (L.L.Matrix_Status) 4 = {if} ' Schritt 4: Textur entsperren und filtern. 0 (M.V.STUnlock) 1 (M.V.STUnlock) 1 (M.V.STFilter) ' Nochmal sperren, entsperren, filtern... Sonst wird die neue Textur nicht angezeigt. 1 (M.V.STLock) 1 (M.V.STUnlock) 1 (M.V.STFilter) ' Alles zurücksetzen: 0 (S.L.Matrix_Modul) 0 (S.L.Matrix_Cursor) 0 (S.L.Matrix_Status) {endif} (L.L.Matrix_Status) 0 = (L.L.elec_busbar_main) && {if} (L.S.TimeGap) (L.L.Matrix_Timer_Wechsel) + (S.L.Matrix_Timer_Wechsel) (L.L.Matrix_PageDuration) > && {if} ' Prüfen ob sich die Liniennummer ändern soll. Wenn ja: Mit Schritt 1 beginnen. ' Neuer Liniennummerncode? (L.L.IBIS_Linie_Complex) (L.L.Matrix_Nr_Last) = ! {if} (M.L.Matrix_CreateNr) 1 (S.L.Matrix_Status) {endif} ' Über Menü oder von AI geändert? (L.$.Matrix_NrAI) (L.$.Matrix_Nr) $= ! {if} (L.$.Matrix_NrAI) (S.$.Matrix_Nr) 1 (S.L.Matrix_Status) {endif} ' Prüfen ob sich der Zieltext ändern soll. Wenn ja: Mit Schritt 1 beginnen. ' Zielwechsel bei Wechselzielen? (L.L.Matrix_TerminusCode) 10000 >= {if} (M.L.Matrix_CreateTerminus) 1 (S.L.Matrix_Status) {endif} ' Neuer Zielcode? (L.L.IBIS_TerminusIndex) (L.L.Matrix_TerminusIndex_Last) = ! {if} (L.L.IBIS_TerminusIndex) (M.V.GetTerminusCode) (S.L.Matrix_TerminusCode) (M.L.Matrix_CreateTerminus) (M.L.matrix_refreshIntIndex) 1 (S.L.Matrix_Status) (L.L.IBIS_TerminusIndex) (S.L.Matrix_TerminusIndex_Last) {endif} 0 (S.L.Matrix_Timer_Wechsel) {endif} {endif} (L.$.Matrix_Nr) "DB" $= {if} "}" (S.$.Matrix_Nr) {endif} (L.$.Matrix_Nr) 2 $SetLengthL "SB" $= {if} "]" (L.$.Matrix_Nr) 2 $cutBegin $+ (S.$.Matrix_Nr) {endif} (L.$.Matrix_Nr) 2 $SetLengthL "CE" $= {if} "{" (L.$.Matrix_Nr) 2 $cutBegin $+ (S.$.Matrix_Nr) {endif} (L.$.Matrix_Nr) 2 $SetLengthL "NE" $= {if} "\" (L.$.Matrix_Nr) 2 $cutBegin $+ (S.$.Matrix_Nr) {endif} (L.S.TimeGap) (L.L.Matrix_Timer_an) + (S.L.Matrix_Timer_an) (L.L.Matrix_PageDuration) > (L.L.Matrix_Status) -1 = && (L.L.elec_busbar_main) && {if} ' Matrix mit aktuellen Daten beschreiben, wenn Versorgung hergestellt wird. ' (Beginn mit Schritt 2 - Übertragung der Speicherbitmap auf die Haupttextur.) 2 (S.L.Matrix_Status) 0 (S.L.Matrix_Timer_an) {endif} (L.S.TimeGap) (L.L.Matrix_Timer_aus) + (S.L.Matrix_Timer_aus) (L.L.Matrix_PageDuration) > (L.L.Matrix_Status) 0 = && (L.L.elec_busbar_main) 0 = && {if} ' Versorgung fehlt: Anzeige löschen. 1 (M.V.STNewTex) -1 (S.L.Matrix_Status) 0 (S.L.Matrix_Timer_aus) 0 (S.L.Matrix_elec) {endif} (L.L.matrix_refresh_seitenschild) {if} "..\..\Anzeigen\Seitenschilder\" 2 (M.V.GetDepotStringGlobal) $+ "\" $+ (L.$.Matrix_Nr) $RemoveSpaces $+ ".bmp" $+ (S.$.Matrix_Seitenschild) 0 (S.L.matrix_refresh_seitenschild) {endif} {end} '------------------------------------------------------------------------------------------------------------------------------' ' Trigger: KI, Seitenschild, Steckschild ' '------------------------------------------------------------------------------------------------------------------------------' {trigger:ai_scheduled_settarget} ' Stromversorgung herstellen: 1 (S.L.elec_busbar_main) ' Hier wird die Nummer eingestellt: (L.$.SetLineTo) (S.$.Matrix_NrAI) ' Hier wird das Ziel eingestellt: 1 (S.L.elec_busbar_main) (L.L.AI_target_index) s0 (M.V.GetTerminusCode) s1 ' Wenn der Terminus-Code größer als 1000 ist, dann bitte Steckschild verwenden: 1000 > {if} l1 1000 - (S.L.matrix_steckschild_index) l0 (S.L.matrix_steckschild_Termindex) ' Matrix auf 0: 0 (S.L.IBIS_TerminusIndex) s2 {else} l0 (S.L.IBIS_TerminusIndex) s2 -1 (S.L.matrix_steckschild_Termindex) -1 (S.L.Matrix_TerminusIndex_Last) ' Wenn der Bitmap-String in Verwendung ist, dann den als Integer interpretieren und ' Steckschild zusätzlich setzen: l0 6 (M.V.GetTerminusString) $StrToFloat s1 l1 1000 > {if} l1 1000 - (S.L.matrix_steckschild_index) l0 (S.L.matrix_steckschild_Termindex) {endif} {endif} (M.L.matrix_setsteckschild) l2 (M.V.GetTerminusCode) (S.L.IBIS_TerminusCode) 1 (S.L.matrix_refresh_seitenschild) {end} {trigger:matrix_seitenschildklemme_drag} (L.S.mouse_y) -300 / (L.L.matrix_seitenschildklemme) + (S.L.matrix_seitenschildklemme) s0 l0 0 < {if} 0 (S.L.matrix_seitenschildklemme) {endif} l0 0.7 > {if} (L.L.matrix_seitenschild_refresh) 0 = {if} 1 (S.L.matrix_seitenschild_refresh) (T.L.ev_fahrertuer_auf) (L.$.Matrix_Seitenschild) $length 0 = {if} 1 (S.L.matrix_refresh_seitenschild) {else} "" (S.$.Matrix_Seitenschild) {endif} {endif} {endif} l0 1 > {if} 1 (S.L.matrix_seitenschildklemme) {endif} {end} {trigger:matrix_seitenschildklemme_off} (L.L.matrix_seitenschildklemme) 0.3 > {if} (T.L.ev_fahrertuer_zu) {endif} 0 (S.L.matrix_seitenschildklemme) (S.L.matrix_seitenschild_refresh) {end} {trigger:bus_matrix_change_steckschild} (L.L.matrix_steckschild_index) 1 + (S.L.matrix_steckschild_index) 1000 + (M.V.GetTerminusIndex) (S.L.matrix_steckschild_Termindex) (M.L.matrix_setsteckschild) (M.L.matrix_refreshIntIndex) {end} '------------------------------------------------------------------------------------------------------------------------------' ' Macros ' '------------------------------------------------------------------------------------------------------------------------------' {macro:matrix_setsteckschild} (L.L.matrix_steckschild_Termindex) s0 0 >= {if} l0 6 (M.V.GetTerminusString) (S.$.Matrix_SchildFrnt) 1 $SetLengthL $StrToFloat 1 max (S.L.matrix_steckschild_vis) "..\..\Anzeigen\SteckSchilder\" (L.$.Matrix_SchildFrnt) $+ (S.$.Matrix_SchildFrnt) {else} 0 (S.L.matrix_steckschild_index) (S.L.matrix_steckschild_vis) "" (S.$.Matrix_SchildFrnt) {endif} {end} {macro:matrix_refreshIntIndex} (L.L.matrix_steckschild_Termindex) s0 0 >= l0 0 (M.V.GetTerminusString) $length 0 > && {if} l0 {else} (L.L.IBIS_TerminusIndex) {endif} (S.L.target_index_int) {end} {macro:Matrix_CreateNr} (L.L.IBIS_Linie_Complex) (S.L.Matrix_Nr_Last) 100 / trunc s0 (L.L.IBIS_Linie_Suffix) s1 l0 0 = {if} "" {else} l0 trunc $IntToStr {endif} (S.$.Matrix_Nr) l1 1 = {if} "E" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 4 = {if} "N" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 5 = {if} "S" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 9 = {if} "E" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 10 = {if} "E" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 11 = {if} "D" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 12 = {if} "C" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 13 = {if} "B" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 15 = {if} "N" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 18 = {if} "R" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 23 = {if} "S" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 25 = {if} "U" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 26 = {if} "U" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 27 = {if} "M" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 28 = {if} "M" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 30 = {if} "S" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 31 = {if} "U" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 32 = {if} "M" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 35 = {if} "N" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 36 = {if} "X" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 37 = {if} "{" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 38 = {if} "\" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 39 = {if} "]" (L.$.Matrix_Nr) 2 $SetLengthR $RemoveSpaces $+ {endif} l1 40 = {if} "}" {endif} l1 44 = {if} "1" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 45 = {if} "2" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 46 = {if} "3" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 47 = {if} "4" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 48 = {if} "5" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 49 = {if} "6" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 50 = {if} "7" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 51 = {if} "8" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} l1 52 = {if} "9" (L.$.Matrix_Nr) 3 $SetLengthR $+ {endif} $RemoveSpaces (S.$.Matrix_Nr) (S.$.Matrix_NrAI) {end} {macro:Matrix_CreateTerminus} ' Wenn diese Funktion mit einem Code kleiner als 10000 aufgerufen wird, wurde ein neuer Code eingegeben. ' In dem Fall wird geprüft, ob Wechselziele vorhanden sind. ' Wenn das der Fall ist, wird anstelle des "normalen" Codes das erste Wechselziel (Code+10000) geladen. ' Wenn diese Funktion mit einem Code größer als 10000 aufgerufen wird, werden gerade Wechselziele angezeigt. ' In dem Fall wird das nächste Ziel in der Reihe (Code+10000+n*1000) geladen. (L.L.Matrix_TerminusCode) s0 10000 < {if} l0 10000 + (S.L.Matrix_TerminusCode) (M.L.Matrix_GetTerminusStrings) "" (L.$.Matrix_TerminusL1) $= "" (L.$.Matrix_TerminusL2) $= && "" (L.$.Matrix_TerminusL3) $= && || "" (L.$.Matrix_TerminusL4) $= && || {if} l0 (S.L.Matrix_TerminusCode) (M.L.Matrix_GetTerminusStrings) {endif} {else} l0 1000 + (S.L.Matrix_TerminusCode) (M.L.Matrix_GetTerminusStrings) "" (L.$.Matrix_TerminusL1) $= "" (L.$.Matrix_TerminusL2) $= && "" (L.$.Matrix_TerminusL3) $= && || "" (L.$.Matrix_TerminusL4) $= && || {if} (L.L.IBIS_TerminusIndex) (M.V.GetTerminusCode) 10000 + (S.L.Matrix_TerminusCode) (M.L.Matrix_GetTerminusStrings) {endif} {endif} {end} {macro:Matrix_GetTerminusStrings} (L.L.Matrix_TerminusCode) (M.V.GetTerminusIndex) s1 l1 26 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL1) l1 27 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL2) l1 28 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL3) l1 29 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL4) l1 7 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_Bitmapfilename) ' Wenn String 26 und 27 in der Hofdatei leer sind, verwende stattdessen String 1 und 2: "" (L.$.Matrix_TerminusL1) $= "" (L.$.Matrix_TerminusL2) $= && {if} l1 1 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL1) l1 2 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL2) {endif} ' Wenn String 28 und 29 in der Hofdatei leer sind, verwende stattdessen String 1 und 2: "" (L.$.Matrix_TerminusL3) $= "" (L.$.Matrix_TerminusL4) $= && {if} l1 1 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL3) l1 2 (M.V.GetTerminusString) $RemoveSpaces (S.$.Matrix_TerminusL4) {endif} ' Wenn nur die untere Zeile beschrieben ist, dann diese nach oben und untere leeren. "" (L.$.Matrix_TerminusL1) $= {if} (L.$.Matrix_TerminusL2) (S.$.Matrix_TerminusL1) "" (S.$.Matrix_TerminusL2) {endif} "" (L.$.Matrix_TerminusL3) $= {if} (L.$.Matrix_TerminusL4) (S.$.Matrix_TerminusL3) "" (S.$.Matrix_TerminusL4) {endif} ' Wenn *I *M *K hinter dem Ziel steht --> löschen (L.$.Matrix_TerminusL1) $d 2 $SetLengthR "*I" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL1) {endif} (L.$.Matrix_TerminusL2) $d 2 $SetLengthR "*I" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL2) {endif} (L.$.Matrix_TerminusL3) $d 2 $SetLengthR "*I" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL3) {endif} (L.$.Matrix_TerminusL4) $d 2 $SetLengthR "*I" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL4) {endif} (L.$.Matrix_TerminusL1) $d 2 $SetLengthR "*M" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL1) {endif} (L.$.Matrix_TerminusL2) $d 2 $SetLengthR "*M" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL2) {endif} (L.$.Matrix_TerminusL3) $d 2 $SetLengthR "*M" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL3) {endif} (L.$.Matrix_TerminusL4) $d 2 $SetLengthR "*M" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL4) {endif} (L.$.Matrix_TerminusL1) $d 2 $SetLengthR "*K" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL1) {endif} (L.$.Matrix_TerminusL2) $d 2 $SetLengthR "*K" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL2) {endif} (L.$.Matrix_TerminusL3) $d 2 $SetLengthR "*K" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL3) {endif} (L.$.Matrix_TerminusL4) $d 2 $SetLengthR "*K" $= {if} 2 $cutEnd (S.$.Matrix_TerminusL4) {endif} ' Wenn *B hinter dem Ziel steht, soll die Zeile in Fett geschrieben werden, sonst in dünn (L.$.Matrix_TerminusL1) $d 2 $SetLengthR "*B" $= {if} 1 (S.L.Matrix_L1_Fett) 2 $cutEnd (S.$.Matrix_TerminusL1) {else} 0 (S.L.Matrix_L1_Fett) {endif} (L.$.Matrix_TerminusL2) $d 2 $SetLengthR "*B" $= {if} 1 (S.L.Matrix_L2_Fett) 2 $cutEnd (S.$.Matrix_TerminusL2) {else} 0 (S.L.Matrix_L2_Fett) {endif} (L.$.Matrix_TerminusL3) $d 2 $SetLengthR "*B" $= {if} 1 (S.L.Matrix_L3_Fett) 2 $cutEnd (S.$.Matrix_TerminusL3) {else} 0 (S.L.Matrix_L3_Fett) {endif} (L.$.Matrix_TerminusL4) $d 2 $SetLengthR "*B" $= {if} 1 (S.L.Matrix_L4_Fett) 2 $cutEnd (S.$.Matrix_TerminusL4) {else} 0 (S.L.Matrix_L4_Fett) {endif} ' dient dazu, dass die letzte Zeile (4) ebenfalls in Fett geschrieben kann, sowie, dass es Wechselziele anspricht. (L.$.Matrix_TerminusLDummy) $d 2 $SetLengthR "*B" $= {if} 1 (S.L.Matrix_LDummy_Fett) 2 $cutEnd (S.$.Matrix_TerminusLDummy) {else} 0 (S.L.Matrix_LDummy_Fett) {endif} {end} {macro:Matrix_SetCoords} (L.L.Matrix_Modul) 0 = {if} 132 (S.L.Matrix_Width) 16 (S.L.Matrix_Height) {endif} (L.L.Matrix_Modul) 1 = {if} 35 (S.L.Matrix_Width) 16 (S.L.Matrix_Height) {endif} (L.L.Matrix_Modul) 2 = {if} 132 (S.L.Matrix_Width) 16 (S.L.Matrix_Height) {endif} 0 (S.L.Matrix_Xpos) 0 (S.L.Matrix_Ypos) {end} {macro:Matrix_WriteNr} (L.$.Matrix_Nr) $length 0 > {if} (L.L.Matrix_Modul) 0 = {if} (L.$.Matrix_Nr) (L.L.Font_16x6) s0 (M.V.TextLength) 1 + s2 0 s1 s3 0 1 (L.L.Matrix_Xpos) + 1 (L.L.Matrix_Ypos) + l0 2 l1 (L.$.Matrix_Nr) (M.V.STTextOut) {endif} (L.L.Matrix_Modul) 1 = {if} (L.$.Matrix_Nr) (L.L.Font_16x6) s0 (M.V.TextLength) 1 + s2 0 s1 s3 (L.L.Matrix_Width) l2 l3 + - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) 0 1 (L.L.Matrix_Xpos) + 28 (L.L.Matrix_Ypos) + l0 2 l1 (L.$.Matrix_Nr) (M.V.STTextOut) {endif} (L.L.Matrix_Modul) 2 = {if} (L.$.Matrix_Nr) (L.L.Font_16x6) s0 (M.V.TextLength) 1 + s2 0 s1 s3 0 50 (L.L.Matrix_Xpos) + 28 (L.L.Matrix_Ypos) + l0 2 l1 (L.$.Matrix_Nr) (M.V.STTextOut) {endif} (L.L.Matrix_Xpos) l2 + l3 + 1 + (S.L.Matrix_Xpos) {endif} {end} {macro:Matrix_WriteTerminus} (M.L.Matrix_CheckDescender) ' Abfrage: Welche Zielmatrix wird verwendet? (L.L.Matrix_Modul) 0 = {if} (L.$.Matrix_TerminusL1) $length 0 > {if} ' Verfuegbare Breite fuer das Ziel: (L.L.Matrix_Width) (L.L.Matrix_Xpos) - s0 (L.$.Matrix_TerminusL2) $length 0 = {if} ' Schrift waehlen: (L.$.Matrix_TerminusL1) (L.L.Font_16_0B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL1) (L.L.Font_16_0) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL1) (L.L.Font_8_1B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL1) (L.L.Font_8_1) s1 (M.V.TextLength) s2 {if} (L.L.Matrix_TerminusL1HasDescender) {if} (L.L.Matrix_Height) 8 - 2 / {else} (L.L.Matrix_Height) 7 - 2 / {endif} {endif} {else} (L.L.Matrix_TerminusL1HasDescender) {if} (L.L.Matrix_Height) 8 - 2 / {else} (L.L.Matrix_Height) 7 - 2 / {endif} {endif} {else} 0 {endif} {else} 0 {endif} trunc (S.L.Matrix_Ypos) ' Sperrung: l0 l2 - (L.$.Matrix_TerminusL1) $length 1 - / trunc ' maximal 2: 2 min s3 ' Textlaenge mit Sperrung: l2 (L.$.Matrix_TerminusL1) $length 1 - l3 * + s2 ' Zentrierung: l0 l2 - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) ' Schreiben: 0 1 (L.L.Matrix_Xpos) + 1 (L.L.Matrix_Ypos) + l1 2 l3 (L.$.Matrix_TerminusL1) (M.V.STTextOut) {else} ' Zeile 1: ' Xpos zwischenspeichern: (L.L.Matrix_Xpos) s4 ' Schrift waehlen: (L.$.Matrix_TerminusL1) (L.L.Font_8_1B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL1) (L.L.Font_8_1) s1 (M.V.TextLength) s2 {if} (L.L.Matrix_TerminusL1HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - 2 / {else} (L.L.Matrix_Height) 2 / 7 - 2 / {endif} {endif} {else} (L.L.Matrix_TerminusL1HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - 2 / {else} (L.L.Matrix_Height) 2 / 7 - 2 / {endif} {endif} trunc (S.L.Matrix_Ypos) ' Sperrung: l0 l2 - (L.$.Matrix_TerminusL1) $length 1 - / trunc ' maximal 2: 2 min s3 ' Textlaenge mit Sperrung: l2 (L.$.Matrix_TerminusL1) $length 1 - l3 * + s2 ' Zentrierung (aufgerundet, der Text soll eher rechts stehen): l0 l2 - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) ' Schreiben: 0 1 (L.L.Matrix_Xpos) + 1 (L.L.Matrix_Ypos) + l1 2 l3 (L.$.Matrix_TerminusL1) (M.V.STTextOut) ' Zeile 2: ' Xpos zuruecksetzen: l4 (S.L.Matrix_Xpos) ' Schrift waehlen: (L.$.Matrix_TerminusL2) (L.L.Font_8_1B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL2) (L.L.Font_8_1) s1 (M.V.TextLength) s2 {if} (L.L.Matrix_TerminusL2HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - (L.L.Matrix_Height) + 2 / {else} (L.L.Matrix_Height) 2 / 7 - (L.L.Matrix_Height) + 2 / {endif} {endif} {else} (L.L.Matrix_TerminusL2HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - (L.L.Matrix_Height) + 2 / {else} (L.L.Matrix_Height) 2 / 7 - (L.L.Matrix_Height) + 2 / {endif} {endif} trunc (S.L.Matrix_Ypos) ' Sperrung: l0 l2 - (L.$.Matrix_TerminusL2) $length 1 - / trunc ' maximal 2: 2 min s3 ' Textlaenge mit Sperrung: l2 (L.$.Matrix_TerminusL2) $length 1 - l3 * + s2 ' Zentrierung (aufgerundet, der Text soll eher rechts stehen): l0 l2 - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) ' Schreiben: 0 1 (L.L.Matrix_Xpos) + 1 (L.L.Matrix_Ypos) + l1 2 l3 (L.$.Matrix_TerminusL2) (M.V.STTextOut) {endif} {endif} {else} (L.$.Matrix_TerminusL3) $length 0 > {if} ' Verfuegbare Breite fuer das Ziel: (L.L.Matrix_Width) (L.L.Matrix_Xpos) - s0 (L.$.Matrix_TerminusL4) $length 0 = {if} ' Schrift waehlen: (L.$.Matrix_TerminusL3) (L.L.Font_16_0B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL3) (L.L.Font_16_0) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL3) (L.L.Font_8_1B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL3) (L.L.Font_8_1) s1 (M.V.TextLength) s2 {if} (L.L.Matrix_TerminusL3HasDescender) {if} (L.L.Matrix_Height) 8 - 2 / {else} (L.L.Matrix_Height) 7 - 2 / {endif} {endif} {else} (L.L.Matrix_TerminusL3HasDescender) {if} (L.L.Matrix_Height) 8 - 2 / {else} (L.L.Matrix_Height) 7 - 2 / {endif} {endif} {else} 0 {endif} {else} 0 {endif} trunc (S.L.Matrix_Ypos) ' Sperrung: l0 l2 - (L.$.Matrix_TerminusL3) $length 1 - / trunc ' maximal 2: 2 min s3 ' Textlaenge mit Sperrung: l2 (L.$.Matrix_TerminusL3) $length 1 - l3 * + s2 ' Zentrierung: l0 l2 - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) ' Schreiben: 0 50 (L.L.Matrix_Xpos) + 28 (L.L.Matrix_Ypos) + l1 2 l3 (L.$.Matrix_TerminusL3) (M.V.STTextOut) {else} ' Zeile 1: ' Xpos zwischenspeichern: (L.L.Matrix_Xpos) s4 ' Schrift waehlen: (L.$.Matrix_TerminusL3) (L.L.Font_8_1B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL3) (L.L.Font_8_1) s1 (M.V.TextLength) s2 {if} (L.L.Matrix_TerminusL3HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - 2 / {else} (L.L.Matrix_Height) 2 / 7 - 2 / {endif} {endif} {else} (L.L.Matrix_TerminusL3HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - 2 / {else} (L.L.Matrix_Height) 2 / 7 - 2 / {endif} {endif} trunc (S.L.Matrix_Ypos) ' Sperrung: l0 l2 - (L.$.Matrix_TerminusL3) $length 1 - / trunc ' maximal 2: 2 min s3 ' Textlaenge mit Sperrung: l2 (L.$.Matrix_TerminusL3) $length 1 - l3 * + s2 ' Zentrierung (aufgerundet, der Text soll eher rechts stehen): l0 l2 - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) ' Schreiben: 0 50 (L.L.Matrix_Xpos) + 28 (L.L.Matrix_Ypos) + l1 2 l3 (L.$.Matrix_TerminusL3) (M.V.STTextOut) ' Zeile 2: ' Xpos zuruecksetzen: l4 (S.L.Matrix_Xpos) ' Schrift waehlen: (L.$.Matrix_TerminusL4) (L.L.Font_8_1B) s1 (M.V.TextLength) s2 l0 > {if} (L.$.Matrix_TerminusL4) (L.L.Font_8_1) s1 (M.V.TextLength) s2 {if} (L.L.Matrix_TerminusL4HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - (L.L.Matrix_Height) + 2 / {else} (L.L.Matrix_Height) 2 / 7 - (L.L.Matrix_Height) + 2 / {endif} {endif} {else} (L.L.Matrix_TerminusL4HasDescender) {if} (L.L.Matrix_Height) 2 / 8 - (L.L.Matrix_Height) + 2 / {else} (L.L.Matrix_Height) 2 / 7 - (L.L.Matrix_Height) + 2 / {endif} {endif} trunc (S.L.Matrix_Ypos) ' Sperrung: l0 l2 - (L.$.Matrix_TerminusL4) $length 1 - / trunc ' maximal 2: 2 min s3 ' Textlaenge mit Sperrung: l2 (L.$.Matrix_TerminusL4) $length 1 - l3 * + s2 ' Zentrierung (aufgerundet, der Text soll eher rechts stehen): l0 l2 - 2 / trunc (L.L.Matrix_Xpos) + (S.L.Matrix_Xpos) ' Schreiben: 0 50 (L.L.Matrix_Xpos) + 28 (L.L.Matrix_Ypos) + l1 2 l3 (L.$.Matrix_TerminusL4) (M.V.STTextOut) {endif} {endif} {endif} {end} {macro:Matrix_PrintBitmap} 0 (S.L.Matrix_Cursor) (L.L.Matrix_Modul) 0 = {if} (M.L.Matrix_PrintBitmapPixel11) (M.L.Matrix_PrintBitmapPixel6) {endif} (L.L.Matrix_Modul) 1 = {if} (M.L.Matrix_PrintBitmapPixel9) (M.L.Matrix_PrintBitmapPixel5) (M.L.Matrix_PrintBitmapPixel4) {endif} (L.L.Matrix_Modul) 2 = {if} (M.L.Matrix_PrintBitmapPixel11) (M.L.Matrix_PrintBitmapPixel6) {endif} 0 (S.L.Matrix_Cursor) {end} '2048 {macro:Matrix_PrintBitmapPixel11} (M.L.Matrix_PrintBitmapPixel10) (M.L.Matrix_PrintBitmapPixel10) {end} '1024 {macro:Matrix_PrintBitmapPixel10} (M.L.Matrix_PrintBitmapPixel9) (M.L.Matrix_PrintBitmapPixel9) {end} '512 {macro:Matrix_PrintBitmapPixel9} (M.L.Matrix_PrintBitmapPixel8) (M.L.Matrix_PrintBitmapPixel8) {end} '256 {macro:Matrix_PrintBitmapPixel8} (M.L.Matrix_PrintBitmapPixel7) (M.L.Matrix_PrintBitmapPixel7) {end} '128 {macro:Matrix_PrintBitmapPixel7} (M.L.Matrix_PrintBitmapPixel6) (M.L.Matrix_PrintBitmapPixel6) {end} '64 {macro:Matrix_PrintBitmapPixel6} (M.L.Matrix_PrintBitmapPixel5) (M.L.Matrix_PrintBitmapPixel5) {end} '32 {macro:Matrix_PrintBitmapPixel5} (M.L.Matrix_PrintBitmapPixel4) (M.L.Matrix_PrintBitmapPixel4) {end} '16 {macro:Matrix_PrintBitmapPixel4} (M.L.Matrix_PrintBitmapPixel3) (M.L.Matrix_PrintBitmapPixel3) {end} '8 {macro:Matrix_PrintBitmapPixel3} (M.L.Matrix_PrintBitmapPixel2) (M.L.Matrix_PrintBitmapPixel2) {end} '4 {macro:Matrix_PrintBitmapPixel2} (M.L.Matrix_PrintBitmapPixel1) (M.L.Matrix_PrintBitmapPixel1) {end} '2 {macro:Matrix_PrintBitmapPixel1} (M.L.Matrix_PrintBitmapPixel0) (M.L.Matrix_PrintBitmapPixel0) {end} '1 {macro:Matrix_PrintBitmapPixel0} (L.L.Matrix_Modul) 0 = {if} 1 s0 1 s1 {endif} (L.L.Matrix_Modul) 1 = {if} 1 s0 28 s1 {endif} (L.L.Matrix_Modul) 2 = {if} 50 s0 28 s1 {endif} (L.L.Matrix_Cursor) (L.L.Matrix_Width) % s2 (L.L.Matrix_Cursor) (L.L.Matrix_Width) / trunc s3 ' Pixel von Speicherbitmap lesen: 0 l0 l2 + l1 l3 + (M.V.STReadPixel) 0 (M.V.STGetR) s4 1 l4 255 255 255 (M.V.STSetColor) ' Pixel zeichnen: 1 l0 l2 + 4 * s4 l1 l3 + 4 * s5 l4 4 + 1 - l5 4 + 1 - (M.V.STDrawRect) ' Cursor verschieben: (L.L.Matrix_Cursor) 1 + (S.L.Matrix_Cursor) {end} {macro:Matrix_CheckDescender} ' Geprüft werden 24 Zeichen. Es ist unwahrscheinlich, dass eine Zeile eines Ziels länger ist. 0 (S.L.Matrix_TerminusL1HasDescender) (S.L.Matrix_TerminusL2HasDescender) (S.L.Matrix_TerminusL3HasDescender) (S.L.Matrix_TerminusL4HasDescender) 1 (S.L.Matrix_Cursor) (M.L.Matrix_CheckDescender3) (M.L.Matrix_CheckDescender3) (M.L.Matrix_CheckDescender3) 0 (S.L.Matrix_Cursor) {end} {macro:Matrix_CheckDescender3} (M.L.Matrix_CheckDescender2) (M.L.Matrix_CheckDescender2) {end} {macro:Matrix_CheckDescender2} (M.L.Matrix_CheckDescender1) (M.L.Matrix_CheckDescender1) {end} {macro:Matrix_CheckDescender1} (M.L.Matrix_CheckDescender0) (M.L.Matrix_CheckDescender0) {end} {macro:Matrix_CheckDescender0} (L.$.Matrix_TerminusL1) $length 0 > {if} (L.$.Matrix_TerminusL2) $length s7 (L.L.Matrix_Cursor) >= {if} l7 (L.L.Matrix_Cursor) - s7 (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "g" $= (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "j" $= || (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "p" $= || (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "q" $= || (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "y" $= || (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "ß" $= || (L.$.Matrix_TerminusL2) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "," $= || {if} 1 (S.L.Matrix_TerminusL2HasDescender) {endif} {endif} {endif} (L.$.Matrix_TerminusL2) $length 0 = {if} (L.$.Matrix_TerminusL1) $length s7 (L.L.Matrix_Cursor) >= {if} l7 (L.L.Matrix_Cursor) - s7 (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "g" $= (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "j" $= || (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "p" $= || (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "q" $= || (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "y" $= || (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "ß" $= || (L.$.Matrix_TerminusL1) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "," $= || {if} 1 (S.L.Matrix_TerminusL1HasDescender) {endif} {endif} {endif} (L.$.Matrix_TerminusL3) $length 0 > {if} (L.$.Matrix_TerminusL4) $length s7 (L.L.Matrix_Cursor) >= {if} l7 (L.L.Matrix_Cursor) - s7 (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "g" $= (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "j" $= || (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "p" $= || (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "q" $= || (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "y" $= || (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "ß" $= || (L.$.Matrix_TerminusL4) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "," $= || {if} 1 (S.L.Matrix_TerminusL4HasDescender) {endif} {endif} {endif} (L.$.Matrix_TerminusL4) $length 0 = {if} (L.$.Matrix_TerminusL3) $length s7 (L.L.Matrix_Cursor) >= {if} l7 (L.L.Matrix_Cursor) - s7 (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "g" $= (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "j" $= || (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "p" $= || (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "q" $= || (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "y" $= || (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "ß" $= || (L.$.Matrix_TerminusL3) (L.L.Matrix_Cursor) 1 - $cutBegin l7 $cutEnd "," $= || {if} 1 (S.L.Matrix_TerminusL3HasDescender) {endif} {endif} {endif} (L.L.Matrix_Cursor) 1 + (S.L.Matrix_Cursor) {end}