home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
c
/
caty16.zip
/
CATYMVFO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-01-17
|
38KB
|
963 lines
UNIT CATYMVFO (* CATY Memory/VFO routines D. J. Wilke N3HGQ 7/13/91 *);
INTERFACE
USES CRT, DOS, CATYGLO, CATYUTIL,
CATYDISP, CATYCOMM, CATYRTC;
PROCEDURE LoadMemories(MemFileToUse : STRING);
PROCEDURE SelectMemFile;
PROCEDURE SetVFO(Page,BarPos : INTEGER);
PROCEDURE Pager;
PROCEDURE Upper;
PROCEDURE Downer;
PROCEDURE LoadVFO(VFOFileToUse : STRING);
PROCEDURE SelectVFOFile;
PROCEDURE SetFreq;
PROCEDURE VFOMRSelect;
PROCEDURE ShowSplits(SelFreq,OffsFreq : REAL);
PROCEDURE MemSelect;
PROCEDURE QuickStat;
FUNCTION Offset(Page,BarPos : INTEGER) : STRING;
IMPLEMENTATION
USES CATYINST;
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE LoadMemories(MemFileToUse : STRING);
VAR
RecNo,DotPos,
Result,BCDin : INTEGER;
Ok : BOOLEAN;
FreqChr : STRING;
Tone : STRING[2];
DispFreq : STRING[7];
FreqSet : STRING[8];
FreqString,
LSDFreq : STRING[10];
Desc : STRING[50];
FreqTune : REAL;
Mode : CHAR;
BEGIN (* LoadMemories *)
PromptLine('W'); (* Put up wait message *)
WINDOW(2,6,79,23);
PrMessage(' - Load Memories from Database File - ',4);
CLRSCR;
ASSIGN(Y767MemDataFile,MemFileToUse);
{$I-} RESET(Y767MemDataFile) {$I+} ;
Ok := (IOResult = 0);
IF NOT Ok THEN BEGIN
TEXTCOLOR(20);
TEXTBACKGROUND(DBG); (* Error colors *)
GOTOXY(20,6);
WRITE('Cannot find FT-767 memory channel data file.');
GOTOXY(20,7);
WRITE('Memory channels will NOT be loaded.');
GOTOXY(20,8);
WRITE('Press return to continue.');
Warble(1000,800);
READLN;
END (* IF NOT Ok *)
ELSE BEGIN
RecNo := 0;
FreqString := '';
TEXTCOLOR(PFG); TEXTBACKGROUND(BLUE); (* Special param colors *)
GOTOXY(26,3);
WRITE(' Using Datafile ');
TEXTCOLOR(SFG); TEXTBACKGROUND(BLUE); (* Filename colors *)
WRITE(MemFileToUse,' ');
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
GOTOXY(5,5);
WRITE('Memory Frequency Tone ');
GOTOXY(33,5);
WRITE('Identifier, Description, Offset, Notes');
PrLines('H',6,75,11,11,SBA,DBG,196); (* Display divider line *)
PrLines('V',9,9,12,21,SBA,DBG,179);
PrLines('V',26,26,12,21,SBA,DBG,179);
PrLines('V',31,31,12,21,SBA,DBG,179);
FOR Index := 1 TO 9 DO BEGIN
READLN(Y767MemDataFile); (* Read past column titles *)
END; (* FOR Index *)
TurnCatOn;
CatSend(Nul3String+CHR(0)+CHR(9),5); (* Load into VFO A *)
WHILE RecNo < 10 DO BEGIN
FreqString := '';
LSDFreq := '';
FreqSet := '';
TEXTCOLOR(PFG);
TEXTBACKGROUND(DBG); (* Parameter colors *)
READLN(Y767MemDataFile,Y767MemFileParams);
IF LENGTH(Y767MemFileParams) > 26 THEN BEGIN
GOTOXY(6,RecNo + 7);
FreqString := COPY(Y767MemFileParams,1,8);
Tone := COPY(Y767MemFileParams,10,2);
Mode := Y767MemFileParams[13];
DispFreq := COPY(Y767MemFileParams,15,7);
Desc := COPY(Y767MemFileParams,25,50);
GOTOXY(6,RecNo + 7); WRITE(RecNo);
GOTOXY(12,RecNo + 7); WRITE(DispFreq);
GOTOXY(20,RecNo + 7); WRITE('MHz.');
GOTOXY(27,RecNo + 7); WRITE(Tone);
GOTOXY(33,RecNo + 7); WRITE(Desc);
VAL(FreqString,FreqTune,Result);
FreqTune := FreqTune/100000.0;
CheckFreq(FreqTune); (* Check if valid Freq *)
LSDFreq := MakeLSDMSD(FreqString,8);
FreqSet := FreqParm(LSDFreq,8);
IF NOT FreqErrorFlag THEN BEGIN (* Send the Freq to 767 *)
CASE Mode OF
'L' : Mode := CHR($10);
'U' : Mode := CHR($11);
'C' : Mode := CHR($12);
'A' : Mode := CHR($13);
'F' : Mode := CHR($14);
'K' : Mode := CHR($15);
END; (* CASE *)
CatSend(MultString(3,NUL)+
CHR(RecNo)+CHR($A),8); (*Sel Mem channel *)
CatSend(FreqSet+CHR(8),5); (* Set frequency *)
CatSend(Nul3String+Mode+
CHR($A),8); (* Set Memory Mode *)
CatSend(Nul3String+CHR($60)+
CHR($A),86); (* Move to Memory *)
END; (* IF NOT *)
END; (* IF LENGTH *)
INC(RecNo);
END; (* WHILE RecNo *)
CatSend(Nul3String+CHR(2)+CHR(9),5); (* Now, turn on MR *)
TurnCatOff;
TEXTCOLOR(DFG);
TEXTBACKGROUND(DBG); (* Default screen colors *)
GOTOXY(19,18); WRITE(' Current contents of all memories.');
QuickStat;
WINDOW(1,1,80,25);
PromptLine('M'); (* Put up Main Menu message *)
PromptLine('K'); (* Put up FK line *)
END; (* ELSE *)
END; (* LoadMemories *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE SelectMemFile;
VAR
MemoryProgramFile : CHAR;
MemFileToUse : STRING[12];
BEGIN (* SelectMemFile *)
WINDOW(2,2,79,4);
PrMessage(' - Load Memories from Database File - ',3);
WINDOW(2,6,79,23);
CLRSCR;
PromptLine('S'); (* Put up select message *)
PrMessage('Choose a Memory Datafile:',1);
PrLines('V',41,41,8,22,SBA,DBG,179); (* Display divider line *)
GOTOXY(2,3);
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
WRITELN('A. 10 meter FM band repeaters.');
GOTOXY(2,4);
WRITELN('B. 2 meter FM band repeaters.');
GOTOXY(2,5);
WRITELN('C. 6 meter FM band repeaters.');
GOTOXY(2,6);
WRITELN('D. 70cM (B) band repeaters.');
GOTOXY(2,7);
WRITELN('E. AM broadcast band.');
GOTOXY(2,8);
WRITELN('F. AMTOR/SITOR frequencies.');
GOTOXY(2,9);
WRITELN('G. 10 meter CW BEACON frequencies.');
GOTOXY(2,10);
WRITELN('H. DEFAULT/TIME signal frequencies.');
GOTOXY(2,11);
WRITELN('I. WEFAX/WIREPHOTO frequencies.');
GOTOXY(2,12);
WRITELN('J. HF/VHF packet frequencies.');
GOTOXY(2,13);
WRITELN('K. RTTY/PRESS frequencies.');
GOTOXY(2,14);
WRITELN('L. "SKED" frequencies.');
GOTOXY(2,15);
WRITELN('M. PMS scan, CW band: 10M thru 20M.');
GOTOXY(2,16);
WRITELN('N. PMS scan, SSB band: 10M thru 20M.');
GOTOXY(43,3);
WRITELN('O. W1AW CW bulletins.');
GOTOXY(46,4);
WRITE('Daily: 5/8/11pm; MTWThF-10am.');
GOTOXY(43,6);
WRITELN('P. W1AW code practice.');
GOTOXY(46,7);
WRITE('slow speed: MWF-9am/7pm;');
GOTOXY(58,8);
WRITE('TThSSn-4/10pm.');
GOTOXY(46,9);
WRITE('fast speed: MWF-4/10pm;');
GOTOXY(58,10);
WRITE('TTh-9am; TThSSn-7pm.');
GOTOXY(43,12);
WRITELN('Q. W1AW SSB/RTTY bulletins.');
GOTOXY(46,13);
WRITE('SSB Daily: 9:45pm, 12:45am.');
GOTOXY(46,14);
WRITE('RTTY Daily: 6/9/12pm;');
GOTOXY(58,15);
WRITE('MTWThF-11am.');
GOTOXY(28,18);
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
WRITE('Above times are EST & EDT.');
GOTOXY(55,1);
MemoryProgramFile := READKEY;
CASE MemoryProgramFile OF
'A','a' : MemFileToUse := 'Y76710M .MEM';
'B','b' : MemFileToUse := 'Y7672MR .MEM';
'C','c' : MemFileToUse := 'Y7676MR .MEM';
'D','d' : MemFileToUse := 'Y76770B .MEM';
'E','e' : MemFileToUse := 'Y767AMB .MEM';
'F','f' : MemFileToUse := 'Y767AMT .MEM';
'G','g' : MemFileToUse := 'Y767BEA .MEM';
'H','h' : MemFileToUse := 'Y767DEF .MEM';
'I','i' : MemFileToUse := 'Y767FAX .MEM';
'J','j' : MemFileToUse := 'Y767PAK .MEM';
'K','k' : MemFileToUse := 'Y767RTY .MEM';
'L','l' : MemFileToUse := 'Y767SKD .MEM';
'M','m' : MemFileToUse := 'Y767PM1 .MEM';
'N','n' : MemFileToUse := 'Y767PM2 .MEM';
'O','o' : MemFileToUse := 'Y767WCB .MEM';
'P','p' : MemFileToUse := 'Y767WCP .MEM';
'Q','q' : MemFileToUse := 'Y767WPB .MEM';
END; (* CASE *)
LoadMemories(MemFileToUse);
END; (* SelectMemFile *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE SetVFO;
VAR
FreqSet,
LSDFreq,
FreqString : STRING[8];
Result : INTEGER;
Mode : CHAR;
FreqTune : REAL;
BEGIN (* SetVFO *)
FreqString := COPY(MemArray[Page *10 +BarPos],1,8);
VAL(FreqString,FreqTune,Result);
FreqTune := FreqTune/100000.0;
IF COPY(MemArray[Page *10 +BarPos],1,8) <> ' ' THEN BEGIN
LSDFreq := MakeLSDMSD(COPY(MemArray[Page *10 +BarPos],1,8),8);
FreqSet := FreqParm(LSDFreq,8);
Mode := MemArray[Page *10 +BarPos,13];
CASE Mode OF
'L' : Mode := CHR($10);
'U' : Mode := CHR($11);
'C' : Mode := CHR($12);
'A' : Mode := CHR($13);
'F' : Mode := CHR($14);
'K' : Mode := CHR($15);
END; (* CASE *)
CheckFreq(FreqTune); (* In valid range? *)
IF NOT FreqErrorFlag THEN BEGIN
IF COPY(MemArray[Page *10 +BarPos],23,1) <> ' ' THEN BEGIN
WINDOW(3,6,29,7);
GOTOXY(5,5);
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Req param colors *)
WRITELN(CHR(18) +' = Offset operation');
WINDOW(5,12,79,22); (* Back to paging window *)
CatSend(Nul3String+CHR(1)+ (* Split operation *)
CHR(9),5); (* Set up to load VFO B *)
CatSend(Offset(Page,BarPos)+
CHR(8),5); (* Set VFO B frequency *)
CatSend(MultString(3,NUL)+
Mode+CHR($A),8); (* Set the Mode *)
END; (* IF COPY *)
CatSend(Nul3String+CHR(0)+
CHR(9),5); (* Set up to load VFO A *)
CatSend(FreqSet+CHR(8),5); (* Set VFO A frequency *)
CatSend(MultString(3,NUL)+
Mode+CHR($A),8); (* Set the Mode *)
IF COPY(MemArray[Page *10 +BarPos],23,1) = ' ' THEN
CatSend(Aclr,26) (* Turn off SPLIT/CLAR/OFFS *)
ELSE
IF (ORD(Update[1])) AND ($08) = 0 THEN (* Mask off Split bit *)
CatSend(SplitTog,26); (* Toggle Split on, if off *)
TEXTCOLOR(SFG); TEXTBACKGROUND(DBG);(* Selected Freq colors *)
PrDfPage(Page,Page *10 +BarPos,1); (* Place bar *)
CatSend(Check,86); (* Get new parameters *)
QuickStat; (* Display new Freq *)
WINDOW(5,12,79,22); (* Back to paging window *)
GOTOXY(1,BarPos); (* Put cursor at beg of line *)
Peep(4000); (* Give audible signal *)
END; (* IF NOT *)
END; (* IF *)
END; (* SetVFO *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE Pager;
BEGIN (* Pager *)
TEXTCOLOR(PFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
CLRSCR; (* Remove all old entries *)
PrDfPage(Page,0,10); (* Put up 10 line page *)
TEXTCOLOR(BFG); TEXTBACKGROUND(BBG); (* Selection bar colors *)
PrDfPage(Page,Page *10 +BarPos,1); (* Put bar on 1 or 10 *)
TEXTCOLOR(PFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(1,BarPos); (* Put cursor at beg of line *)
END; (* Pager *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE Upper; (* Bump the selection bar UP *)
BEGIN (* Upper *)
DEC(BarPos);
IF BarPos = 0 THEN BEGIN (* At top? *)
BarPos := 10; (* Then rollover *)
DEC(Page);
IF Page < 0 THEN Page := 9;
Pager;
END;
TEXTCOLOR(PFG);
TEXTBACKGROUND(DBG);
GOTOXY(1,BarPos);
TEXTCOLOR(BFG);
TEXTBACKGROUND(BBG);
PrDfPage(Page,Page *10 +BarPos,1); (* Place bar *)
TEXTCOLOR(PFG);
TEXTBACKGROUND(DBG);
IF BarPos = 10 THEN
PrDfPage(Page,Page *10 +1,1) (* Remove old bar at top *)
ELSE
PrDfPage(Page,Page *10 +BarPos +1,1); (* Else remove old bar *)
GOTOXY(1,BarPos);
END; (* Upper *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE Downer; (* Bump the selection bar DOWN *)
BEGIN (* Downer *)
INC(BarPos);
IF BarPos = 11 THEN BEGIN (* At bottom? *)
BarPos := 1; (* Then rollover *)
INC(Page);
IF Page = 10 THEN Page := 0;
Pager;
END;
TEXTCOLOR(PFG);
TEXTBACKGROUND(DBG);
GOTOXY(1,BarPos);
TEXTCOLOR(BFG);
TEXTBACKGROUND(BBG);
PrDfPage(Page,Page *10 +BarPos,1); (* Place bar *)
TEXTCOLOR(PFG);
TEXTBACKGROUND(DBG);
IF BarPos = 1 THEN
PrDfPage(Page,Page *10 +10,1) (* Remove old bar at bottom *)
ELSE
PrDfPage(Page,Page *10 +BarPos -1,1); (* Remove old bar *)
GOTOXY(1,BarPos);
END; (* Downer *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE LoadVFO(VFOFileToUse : STRING);
VAR
RecNo,Xpos,
Result,BCDin : INTEGER;
Ok,Fk,Display : BOOLEAN;
Choice : CHAR;
BEGIN (* LoadVFO *)
WINDOW(2,6,79,23);
PrMessage(' - Load VFO A from Datafile - ',4);
CLRSCR;
ASSIGN(Y767VFODataFile,VFOFileToUse);
{$I-} RESET(Y767VFODataFile) {$I+} ;
Ok := (IOResult = 0);
IF NOT Ok THEN BEGIN
TEXTCOLOR(20); TEXTBACKGROUND(DBG); (* Error colors *)
GOTOXY(20,6);
WRITE('Cannot find FT-767 VFO database file.');
GOTOXY(20,7);
WRITE('VFO A will NOT be loaded.');
GOTOXY(20,8);
WRITE('Press return to continue.');
Warble(1000,800);
READLN;
END (* IF NOT Ok *)
ELSE BEGIN (* File read OK, get data *)
RecNo := 0;
Page := 0;
Display := TRUE; (* Display pages of datafile *)
Xpos := 5;
BarPos := 1; (* Bar at top on page 0 *)
TEXTCOLOR(PFG); TEXTBACKGROUND(BLUE); (* Special param colors *)
GOTOXY(26,3);
WRITE(' Using Datafile ');
TEXTCOLOR(SFG); TEXTBACKGROUND(BLUE); (* Filename colors *)
WRITE(VFOFileToUse,' ');
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Special prompt colors *)
PromptLine('V'); (* Put up pager key line *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
GOTOXY(5,5);
WRITE('Record Freq Ofs Mode ');
GOTOXY(33,5);
WRITE('Identifier, Description, Notes');
PrLines('H',6,75,11,11,SBA,DBG,196); (* Display divider line *)
FILLCHAR(MemArray,SIZEOF(MemArray),' '); (* Initialize array *)
FOR Index := 1 TO 9 DO BEGIN
READLN(Y767VFODataFile); (* Read past column titles *)
END; (* FOR Index *)
WINDOW(5,12,79,22); (* Paging window *)
WHILE NOT EOF(Y767VFODataFile) DO BEGIN
TEXTCOLOR(PFG);
TEXTBACKGROUND(DBG); (* Parameter colors *)
INC(RecNo);
READLN(Y767VFODataFile,Y767MemFileParams);
(* Make bar length = 70 characters for valid entries *)
IF (LENGTH(Y767MemFileParams) < 70) THEN BEGIN
Y767MemFileParams := Y767MemFileParams +
MultString(70 - LENGTH(Y767MemFileParams),' ');
END; (* IF *)
MemArray[RecNo] := Y767MemFileParams;
END; (* WHILE NOT EOF*)
DataFileRec := RecNo;
CLRSCR;
PrDfPage(Page,0,10); (* Display Page 0 *)
GOTOXY(1,BarPos);
TEXTCOLOR(BFG);
TEXTBACKGROUND(BBG);
PrDfPage(Page,Page *10 +BarPos,1); (* Put bar on 1st entry *)
GOTOXY(1,BarPos);
WHILE Display DO BEGIN
REPEAT
InKey(Fk,Choice);
UNTIL (Choice IN [#72..#82])
OR (Choice = #13);
CASE Choice OF
#13 : BEGIN (* Accept this selection *)
TurnCatOn;
SetVFO(Page,BarPos); (* Change the VFO *)
TurnCatOff;
END;
#72 : Upper; (* Cursor Up *)
#73 : BEGIN (* Page UP *)
DEC(Page);
IF Page < 0 THEN Page := 9;
BarPos := 10;
Pager;
END;
#75 : BEGIN (* REVERSE Scan *)
TurnCatOn;
REPEAT (* This is the Scan *)
Upper; (* Up = reverse *)
SetVFO(Page,BarPos); (* Setup the VFO *)
UNTIL Keypressed;
TurnCatOff;
END;
#77 : BEGIN (* FORWARD Scan *)
TurnCatOn;
REPEAT (* This is the Scan *)
Downer; (* Down = forward *)
SetVFO(Page,BarPos); (* Setup the VFO *)
UNTIL Keypressed;
TurnCatOff;
END;
#79 : Display := FALSE; (* End *)
#80 : Downer; (* Cursor Down *)
#81 : BEGIN (* Page Down *)
INC(Page);
IF Page = 10 THEN Page := 0;
BarPos := 1;
Pager;
END; (* #81 *)
END; (* CASE *)
END; (* WHILE Display *)
END; (* ELSE *)
FOR Index := 1 TO 80 DO BEGIN (* Clean up behind us *)
ScreenWrite(' ',Index,23,0);
ScreenWrite(CHR(205),Index,24,SBA); (* Put back line *)
END;
WINDOW(2,6,79,23);
ScreenWrite(CHR(186),1,23,SBA); (* Put back corners *)
ScreenWrite(CHR(186),80,23,SBA);
ScreenWrite(CHR(200),1,24,SBA);
ScreenWrite(CHR(188),80,24,SBA);
TEXTCOLOR(DFG);
TEXTBACKGROUND(DBG); (* Default screen colors *)
END; (* LoadVFO * )
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE SelectVFOFile;
VAR
VFOProgramFile : CHAR;
VFOFileToUse : STRING[12];
BEGIN (* SelectVFOFile *)
WINDOW(2,2,79,4);
PrMessage(' - Load VFO<A> from Database File - ',3);
WINDOW(2,6,79,23);
CLRSCR;
PromptLine('S'); (* Put up select message *)
PrMessage('Choose a VFO Datafile:',2);
GOTOXY(10,4);
TEXTCOLOR(RFG);
TEXTBACKGROUND(DBG); (* Requested param colors *)
WRITELN('A. 2 Meter FM voice repeaters.');
GOTOXY(10,5);
WRITELN('B. 10 Meter CW BEACON frequencies.');
GOTOXY(10,6);
WRITELN('C. International MARINE radiotelephone channels.');
GOTOXY(10,7);
WRITELN('D. 2 Meter PACKET BBS frequencies.');
GOTOXY(10,8);
WRITELN('E. International Shortwave 2.000 - 11.500 MHz.');
GOTOXY(10,9);
WRITELN('F. International Shortwave 11.600 - 28.000 MHz.');
GOTOXY(10,10);
WRITELN('G. Commercial radioteletype 2.024 - 14.565 MHz.');
GOTOXY(10,11);
WRITELN('H. Commercial radioteletype 14.568 - 19.280 MHz.');
GOTOXY(10,12);
WRITELN('I. Commercial radioteletype 19.565 - 25.337 MHz.');
GOTOXY(10,13);
WRITELN('J. International Shortwave by day of week & UTC time.');
GOTOXY(55,2);
VFOProgramFile := READKEY;
CASE VFOProgramFile OF
'A','a' : VFOFileToUse := 'Y7672MR .DAT';
'B','b' : VFOFileToUse := 'Y767BEA .DAT';
'C','c' : VFOFileToUse := 'Y767MCH .DAT';
'D','d' : VFOFileToUse := 'Y767PAK .DAT';
'E','e' : VFOFileToUse := 'Y767SWA .DAT';
'F','f' : VFOFileToUse := 'Y767SWB .DAT';
'G','g' : VFOFileToUse := 'Y767TTA .DAT';
'H','h' : VFOFileToUse := 'Y767TTB .DAT';
'I','i' : VFOFileToUse := 'Y767TTC .DAT';
'J','j' : VFOFileToUse := 'Y767UTC .DAT';
END; (* CASE *)
LoadVFO(VFOFileToUse);
END; (* SelectVFOFile *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE SetFreq;
(* Get frequency, build BCD Hex string for use in CatSend Subroutine *)
VAR
FreqString,LSDFreq,FreqSet : STRING[10];
MHzString,KHzString : STRING[10];
FreqInt : STRING[8];
FreqTrans : STRING;
FreqTune : REAL;
DotPos,Result,BCDIn,MHz,KHz,Hz : INTEGER;
BEGIN (* SetFreq *)
FreqString := ''; (* Initialize variables *)
MHzString := '';
KHzString := '';
FreqTune := 0.0;
FreqInt := '';
LSDFreq := '';
FreqSet := '';
DotPos := 0;
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
WINDOW(1,1,80,5);
PrMessage(' - Set Frequency Screen - ',4);
WINDOW(2,6,79,23);
CLRSCR;
PromptLine('S'); (* Put up select message *)
(* Display headings & draw `Operating Frequency' box *)
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(56,1); WRITE('Operating Frequency');
PrBox; (* Draw `Op Freq' box *)
IF SetSel THEN PrBandLimits; (* Display band limits table *)
(* Prompt for desired frequency *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
GOTOXY(11,3); WRITE('Enter desired frequency.');
GOTOXY(36,3); WRITE(CHR(198));
FOR Index := 1 TO 18 DO
WRITE(CHR(205));
WRITE(CHR(16));
GOTOXY(69,3); WRITE('MHz.');
IF SetSel THEN BEGIN
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(59,3); WRITE(' ');
GOTOXY(59,3);
READLN(FreqString);
END
ELSE FreqString := ('145.03075');
PromptLine('W'); (* Put up wait message *)
VAL(FreqString,FreqTune,Result); (* Freq is REAL number *)
CheckFreq(FreqTune);
IF NOT FreqErrorFlag THEN BEGIN
GOTOXY(57,3); (* Set up `Op Freq' box *)
WRITE(FreqTune:10:5); (* Display Freq in box *)
(* Pad Freq with leading and trailing zeros, if necessary *)
DotPos := Pos('.',FreqString);
DELETE(FreqString,DotPos,1);
IF DotPos = 0 THEN DotPos := LENGTH(FreqString) + 1;
FreqInt := MultString(4 - DotPos,'0')
+ FreqString + MultString(8 - LENGTH(FreqInt),'0');
LSDFreq := MakeLSDMSD(FreqInt,8);
FreqSet := FreqParm(LSDFreq,8);
IF NOT SetSel THEN BEGIN
GOTOXY(19,12); WRITE(LENGTH(FreqString),' Positions.');
GOTOXY(10,13); WRITE(FreqTune:10:5,' MHz. (FreqTune)');
GOTOXY(12,14); WRITE(FreqInt,' Normal BCD (FreqInt)');
GOTOXY(12,15); WRITE(LSDFreq,' Inverted BCD (LSDFreq)');
GOTOXY(13,16); WRITE(COPY(FreqSet,1,1));
GOTOXY(15,16); WRITE(COPY(FreqSet,2,1));
GOTOXY(17,16); WRITE(COPY(FreqSet,3,1));
GOTOXY(19,16); WRITE(COPY(FreqSet,4,1));
GOTOXY(22,16); WRITE('BCD string LSD->MSD (FreqSet)');
END; (* NOT SetSel *)
(* Send the Frequency to 767 *)
TurnCatOn;
CatSend(MultString(4,Nul) + CHR(9),5); (* Turn off Mem mode 1st *)
CatSend(FreqSet + CHR(8),5); (* Set the frequency *)
ModeSelect;
TurnCatOff;
END; (* IF NOT *)
END; (* SetFreq *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE VFOMRSelect;
(* Select between VFOs and Memory *)
VAR
VMS,VMSel : CHAR;
BEGIN (* VFOMRSelect *)
PromptLine('S'); (* Put up select message *)
VMS := CHR(0); (* Initialize variables *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
WINDOW(1,1,80,5);
PrMessage(' - Select VFO/Memory Screen - ',4);
WINDOW(2,6,79,23);
CLRSCR;
(* Display headings & draw `Operating Frequency' box *)
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(57,1); WRITE(' Selected ');
PrBox;
(* Prompt for VFO A, VFO B or Memory *)
GOTOXY(11,1); WRITE('A=VFO A, B=VFO B, M=Memory');
GOTOXY(11,3); WRITE('Enter A, B, or M.');
GOTOXY(29,3); WRITE(CHR(198));
FOR Index := 1 TO 25 DO
Write(CHR(205));
WRITE(CHR(16));
IF SetSel THEN BEGIN
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(60,3); WRITE(' ? ');
GOTOXY(65,3);
REPEAT
VMSel := UPCASE(ReadKey);
CASE VMSel OF
'A' : BEGIN
VMS := CHR(0);
GOTOXY(60,3); WRITE(' VFO A ');
END;
'B' : BEGIN
VMS := CHR(1);
GOTOXY(60,3); WRITE(' VFO B ');
END;
'M' : BEGIN
VMS := CHR(2);
GOTOXY(60,3); WRITE(' MEMORY ');
END;
END; (* CASE *)
UNTIL (VMSel = 'A') OR (VMSel = 'B') OR (VMSel = 'M');
PromptLine('W'); (* Put up wait message *)
END; (* IF SetSel *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
TurnCatOn;
CatSend(Nul3String+VMS+CHR(9),5); (* Set VFOs or Mem *)
TurnCatOff;
MainMenu;
END; (* VFOMRSelect *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE ShowSplits(SelFreq,OffsFreq : REAL);
(* Display repeater splits *)
BEGIN (* ShowSplits *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
WINDOW(1,1,80,5);
PrMessage(' - Repeater Offset Display Screen - ',4);
WINDOW(2,6,79,23);
CLRSCR;
PrMessage('Current VFO Parameters ',1); (* Display Mem Chan headings *)
PrLines('H',6,55,7,7,SBA,DBG,196); (* Display divider line *)
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(9,3); WRITE('VFO<A> - Repeater Output - Radio Receives on: ');
GOTOXY(9,4); WRITE('VFO<B> - Repeater Input - Radio Transmits on: ');
PrLines('H',6,55,10,10,SBA,DBG,196); (* Display divider line *)
ScreenWrite(CHR(201),57,7,SBA); (* Dbl corner, UL *)
PrLines('H',58,74,7,0,SBA,DBG,205); (* Top dbl line, box *)
ScreenWrite(CHR(187),75,7,SBA); (* Dbl corner, UR *)
ScreenWrite(CHR(186),57,8,SBA); (* Dbl V line, left *)
ScreenWrite(CHR(186),75,8,SBA); (* Dbl V line, right *)
ScreenWrite(CHR(186),57,9,SBA); (* Dbl V line, left *)
ScreenWrite(CHR(186),75,9,SBA); (* Dbl V line, right *)
ScreenWrite(CHR(200),57,10,SBA); (* Dbl corner, LL *)
PrLines('H',58,74,10,0,SBA,DBG,205); (* Bot dbl line, box *)
ScreenWrite(CHR(188),75,10,SBA); (* Dbl corner, LR *)
TEXTCOLOR(SFG); TEXTBACKGROUND(DBG); (* Returned status colors *)
GOTOXY(59,3); WRITE((SelFreq/100000):9:5); (* Disp rptr's output freq *)
GOTOXY(59,4); WRITE((OffsFreq/100000):9:5); (* Disp rptr's input freq *)
ScreenWrite(CHR(18),57,11,SFG); (* Split legend explained *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
GOTOXY(57,6); WRITE('Indicates Split=ON');
GOTOXY(69,3); WRITE('mHz.');
GOTOXY(69,4); WRITE('mHz.');
PrLines('H',2,79,12,12,SBA,DBG,205); (* Display dbl divider line *)
PrMessage('Internal Band Plan for Repeater Offsets',8);
PrLines('H',6,75,15,15,SBA,DBG,196); (* Display divider line *)
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(13,9);
WRITE('10 Meters - 29.500 mHz to 29.700 mHz: -100 kHz');
GOTOXY(13,11);
WRITE('6 Meters - 52.010 mHz to 52.999 mHz: +1000 kHz');
GOTOXY(13,12);
WRITE(' - 53.000 mHz to 54.000 mHz: -1000 kHz');
PrLines('H',6,75,18,18,SBA,DBG,196); (* Display divider line *)
GOTOXY(13,14);
WRITE('2 Meters - 144.600 mHz to 146.999 mHz: -600 kHz');
GOTOXY(13,15);
WRITE(' - 147.000 mHz to 147.400 mHz: +600 kHz');
PrLines('H',6,75,21,21,SBA,DBG,196); (* Display divider line *)
GOTOXY(13,17);
WRITE('70 Centimeters - 442.000 mHz to 444.999 mHz: +5000 kHz');
GOTOXY(13,18);
WRITE(' - 445.000 mHz to 450.000 mHz: -5000 kHz');
CatSend(Check,86);
QuickStat;
PromptLine('M'); (* Put up Main Menu message *)
Repeater := FALSE;
PromptLine('K'); (* Put up FK line *)
END; (* ShowSplits *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE MemSelect;
(* Select memory channel *)
VAR
MemCh,MCH : CHAR;
MemAddr : INTEGER;
FreqInt,
LSDFreq,
ROffset,
FreqString : STRING[8];
Result : INTEGER;
FreqTune : REAL;
OffsFreq : REAL;
BEGIN (* MemSelect *)
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
WINDOW(1,1,80,5);
PrMessage(' - Select Memory Screen - ',4);
WINDOW(2,6,79,23);
CLRSCR;
PromptLine('S'); (* Put up select message *)
PrMessage('Current Memory Parameters ',5); (* Disp Mem Chan headings *)
GOTOXY(13,6); WRITE(' Channel');
GOTOXY(29,6); WRITE('Frequency');
GOTOXY(48,6); WRITE('Mode');
GOTOXY(62,6); WRITE('Tone');
PrLines('H',6,75,12,12,SBA,DBG,196); (* Display divider line *)
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
FOR Index := 0 TO 9 DO BEGIN (* Display Mem channel nos. *)
GOTOXY(12,Index + 8);
WRITE('Memory 0');
WRITE(Index);
END;
PrMem(27,86,8,27,49,59); (* Display channel data from Update stream *)
(* Display headings & draw `Selected Memory' box *)
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(58,1); WRITE('Selected Memory');
PrBox; (* Draw `Memory Select' box *)
(* Prompt for desired memory number *)
GOTOXY(11,3); WRITE('Enter desired memory.');
GOTOXY(33,3); WRITE(CHR(198));
FOR Index := 1 TO 21 DO
WRITE(CHR(205)); WRITE(CHR(16));
GOTOXY(60,3); WRITE('Channel');
IF SetSel THEN
TEXTCOLOR(RFG); TEXTBACKGROUND(DBG); (* Requested param colors *)
GOTOXY(69,3); WRITE(' ');
REPEAT
MemCh := (ReadKey);
UNTIL MemCh IN [#48..#57];
PromptLine('W'); (* Put up wait message *)
(* Display Channel # in `Selected Memory' box *)
GOTOXY(69,3); WRITE('0',MemCh);
MCH := CHR((ORD(MemCh) -48)); (* Compute Bin value *)
(* Compute ByteNo in Update stream *)
MemAddr := (ORD(MemCh) -48) *6 +27;
GOTOXY(59,3); WRITE(' ');
(* Display Memory Channel Frequency in `Selected Memory' box *)
PrFreq(Update,MemAddr,59,3);
TurnCatOn;
CatSend(Nul3String+MCH+CHR($A),8); (* Set the channel *)
IF NOT Repeater THEN
CatSend(Nul3String+CHR(2)+CHR(9),5) (* Switch mode to MR *)
ELSE CatSend(Nul3String+CHR(0)+CHR(9),5); (* Switch mode to VFO<A> *)
OffsFreq := SelFreq;
IF Repeater THEN BEGIN
(* 10 meter repeaters *)
IF (SelFreq >= 2950000) AND (SelFreq <= 2970000) THEN
OffsFreq := OffsFreq - 10000;
(* 6 meter repeaters *)
IF (SelFreq >= 5201000) AND (SelFreq <= 5400000) THEN BEGIN
IF SelFreq < 5300000 THEN OffsFreq := SelFreq - 100000;
IF SelFreq >= 5300000 THEN OffsFreq := SelFreq + 100000;
END; (* IF *)
(* 2 meter repeaters *)
IF (SelFreq >= 14460000) AND (SelFreq <= 14740000) THEN BEGIN
IF SelFreq < 14700000 THEN OffsFreq := SelFreq - 60000;
IF SelFreq >= 14700000 THEN OffsFreq := SelFreq + 60000;
END; (* IF *)
(* 70 centimeter repeaters *)
IF (SelFreq >= 44200000) AND (SelFreq <= 45000000) THEN BEGIN
IF SelFreq < 44500000 THEN OffsFreq := SelFreq +500000;
IF SelFreq >= 44500000 THEN OffsFreq := SelFreq -500000;
END; (* IF *)
IF OffsFreq <> SelFreq THEN BEGIN (* Split is ready *)
IF (ORD(Update[1])) AND ($08) = 0 THEN (* Mask off Split bit *)
CatSend(SplitTog,26); (* Toggle Split on if off *)
END
ELSE IF (ORD(Update[1])) AND ($08) <> 0 THEN (* Mask off Split bit *)
CatSend(SplitTog,26); (* Toggle Split off if on *)
(* Construct LSD->MSD string for Offset value *)
STR(OffsFreq:8:0,FreqString);
WHILE COPY(FreqString,1,1) = ' ' DO
DELETE(FreqString,1,1);
FreqInt := MultString(8 - LENGTH(FreqString),'0') +FreqString;
LSDFreq := MakeLSDMSD(FreqInt,8);
ROffset := FreqParm(LSDFreq,8);
CatSend(Nul3String+CHR(1)+CHR(9),5); (* Set up to load VFO B *)
CatSend(MToV,26); (* Move Mem to VFO B *)
CatSend(ROffset+CHR(8),5); (* Set VFO B to offset *)
CatSend(Nul3String+CHR(0)+CHR(9),5); (* Set up to load VFO A *)
CatSend(MToV,26); (* Move Mem to VFO A *)
ShowSplits(SelFreq,OffsFreq); (* Display both freqs *)
Repeater := FALSE;
END; (* IF Repeater *)
CatSend(Check,86);
QuickStat;
TurnCatOff;
END; (* MemSelect *)
(*═══════════════════════════════════════════════════════════════════════*)
PROCEDURE QuickStat;
(* Do a quick update in upper left box *)
VAR
HamGen,
ModePos : INTEGER;
BEGIN (* QuickStat *)
WINDOW(1,1,20,5);
(* Display upper left box headings *)
TEXTCOLOR(PFG); TEXTBACKGROUND(Blue); (* Parameter screen colors *)
GOTOXY(3,2); WRITE('Freq:');
TEXTCOLOR(SFG); TEXTBACKGROUND(Blue); (* Special status colors *)
PrFreq(Update,2,8,2); (* Operating Freq *)
(* Display selected Memory/VFO, Mode status in upper left box *)
TEXTCOLOR(SFG); TEXTBACKGROUND(Blue); (* Special status colors *)
PrFreq(Update,2,8,2); (* Operating Freq *)
TEXTCOLOR(PFG); TEXTBACKGROUND(Blue); (* Special param colors *)
GOTOXY(3,3); WRITE('Active: ');
TEXTCOLOR(SFG); TEXTBACKGROUND(Blue); (* Special status colors *)
GOTOXY(11,3);
IF (ORD(Update[1])) AND ($20) <> 0 THEN BEGIN (* Mask off MR bit *)
WRITE('MEMORY ');
ModePos := ORD(Update[8]) * 6 + 32; (* Calc selected MR mode *)
END (* IF *)
ELSE IF (ORD(Update[1])) AND ($10) = 0 THEN BEGIN (* Mask off VFO bit *)
WRITE('VFO A ');
ModePos := 20;
END (* ELSE IF *)
ELSE BEGIN
WRITE('VFO B ');
ModePos := 26;
END; (* ELSE *)
IF (ORD(Update[1])) AND ($08) <> 0 THEN BEGIN (* Mask off SPLIT bit *)
TEXTCOLOR(SFG); TEXTBACKGROUND(Blue); (* Special status colors *)
WRITE(CHR(18));
END (* IF *)
ELSE IF (ORD(Update[1])) AND ($20) = 0 THEN (* Mask off MR bit *)
WRITE(' ');
TEXTCOLOR(PFG); TEXTBACKGROUND(Blue); (* Special param colors *)
GOTOXY(3,4); WRITE('Mode: ');
TEXTCOLOR(SFG); TEXTBACKGROUND(Blue); (* Special status colors *)
HamGen := Bin2BCDHex(ORD(Update[1]) AND $2);
GOTOXY(9,4);
IF HamGen <> 0 THEN WRITE('Gen/')
ELSE WRITE('Ham/');
PrMode(Update,ModePos,13,4);
TEXTCOLOR(SFG); TEXTBACKGROUND(Blue); (* Special status colors *)
IF (ORD(Update[1])) AND ($40) <> 0 THEN BEGIN (* Mask off Clar bit *)
WRITE(' ',CHR(29));
END (* IF *)
ELSE WRITE(' ');
TEXTCOLOR(DFG); TEXTBACKGROUND(DBG); (* Default screen colors *)
END; (* QuickStat *)
(*═══════════════════════════════════════════════════════════════════════*)
FUNCTION Offset(Page,BarPos : INTEGER) : STRING;
(* Compute repeater Split from operating frequency, return Offset Freq *)
VAR
FreqSet,
FreqInt,
LSDFreq,
Junk,
FreqString : STRING[8];
Ofs : CHAR;
DotPos,
Result : INTEGER;
FreqTune : REAL;
BEGIN (* Offset *)
LSDFreq := '';
FreqInt := '';
FreqString := '';
Ofs := ' ';
(* Get repeater's OUTPUT Frequency from Memory array *)
VAL(COPY(MemArray[Page *10 +BarPos],1,8),FreqTune,Result);
Ofs := MemArray[Page *10 +BarPos,23];
(* 10 meter repeaters *)
IF (FreqTune >= 2950000) AND (FreqTune <= 2970000) THEN BEGIN
IF Ofs = '-' THEN FreqTune := FreqTune - 10000;
IF Ofs = '+' THEN FreqTune := FreqTune + 10000;
END; (* IF *)
(* 6 meter repeaters *)
IF (FreqTune >= 5201000) AND (FreqTune <= 5400000) THEN BEGIN
IF Ofs = '-' THEN FreqTune := FreqTune - 100000;
IF Ofs = '+' THEN FreqTune := FreqTune + 100000;
END; (* IF *)
(* 2 meter repeaters *)
IF (FreqTune >= 14460000) AND (FreqTune <= 14740000) THEN BEGIN
IF Ofs = '-' THEN FreqTune := FreqTune - 60000;
IF Ofs = '+' THEN FreqTune := FreqTune + 60000;
END; (* IF *)
(* 70 centimeter repeaters *)
IF (FreqTune >= 44200000) AND (FreqTune <= 45000000) THEN BEGIN
IF Ofs = '-' THEN FreqTune := FreqTune - 500000;
IF Ofs = '+' THEN FreqTune := FreqTune + 500000;
END; (* IF *)
(* Construct LSD->MSD string for Offset value *)
STR(FreqTune:8:0,FreqString);
WHILE COPY(FreqString,1,1) = ' ' DO
DELETE(FreqString,1,1);
FreqInt := MultString(8 - LENGTH(FreqString),'0') +FreqString;
LSDFreq := MakeLSDMSD(FreqInt,8);
Offset := FreqParm(LSDFreq,8);
END; (* Offset *)
END (* of UNIT CATYMVFO *).