'version A : 10.4.98 Korrektur bei 'SET @CW=' (Leerzeichen eingefuegt) 'version 9 : 28.4.97 15:47 -os online speed aenderung 'version 8 : 30.1.97 16:48 -w wortpause '28.9.96 19:37 set @cw=... '27.2.96 17:54 (wegen GROSS Z in cw.asm ) '31.10.95 18:41 'cw5.bas 'mit rts als ptt -12v aus +12v ein locate ,,1 defint a-z ' variablen fuer "cw.obj"... public tdid&,spon,char,fqindex,muster,pause,comx $link "cw.obj" ' unterprogramme aus "cw.obj"... declare sub morse() declare sub fq() 'diverse variablen.... bpmmin=1 bpmmax=200 bpmstd=60 pamax=55 'konstanten... blank = &h20 limit = &h7f unterstrich = &h5f ra0$="浜様様様様様様様様様様" ra1$=" Abbrechen j/n ? " ra2$="藩様様様様様様様様様様" ze=22 sp=25 br=len(ra0$)-1 ho=2 dim sc(ze:ze+ho,sp:sp+br) ze1=1 sp1=70 '================================ command1$=command$+" "+environ$("@CW") gosub get.command ' berechne aus bu / min die schrittdauer tdid& ... gosub calc.par gosub calc.bpm gosub check.comx if scon then if logo.on then call logo if logo.on then gosub print.status if status.only then end(1) end if if file$="" then goto finito end if x$="" indatei$=file$ gosub datei.lesen gosub umlaute.ersetzen ' frequenz des tongenerators ... call fq gosub ptt.on ' telegraphiere string x$ ... j=1 while mid$(x$,j,1) <> chr$(0) char=asc(mid$(x$,j,1)) display.char=char gosub q.taste gosub xyz if mchar <> 0 then char=mchar call morse end if if scon and display.char =13 then ? elseif scon and display.char >=blank then ? chr$(display.char); end if j=j+1 wend ' programm-ende ... if scon then ? if logo.on then call gruss end if gosub ptt.off end '-------------------------- sub logo ? "*** Heri's Morse-Tutor *** "; end sub sub gruss ? "*** vy 73 de DK2JK *** ( Version A: 10.4.98 )" end sub '--------------------------------- get.command: call find.sw(command1$,"-o", online.speed$) call find.sw(command1$,"-w", wpause$) call find.sw(command1$,"-f", file$) call find.sw(command1$,"-s",speed$) call find.sw(command1$,"-p",pause$) call find.sw(command1$,"-t",ton$) call find.sw(command1$,"-d",display$) call find.sw(command1$,"-com",comx$) call find.sw(command1$,"-x",logo.on$) 'logo anzeigen oder nicht return finito: 'call logo ? " Aufruf: cw -f [-s] [-p] [-w

] [-t] [-d0] [-comx] -[xy]" ? " file ... Datei, die telegraphiert werden soll " ? " bpm ... Buchstaben pro Minute " ? " ";bpmmin;"...";bpmmax;"(Standard= ";bpmstd;" BpM )" ? " pause ... zustzliche Pause nach jedem Buchstaben" ? " 0...";pamax;" -p0:normal -p10: halbe Geschw." ? " -w

... Wortpause p= 0:normal 1: doppelt 2: dreifach" ? " fq ... 0 : Ton vom Computer aus " ? " 500... 1500 Hz (keine Angabe: Standard: 700 Hz) " ? " -d0 ... Display aus (sonst: ein )" ? " -comx ... Ausgabe ber TxD von COMx (x= 1 ...4) " ? " (Standard: COM1 ; x=0 --> keine Ausgabe )" ? " gleichzeitige PTT-Ansteuerung via RTS von COMx " ? " -xy ... y=0 Programm-Logo wird nicht angezeigt" ? " y=s Nur Statusanzeige des Programms " ? " -os ... Freigabe Online Speed nderung mit '+' oder '-' " ? " Parameter knnen -falls in der Kommandozeile nicht angegeben- " ? " auch mittels SET-Variable angeben werden , z.B." ? " > set @cw= -ftext0 -s120 -p0 -t800 -d0 -com3 -x0 " call gruss end (1) return '----------------------- calc.bpm: 'input: speed$ bpm=val(speed$) calc.bpm.1: 'input: bpm if bpm=0 then bpm=bpmstd elseif bpm <=bpmmin then bpm=bpmmin elseif bpm >=bpmmax then bpm=bpmmax end if tdid&=6e6/bpm bpm.eff=10*bpm/(10+pause) return print.bpm: color 15,1 'save cursor... curze= csrlin cursp= pos 'print message... speed.display$ ="SPEED:"+right$(" "+str$(bpm.eff),3) locate ze1,sp1 : ? speed.display$; locate curze,cursp color 7,0 return bpm.plus: bpm=bpm+5 gosub calc.bpm.1 gosub print.bpm return bpm.minus: if bpm >=35 then bpm=bpm-5 gosub calc.bpm.1 gosub print.bpm return '----------------------- calc.par: 'if online.speed$ = "s" then os.enable=1 os.enable=1 wpamax=12 wpa=val(wpause$) if wpa=0 then wpa=0 elseif wpa >=wpamax then wpa=wpamax end if wpause=wpa pa=val(pause$) if pa=0 then pa=0 elseif pa >=pamax then pa=pamax end if pause=pa if ton$="0" then spon=0 else spon=1 call calc.fqindex end if if display$="0" then scon=0 else scon=1 end if if logo.on$="0" then logo.on=0 else logo.on=1 end if if logo.on$="s" then status.only=1 return '--------------------- sub calc.fqindex shared ton$,fqindex f=val(ton$) if f<>0 and f>=500 and f<=1500 then fqindex=(f-500)/50 else fqindex=4 '700 hz end if end sub '**************************** ' datei lesen nach x$ Datei.lesen: f$= dir$(indatei$) if f$ ="" then ? "*** Dateiname nicht ok ..." end(2) end if on error goto file.err OPEN indatei$ FOR binary ACCESS read AS #2 on error goto flen=lof(2) get$ #2,flen,x$ close #2 x$=x$+chr$(0) 'ende-zeichen return '---------------------------- sub find.sw(xi$,sw$,xo$) xpos= instr(xi$,sw$) if xpos=0 then xo$="" else rest$= mid$(xi$,xpos+len(sw$)) xo$=extract$(rest$," ") end if end sub '----------------------- file.err: if err=53 then ? "*** Datei: ";chr$(34);indatei$;chr$(34);" nicht gefunden" else ? "*** Fehler #";err end if end(2) q.taste: inkey.chr$=inkey$ gosub q.online.speed return q.online.speed: if os.enable = 1 then if inkey.chr$ = "." then gosub print.bpm inkey.chr$="" elseif inkey.chr$ = "+" then gosub bpm.plus inkey.chr$="" elseif inkey.chr$="-" then gosub bpm.minus inkey.chr$="" else gosub q.ende end if end if return '--------------------------------- ' abfrage abbrechen ja oder nein ... q.ende: if inkey.chr$ <> "" then 'save cursor... curze= csrlin cursp= pos 'save window... for zi=ze to ze+ho for si=sp to sp+br sc(zi,si)=screen(zi,si) next si next zi 'vorsorglich aus... gosub ptt.off 'print message... locate ze,sp : ? ra0$; locate ze+1,sp : ? ra1$; locate ze+2,sp : ? ra2$; 'ja oder nein ?... do yn$=inkey$ loop until yn$<>"" 'restore window... for zi=ze to ze+ho for si=sp to sp+br locate zi,si ? chr$(sc(zi,si)); next si next zi 'restore cursor... locate curze,cursp yn$=lcase$(yn$) if yn$="y" or yn$="j" then if scon then ? "<=== ABBRUCH ===" if logo.on then call gruss end if end (0) else 'wieder ein... gosub ptt.on end if end if return '----------------------------------- xyz: if char=&h5f then mchar=blank bl.flag=0 else if bl.flag=0 then if char <=blank or char > limit then bl.flag=1 while bl.count<=wpause bl.count=bl.count+1 char=blank call morse wend bl.count=0 mchar=blank else mchar=char end if else if char <=blank or char > limit then mchar=00 else mchar=char bl.flag=0 end if end if end if return '----------------- check.comx: dim comx(5) def seg=&h40 for i=1 to 4 comx(i)=peeki((i-1)*2) next i comx(0)=0 if comx$="" then comx.i=1 'standard: com1 comx$="1" elseif comx$="0" then comx.i=0 msgcom$="gesperrt" elseif comx$="1" then comx.i=1 elseif comx$="2" then comx.i=2 elseif comx$="3" then comx.i=3 elseif comx$="4" then comx.i=4 else comx.i=0 msgcom$="COM"+ltrim$(comx$) gosub fehler.com end if if comx.i>0 then msgcom$="COM"+ltrim$(comx$) if comx(comx.i)=0 then gosub fehler.com end if end if comx=comx(comx.i) 'basisadresse der schnittstelle COMx return '------------------- fehler.com: ?"*** ";msgcom$;" nicht vorhanden" end 5 return umlaute.ersetzen: REPLACE "" WITH "ae" IN x$ REPLACE "" WITH "ae" IN x$ REPLACE "" WITH "oe" IN x$ REPLACE "" WITH "oe" IN x$ REPLACE "" WITH "ue" IN x$ REPLACE "" WITH "ue" IN x$ REPLACE "" WITH "ss" IN x$ return ptt.on: if comx.i <> 0 then mcr = (comx(comx.i))+4 out mcr,2 delay .3 'sek end if return ptt.off: if comx.i <> 0 then mcr = (comx(comx.i))+4 delay .3 'sek out mcr,0 end if return print.status: ? " BpM:";bpm;"; BpM(eff):";Bpm.eff;"; Ausgang: ";msgcom$ return