Source file: /~heha/messtech/ad_da.zip/PAS/SETUP.PAS

uses crt,Dos;{
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º T E C H N I S C H E   U N I V E R S I T Ž T   C H E M N I T Z          º
º                                                                        º
º Programm zur Ansteuerung des AD/DA-Wandlermoduls mit Einchip-          º
º rechner 68HC11                                                         º
º                                                                        º
º Hardware-Setup-Programm                                                º
º                                                                        º
º Programmierer:    Torsten Levin                                        º
º                   03 AET 89                                            º
º                   TU Chemnitz-Zwickau                                  º
º                                                                        º
º Chemnitz, Januar-April 1993                                            º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
}

Type InstTyp                = Record
                                LPT,COM : Byte;
                              End;

Var
      InstF      : File of InstTyp;
      Inst       : InstTyp;
      i,j        : integer;
      ta         : char;
      cursorsave : word;
      ende       : Boolean;
      position   : Byte;

{---Prozedur-CursorOn--------------------------------------}
  Procedure Cursoron;
  Var regi:registers;
  Begin
    regi.ah:=1;
    regi.cx:=cursorsave;
    intr(16,regi);
  End;

{---Prozedur-CursorOff-------------------------------------}
  Procedure Cursoroff;
  Var regi:registers;
  Begin
    regi.ah:=3;
    intr(16,regi);
    cursorsave:=regi.cx;
    regi.ah:=1;
    regi.ch:=32;
    intr(16,regi);
 End;

{---Prozedur-Init------------------------------------------}
  procedure init;
  var ip,jp:integer;
  begin
    textbackground(1);
    clrscr;
    textcolor(0);
    textbackground(7);
    gotoxy(1,1);
    write('  AD/DA-Wandlermodul Version 3.0       Hardware-Setup       TU Chemnitz-Zwickau ');
    textcolor(15);
    textbackground(1);
    gotoxy(1,2);write('É');
    gotoxy(1,24);write('È');
    gotoxy(80,24);write('¼');
    gotoxy(80,2);write('»');
    for i:= 2 to 79 do
    begin
      gotoxy(i,2);write('Í');
      gotoxy(i,24);write('Í');
    end;
    for i:= 3 to 23 do
    begin
      gotoxy(1,i);write('º');
      gotoxy(80,i);write('º');
    end;
    textbackground(7);
    window(1,25,80,25);
    clrscr;
    window(1,1,80,25);
    gotoxy(1,25);
    textcolor(15);
    write('  PgUp/PgDn            Leertaste            Return                 ESC ');
    textcolor(0);
    gotoxy(13,25);
    write('W„hlen');
    gotoxy(34,25);
    write('Žndern');
    gotoxy(52,25);
    write('Sichern+Ende');
    gotoxy(72,25);
    write('Abbruch');
    gotoxy(52,10);
    write('  LPT ',Inst.LPT,' ');
    textcolor(15);
    textbackground(1);
    gotoxy(52,12);
    write('  COM ',Inst.COM,' ');
    gotoxy(10,10);
    write('Parallele Schnittstelle f�r Drucker    :');
    gotoxy(10,12);
    write('Serielle Schnittstelle f�r AD/DA-Modul :');
  end;
{---Frage--------------------------------------------------}
  Procedure Frage(Text:String;Var OK:Boolean);
  Begin
    sound(500);
    delay(100);
    nosound;
    textcolor(15);
    textbackground(1);
    gotoxy(10,20);write('É');
    gotoxy(10,22);write('È');
    gotoxy(70,22);write('¼');
    gotoxy(70,20);write('»');
    for i:= 11 to 69 do
    begin
      gotoxy(i,20);write('Í');
      gotoxy(i,22);write('Í');
    end;
    for i:= 21 to 21 do
    begin
      gotoxy(10,i);write('º');
      gotoxy(70,i);write('º');
    end;
    textcolor(12);
    gotoxy(12,21);
    Write(Text);
    textcolor(15);
    gotoxy(14+Length(Text),21);
    Write('(J/N) : ');
    Repeat
      ta:=Readkey;
    Until Ta in ['J','j','n','N'];
    write(upcase(ta));
    delay(200);
    gotoxy(10,20);
    write('                                                             ');
    gotoxy(10,21);
    write('                                                             ');
    gotoxy(10,22);
    write('                                                             ');
    If ta in ['j','J'] then OK:=True else OK:=False;
  End;

{---------------H-A-U-P-T-P-R-O-G-R-A-M-M--------------------------}
  begin
    Assign(InstF,'SETUP.DAT');
    {$I-}
    Reset(InstF);
    {$I+}
    If Ioresult=0 Then
    Begin
      {$I-}
      read(InstF,Inst);
      {$I+}
      Close(instf);
    End
    else Begin
      Inst.lpt:=1;
      Inst.Com:=2;
    End;
    cursoroff;
    init;
    ende:=false;
    position:=1;
    Repeat
      Repeat
        ta:=readkey;
        if ta = #0 Then Ta:=Readkey;
      Until ord(ta) in [13,27,32,73,81];
      If Ord(Ta)=13 Then
      Begin
        Frage('Speichern und Programm beenden?',ende);
        If Ende Then
        Begin
          Rewrite(InstF);
          write(InstF,Inst);
          Close(InstF);
        End;
      End;
      If Ord(Ta)=27 Then Frage('Programm ohne Speichern beenden?',ende);
      If Ord(Ta) in [73,81,32] Then
      Begin
        If Ord(Ta) in [73,81] Then if position=1 Then position:=2 else position:=1;
        If (Ord(Ta) = 32) and (position=1) Then If inst.lpt<2 then inc(inst.lpt) else inst.lpt:=1;
        If (Ord(Ta) = 32) and (position=2) Then If inst.com<2 then inc(inst.com) else inst.com:=1;
        If position=1 Then
        Begin
          textcolor(0);
          textbackground(7);
          gotoxy(52,10);
          write('  LPT ',inst.lpt,' ');
          textcolor(15);
          textbackground(1);
          gotoxy(52,12);
          write('  COM ',inst.com,' ');
        End
        else Begin
          textcolor(15);
          textbackground(1);
          gotoxy(52,10);
          write('  LPT ',inst.lpt,' ');
          textcolor(0);
          textbackground(7);
          gotoxy(52,12);
          write('  COM ',inst.com,' ');
        End;
      End;
    Until Ende;
    textbackground(0);
    Textcolor(7);
    ClrScr;
  end.
Detected encoding: ANSI (CP1252)4
Wrong umlauts? - Assume file is ANSI (CP1252) encoded