Commit 0cbb106c by kollo

version 1.09-4

parent 6180eac2
Diese Beispielprogramme sind Anwendingen der Modifikation tinexbasic fuer das
HERA-Kontrollsystem (DESY, Hamburg) und laufen nicht in
der normalen X11-Basic-Version. Sie koennen aber als Beispiel und Anregung
dienen.
M.H. 08'2003
open "I",#1,"mail/HERA"
print "<HTML> <HEAD> <TITLE> HERA Beam Dynamics Meeting</TITLE></HEAD>"
print "<BODY bgcolor=#ffffff link=2200aa vlink=008800>"
print "MARKUS HOFFMANN 1/1 2003<hr>"
print "scanmail V.1.01 Markus Hoffmann's at DESY "
i=0
while not eof(#1)
lineinput #1,t$
if left$(t$,16)="Subject: HERA Be"
wort_sep t$,":",1,a$,subject$
print "<hr>"
print "<H3>"
print subject$
print "</H3>"
print "<A HREF="+chr$(34)+"minutes/"+chr$(34)+"> MINUTES </A>"
flush
wort_sep subject$," : ",1,a$,sdate$
a=20
endif
if a
if left$(t$,5)="From:" or left$(t$,5)="Recei"
if flag
print "</UL>"
endif
a=0
flag=0
else
if instr(t$,"schedule") and flag=0
print "<UL>"
flag=1
endif
if instr(t$,"regards") or instr(t$,"Barber")
if flag
print "</UL>"
endif
flag=0
endif
endif
endif
if flag
t$=trim$(t$)
if glob(left$(t$,3),"*)*")
print "<li> ";
flag2=1
else
if flag2 and len(t$)
print "<p>"
flag2=0
endif
endif
if glob(t$,"*http:/*")
wort_sep t$,"http:/",1,a$,b$
wort_sep b$," ",1,b$,c$
print a$+"<A HREF="+chr$(34)+"http:/"+b$+chr$(34)+"> http:/"+b$+"</a> "+c$
else
print t$
endif
endif
wend
close
if flag
print "</UL>"
endif
print "<HR><br><I>Kommentare oder Anregungen zu dieser WWW-Seite bitte"
print "<A HREF=mailto:hoffmann@mpyldhoff.desy.de>hierhin</A>.</I><P>"
print "<FONT FACE="+chr$(34)+"ARIAL,HELVETICA"+chr$(34)+" SIZE=1>"
print "<SCRIPT Language="+chr$(34)+"JavaScript"+chr$(34)+">"
print "<!--"
print " document.write('Letzte Bearbeitung: '+document.lastModified);"
print " //-->"
print "</SCRIPT></FONT></BODY></HTML>"
quit
' ############################################################
' ## Dynamische Temperatur-Ueberwachung der Messfuehler an ##
' ## den Absorberflanschen der Wechselwirkungszonen Nord ##
' ## und Sued bei HERA. ##
' ## ##
' ## Projekt von Anju Stroemer und Markus Hoffmann ##
' ## Letzte Bearbeitung: 03.11.2003 ##
' ############################################################
dim tempsn(6,1),tempss(6,1)
dim timesn(6,1),timess(6,1)
dim taun(6),taus(6),texte$(6)
dim warnn(6),dumpn(6)
dim warns(6),dumps(6)
' Zeitkonstanten:
' Ermittelt aus den Abkuehlkurven bei Strahldump oder -verlust
' des Positronenstrahls. Verhalten etwa E-Funktion
' Bei hohen Temperatuen allerdings staerkere Abkuehlung und
' kleineres Tau, Einheit: Sekunden
taun(0)=440
taun(1)=500
taun(2)=370
taun(3)=500
taun(4)=500
taun(5)=888
taun(6)=5040
taus(0)=500
taus(1)=500
taus(2)=1900
taus(3)=486
taus(4)=500
taus(5)=2900
taus(6)=60
dumpn(0)=50
dumpn(1)=50
dumpn(2)=50
dumpn(3)=50
dumpn(4)=50
dumpn(5)=50
dumpn(6)=50
dumps(0)=50
dumps(1)=50
dumps(2)=50
dumps(3)=50
dumps(4)=50
dumps(5)=50
dumps(6)=200
texte$(0)="11m e innen"
texte$(1)="11m p innen"
texte$(2)="11m p aussen"
texte$(3)="11m innen"
texte$(4)="11m aussen"
texte$(5)="14m"
texte$(6)="H1 C4a / SR 19 m"
sizew ,640,200
titlew 1,"Temperaturueberwachung 11m + 14 m"
dt=8
schwarz=get_color(0,0,0)
weiss=get_color(65535,65535,65535)
rot=get_color(65535,0,0)
gruen=get_color(0,65535,0)
gelb=get_color(65535,65535,0)
orange=get_color(65535,32000,0)
blau=get_color(0,0,65535)
clearw 1
@button(370,185,"QUIT",0)
@button(320,185,"HELP",0)
color weiss
text 400,190,"(c) Anju Stroemer & Markus Hoffmann"
for i=0 to 6
text 500,i*20+20,texte$(i)
next i
showpage
do
sdt=timer
@mausfrage
color schwarz
pbox 0,0,500,175
@drawabs(0,0)
text 94,16,"N"
text 370,12,"N"
text 400,12,"S"
text 94,116,"S"
@drawabs(0,100)
for i=0 to 6
if abs(tempsn(i,1)-tempsn(i,0))>0.21
tempsn(i,0)=tempsn(i,1)
timesn(i,0)=timesn(i,1)
endif
if abs(tempss(i,1)-tempss(i,0))>0.21
tempss(i,0)=tempss(i,1)
timess(i,0)=timess(i,1)
endif
timesn(i,1)=timer
timess(i,1)=timer
next i
tempsn(0,1)=tineget("HERA/HERADATA/NR11ei/[ABSTEMPNRD1]")
tempsn(1,1)=tineget("HERA/HERADATA/NR11ea/[ABSTEMPNRD1]")
tempsn(2,1)=tineget("HERA/HERADATA/NR11pa/[ABSTEMPNRD1]")
tempsn(3,1)=tineget("HERA/HERADATA/NR11i/[ABSTEMPNRD1]")
tempsn(4,1)=tineget("HERA/HERADATA/NR11a/[ABSTEMPNRD1]")
tempsn(5,1)=tineget("HERA/HERADATA/NR14i/[ABSTEMPNRD1]")
tempsn(6,1)=tineget("HISTORY/C4a-R-Innen/[H1TEMP-HV]")
' tempsn(6,1)=tineget("HISTORY/#0/[H1TEMP-HV]")
@mausfrage
tempss(0,1)=tineget("HERA/HERADATA/SR11ei/[ABSTEMPSUD1]")
tempss(1,1)=tineget("HERA/HERADATA/SR11ea/[ABSTEMPSUD1]")
tempss(2,1)=tineget("HERA/HERADATA/SR11pa/[ABSTEMPSUD1]")
tempss(3,1)=tineget("HERA/HERADATA/SR11i/[ABSTEMPSUD1]")
tempss(4,1)=tineget("HERA/HERADATA/SR11a/[ABSTEMPSUD1]")
tempss(5,1)=tineget("HERA/HERADATA/SR14i/[ABSTEMPSUD1]")
tempss(6,1)=tineget("HERA/HERADATA/SR19a/[ABSTEMPSUD1]")
@mausfrage
ecur=tineget("HERA/HERADATA/#0[HEDCCur]")
pcur=tineget("HERA/HERADATA/#0[HPDCCur]")
' for i=0 to 6
' print tempsn(i,1)-tempsn(i,0),(timesn(i,1)-timesn(i,0))
' next i
' for i=0 to 6
' print tempss(i,0),tempss(i,1),tempss(i,1)-tempss(i,0),(timess(i,1)-timess(i,0))
' next i
color gruen
text 420,160,"p:"
color rot
text 320,160,"e+:"
color gelb
text 350,160,str$(int(ecur*10)/10)+" mA"
text 450,160,str$(int(pcur*10)/10)+" mA"
@dispn(155,44,0)
@dispn(155,67,1)
@dispn(158,28,2)
@dispn(233,38,3)
@dispn(30,71,4)
@dispn(15,8,5)
@disps(155,144,0)
@disps(155,167,1)
@disps(158,128,2)
@disps(233,138,3)
@disps(30,171,4)
@disps(15,108,5)
' print mousex,mousey
for i=0 to 6
a=tempsn(i,1)+taun(i)*(tempsn(i,1)-tempsn(i,0))/(timesn(i,1)-timesn(i,0))
color orange
text 330,i*20+20,str$(int(a*10)/10)
color gelb
text 300,i*20+20,str$(int(tempsn(i,1)*10)/10)
if tempsn(i,1)-tempsn(i,0)>0.11
color rot
line 290,i*20+20,290,i*20+2
else if tempss(i,1)-tempss(i,0)<-0.11
color blau
line 290,i*20+20,290,i*20+2
endif
if a>dumpn(i)
warnn(i)=2
color rot
pcircle 370,i*20+20,6
else if a>0.8*(dumpn(i)-20)+20
warnn(i)=1
color gelb
pcircle 370,i*20+20,6
else
warnn(i)=0
endif
color weiss
circle 370,i*20+20,6
next i
for i=0 to 6
a=tempss(i,1)+taus(i)*(tempss(i,1)-tempss(i,0))/(timess(i,1)-timess(i,0))
color orange
text 420,i*20+20,str$(int(a*10)/10)
color gelb
text 450,i*20+20,str$(int(tempss(i,1)*10)/10)
if tempss(i,1)-tempss(i,0)>0.11
color rot
line 480,i*20+20,480,i*20+2
else if tempss(i,1)-tempss(i,0)<-0.11
color blau
line 480,i*20+20,480,i*20+2
endif
warns(i)=int(a/50)
if a>dumps(i)
color rot
pcircle 400,i*20+20,6
warns(i)=2
else if a>0.8*(dumps(i)-20)+20
color gelb
pcircle 400,i*20+20,6
warns(i)=1
else
warns(i)=0
endif
color weiss
circle 400,i*20+20,6
next i
showpage
a=max(0.5,dt-(timer-sdt))
while a>0.5
@mausfrage
pause 0.5
sub a,0.5
wend
pause a
loop
end
procedure mausfrage
local t$,mouse_x,mouse_y,mouse_k
MOUSE mouse_x,mouse_y,mouse_k
IF mouse_k=1
IF @inbutton(370,185,"QUIT",mouse_x,mouse_y)
@button(370,185,"QUIT",TRUE)
VSYNC
quit
endif
IF @inbutton(320,185,"HELP",mouse_x,mouse_y)
t$="Temperaturueberwachung der Flansche in der Naehe von Absorber 4||"
t$=t$+"Gelbe Punkte: Temperatur kann bis 80% der Dumpschwelle ansteigen|"
t$=t$+"Rote Punkte: Temperaturanstieg fuehrt wahrscheinlich zum Dump|"
t$=t$+"Gelbe Zahlen: Aktuelle Temperatur-Messwerte|"
t$=t$+"Orange Zahlen: Temperaturanstieg geht wahrscheinlich bis...|"
if form_alert(1,"[1]["+t$+"][ OK | mehr ...]")=2
t$="Temperaturueberwachung der Flansche in der Naehe von Absorber 4||"
t$=t$+"Fuer weitere Fragen bitte an Markus Hoffmann wenden|"
~form_alert(1,"[1]["+t$+"][ OK ]")
endif
endif
endif
return
procedure drawabs(x,y)
color weiss
box x+50,y,x+50+100,y+60
line x,y+10,x+50,y+10
line x,y+20+30,x+50,y+20+30
line x+150,y+6,x+200,y+6
line x+150,y+16,x+200,y+16
line x+150,y+26,x+200,y+26
line x+150,y+36,x+200,y+36
line x+150,y+46,x+200,y+46
line x+150,y+56,x+200,y+56
box x+35,y,x+45,y+60
box x+130+35,y+22,x+130+40,y+40
box x+120+35,y+42,x+120+40,y+60
box x+140+35,y+2,x+140+40,y+20
text x+80,y+40,"Abs 4"
box x+200+35,y+42,x+200+40,y+60
line x+225,y+46,x+250,y+46
line x+225,y+56,x+250,y+56
return
procedure button(button_x,button_y,button_t$,sel)
local x,y,w,h
defline ,1
deftext 1,0.05,0.1,0
button_l=ltextlen(button_t$)
x=button_x-button_l/2-10
y=button_y-10
w=button_l+20
h=20
color grau
pbox x+5,y+5,x+w+5,y+h+5
color abs(sel)*schwarz+abs(not sel)*weiss
pbox x,y,x+w,y+h
if sel=-1
color weiss
else
color schwarz
endif
box x,y,x+w,y+h
ltext button_x-button_l/2,button_y-5,button_t$
RETURN
FUNCTION inbutton(button_x,button_y,button_t$,mx,my)
local x,y,w,h
deftext 1,0.05,0.1,0
button_l=ltextlen(button_t$)
x=button_x-button_l/2-10
y=button_y-10
w=button_l+20
h=20
if mx>=x and my>=y and mx<=x+w and my<=y+h
RETURN TRUE
ELSE
RETURN FALSE
ENDIF
ENDFUNC
procedure dispn(x,y,oi)
if warnn(oi)=2
color rot
else if warnn(oi)
color rot
else
color gelb
endif
text x,y,str$(int(tempsn(oi,1)*10)/10)
return
procedure disps(x,y,oi)
if warns(oi)=2
color rot
else if warnn(oi)
color rot
else
color gelb
endif
text x,y,str$(int(tempss(oi,1)*10)/10)
return
%
% Daten von Anju Stromer und Markus Hoffmann
%
%Parameter (Archiv) Name Dumpschwelle [C] Tau [s]
%
%ABSTEMPNRD1[42] NR11a 50 1000 +/- 800
%ABSTEMPNRD1[83] NR11i 55 1000 +/- 500
%ABSTEMPNRD1[48] NR11ei 50 1500 bzw. 440
%ABSTEMPNRD1[43] NR11pi 50 300+/-115 bzw. 1860+/-11
%ABSTEMPNRD1[57] NR11pa 50 370 bzw 1700
%ABSTEMPNRD1[54] NR14i 50 470 bzw 1380 (892+/-22)
%Parameter Name Dumpschwelle [C] Tau [s]
%
%ABSTEMPSUD1[57] SR11a 50
%ABSTEMPSUD1[81] SR11i 55
%ABSTEMPSUD1[48] SR11ei 50
%ABSTEMPSUD1[55] SR11pi 50
%ABSTEMPSUD1[58] SR11pa 50
%ABSTEMPSUD1[54] SR14i 50
%Parameter Name Dumpschwelle [C] Tau [s]
%
%H1TEMP-HV[0] C4a-R-Innen ? (6800+/-400) --->(5040+/-80) bzw (7200 +/- 90)
%H1TEMP-HV[1] C4b-R-Innen ? (6600+/-780)
%H1TEMP-HV[2] C5a-R-Innen ? (2430+/-140)
%H1TEMP-HV[3] C5b-R-Innen ? (7160+/-370)
%H1TEMP-HV[4] GO-Flange ? (5920+/-120)
%H1TEMP-HV[5] GO-Flange ? ----
%H1TEMP-HV[6] key-3570-Oben ? (3130+/-150)
%H1TEMP-HV[7] GG-TrFlug-Ri ? (2590+/-50)
%H1TEMP-HV[8] AlBe-Metall-Ob ? (2700+/-100)
%H1TEMP-HV[9] GO-PU-Balg-Ob-1 ? (5870+/-100)
%H1TEMP-HV[10] GG-PU-Balg-Ob-2 ? (7470+/-400)
......@@ -2,7 +2,7 @@ Summary: Example basic program sourcefiles for X11-Basic
Vendor: Markus Hoffmann
Name: X11Basic-examples
Version: 1.09
Release: 2
Release: 4
Copyright: GPL
Group: Development/Languages
URL: http://x11-basic.sourceforge.net/examples/
......@@ -27,7 +27,7 @@ Dies sind einige Beispielprogramme mit teils
groesserem Umfang fuer X11-Basic.
Sie sollen als Anleitung und Anregung fuer eigene
Programme diehnen.
Programme dienen.
Viel Spass damit.
Markus Hoffmann
......@@ -37,13 +37,3 @@ Authors:
--------
Markus Hoffmann <kollo@users.sourceforge.net>
%changelog
* Tue Jun 26 2003 Markus Hoffmann <kollo@users.sourceforge.net>
changed email-address
* Tue Mar 07 2002 Markus Hoffmann <m.hoffmann@uni-bonn.de>
included manual
* Tue Jan 01 2002 Markus Hoffmann <m.hoffmann@uni-bonn.de>
2nd release
* Tue Aug 28 2001 Markus Hoffmann <m.hoffmann@uni-bonn.de>
1st release
' Is there something wrong with the random generator ?
dim m(10)
n=10000
for a=1 to n
m=0
For b=1 to 10
m=min(m,round(random(100)/10))
next b
m(m)=m(m)+1
next a
print "MIN:"
for a=0 to 10
print a,": ",int(m(a)/n*1000)/10
next a
arrayfill m(),0
n=10000
for a=1 to n
m=0
For b=1 to 10
m=max(m,round(random(100)/10))
next b
m(m)=m(m)+1
next a
print "MAX:"
for a=0 to 10
print a,": ",int(m(a)/n*1000)/10
next a
Diese Beispielprogramme sind Anwendingen der Modifikation csxbasic fuer das
ELSA-Kontrollsystem (Physikalisches Institut, Uni-Bonn) und laufen nicht in
der normalen X11-Basic-Version. Sie koennen aber als Beispiel und Anregung
diehnen.
dienen.
M.H. 08'2001
......@@ -1251,13 +1251,13 @@ procedure hoehenprofil
print #11,"set y2label "+chr$(34)+"Geschwindigkeit [km/h]"+chr$(34)
print #11,"set origin 0,0"
print #11,"set size 1,0.5"
print #11,"plot [:][-10:] "+chr$(34)+dattmp$+chr$(34)+" u ($2/1000):4 t ";
print #11,"plot [:][-10:200] "+chr$(34)+dattmp$+chr$(34)+" u ($2/1000):4 t ";
print #11,chr$(34)+"Hoehe"+chr$(34)+" w steps , ";
print #11,chr$(34)+dattmp$+chr$(34)+" u ($2/1000):($5) t ";
print #11,chr$(34)+"Geschwindigkeit"+chr$(34)+" w steps"
print #11,"set origin 0,0.5"
print #11,"set xlabel "+chr$(34)+"Zeit [h]"+chr$(34)
print #11,"plot [:][-10:] "+chr$(34)+dattmp$+chr$(34)+" u ($3/3600):4 t ";
print #11,"plot [:][-10:200] "+chr$(34)+dattmp$+chr$(34)+" u ($3/3600):4 t ";
print #11,chr$(34)+"Hoehe"+chr$(34)+" w steps , ";
print #11,chr$(34)+dattmp$+chr$(34)+" u ($3/3600):5 t ";
print #11,chr$(34)+"Geschwindigkeit"+chr$(34)+" w steps"
......
......@@ -11,7 +11,7 @@
FTEXT(X=1,Y=2,W=30,H=1,COLOR=4513,FONT=3,BORDER=1,TEXT="", PTMP="_______________________________________",PVALID="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", FLAGS=EDITABLE)
FTEXT(X=1,Y=3,W=30,H=1,COLOR=4513,FONT=3,BORDER=1,TEXT="", PTMP="_______________________________________",PVALID="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", FLAGS=EDITABLE)
FTEXT(X=1,Y=4,W=30,H=1,COLOR=4513,FONT=3,BORDER=1,TEXT="", PTMP="_______________________________________",PVALID="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", FLAGS=EDITABLE)
BOX(X=2,Y=6,W=50,H=3, FRAME=-1, FRAMECOL=1, TEXTCOL=1, BGCOL=1, PATTERN=0, TEXTMODE=0) {
BOX(X=2,Y=6,W=50,H=3, FRAME=-1, FRAMECOL=1, TEXTCOL=1, BGCOL=1, PATTERN=5, TEXTMODE=0) {
BUTTON(X=2,Y=1,W=4,H=1, TEXT="ON",STATE=SELECTED, FLAGS=RADIOBUTTON+SELECTABLE,FRAME=2, FRAMECOL=1, TEXTCOL=1, BGCOL=1, PATTERN=0, TEXTMODE=0)
BUTTON(X=8,Y=1,W=4,H=1, TEXT="OFF",FLAGS=RADIOBUTTON+SELECTABLE,FRAME=2, FRAMECOL=1, TEXTCOL=1, BGCOL=1, PATTERN=0, TEXTMODE=0)
}
......
' gui2bas V.1.00 (c) Markus Hoffmann 2003
' convertetd demo.gui 22.10.2003 17:41:03
bx=0
by=20
bw=640
bh=400
@formular ! execute form
quit
procedure formular
local ret
' Little selector box (c) Markus Hoffmann 07.2003
' convert this with gui2bas !
' as an example for the use of the gui system
' with X11-Basic
string0$="Select option ..."+chr$(0)+space$(0)
string1$=""+chr$(0)
string2$=""+chr$(0)
tedinfo0$=mkl$(varptr(string0$))+mkl$(varptr(string1$))+mkl$(varptr(string2$))+mki$(3)+mki$(0)+mki$(2)+mki$(4513)+mki$(0)+mki$(253)+mki$(0)+mki$(0)
obj1$=mki$(2)+mki$(-1)+mki$(-1)+mki$(22)+mki$(0)+mki$(32)+mkl$(varptr(tedinfo0$))+mki$(16)+mki$(16)+mki$(560)+mki$(16)
string3$="Line 1"+chr$(0)+space$(39)
string4$="_______________________________________"+chr$(0)
string5$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"+chr$(0)
tedinfo1$=mkl$(varptr(string3$))+mkl$(varptr(string4$))+mkl$(varptr(string5$))+mki$(3)+mki$(0)+mki$(0)+mki$(4513)+mki$(0)+mki$(1)+mki$(39)+mki$(39)
obj3$=mki$(4)+mki$(-1)+mki$(-1)+mki$(29)+mki$(8)+mki$(0)+mkl$(varptr(tedinfo1$))+mki$(8)+mki$(16)+mki$(240)+mki$(16)
string6$=""+chr$(0)+space$(39)
string7$="_______________________________________"+chr$(0)
string8$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"+chr$(0)
tedinfo2$=mkl$(varptr(string6$))+mkl$(varptr(string7$))+mkl$(varptr(string8$))+mki$(3)+mki$(0)+mki$(0)+mki$(4513)+mki$(0)+mki$(1)+mki$(39)+mki$(39)
obj4$=mki$(5)+mki$(-1)+mki$(-1)+mki$(29)+mki$(8)+mki$(0)+mkl$(varptr(tedinfo2$))+mki$(8)+mki$(32)+mki$(240)+mki$(16)
string9$=""+chr$(0)+space$(39)
string10$="_______________________________________"+chr$(0)
string11$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"+chr$(0)
tedinfo3$=mkl$(varptr(string9$))+mkl$(varptr(string10$))+mkl$(varptr(string11$))+mki$(3)+mki$(0)+mki$(0)+mki$(4513)+mki$(0)+mki$(1)+mki$(39)+mki$(39)
obj5$=mki$(6)+mki$(-1)+mki$(-1)+mki$(29)+mki$(8)+mki$(0)+mkl$(varptr(tedinfo3$))+mki$(8)+mki$(48)+mki$(240)+mki$(16)
string12$=""+chr$(0)+space$(39)
string13$="_______________________________________"+chr$(0)
string14$="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"+chr$(0)
tedinfo4$=mkl$(varptr(string12$))+mkl$(varptr(string13$))+mkl$(varptr(string14$))+mki$(3)+mki$(0)+mki$(0)+mki$(4513)+mki$(0)+mki$(1)+mki$(39)+mki$(39)
obj6$=mki$(7)+mki$(-1)+mki$(-1)+mki$(29)+mki$(8)+mki$(0)+mkl$(varptr(tedinfo4$))+mki$(8)+mki$(64)+mki$(240)+mki$(16)
string15$="ON"+chr$(0)
obj8$=mki$(9)+mki$(-1)+mki$(-1)+mki$(26)+mki$(17)+mki$(1)+mkl$(varptr(string15$))+mki$(16)+mki$(16)+mki$(32)+mki$(16)
string16$="OFF"+chr$(0)
obj9$=mki$(7)+mki$(-1)+mki$(-1)+mki$(26)+mki$(17)+mki$(0)+mkl$(varptr(string16$))+mki$(64)+mki$(16)+mki$(32)+mki$(16)
obj7$=mki$(2)+mki$(8)+mki$(9)+mki$(20)+mki$(0)+mki$(0)+mkl$(16716058)+mki$(16)+mki$(96)+mki$(400)+mki$(48)
obj2$=mki$(10)+mki$(3)+mki$(7)+mki$(20)+mki$(0)+mki$(0)+mkl$(16716032)+mki$(16)+mki$(48)+mki$(480)+mki$(160)
ok=10
string17$="OK"+chr$(0)
obj10$=mki$(11)+mki$(-1)+mki$(-1)+mki$(26)+mki$(7)+mki$(0)+mkl$(varptr(string17$))+mki$(520)+mki$(64)+mki$(56)+mki$(64)
cancel=11
string18$="CANCEL"+chr$(0)
obj11$=mki$(0)+mki$(-1)+mki$(-1)+mki$(26)+mki$(37)+mki$(0)+mkl$(varptr(string18$))+mki$(520)+mki$(144)+mki$(56)+mki$(64)
obj0$=mki$(-1)+mki$(1)+mki$(11)+mki$(20)+mki$(0)+mki$(16)+mkl$(135424)+mki$(0)+mki$(0)+mki$(592)+mki$(224)
tree0$=obj0$+obj1$+obj2$+obj3$+obj4$+obj5$+obj6$+obj7$+obj8$+obj9$+obj10$
tree0$=tree0$+obj11$
~form_dial(0,0,0,0,0,bx,by,bw,bh)
~form_dial(1,0,0,0,0,bx,by,bw,bh)
' ~objc_draw(varptr(tree0$),0,-1,0,0)
ret=form_do(varptr(tree0$))
~form_dial(2,0,0,0,0,bx,by,bw,bh)
~form_dial(3,0,0,0,0,bx,by,bw,bh)
vsync
return
echo off
' Zahlen als Text (deutsch) (c) Markus Hoffmann 1999
PRINT @zahl$(101001)
print "Bitte mit der Maus irgendwohin klicken ..."
rootwindow
color 0
color get_color(10000,10000,45535)
pbox 0,0,640,400
color 1
text 100,100,"Klick mich !"
color get_color(65535,65535,65535)
text 100,300,"Klick mich !"
vsync
DO
REPEAT
......@@ -92,6 +92,6 @@ FUNCTION einser$(e)
RETURN "acht"
else if e=9
RETURN "neun"
ENDSELECT
ENDIF
RETURN ""
ENDFUNC
' Demonstration der HF-Anpassung bei zwei Beschleunigern
' mit unterschiedlichem Umfang und leicht unterschiedlichen
' Frequenzen. (c) Markus Hoffmann DESY 2004
v=11/4
r=50
dt=4*r/180*pi
h1=20
h2=v*h1
clr count
bx=0
by=0
bw=160
bh=160
sizew ,bw,bh
schwarz=get_color(0,0,0)
weiss=get_color(65535,65535,65535)
rot=get_color(65535,0,0)
do
color schwarz
pbox 0,0,bw,bh
f1=1/2/pi/r*h1
f2=1/2/pi/r/v*h2+f1/11/9
@drawzak(100-r-10,100,r,h1,-t,0,0)
ahit=hit
@drawzak(100+v*r+10,100,r*v,h2,t,-10*v,f1*t-f2*t)
bhit=hit
text 20,180,str$(int((f1*t-f2*t)*180/pi mod 360))
if ahit=1 and bhit=1
pcircle 25,15,5
else
circle 25,15,5
endif
if abs(sin(f1*t-f2*t))<0.1 and cos(f1*t-f2*t)<0
pcircle 40,15,5
armin=1
else
armin=0
circle 40,15,5
endif
if ahit=1 and bhit=1 and armin=1
text 100,80,"** TRANSFER **"
exit if true
endif
vsync
'get bx,by,bw,by+bh,t$
'bsave "b"+str$(count,3,3,1)+".xpm",varptr(t$),len(t$)
'get 0,0,60,40,t$
'bsave "s"+str$(count,3,3,1)+".xpm",varptr(t$),len(t$)
'get 0,40,100,120,t$
'bsave "p"+str$(count,3,3,1)+".xpm",varptr(t$),len(t$)
'get 100,0,bw-100,bh,t$
'bsave "h"+str$(count,3,3,1)+".xpm",varptr(t$),len(t$)
' exit if count>=89
' exit if t/r/v>2*pi
add t,dt
inc count
exit if count>=248*4
loop
end
procedure drawzak(x0,y0,r0,n,t,marker,df)
local i,p
color weiss
for i=0 to n
p=i/n*2*pi+t/r0+df/n
line x0+r0*cos(p),y0+r0*sin(p),x0+(r0+10)*cos(p+pi/n),y0+(r0+10)*sin(p+pi/n)
line x0+r0*cos(p),y0+r0*sin(p),x0+(r0+10)*cos(p-pi/n),y0+(r0+10)*sin(p-pi/n)
next i
color rot
p2=marker/n*2*pi+t/r0
line x0+r0*cos(p2),y0+r0*sin(p2),x0+(r0-10)*cos(p2),y0+(r0-10)*sin(p2)
' print abs((t/r0 mod 2*pi))
if abs((t/r0 mod 2*pi))<0.1
pcircle 10,r0/5,5
hit=1
else
circle 10,r0/5,5
hit=0
endif
return
......@@ -5,7 +5,10 @@
' do a:
' xbasic playsnd.bas popcorn.snd
bin=1/50
speed=4
bin=1/40/max(speed,4)
name$=param$(2)
if exist(name$)
open "I",#1,name$
......@@ -52,7 +55,7 @@ if exist(name$)
else if b=11 or b=12 or b=13 or b>=8*16
b2=peek(varptr(b$)+i+1) and 255
print i;": ";pt1,pt2,pt3,b2
b2=b2/40
b2=b2/40/speed
if (lt1=0 or pt1=0) and (lt2=0 or pt2=0) and (lt3=0 or pt3=0)
sound 0
pause b2
......
......@@ -10,4 +10,6 @@ do
vsync
color schwarz
rbox 100,100,x,y
exit if mousek=2
loop
quit
......@@ -13,10 +13,10 @@ else if a=-1
print "ERROR, fork() failed !"
quit
else ! parent instance
alert 1,"Hi, I am Parent. Child PID="+str$(a),1," OK | Kill Child ! ",b
if b=2
system "kill "+str$(a)
alert 1,"Child PID="+str$(a)+" killed !",1," OK ",b
endif
alert 1,"Hi, I am Parent. Child PID="+str$(a),1," OK | Kill Child ! ",b
if b=2
system "kill "+str$(a)
alert 1,"Child PID="+str$(a)+" killed !",1," OK ",b
endif
endif
quit
......@@ -19,6 +19,7 @@ do
pbox 0,0,200,300
color gelb
ltext 0,0,c$
text 10,280,"Keycode: "+str$(a)+"/"+str$(b)
vsync
print c$
loop
......@@ -4,41 +4,40 @@
' *.jpg, *.gif and *.png files
' (c) Markus Hoffmann 2003
'
' Revision 2
tmpfile$="fotoweb"+str$(timer)