next up previous contents
Nächste Seite: 9.3 Unit MessU Aufwärts: 9. Programmlisting Vorherige Seite: 9.1 Programm CM   Inhalt

9.2 Unit Glob


{-------------------------------------------------------------------}

{ Deklaration globaler Konstanten, Typen, Variablen, Prozzeduren und
  Funktionen }
unit Glob;

{$D-}

{-------------------------------------------------------------------}

interface

const
  cmInfo    = 1001;
  cmRechner = 1002;
  cmMessung = 1003;
  cmConvert = 1004;
  cmAusgabe = 1005;
  cmGamma   = 1006;
  cmMotor   = 1007;
  hcRechner = 1;
  hcInfo    = 2;
  hcMessung = 3;
  hcConvert = 4;
  hcAusgabe = 5;
  hcGamma   = 6;
  hcMotor   = 7;

  ExtPlot  = 'PLT';
  ExtMess  = 'MES';
  ExtFFT   = 'FFT';
  ExtKor   = 'KOR';
  ExtDaten = 'DAT';
  ExtGamma = 'GAM';

  nmax     = 1024;
  hmax     = 256;

type
  RealArray = array [0..nmax - 1] of single;
  Wordarray = array [0..nmax - 1] of word;
  DatFile = record
    int, obj, ref, dark : string;
  end;
  Werte = record
    gamma, SAM, delta : real;
  end;
  RMessdaten = record
    files : array [0..3] of string [8];
    dates : array [0..1] of string [8];
  end;

var
  df                                   : array [0..30] of DatFile;
  w                                    : array [0..30] of Werte;
  Messdaten                            : RMessdaten;
  Imes                                 : ^Wordarray;
  Itrans, IRe, IIm                     : ^Realarray;
  Anzahldelta, FFTmax, AnzeigeSchalter : word;
  AnzahlMessung, Fehler                : integer;
  deltac, deltacSAm, Tau               : real;
  FileName, Path, Extens               : string;
  Abbruch, Ok                          : boolean;

function Exists(Fn : string) : boolean;
procedure ValueR(Param : string; var a : real);
procedure ValueI(Param : string; var i : integer);

{-------------------------------------------------------------------}

implementation

{-------------------------------------------------------------------}

{ Pruefung ob eine Datei vorhanden ist }
function Exists(Fn : string) : boolean;

var
  Datei : file;

begin
  Assign(Datei, Fn);
  {$I-}
  Reset(Datei);
  {$I+}
  if IOResult = 0 then
  begin
    Exists := true;
    Close(Datei);
  end
  else Exists := false;
end; { Exists }

{-------------------------------------------------------------------}

{ Konvertierung eines String in einen Real-Wert }
procedure ValueR(Param : string; var a : real);

begin
  Val(Param, a, Fehler);
  Ok := Ok and (Fehler = 0)
end; { ValueR }

{-------------------------------------------------------------------}

{ Konvertierung eines String in einen Integer-Wert }
procedure ValueI(Param : string; var i : integer);

begin
  Val(Param, i, Fehler);
  Ok := Ok and (Fehler = 0)
end;

{-------------------------------------------------------------------}

end. { Glob }

{-------------------------------------------------------------------}

next up previous contents
Nächste Seite: 9.3 Unit MessU Aufwärts: 9. Programmlisting Vorherige Seite: 9.1 Programm CM   Inhalt
Udo Becker
2000-01-02