app/schulis-simulationssystem/3.0/src/mat.hp74xx plot

Raw file
Back to index

1
2
3
PACKEThpplotDEFINESdrawingarea,plotterkanal,beginplot,endplot,plotend,stdhoehe,stdbreite,geschwindigkeit,clear,pen,move,draw:LETxcm=40.19,ycm=27.46,plotterunitspercm=402.0,buffersize=1024;LETinitcmd="IN",textcmd="LB",separator=",",terminator=";",outputterminator="
",movecmd="PU",drawcmd="PD",pencmd="SP",charsizecmd="SI",linetypecmd="LT",plotabscmd="PA",askbuffersize="�.B",stdcharpre="�CS33;LB",stdcharpost="�SS;LB",etx="";ROW22TEXT CONSTnichtasciizeichen:=ROW22TEXT:(stdcharpre+"["+stdcharpost,stdcharpre+"\"+stdcharpost,stdcharpre+"]"+stdcharpost,stdcharpre+"{"+stdcharpost,stdcharpre+"|"+stdcharpost,stdcharpre+"}"+stdcharpost,"k","-","#"," ",stdcharpre+"~"+stdcharpost,"�UC3,0,99,0,16,-99,0,-8,99,-3,0;LB","�UC3,0,99,0,16;LB","�UC3,0,99,0,8,-4,0;LB","�UC0,8,99,3,0,0,8;LB","�UC3,16,99,0,-8,3,0;LB","�UC3,0,99,0,8,3,0;LB","�UC0,8,99,6,0,-99,-3,0,99,0,8;LB","�UC0,8,99,6,0,-99,-3,0,99,0,-8;LB","�UC3,0,99,0,16,-99,0,-8,99,3,0;LB","�UC0,8,99,6,0;LB","�UC0,8,99,6,0,-99,-3,-8,99,0,16;LB");INT CONSTxunits:=int(xcm*plotterunitspercm),yunits:=int(ycm*plotterunitspercm);INT VARterminalchannel,plotterchannel:=5;INT VARfreebytes;REAL VARbuchstabenhoehe:=ycm/25.0,buchstabenbreite:=xcm/80.0;PROCdrawingarea(REAL VARx1,y1,INT VARxpixel,ypixel):x1:=xcm;y1:=ycm;xpixel:=xunits;ypixel:=yunits;END PROCdrawingarea;PROCgeschwindigkeit(INT CONSTx):END PROCgeschwindigkeit;REAL PROCstdhoehe:buchstabenhoeheEND PROCstdhoehe;REAL PROCstdbreite:buchstabenbreiteEND PROCstdbreite;PROCstdhoehe(REAL CONSThoehe):buchstabenhoehe:=hoehe;END PROCstdhoehe;PROCstdbreite(REAL CONSTbreite):buchstabenbreite:=breite;END PROCstdbreite;PROCbeginplot:freebytes:=9;toplotterchannel;clear;TEXT VARhp:=pencmd;hpCAT"1";hpCATterminator;sendtoplotter(hp)ENDPROCbeginplot;PROCendplot:ENDPROCendplot;PROCplotend:clear;TEXT VARhp:=pencmd;hpCAT"0";hpCATterminator;hpCATinitcmd;hpCATterminator;sendtoplotter(hp);toterminalchannelENDPROCplotend;PROCclear:TEXT VARhp:=initcmd;hpCATterminator;hpCATplotabscmd;hpCATterminator;sendtoplotter(hp);END PROCclear;PROCpen(INT CONSTbackground,foreground,thickness,linetype):TEXT VARhp:=pencmd;IFforeground>6ORforeground<1THENhpCAT"1"ELSEhpCATtext(foreground)END IF;hpCATterminator;hpCATlinetypecmd;IFlinetype>1ANDlinetype<6THENhpCATtext(linetype-1);hpCATseparator;hpCAT"0.75";END IF;hpCATterminator;sendtoplotter(hp)END PROCpen;PROCmove(INT CONSTx,y):verifyxy;movetoxy.verifyxy:INT VARxx,yy;xx:=max(0,x);xx:=min(xunits,xx);yy:=max(0,y);yy:=min(yunits,yy).movetoxy:TEXT VARhp:=movecmd;hpCATtext(xx);hpCATseparator;hpCATtext(yy);hpCATterminator;sendtoplotter(hp)END PROCmove;PROCdraw(INT CONSTx,y):verifyxy;drawtoxy.verifyxy:INT VARxx,yy;xx:=max(0,x);xx:=min(xunits,xx);yy:=max(0,y);yy:=min(yunits,yy).drawtoxy:TEXT VARhp:=drawcmd;hpCATtext(xx);hpCATseparator;hpCATtext(yy);hpCATterminator;sendtoplotter(hp)END PROCdraw;PROCdraw(TEXT CONSTrecord,REAL CONSTangle,height,width):TEXT VARhp:=charsizecmd,konvertiertertext:="";konvertieretext;hpCATtext(width*0.66666667,8,4);hpCATseparator;hpCATtext(height*0.5,8,4);hpCATterminator;hpCATtextcmd;hpCATkonvertiertertext;hpCATetx;sendtoplotter(hp).konvertieretext:INT VARstelle;INT VARzeichen;FORstelleFROM1UPTO LENGTHrecordREPEATzeichen:=code(recordSUBstelle);IFzeichen=251THENkonvertiertertextCATnichtasciizeichen[11]ELIFzeichen>=185ANDzeichen<=188THENkonvertiertertextCATnichtasciizeichen[zeichen-173]ELIFzeichen>=200ANDzeichen<=206THENkonvertiertertextCATnichtasciizeichen[zeichen-184]ELIFzeichen>=214ANDzeichen<=223THENkonvertiertertextCATnichtasciizeichen[zeichen-213]ELSEkonvertiertertextCATcode(zeichen)END IF END REPEAT END PROCdraw;PROCdraw(TEXT CONSTrecord):draw(record,0.0,stdhoehe,stdbreite)END PROCdraw;PROCtoplotterchannel:terminalchannel:=channel(myself);continue(plotterchannel);END PROCtoplotterchannel;PROCtoterminalchannel:END PROCtoterminalchannel;INT PROCplotterkanal:plotterchannelEND PROCplotterkanal;PROCplotterkanal(INT CONSTnr):plotterchannel:=nr;END PROCplotterkanal;PROCsendtoplotter(TEXT CONSTstring):INT VARlaenge;laenge:=
LENGTHstring;IFfreebytes<buffersizeDIV2ORfreebytes-9<laengeTHENwarteaufgenugfreienpufferEND IF;out(string);freebytesDECRlaenge;checkforerror.warteaufgenugfreienpuffer:TEXT VARplotteroutput,char;INT VARdelay:=0;REPplotteroutput:="";pause(delay);REP UNTILincharety=""PER;out(askbuffersize);freebytesDECR3;REPinchar(char);plotteroutputCATcharUNTILchar=outputterminatorPER;plotteroutput:=subtext(plotteroutput,1,LENGTHplotteroutput-1);freebytes:=int(plotteroutput);delay:=1;UNTILfreebytes>buffersizeDIV2ANDfreebytes-9>=laengePER.checkforerror:out("OE;");TEXT VARc,t;inchar(c);inchar(t);IFc<>"0"THENtoterminalchannel;errorstop("Fehler durch String: "+string+" Nr.: "+c)FI;out("�.E");inchar(c);inchar(t);IFt<>outputterminatorTHENcCATt;inchar(t);END IF;IFc<>"0"THENtoterminalchannel;errorstop("Fehler durch String: "+string+" Nr.: "+c)END IF;freebytesDECR6END PROCsendtoplotter;END PACKEThpplot;plotterkanal(7)