app/schulis-simulationssystem/3.0/src/ls co routinen und co

Raw file
Back to index

PACKETcoroutinenundcoDEFINEScoroutinedummy,coroutinezeit,coroutinephase,coroutinehisto,skalierung,kreuzzeitvergleich,kreuzphasevergleich,kreuzhistovergleich,tabelle:LETerstekurve=74,zweitekurve=75,legendentext=73,auskoberbegriff=5,normaleanzahlvonausgegebenenpunkten=21,laengevarkurzform=7,laengebeibeschriftung=8,nachkommastellen=2,vorkomma=5,penanzahl=5,epsilon=0.5,abstand=0.1,achsenabstand=0.05,histogrammkennzeichen="h",zeitdiagrammkennzeichen="z",phasendiagrammkennzeichen="p",gepunktet=2,durchgezogen=1,standarddicke=0,loeschstift=0,standardstift=1;BOOL VARmitskalierung;skalierung(TRUE);REAL CONSTstandardhoehe:=stdhoehe,standardbreite:=stdbreite;LETinitialisieren=0,kreuzerzeugen=1,erstersatz=2,folgendersatz=3,anfpunktloeschen=4,plotten=5,abschluss=6,erstersatzneu=7,hminhisto=0.0,hzwihisto=3.0,hmaxhisto=12.0,maxkurven=20,maxanzvarproloesung=4;PROCskalierung(BOOL CONSTx):mitskalierung:=x;setzerahmen(x)END PROCskalierung;PROCcoroutinedummy(OUTPUT VARseite,INT CONSTfenster,KURVE VARkurve,REAL VARzeit,ZUSTAND VARmuster,ZUSTAND VARzustand,DATASPACE VARds1,INT VARwas,REAL VARxmin,xmax,ymin,ymax,BOOL VARdummy):END PROCcoroutinedummy;PROCcoroutinehisto(OUTPUT VARseite,INT CONSTfenster,KURVE VARkurve,REAL VARzeit,ZUSTAND VARmuster,ZUSTAND VARzustand,DATASPACE VARds1,INT VARwas,REAL VARxmin,xmax,ymin,ymax,BOOL VARdummy):REAL VARabbzeit,hakt,hmin,hzwi;INT VARz1;REAL VARalt,neu;BOUND STRUCT(REALt,dicke,ZUSTANDz,erster,ROWmaxanzvarproloesungINTp,ROW2PICTUREgraph,ROW4REALvpk,ROW5ROW5REALkoord,INTanz,REALnmin,nmax,tmin,tmax)VARl:=ds1;was:=wasMOD10;SELECTwasOF CASEinitialisieren:coroutineinitialisieren;was:=erstersatzCASEkreuzerzeugen:kreuzerzeugenundmalen;was:=erstersatzCASEerstersatz:erstenausgeben;was:=folgendersatzCASEfolgendersatz:folgendenausgebenCASEanfpunktloeschen:anfangspunktloeschen;was:=erstersatzneuCASEplotten:bildschirminhaltplotten;CASEabschluss:CASEerstersatzneu:putparameter(l.koord);erstenneuausgeben;was:=folgendersatzENDSELECT.coroutineinitialisieren:l.dicke:=balkendickebestimmen;l.t:=0.0;l.z:=neuerzustand(dimension+codimension);FORz1FROM1UPTOdimension+codimensionREPreplace(l.z,z1,-maxreal)PER;l.tmin:=xmin;l.tmax:=xmax;l.nmin:=ymin;l.nmax:=ymax;FORz1FROM1UPTOdimension+codimensionREPreplace(l.z,z1,l.nmin-0.1)PER;bestimmevariablenanzahl(l.p,l.anz,muster,dummy);legefensterfest(seite,l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4),fenster).kreuzerzeugenundmalen:nildiagramm(seite,fenster);beginplot;viewport(l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4));bestimmeextrema(histogrammkennzeichen,kurve,l.p,l.anz,l.tmin,l.tmax,l.nmin,l.nmax);window(seite,fenster,l.nmin,l.nmax,hminhisto,hmaxhisto);window(l.nmin,l.nmax,hminhisto,hmaxhisto);setzeundschreibekoordinatenkreuz;hmin:=hminhisto;hzwi:=hzwihisto;beschrifte(histogrammkennzeichen,seite,fenster,l.p,l.anz,l.nmin,l.nmax,hmin,hzwi);endplot.erstenausgeben:viewport(l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4));window(l.nmin,l.nmax,hminhisto,hmaxhisto);getparameter(l.koord);erstenneuausgeben.folgendenausgeben:beginplot;putparameter(l.koord);move(l.t,hminhisto+1.0);abbzeit:=abbildungtbeihistogramm(l.tmin,l.tmax,l.nmin,l.nmax,zeit);IFl.t<abbzeitTHENpen(loeschstift,standardstift,standarddicke,gepunktet)ELSEpen(loeschstift,loeschstift,standarddicke,durchgezogen)FI;draw(abbzeit,hminhisto+1.0);FORz1FROM1UPTOl.anzREPbalkenfortfuehrenPER;endplot;l.t:=abbzeit;l.z:=zustand.anfangspunktloeschen:beginplot;putparameter(l.koord);FORz1FROM1UPTOl.anzREPhakt:=hzwihisto+2.1*real(z1)+0.5*standardhoehe-0.2;alt:=zustandSUBl.p(z1);linksoffenerkasten(l.nmin,min(alt,l.nmax),l.dicke,hakt,loeschstift)PER;endplot.erstenneuausgeben:FORz1FROM1UPTOdimension+codimensionREPreplace(l.z,z1,l.nmin-0.1)PER;beginplot;FORz1FROM1UPTOl.anzREPbalkenfortfuehrenPER;endplot;abbzeit:=abbildungtbeihistogramm(l.tmin,l.tmax,l.nmin,l.nmax,zeit);l.t:=abbzeit;l.erster:=zustand;l.z:=zustand.bildschirminhaltplotten:richtepicturesein;ordnepenszu;tragebalkeninpicture1ein;tragezeitinpicture2ein;schreibepictures.balkendickebestimmen:IFfenster=1THEN2.0*standardhoeheELSE
standardhoeheFI.setzeundschreibekoordinatenkreuz:putkreuz(seite,fenster,kreuzerzeugenundzeichnen(l.tmin,l.tmax,l.nmin,l.nmax,histogrammkennzeichen)).balkenfortfuehren:hakt:=hzwihisto+2.1*real(z1)+0.5*standardhoehe-0.2;alt:=l.zSUBl.p(z1);neu:=zustandSUBl.p(z1);IFalt<neuTHEN IFalt<l.nminTHEN IFneu<l.nminTHEN LEAVEbalkenfortfuehrenELSElinksoffenerkasten(l.nmin,min(neu,l.nmax),l.dicke,hakt,standardstift)FI ELIFalt=l.nminTHENstrichsenkrecht(l.nmin,l.dicke,hakt,loeschstift);zweistriche(l.nmin,min(neu,l.nmax),l.dicke,hakt,standardstift)ELIFalt>l.nminCANDalt<=l.nmaxTHEN IFneu>l.nminCANDneu<=l.nmaxTHENstrichsenkrecht(alt,l.dicke,hakt,loeschstift);linksoffenerkasten(alt,neu,l.dicke,hakt,standardstift)ELIFneu>l.nmaxTHENstrichsenkrecht(alt,l.dicke,hakt,loeschstift);zweistriche(alt,l.nmax,l.dicke,hakt,standardstift)FI ELIFalt>l.nmaxTHEN LEAVEbalkenfortfuehrenFI ELIFalt=neuTHEN LEAVEbalkenfortfuehrenELIFalt>neuTHEN IFalt<l.nminTHEN LEAVEbalkenfortfuehrenELIFalt=l.nminTHENstrichsenkrecht(alt,l.dicke,hakt,loeschstift);ELIFalt>l.nminCANDalt<=l.nmaxTHENlinksoffenerkasten(max(neu,l.nmin),alt,l.dicke,hakt,loeschstift);IFneu>=l.nminCANDneu<l.nmaxTHENstrichsenkrecht(neu,l.dicke,hakt,standardstift)FI ELIFalt>l.nmaxTHEN IFneu<l.nminTHENzweistriche(l.nmin,l.nmax,l.dicke,hakt,loeschstift)ELIFneu>=l.nminCANDneu<l.nmaxTHENzweistriche(neu,l.nmax,l.dicke,hakt,loeschstift);strichsenkrecht(neu,l.dicke,hakt,standardstift)ELIFneu=l.nmaxTHENstrichsenkrecht(neu,l.dicke,hakt,standardstift)ELIFneu>l.nmaxTHEN LEAVEbalkenfortfuehrenFI FI FI.richtepicturesein:l.graph(1):=nilpicture;l.graph(2):=nilpicture.ordnepenszu:pen(l.graph(1),durchgezogen);pen(l.graph(2),gepunktet).tragebalkeninpicture1ein:FORz1FROM1UPTOl.anzREPalt:=l.ersterSUBl.p(z1);neu:=zustandSUBl.p(z1);hakt:=hzwihisto+2.1*real(z1)+0.5*standardhoehe-0.2;IFneu>l.nmaxTHENzweistrichepic(l.nmin,l.nmax,l.dicke,hakt,l.graph(1))ELSElinksoffenerkastenpic(l.nmin,neu,l.dicke,hakt,l.graph(1))FI;IFalt=l.nminTHENstrichsenkrechtpic(l.nmin,l.dicke,hakt,l.graph(1))FI;PER.tragezeitinpicture2ein:move(l.graph(2),abbildungtbeihistogramm(l.tmin,l.tmax,l.nmin,l.nmax,l.tmin),hminhisto+1.0);draw(l.graph(2),abbildungtbeihistogramm(l.tmin,l.tmax,l.nmin,l.nmax,zeit),hminhisto+1.0).schreibepictures:putpicture(seite,fenster,l.graph(1));putpicture(seite,fenster,l.graph(2)).END PROCcoroutinehisto;PROCzweistriche(REAL CONSTmin,max,dicke,hoehe,INT CONSTstift):REAL VARhalbedicke:=0.5*dicke;pen(loeschstift,stift,standarddicke,durchgezogen);move(min,hoehe-halbedicke);draw(max,hoehe-halbedicke);move(min,hoehe+halbedicke);draw(max,hoehe+halbedicke).END PROCzweistriche;PROCzweistrichepic(REAL CONSTmin,max,dicke,hoehe,PICTURE VARgraph):REAL VARhalbedicke:=0.5*dicke;move(graph,min,hoehe-halbedicke);draw(graph,max,hoehe-halbedicke);move(graph,min,hoehe+halbedicke);draw(graph,max,hoehe+halbedicke).END PROCzweistrichepic;PROCstrichsenkrecht(REAL CONSTpos,dicke,hoehe,INT CONSTstift):REAL VARhalbedicke:=0.5*dicke;pen(loeschstift,stift,standarddicke,durchgezogen);move(pos,hoehe-halbedicke);draw(pos,hoehe+halbedicke).END PROCstrichsenkrecht;PROCstrichsenkrechtpic(REAL CONSTpos,dicke,hoehe,PICTURE VARgraph):REAL VARhalbedicke:=0.5*dicke;move(graph,pos,hoehe-halbedicke);draw(graph,pos,hoehe+halbedicke).END PROCstrichsenkrechtpic;PROClinksoffenerkasten(REAL CONSTmin,max,dicke,hoehe,INT CONSTstift):REAL VARhalbedicke:=0.5*dicke;pen(loeschstift,stift,standarddicke,durchgezogen);move(min,hoehe-halbedicke);draw(max,hoehe-halbedicke);draw(max,hoehe+halbedicke);draw(min,hoehe+halbedicke).END PROClinksoffenerkasten;PROClinksoffenerkastenpic(REAL CONSTmin,max,dicke,hoehe,PICTURE VARgraph):REAL VARhalbedicke:=0.5*dicke;move(graph,min,hoehe-halbedicke);draw(graph,max,hoehe-halbedicke);draw(graph,max,hoehe+halbedicke);draw(graph,min,hoehe+halbedicke).END PROClinksoffenerkastenpic;PROCcoroutinezeit(OUTPUT VARseite,INT CONSTfenster,KURVE VARkurve,REAL VARzeit,ZUSTAND VARmuster,ZUSTAND VARzustand,DATASPACE VARds1,INT VARwas,REAL VARxmin,xmax,ymin,ymax,BOOL VARdummy):BOUND
 STRUCT(REALt,dicke,ZUSTANDz,ROWmaxanzvarproloesungINTp,ROWmaxanzvarproloesungPICTUREgraph,ROW4REALvpk,ROW5ROW5REALkoord,INTanz,REALxmin,xmax,ymin,ymax)VARl:=ds1;INT VARz1;was:=wasMOD10;SELECTwasOF CASEinitialisieren:coroutineinitialisieren;was:=erstersatzCASEkreuzerzeugen:kreuzerzeugenundmalen;was:=erstersatzCASEerstersatz:erstenausgeben;was:=folgendersatzCASEfolgendersatz:folgendenausgebenCASEanfpunktloeschen:was:=erstersatzneuCASEplotten:bildschirminhaltplottenCASEabschluss:CASEerstersatzneu:putparameter(l.koord);erstenneuausgeben;was:=folgendersatzENDSELECT.coroutineinitialisieren:l.t:=0.0;l.z:=neuerzustand(dimension+codimension);l.xmin:=xmin;l.xmax:=xmax;l.ymin:=ymin;l.ymax:=ymax;richtepicturesein;bestimmevariablenanzahl(l.p,l.anz,muster,dummy);ordnepenszu;legefensterfest(seite,l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4),fenster).kreuzerzeugenundmalen:nildiagramm(seite,fenster);beginplot;viewport(l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4));bestimmeextrema(zeitdiagrammkennzeichen,kurve,l.p,l.anz,l.xmin,l.xmax,l.ymin,l.ymax);window(seite,fenster,l.xmin,l.xmax,l.ymin,l.ymax);window(l.xmin,l.xmax,l.ymin,l.ymax);setzeundschreibekoordinatenkreuz;beschrifte(zeitdiagrammkennzeichen,seite,fenster,l.p,l.anz,l.xmin,l.xmax,l.ymin,l.ymax);endplot.erstenausgeben:erstenneuausgeben;viewport(l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4));window(l.xmin,l.xmax,l.ymin,l.ymax);getparameter(l.koord).folgendenausgeben:beginplot;putparameter(l.koord);FORz1FROM1UPTOl.anzREPverbindepunkteimzeitdiagramm;PER;endplot;l.t:=zeit;l.z:=zustand.bildschirminhaltplotten:REAL VARstopzeit:=zeit;nildiagrammmitkreuz(seite,fenster);FORz1FROM1UPTOl.anzREPlesekomplettekurvePER;schreibepictures;l.t:=zeit;l.z:=zustand;.erstenneuausgeben:l.t:=zeit;l.z:=zustand.lesekomplettekurve:leseersten(kurve,zeit,zustand);REPleseabschnittmitpunktenausserhalbdessichtbarenbereiches;leseabschnittmitpunkteninnerhalbdessichtbarenbereiches;PER.leseabschnittmitpunktenausserhalbdessichtbarenbereiches:REP IF NOT(zeit<stopzeit)THEN LEAVElesekomplettekurveELIFimausgabefenster(zustand,l.p(z1),l.ymin,l.ymax)THEN LEAVEleseabschnittmitpunktenausserhalbdessichtbarenbereichesFI;lesenaechsten(kurve,zeit,zustand);PER.leseabschnittmitpunkteninnerhalbdessichtbarenbereiches:move(l.graph(z1),zeit,zustandSUBl.p(z1));REPlesenaechsten(kurve,zeit,zustand);IF NOT(zeit<=stopzeit)THEN LEAVElesekomplettekurveELIF NOTimausgabefenster(zustand,l.p(z1),l.ymin,l.ymax)THEN LEAVEleseabschnittmitpunkteninnerhalbdessichtbarenbereichesFI;draw(l.graph(z1),zeit,zustandSUBl.p(z1));IF NOT(zeit<stopzeit)THEN LEAVElesekomplettekurveFI PER.setzeundschreibekoordinatenkreuz:putkreuz(seite,fenster,kreuzerzeugenundzeichnen(l.xmin,l.xmax,l.ymin,l.ymax,zeitdiagrammkennzeichen)).richtepicturesein:FORz1FROM1UPTOmaxanzvarproloesungREPl.graph(z1):=nilpicturePER.ordnepenszu:INT VARstiftenr:=1;FORz1FROM1UPTOl.anzREPordnepenzuPER.ordnepenzu:pen(l.graph(z1),stiftenr);IFstiftenr=penanzahlTHENstiftenr:=1ELSEstiftenrINCR1FI.verbindepunkteimzeitdiagramm:BOOL VARaltimbereich:=imausgabefenster(l.z,l.p(z1),l.ymin,l.ymax),neuimbereich:=imausgabefenster(zustand,l.p(z1),l.ymin,l.ymax);IFneuimbereichCANDaltimbereichTHENmalenbzwloeschennormalFI.malenbzwloeschennormal:IFzeit<l.tTHENpen(loeschstift,loeschstift,standarddicke,durchgezogen);move(zeit,zustandSUBl.p(z1));draw(l.t,l.zSUBl.p(z1))ELSEpen(loeschstift,standardstift,standarddicke,pen(l.graph(z1)));move(l.t,l.zSUBl.p(z1));draw(zeit,zustandSUBl.p(z1))FI.schreibepictures:FORz1FROM1UPTOl.anzREPputpicture(seite,fenster,l.graph(z1))PER.END PROCcoroutinezeit;PROCcoroutinephase(OUTPUT VARseite,INT CONSTfenster,KURVE VARkurve,REAL VARzeit,ZUSTAND VARmuster,ZUSTAND VARzustand,DATASPACE VARds1,INT VARwas,REAL VARxmin,xmax,ymin,ymax,BOOL VARautomatik):LETanzahlloesung=2;BOUND STRUCT(REALt,ZUSTANDz,ROWmaxanzvarproloesungINTp,ROW4REALvpk,ROW5ROW5REALkoord,PICTUREgraph,BOOLaufbildschirm,REALxmin,xmax,ymin,ymax,BOOLanfpunkt)VARl:=ds1;INT VARdummy:=0;REAL VARxwert,ywert;BOOL VARvergleich;vergleich:=was<>(wasMOD10);was:=wasMOD10;SELECTwasOF
 CASEinitialisieren:coroutineinitialisieren;was:=erstersatzCASEkreuzerzeugen:kreuzerzeugenundmalen;was:=erstersatzCASEerstersatz:erstenausgeben;was:=folgendersatzCASEfolgendersatz:folgendenausgebenCASEanfpunktloeschen:anfangspunktloeschen;was:=erstersatzneuCASEplotten:bildschirminhaltplotten;was:=folgendersatzCASEabschluss:CASEerstersatzneu:putparameter(l.koord);erstenneuausgeben;was:=folgendersatzENDSELECT.coroutineinitialisieren:l.t:=0.0;l.z:=neuerzustand(dimension+codimension);l.aufbildschirm:=TRUE;l.anfpunkt:=FALSE;l.xmin:=xmin;l.xmax:=xmax;l.ymin:=ymin;l.ymax:=ymax;richtepictureein;ordnepenzu;bestimmevariablenanzahl(l.p,dummy,muster,automatik);IFautomatikTHENvertauscheevtlvariablen(muster,l.xmin,l.xmax,l.ymin,l.ymax);bestimmevariablenanzahl(l.p,dummy,muster,automatik);FI;legefensterfest(seite,l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4),fenster).kreuzerzeugenundmalen:nildiagramm(seite,fenster);beginplot;viewport(l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4));bestimmeextrema(phasendiagrammkennzeichen,kurve,l.p,anzahlloesung,l.xmin,l.xmax,l.ymin,l.ymax);IFautomatikTHENvertauscheevtlvariablen(muster,l.xmin,l.xmax,l.ymin,l.ymax);bestimmevariablenanzahl(l.p,dummy,muster,automatik);FI;window(seite,fenster,l.xmin,l.xmax,l.ymin,l.ymax);window(l.xmin,l.xmax,l.ymin,l.ymax);setzeundschreibekoordinatenkreuz;beschrifte(phasendiagrammkennzeichen,seite,fenster,l.p,0,l.xmin,l.xmax,l.ymin,l.ymax);endplot.erstenausgeben:viewport(l.vpk(1),l.vpk(2),l.vpk(3),l.vpk(4));window(l.xmin,l.xmax,l.ymin,l.ymax);getparameter(l.koord);erstenneuausgeben.folgendenausgeben:putparameter(l.koord);beginplot;pen(loeschstift,standardstift,standarddicke,durchgezogen);verbindepunkteimphasendiagramm;endplot;l.t:=zeit;l.z:=zustand.anfangspunktloeschen:IFl.anfpunktTHENxwert:=zustandSUBl.p(1);ywert:=zustandSUBl.p(2);beginplot;pen(loeschstift,loeschstift,standarddicke,durchgezogen);move(xwert,ywert);zeichnefadenkreuz;endplot;l.anfpunkt:=FALSE FI.bildschirminhaltplotten:REAL VARstopzeit:=zeit;l.aufbildschirm:=FALSE;leseersten(kurve,zeit,zustand);trageanfangspunktein;lesekomplettekurve;schreibepicture;l.t:=zeit;l.z:=zustand;l.aufbildschirm:=TRUE.erstenneuausgeben:beginplot;pen(loeschstift,standardstift,standarddicke,durchgezogen);trageanfangspunktein;l.t:=zeit;l.z:=zustand;endplot.richtepictureein:l.graph:=nilpicture.ordnepenzu:IFvergleichTHENpen(l.graph,gepunktet)ELSEpen(l.graph,durchgezogen)FI.setzeundschreibekoordinatenkreuz:putkreuz(seite,fenster,kreuzerzeugenundzeichnen(l.xmin,l.xmax,l.ymin,l.ymax,phasendiagrammkennzeichen)).trageanfangspunktein:IF(imausgabefenster(zustand,l.p(1),l.xmin,l.xmax)ANDimausgabefenster(zustand,l.p(2),l.ymin,l.ymax))THENxwert:=zustandSUBl.p(1);ywert:=zustandSUBl.p(2);IFl.aufbildschirmTHENmove(xwert,ywert);zeichnefadenkreuz;l.anfpunkt:=TRUE ELSEmove(l.graph,xwert,ywert);zeichnefadenkreuzimpicFI;FI.zeichnefadenkreuz:drawcmr(0.2,0.0);move(xwert,ywert);drawcmr(-0.2,0.0);move(xwert,ywert);drawcmr(0.0,0.2);move(xwert,ywert);drawcmr(0.0,-0.2);move(xwert,ywert).zeichnefadenkreuzimpic:drawcmr(l.graph,0.2,0.0);move(l.graph,xwert,ywert);drawcmr(l.graph,-0.2,0.0);move(l.graph,xwert,ywert);drawcmr(l.graph,0.0,0.2);move(l.graph,xwert,ywert);drawcmr(l.graph,0.0,-0.2);move(l.graph,xwert,ywert).lesekomplettekurve:REPleseabschnittmitpunktenausserhalbdessichtbarenbereiches;leseabschnittmitpunkteninnerhalbdessichtbarenbereiches;PER.leseabschnittmitpunktenausserhalbdessichtbarenbereiches:REP IF NOT(zeit<stopzeit)THEN LEAVElesekomplettekurveELIFimausgabefenster(zustand,l.p(1),l.xmin,l.xmax)ANDimausgabefenster(zustand,l.p(2),l.ymin,l.ymax)THEN LEAVEleseabschnittmitpunktenausserhalbdessichtbarenbereichesFI;lesenaechsten(kurve,zeit,zustand);PER.leseabschnittmitpunkteninnerhalbdessichtbarenbereiches:move(l.graph,zustandSUBl.p(1),zustandSUBl.p(2));REPlesenaechsten(kurve,zeit,zustand);IF NOT(zeit<=stopzeit)THEN LEAVElesekomplettekurveELIF NOT(imausgabefenster(zustand,l.p(1),l.xmin,l.xmax)ANDimausgabefenster(zustand,l.p(2),l.ymin,l.ymax))THEN LEAVE
leseabschnittmitpunkteninnerhalbdessichtbarenbereichesFI;draw(l.graph,zustandSUBl.p(1),zustandSUBl.p(2));IF(zeit=letztezeit(kurve))THENcircle(l.graph,0.3,0.0,360.0,0)FI;IF NOT(zeit<stopzeit)THEN LEAVElesekomplettekurveFI PER.verbindepunkteimphasendiagramm:BOOL VARaltimbereich:=imausgabefenster(l.z,l.p(1),l.xmin,l.xmax)CANDimausgabefenster(l.z,l.p(2),l.ymin,l.ymax),neuimbereich:=imausgabefenster(zustand,l.p(1),l.xmin,l.xmax)CANDimausgabefenster(zustand,l.p(2),l.ymin,l.ymax);IFneuimbereichCANDaltimbereichTHENmalenbzwloeschenFI.malenbzwloeschen:IFzeit<l.tTHENpen(loeschstift,loeschstift,standarddicke,durchgezogen);IF(l.t=letztezeit(kurve))THENmove(l.zSUBl.p(1),l.zSUBl.p(2));circle(0.3,0.0,360.0,0);FI;move(zustandSUBl.p(1),zustandSUBl.p(2));draw(l.zSUBl.p(1),l.zSUBl.p(2));ELSEpen(loeschstift,standardstift,standarddicke,pen(l.graph));move(l.zSUBl.p(1),l.zSUBl.p(2));draw(zustandSUBl.p(1),zustandSUBl.p(2));IF(zeit=letztezeit(kurve))THENcircle(0.3,0.0,360.0,0);FI;FI;.schreibepicture:putpicture(seite,fenster,l.graph).END PROCcoroutinephase;PROCvertauscheevtlvariablen(ZUSTAND VARmaske,REAL VARxmin,xmax,ymin,ymax):INT VARi;REAL VARpuffer;IFvertauschennotwendigTHENsucheindexinmaskemit1;setze2fuerdiesenindex;vertauschexundyFI.vertauschennotwendig:(xmax-xmin)<(ymax-ymin).sucheindexinmaskemit1:i:=1;WHILE(maskeSUBi)<>1.0CANDi<=dimension+codimensionREPiINCR1PER.setze2fuerdiesenindex:IFi<=dimension+codimensionTHENreplace(maske,i,2.0)FI.vertauschexundy:puffer:=ymin;ymin:=xmin;xmin:=puffer;puffer:=ymax;ymax:=xmax;xmax:=puffer;.END PROCvertauscheevtlvariablen;PROCkreuzzeitvergleich(OUTPUT VARseite,KURVE VARk1,k2,ZUSTAND VARmaske,INT CONSTfenster1,fenster2,ROWmaxanzvarproloesungINT VARpos,REAL VARxmin,xmax,x1min,x1max,ymin,ymax,BOOL VARdummy):ROW4REAL VARvpk1,vpk2;REAL VARy1min,y1max;PICTURE VARkreuz;INT VARanzahl;bestimmevariablenanzahl(pos,anzahl,maske,dummy);bestimmeextrema(zeitdiagrammkennzeichen,k1,pos,anzahl,xmin,xmax,ymin,ymax);bestimmeextrema(zeitdiagrammkennzeichen,k2,pos,anzahl,x1min,x1max,y1min,y1max);bestimmegemeinsamenwertebereich;beginplot;zeichneersteskreuzimzeitvergleich;zeichnezweiteskreuzimzeitvergleich;endplot.bestimmegemeinsamenwertebereich:IFy1min<yminTHENymin:=y1minFI;IFy1max>ymaxTHENymax:=y1maxFI.zeichneersteskreuzimzeitvergleich:nildiagramm(seite,fenster1);legefensterfest(seite,vpk1(1),vpk1(2),vpk1(3),vpk1(4),fenster1);viewport(vpk1(1),vpk1(2),vpk1(3),vpk1(4));window(seite,fenster1,xmin,xmax,ymin,ymax);window(xmin,xmax,ymin,ymax);kreuz:=nilpicture;kreuz:=kreuzerzeugenundzeichnen(xmin,xmax,ymin,ymax,zeitdiagrammkennzeichen);putkreuz(seite,fenster1,kreuz);beschrifte(zeitdiagrammkennzeichen,seite,fenster1,pos,anzahl,xmin,xmax,ymin,ymax).zeichnezweiteskreuzimzeitvergleich:nildiagramm(seite,fenster2);legefensterfest(seite,vpk2(1),vpk2(2),vpk2(3),vpk2(4),fenster2);viewport(vpk2(1),vpk2(2),vpk2(3),vpk2(4));window(seite,fenster2,x1min,x1max,ymin,ymax);window(x1min,x1max,ymin,ymax);kreuz:=nilpicture;kreuz:=kreuzerzeugenundzeichnen(x1min,x1max,ymin,ymax,zeitdiagrammkennzeichen);putkreuz(seite,fenster2,kreuz);beschrifte(zeitdiagrammkennzeichen,seite,fenster2,pos,anzahl,x1min,x1max,ymin,ymax).END PROCkreuzzeitvergleich;PROCkreuzphasevergleich(OUTPUT VARseite,KURVE VARk1,k2,ZUSTAND VARmaske,INT CONSTfenster1,fenster2,ROWmaxanzvarproloesungINT VARpos,REAL VARxmin,xmax,x1min,x1max,ymin,ymax,BOOL VARautomatik):ROW4REAL VARvpk;REAL VARy1min,y1max;PICTURE VARkreuz;INT VARanzahl;bestimmevariablenanzahl(pos,anzahl,maske,automatik);bestimmeextrema(phasendiagrammkennzeichen,k1,pos,anzahl,xmin,xmax,ymin,ymax);bestimmeextrema(phasendiagrammkennzeichen,k2,pos,anzahl,x1min,x1max,y1min,y1max);bestimmegemeinsamebereiche;IFautomatikTHENvertauscheevtlvariablen(maske,xmin,xmax,ymin,ymax)FI;x1min:=xmin;x1max:=xmax;beginplot;schreibeundbeschriftekreuz;endplot.bestimmegemeinsamebereiche:IFx1min<xminTHENxmin:=x1minFI;IFx1max>xmaxTHENxmax:=x1maxFI;IFy1min<yminTHENymin:=y1minFI;IFy1max>ymaxTHENymax:=y1maxFI.schreibelegende:REAL VARa,b,abstand;TEXT VARname;INT
 VARlaenge;PICTURE VARlegende:=nilpicture,linie1:=nilpicture,linie2:=nilpicture;a:=real(laengebeibeschriftung)*standardbreite;b:=2.0*standardhoehe+0.2;abstand:=9.0*standardbreite;move(legende,xmin,ymin);movecmr(legende,-1.0*a,-1.0*b);draw(legende,meldungstext(legendentext),0.0,standardhoehe,standardbreite);movecmr(legende,abstand,0.0);name:=meldungstext(erstekurve);laenge:=length(name);draw(legende,name,0.0,standardhoehe,standardbreite);movecmr(legende,(real(laenge)+0.5)*standardbreite,0.0);pen(linie1,durchgezogen);move(linie1,xmin,ymin);movecmr(linie1,(-1.0)*a+abstand,((-1.0)*b-0.1));drawcmr(linie1,real(laenge)*standardbreite,0.0);abstand:=abstand+(real(laenge)+0.5)*standardbreite;pen(loeschstift,standardstift,standarddicke,pen(linie1));plot(linie1);name:=meldungstext(zweitekurve);laenge:=length(name);draw(legende,name,0.0,standardhoehe,standardbreite);pen(linie2,gepunktet);move(linie2,xmin,ymin);movecmr(linie2,(-1.0)*a+abstand,((-1.0)*b-0.1));drawcmr(linie2,real(laenge)*standardbreite,0.0);pen(loeschstift,standardstift,standarddicke,pen(linie2));plot(linie2);pen(legende,durchgezogen);pen(loeschstift,standardstift,standarddicke,pen(legende));plot(legende);putkreuz(seite,fenster1,legende);putkreuz(seite,fenster1,linie1);putkreuz(seite,fenster1,linie2).schreibeundbeschriftekreuz:nildiagramm(seite,fenster1);legefensterfest(seite,vpk(1),vpk(2),vpk(3),vpk(4),fenster1);viewport(vpk(1),vpk(2),vpk(3),vpk(4));window(seite,fenster1,xmin,xmax,ymin,ymax);window(xmin,xmax,ymin,ymax);kreuz:=nilpicture;kreuz:=kreuzerzeugenundzeichnen(xmin,xmax,ymin,ymax,phasendiagrammkennzeichen);putkreuz(seite,fenster1,kreuz);beschrifte(phasendiagrammkennzeichen,seite,fenster1,pos,anzahl,xmin,xmax,ymin,ymax);schreibelegende.END PROCkreuzphasevergleich;PROCkreuzhistovergleich(OUTPUT VARseite,KURVE VARk1,k2,ZUSTAND VARmaske,INT CONSTfenster1,fenster2,ROWmaxanzvarproloesungINT VARpos,REAL VARxmin,xmax,x1min,x1max,ymin,ymax,BOOL VARdummy):ROW4REAL VARvpk1,vpk2;REAL VARy1min,y1max,hmin,hzwi,hmax;PICTURE VARkreuz;INT VARanzahl;bestimmevariablenanzahl(pos,anzahl,maske,dummy);bestimmeextrema(histogrammkennzeichen,k1,pos,anzahl,xmin,xmax,ymin,ymax);bestimmeextrema(histogrammkennzeichen,k2,pos,anzahl,x1min,x1max,y1min,y1max);bestimmegemeinsamenwertebereich;beginplot;zeichneersteskreuzimhistogrammvergleich;zeichnezweiteskreuzimhistogrammvergleich;endplot.bestimmegemeinsamenwertebereich:IFy1min<yminTHENymin:=y1minFI;IFy1max>ymaxTHENymax:=y1maxFI.zeichneersteskreuzimhistogrammvergleich:nildiagramm(seite,fenster1);legefensterfest(seite,vpk1(1),vpk1(2),vpk1(3),vpk1(4),fenster1);viewport(vpk1(1),vpk1(2),vpk1(3),vpk1(4));hmin:=hminhisto;hzwi:=hzwihisto;hmax:=hmaxhisto;window(seite,fenster1,ymin,ymax,hmin,hmax);window(ymin,ymax,hmin,hmax);kreuz:=nilpicture;kreuz:=kreuzerzeugenundzeichnen(xmin,xmax,ymin,ymax,histogrammkennzeichen);putkreuz(seite,fenster1,kreuz);beschrifte(histogrammkennzeichen,seite,fenster1,pos,anzahl,ymin,ymax,hmin,hzwi).zeichnezweiteskreuzimhistogrammvergleich:nildiagramm(seite,fenster2);legefensterfest(seite,vpk2(1),vpk2(2),vpk2(3),vpk2(4),fenster2);viewport(vpk2(1),vpk2(2),vpk2(3),vpk2(4));window(seite,fenster2,ymin,ymax,hmin,hmax);window(ymin,ymax,hmin,hmax);kreuz:=nilpicture;kreuz:=kreuzerzeugenundzeichnen(x1min,x1max,ymin,ymax,histogrammkennzeichen);putkreuz(seite,fenster2,kreuz);beschrifte(histogrammkennzeichen,seite,fenster2,pos,anzahl,ymin,ymax,hmin,hzwi).END PROCkreuzhistovergleich;PROCbestimmevariablenanzahl(ROWmaxanzvarproloesungINT VARpos,INT VARanzahl,ZUSTAND CONSTmuster,BOOL VARautomatik):INT VARz1,z2;FORz1FROM1UPTOmaxanzvarproloesungREPpos(z1):=0PER;z2:=0;automatik:=TRUE;FORz1FROM1UPTOdimension+codimensionREP IF(musterSUBz1)<>0.0THENz2INCR1;IF(musterSUBz1)=1.0THENpos(z2):=z1ELSEpos(2):=z1;z2:=0;automatik:=FALSE FI;FI;PER;anzahl:=z2.END PROCbestimmevariablenanzahl;PROCbestimmeextrema(TEXT CONSTwas,KURVE VARkurve,ROWmaxanzvarproloesungINT CONSTpos,INT CONSTanzahl,REAL VARxmin,xmax,ymin,ymax):INT VARi;ZUSTAND VARzustand:=neuerzustand(dimension
+codimension);IFwas=phasendiagrammkennzeichenTHENeinfacherandwertebestimmenELSErandwerteausmehrerenloesungenbestimmenFI;IFxmin>xmaxTHEN REAL VARhelpx:=xmin;xmin:=xmax;xmax:=helpx;ELIFxmax=xminTHENxmax:=xmin+epsilon;xmin:=xmin-epsilon;FI;IFymin>ymaxTHEN REAL VARhelp:=ymin;ymin:=ymax;ymax:=help;ELIFymax=yminTHENymax:=ymin+epsilon;ymin:=ymin-epsilon;FI.einfacherandwertebestimmen:ymin:=max(minimalwerte(kurve)SUBpos(2),randuntenSUBpos(2));ymax:=min(maximalwerte(kurve)SUBpos(2),randobenSUBpos(2));xmin:=max(minimalwerte(kurve)SUBpos(1),randuntenSUBpos(1));xmax:=min(maximalwerte(kurve)SUBpos(1),randobenSUBpos(1));ymin:=ymin-achsenabstand*(ymax-ymin);xmin:=xmin-achsenabstand*(xmax-xmin).randwerteausmehrerenloesungenbestimmen:ymin:=max(minimalwerte(kurve)SUBpos(1),randuntenSUBpos(1));ymax:=min(maximalwerte(kurve)SUBpos(1),randobenSUBpos(1));FORiFROM2UPTOanzahlREP IFmax(minimalwerte(kurve)SUBpos(i),randuntenSUBpos(i))<yminTHENymin:=max(minimalwerte(kurve)SUBpos(i),randuntenSUBpos(i));FI;IFmin(maximalwerte(kurve)SUBpos(i),randobenSUBpos(i))>ymaxTHENymax:=min(maximalwerte(kurve)SUBpos(i),randobenSUBpos(i));FI;PER;IFwas=zeitdiagrammkennzeichenTHENymin:=ymin-achsenabstand*(ymax-ymin)FI;xmax:=letztezeit(kurve);leseersten(kurve,xmin,zustand).END PROCbestimmeextrema;PICTURE PROCkreuzerzeugenundzeichnen(REAL CONSTxmin,xmax,ymin,ymax,TEXT CONSTzeichen):PICTURE VARtransfer;BOUND PICTURE VARkreuz;REAL VARhoehe,stelle;ROW3REAL VARschoenezahl;INT VARpos;BOOL VARzeitachsehisto;IFexists("KREUZ")THENforget("KREUZ",quiet)FI;kreuz:=new("KREUZ");kreuz:=nilpicture;ordnestiftzu;IFzeichen=histogrammkennzeichenTHENzeichnetachse;zeichnenachse;IFmitskalierungTHENtskalierung;nskalierungFI;ELSEzeichnexachse;zeichneyachse;IFmitskalierungTHENxskalierung;yskalierungFI;FI;lieferekreuz.ordnestiftzu:pen(loeschstift,standardstift,standarddicke,durchgezogen);pen(kreuz,durchgezogen).zeichnetachse:move(ymin,hminhisto);draw(ymax,hminhisto);move(kreuz,ymin,hminhisto);draw(kreuz,ymax,hminhisto);zeichnetspitze.zeichnetspitze:move(ymax,hminhisto);drawcmr(-0.2,0.2);move(ymax,hminhisto);drawcmr(-0.2,-0.2);move(kreuz,ymax,hminhisto);drawcmr(kreuz,-0.2,0.2);move(kreuz,ymax,hminhisto);drawcmr(kreuz,-0.2,-0.2).zeichnenachse:move(ymin,hzwihisto);draw(ymax,hzwihisto);move(kreuz,ymin,hzwihisto);draw(kreuz,ymax,hzwihisto);zeichnenspitze.zeichnenspitze:drawcmr(-0.2,0.2);move(ymax,hzwihisto);drawcmr(-0.2,-0.2);drawcmr(kreuz,-0.2,0.2);move(kreuz,ymax,hzwihisto);drawcmr(kreuz,-0.2,-0.2).tskalierung:stelle:=xmin;zahlen(xmin,0.9*(xmax-xmin)+xmin,schoenezahl);zeitachsehisto:=TRUE;hoehe:=hminhisto;histoskalierung.nskalierung:stelle:=ymin;zahlen(ymin,0.9*(ymax-ymin)+ymin,schoenezahl);zeitachsehisto:=FALSE;hoehe:=hzwihisto;histoskalierung.histoskalierung:stelle:=schoenezahl(1);move(abbildungstelle,hoehe);movecmr(0.0,0.2);drawcmr(0.0,-0.3);move(kreuz,abbildungstelle,hoehe);movecmr(kreuz,0.0,0.2);drawcmr(kreuz,0.0,-0.3);beschrifte;FORposFROM2UPTO3REPstelle:=schoenezahl(pos);zeichnehistostrich;zeichnegegenstrich;beschriftePER.zeichnehistostrich:move(abbildungstelle,hoehe);drawcmr(0.0,0.1);move(kreuz,abbildungstelle,hoehe);drawcmr(kreuz,0.0,0.1).zeichnexachse:move(xmin,ymin);draw(xmax,ymin);move(kreuz,xmin,ymin);draw(kreuz,xmax,ymin);zeichnexspitze.zeichnexspitze:drawcmr(-0.2,0.2);move(xmax,ymin);drawcmr(-0.2,-0.2);drawcmr(kreuz,-0.2,0.2);move(kreuz,xmax,ymin);drawcmr(kreuz,-0.2,-0.2).zeichneyachse:move(xmin,ymin);draw(xmin,ymax);move(kreuz,xmin,ymin);draw(kreuz,xmin,ymax);zeichneyspitze.zeichneyspitze:drawcmr(0.0,standardhoehe);drawcmr(0.2,-0.2);move(xmin,ymax);movecmr(0.0,standardhoehe);drawcmr(-0.2,-0.2);drawcmr(kreuz,0.0,standardhoehe);drawcmr(kreuz,0.2,-0.2);move(kreuz,xmin,ymax);movecmr(kreuz,0.0,standardhoehe);drawcmr(kreuz,-0.2,-0.2).xskalierung:stelle:=xmin;zahlen(xmin,0.9*(xmax-xmin)+xmin,schoenezahl);IFzeichen=zeitdiagrammkennzeichenTHENstelle:=schoenezahl(1);beschrifteersten;FI;stelle:=schoenezahl(1);IFzeichen=phasendiagrammkennzeichenTHENmove(stelle,ymin);movecmr(0.0,0.2);drawcmr(0.0,-0.3)
;move(kreuz,stelle,ymin);movecmr(kreuz,0.0,0.2);drawcmr(kreuz,0.0,-0.3);beschrifte;FI;FORposFROM2UPTO3REPstelle:=schoenezahl(pos);zeichnexstrich;zeichnegegenstrich;beschriftePER.zeichnexstrich:move(stelle,ymin);drawcmr(0.0,0.1);move(kreuz,stelle,ymin);drawcmr(kreuz,0.0,0.1).zeichnegegenstrich:drawcmr(0.0,0.1);drawcmr(0.0,-0.3);drawcmr(kreuz,0.0,0.1);drawcmr(kreuz,0.0,-0.3).beschrifteersten:move(stelle,ymin);movecmr(0.0,-1.0*standardhoehe-abstand);draw(compress(wandle(stelle,laengebeibeschriftung,nachkommastellen)),0.0,standardhoehe,standardbreite);move(kreuz,stelle,ymin);movecmr(kreuz,0.0,-1.0*standardhoehe-abstand);draw(kreuz,compress(wandle(stelle,laengebeibeschriftung,nachkommastellen)),0.0,standardhoehe,standardbreite).beschrifte:IFzeichen=histogrammkennzeichenTHENmove(abbildungstelle,hoehe)ELSEmove(stelle,ymin)FI;movecmr(((-1.0)*real(vorkomma))*standardbreite,-1.0*standardhoehe-abstand);draw(wandle(stelle,laengebeibeschriftung,nachkommastellen),0.0,standardhoehe,standardbreite);IFzeichen=histogrammkennzeichenTHENmove(kreuz,abbildungstelle,hoehe)ELSEmove(kreuz,stelle,ymin)FI;movecmr(kreuz,((-1.0)*real(vorkomma))*standardbreite,-1.0*standardhoehe-abstand);draw(kreuz,wandle(stelle,laengebeibeschriftung,nachkommastellen),0.0,standardhoehe,standardbreite).yskalierung:zahlen(ymin,0.9*(ymax-ymin)+ymin,schoenezahl);FORposFROM1UPTO3REPstelle:=schoenezahl(pos);zeichneystrich;zeichneygegenstrich;beschrifteyPER.zeichneystrich:move(xmin,stelle);drawcmr(0.1,0.0);move(kreuz,xmin,stelle);drawcmr(kreuz,0.1,0.0).zeichneygegenstrich:drawcmr(0.1,0.0);drawcmr(kreuz,0.1,0.0).beschriftey:move(xmin,stelle);movecmr((-1.0)*(real(laengebeibeschriftung)+0.5)*standardbreite,-0.5*standardhoehe);draw(wandle(stelle,laengebeibeschriftung,nachkommastellen),0.0,standardhoehe,standardbreite);move(kreuz,xmin,stelle);movecmr(kreuz,(-1.0)*(real(laengebeibeschriftung)+0.5)*standardbreite,-0.5*standardhoehe);draw(kreuz,wandle(stelle,laengebeibeschriftung,nachkommastellen),0.0,standardhoehe,standardbreite).lieferekreuz:transfer:=kreuz;forget("KREUZ",quiet);transfer.abbildungstelle:IFzeitachsehistoTHENabbildungtbeihistogramm(xmin,xmax,ymin,ymax,stelle)ELSEstelleFI.END PROCkreuzerzeugenundzeichnen;PROCbeschrifte(TEXT CONSTwas,OUTPUT VARseite,INT CONSTfenster,ROWmaxanzvarproloesungINT CONSTpos,INT CONSTanzahl,REAL VARxmin,xmax,ymin,ymax):LETbeschriftungzeitxachse="t";INT VARz1;PICTURE VARbeschriftung:=nilpicture;TEXT VARname,varoberbegriff;IFanzahl=1THEN IFpos(1)<=dimensionTHENvaroberbegriff:=variablenkurzform(pos(1));ELSEvaroberbegriff:=covariablenkurzform(pos(1)-dimension);FI;ELIFlength(compress(variablenoberbegriffkurzform))=0THENvaroberbegriff:=compress(auskunftstext(auskoberbegriff))ELSEvaroberbegriff:=variablenoberbegriffkurzform;FI;IFwas=phasendiagrammkennzeichenTHENbeschriftephaseELIFwas=histogrammkennzeichenTHENbeschriftehistoELSEbeschriftezeitFI.beschriftephase:IFpos(1)<=dimensionTHENname:=variablenkurzform(pos(1));ELSEname:=covariablenkurzform(pos(1)-dimension);FI;move(beschriftung,xmax,ymin);movecmr(beschriftung,real((-1)*laengevarkurzform)*standardbreite,-2.0*standardhoehe-0.2);draw(beschriftung,name,0.0,standardhoehe,standardbreite);IFpos(2)<=dimensionTHENname:=variablenkurzform(pos(2));ELSEname:=covariablenkurzform(pos(2)-dimension);FI;move(beschriftung,xmin,ymax);movecmr(beschriftung,real((-1)*laengevarkurzform)*standardbreite-0.1,0.0);draw(beschriftung,name,0.0,standardhoehe,standardbreite);pen(beschriftung,durchgezogen);pen(loeschstift,standardstift,standarddicke,pen(beschriftung));plot(beschriftung);putkreuz(seite,fenster,beschriftung).beschriftehisto:pen(beschriftung,durchgezogen);pen(loeschstift,standardstift,standarddicke,pen(beschriftung));move(xmin,ymin);movecmr(-(real(length(beschriftungzeitxachse))+1.0)*standardbreite,-0.2);draw(beschriftungzeitxachse,0.0,standardhoehe,standardbreite);move(xmin,ymax);movecmr(-(real(length(varoberbegriff))+1.0)*standardbreite,-0.2);draw(varoberbegriff,0.0,standardhoehe,standardbreite);move(beschriftung,xmin,
ymin);movecmr(beschriftung,-(real(length(beschriftungzeitxachse))+1.0)*standardbreite,-0.2);draw(beschriftung,beschriftungzeitxachse,0.0,standardhoehe,standardbreite);move(beschriftung,xmin,ymax);movecmr(beschriftung,-(real(length(varoberbegriff))+1.0)*standardbreite,-0.2);draw(beschriftung,varoberbegriff,0.0,standardhoehe,standardbreite);FORz1FROM1UPTOanzahlREP IFpos(z1)<=dimensionTHENname:=variablenkurzform(pos(z1));ELSEname:=covariablenkurzform(pos(z1)-dimension);FI;move(xmin,ymax);mover(0.0,2.1*real(z1));movecmr(-(real(length(name))+1.0)*standardbreite,-0.2);draw(name,0.0,standardhoehe,standardbreite);move(beschriftung,xmin,ymax);mover(beschriftung,0.0,2.1*real(z1));movecmr(beschriftung,-(real(length(name))+1.0)*standardbreite,-0.2);draw(beschriftung,name,0.0,standardhoehe,standardbreite)PER;putkreuz(seite,fenster,beschriftung).beschriftezeit:REAL VARa,b,abstand;INT VARi,wortlaenge;ROWmaxanzvarproloesungPICTURE VARlinie;FORiFROM1UPTOmaxanzvarproloesungREPlinie(i):=nilpicturePER;INT VARstiftenr:=1;FORiFROM1UPTOanzahlREPpen(linie(i),stiftenr);IFstiftenr=penanzahlTHENstiftenr:=1ELSEstiftenrINCR1FI;PER;a:=real(laengebeibeschriftung)*standardbreite;b:=2.0*standardhoehe+0.2;abstand:=9.0*standardbreite;move(beschriftung,xmin,ymin);movecmr(beschriftung,-1.0*a,-1.0*b);draw(beschriftung,meldungstext(legendentext),0.0,standardhoehe,standardbreite);movecmr(beschriftung,abstand,0.0);FORiFROM1UPTOanzahlREPschreibenamen;unterstreichePER;beschrifteachsen;pen(beschriftung,durchgezogen);pen(loeschstift,standardstift,standarddicke,pen(beschriftung));plot(beschriftung);putkreuz(seite,fenster,beschriftung).schreibenamen:IFpos(i)<=dimensionTHENname:=variablenkurzform(pos(i));ELSEname:=covariablenkurzform(pos(i)-dimension);FI;wortlaenge:=length(name);draw(beschriftung,name,0.0,standardhoehe,standardbreite);movecmr(beschriftung,(real(wortlaenge)+0.5)*standardbreite,0.0).unterstreiche:stiftenr:=pen(linie(i));pen(linie(i),stiftenr);move(linie(i),xmin,ymin);movecmr(linie(i),(-1.0)*a+abstand,((-1.0)*b-0.1));drawcmr(linie(i),real(wortlaenge)*standardbreite,0.0);abstand:=abstand+(real(wortlaenge)+0.5)*standardbreite;pen(loeschstift,standardstift,standarddicke,pen(linie(i)));plot(linie(i));putkreuz(seite,fenster,linie(i)).beschrifteachsen:move(beschriftung,xmin,ymax);movecmr(beschriftung,(-1.0)*real(min(laengevarkurzform,length(varoberbegriff)))*standardbreite-0.1,0.0);draw(beschriftung,varoberbegriff,0.0,standardhoehe,standardbreite);name:=beschriftungzeitxachse;move(beschriftung,xmax,ymin);movecmr(beschriftung,-1.0*standardbreite,0.2);draw(beschriftung,name,0.0,standardhoehe,standardbreite).END PROCbeschrifte;REAL PROCabbildungtbeihistogramm(REAL CONSTtmin,tmax,nmin,nmax,takt):IFtmax=tminTHENnminELSEnmin+((takt-tmin)*(nmax-nmin)/(tmax-tmin))FI.END PROCabbildungtbeihistogramm;REAL PROCberechnetestbeizeitdiagramm(REAL CONSTx1,x2,y1,y2,yzw):IFy1=y2THENx1ELSEx1+((x2-x1)*(yzw-y1))/(y2-y1)FI.END PROCberechnetestbeizeitdiagramm;BOOL PROCimausgabefenster(ZUSTAND CONSTz,INT CONSTi,REAL CONSTmin,max):((zSUBi)<=max)CAND((zSUBi)>=min)END PROCimausgabefenster;FILE PROCtabelle(KURVE VARkurve,ZUSTAND CONSTmuster,BOOL CONSTmusterzeit):LETtabellenname=" tabelle",fracs=4,spaltenbreite=13,laenge=13,zeitbeschr=76,DARSTELLUNG=STRUCT(INTanzahlkurven,ROWmaxkurvenINTindex);REAL VARzeit,zeitdifferenz;ZUSTAND VARz:=neuerzustand(DSUBmuster);INT VARi:=0;ROWmaxkurvenSTRUCT(TEXTzraum,strich)VARspalte;INT VARspaltenanzahl,spaltenzaehler,punktzaehler:=0;TEXT CONSTtrennstrichfuerleerezeit:=(laenge+1)*" "+"!";waehlekurvenaus;richtedateiein;schreibeueberschrift;verarbeiteerstenpunkt;WHILE NOTendedestabspeichers(kurve)REPverarbeitenaechstenpunktPER;WHILE NOTanzahlmoeglicherpunkteerreichtCANDmusterzeitREPverarbeiteleerezeilePER;lieferedatei.waehlekurvenaus:DARSTELLUNG VARtabelle;tabelle.anzahlkurven:=0;FORiFROM1UPTO(DSUBmuster)REP IF(musterSUBi)=1.0THENtabelle.anzahlkurvenINCR1;tabelle.index(tabelle.anzahlkurven):=i;IFtabelle.anzahlkurven=maxkurvenTHEN LEAVEwaehlekurvenausFI FI PER.
richtedateiein:IFexists(tabellenname)THENforget(tabellenname,quiet)FI;FILE VARtab:=sequentialfile(output,tabellenname).schreibeueberschrift:bestimmespaltenanzahl;schreibeerstezeile;schreibeunterstreichung.bestimmespaltenanzahl:spaltenanzahl:=tabelle.anzahlkurven+1;setzetabelle.setzetabelle:FORiFROM1UPTOspaltenanzahlREPspalte(i).zraum:="";spalte(i).strich:=" |"PER.schreibeerstezeile:spaltenzaehler:=1;schreibeevtlzeit;FORiFROM1UPTOtabelle.anzahlkurvenREPschreibekoordinatenueberschriftPER;schreibezeileindatei;setzetabelle.schreibeevtlzeit:TEXT VARzeittext:=meldungstext(zeitbeschr);IFlength(zeittext)<laengevarkurzformTHENzeittextCAT((laengevarkurzform-length(zeittext))*" ");ELSEzeittext:=subtext(zeittext,1,laengevarkurzform);FI;spalte(spaltenzaehler).zraum:=((spaltenbreite-laengevarkurzform)*" ")+zeittext;spaltenzaehlerINCR1.schreibekoordinatenueberschrift:TEXT VARbezeichnung;INT VARblankanzahl;IFtabelle.index(i)<=dimensionTHENbezeichnung:=variablenkurzform(tabelle.index(i));ELSEbezeichnung:=covariablenkurzform(tabelle.index(i)-dimension);FI;blankanzahl:=spaltenbreite-length(bezeichnung);spalte(spaltenzaehler).zraum:=((blankanzahlDIV2)*" "+bezeichnung)+(((blankanzahlDIV2)+(blankanzahlMOD2))*" ");spaltenzaehlerINCR1.schreibeunterstreichung:TEXT VARzeile:="",textspalte:="";textspalte:=(laenge+1)*"-"+"+";zeile:=(spaltenzaehler-1)*textspalte;putline(tab,zeile).verarbeiteerstenpunkt:REAL VARzahl;punktzaehlerINCR1;leseerstenbeobachtungspunkt(kurve,zeit,z);schreibepunktinspalten;schreibezeileindatei.schreibepunktinspalten:spaltenzaehler:=1;schreibezeitinspalte;FORiFROM1UPTOtabelle.anzahlkurvenREPschreibekoordinateinspaltePER.schreibezeitinspalte:zahl:=zeit;spalte(spaltenzaehler).zraum:=wandle(zahl,laenge,fracs);spaltenzaehlerINCR1.schreibekoordinateinspalte:zahl:=(zSUBtabelle.index(i));IFergebnisganzzahligTHENzahl:=floor(zSUBtabelle.index(i))ELSEzahl:=zSUBtabelle.index(i)FI;spalte(spaltenzaehler).zraum:=wandle(zahl,laenge,fracs);spaltenzaehlerINCR1.schreibezeileindatei:zeile:="";FORiFROM1UPTOspaltenanzahlREPzeileCATspalte(i).zraum;zeileCATspalte(i).strichPER;putline(tab,zeile).verarbeitenaechstenpunkt:lesenaechstenbeobachtungspunkt(kurve,zeit,z);punktzaehlerINCR1;IFpunktzaehler=2THENzeitdifferenz:=zeit;FI;schreibepunktinspalten;schreibezeileindatei.lieferedatei:tab.anzahlmoeglicherpunkteerreicht:punktzaehler>=normaleanzahlvonausgegebenenpunkten.verarbeiteleerezeile:IFzeitdifferenz=0.0THENspalte(1).zraum:=trennstrichfuerleerezeit;ELSEzeit:=real(punktzaehler)*zeitdifferenz;spalte(1).zraum:=wandle(zeit,laenge,fracs);FI;putline(tab,spalte(1).zraum);punktzaehlerINCR1;.ENDPROCtabelle;END PACKETcoroutinenundco;