batch.h

Go to the documentation of this file.
00001 /* Gnome gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999 The Free Software Foundation
00006  *
00007  * Authors: Percy Zahl <zahl@fkp.uni-hannover.de>
00008  * additional features: Andreas Klust <klust@fkp.uni-hannover.de>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024 
00025 /************************************************************************
00026 
00027               Include File fuer alle Stm - Batch - Programme
00028 
00029                             O. Jusko  7/89
00030 
00031 *************************************************************************/
00032 #ifndef __BATCH_H
00033 #define __BATCH_H
00034 
00035 #include <math.h>
00036 #include <stdlib.h>
00037 #include <stdio.h>
00038 #include <ctype.h>
00039 
00040 // #define PI 3.141592654
00041 
00042 #define VoltAnz  256    /* Achtung Aenderung machen File I/O unmoeglich */
00043 /* min and max macros */
00044 
00045 #ifndef max
00046 #define max(a,b)    (((a) > (b)) ? (a) : (b))
00047 #define min(a,b)    (((a) < (b)) ? (a) : (b))
00048 #endif
00049 
00050 #define PI M_PI
00051 
00052 typedef enum { TopoGraphic, ConstZ, MultiVolt, Spectroscopy, TimeScanMode, SPA2DScan, SPA1DScan, SPAKZScan, ScanTyp5, ScanTyp6 } SCANMODE;
00053 
00054 typedef enum { DATFIL, BYTFIL, SHTFIL, FLTFIL, DBLFIL, CPXFIL, FIL6, FIL7, PGMFIL, EPSFFIL, TGAFIL, D2DFIL, SPEFIL, UIMFIL } FILETYPE;
00055 
00056 /* Falls DOS oder OS2.H not used */
00057 #ifndef INCL_DOS
00058 typedef char   CHAR;
00059 typedef short  SHORT;
00060 typedef long   LONG;
00061 typedef unsigned char   UCHAR;
00062 #ifndef USHORT
00063 typedef unsigned short  USHORT;
00064 #endif
00065 typedef unsigned long   ULONG;
00066 typedef struct {
00067   UCHAR   hours;
00068   UCHAR   minutes;
00069   UCHAR   seconds;
00070   UCHAR   hundredths;
00071   UCHAR   day;
00072   UCHAR   month;
00073   USHORT  year;
00074   SHORT   timezone;
00075   UCHAR   weekday;
00076 } DATETIME;
00077 #endif
00078 
00079 #define DATEI 0
00080 #define SKALAR 1
00081 #define INTAKT 2
00082 
00083 #ifndef BOOL
00084   #define BOOL int
00085 #endif
00086 #ifndef TRUE
00087    #define TRUE 1
00088 #endif
00089 #ifndef FALSE
00090    #define FALSE 0
00091 #endif
00092 
00093 #define MABYT 255
00094 #define MIBYT 0
00095 #define MASHT 32767
00096 #define MISHT -32768
00097 #define MAFLT 3.4e+38
00098 #define MIFLT -3.4e-38
00099 #define MADBL 1.7e+308
00100 #define MIDBL -1.7e-308
00101 
00102 // #define DUMMYSIZE 960     /* noch Platz im Header ... PZ 5/7/97 */
00103 #define DUMMYSIZE 952     /* noch Platz im Header ... PZ 5/7/97 */
00104 
00105 typedef struct {
00106 // shortSCANMODE ScMode;          /* Typ des Scans*/
00107  short    ScMode;         /* Typ des Scans*/
00108  USHORT   NumOfVolts;     /* Anzahl der gescannten Spannungen, eigentl. Voltanz*/
00109  long     nx[VoltAnz];    /* Anzahl der Messpunkte einer Zeile*/
00110  long     ny[VoltAnz];    /* Anzahl der Messzeilen*/
00111  long     dx[VoltAnz];    /* Abstand zweier x - Messpunkte in DA - Einheiten*/
00112  long     dy[VoltAnz];    /* Abstand zweier y - Messpunkte*/
00113  long     x_Offset[VoltAnz];       /* Offset in x [DA]*/
00114  long     y_Offset[VoltAnz];       /* Offset in y [DA]*/
00115  short    VoltScanStart[VoltAnz];  /* Anfang und*/
00116  short    VoltScanEnd[VoltAnz];    /*   Ende des Spec - Scans*/
00117  short    CurVolt[VoltAnz];        /* Biasspannung  [mV], Voltscan*/
00118  short    NumOfTopAve;    /* Anzahl der AD- Messungen, die gemittelt werden*/
00119  short    NumOfSpecAve;   /* Anzahl der AD- Messungen, die gemittelt werden*/
00120  long     HV_MinVolt;     /* minimale Spannung [mV] des HV - Verstaerkers*/
00121  long     HV_MaxVolt;     /* maximale Spannung [mV] des HV - Verstaerkers*/
00122  long     MinDA;          /* minimaler DA - Wert;*/
00123  long     MaxDA;          /* maximaler DA - Wert;*/
00124  double   DAtoAng_X;      /* Umrechnung DA -> Angstroem*/
00125  double   DAtoAng_Y;      /* fuer X, Y, Z*/
00126  double   DAtoAng_Z;      
00127  long     forw_delay;     /* Software forward  Delay zwischen zwei Messungen*/
00128  long     back_delay;     /* Software backward Delay zwischen zwei Messungen*/
00129  double   greyfac;        /* Skalierung der Grauwerte fuer Darstellung*/
00130  double   linefac;        /* Skalierung der Linien fuer Darstellung*/
00131  short    Rotation;       /* Winkel [Grad] des Scans, gegen x*/
00132  short    direction;      /* Scanrichtung : 1 = Vorwaerts, -1 = Rueckwaerts*/
00133  short    Instrument;     /* Welches STM ? 0 = erstes*/
00134  DATETIME StartTime;      /* Datum , Uhrzeit, bei Scanstart*/
00135  DATETIME EndTime;        /* Datum , Uhrzeit  bei Scanende*/
00136  char     UserName[40];   /* Name des Benutzers*/
00137  char     comment[256];   /* Kommentar zum Scan*/
00138  double   VDriftX;        /*  DriftGeschwindigkeit beim Scan */
00139  double   VDriftY;
00140  SHORT    BackInter;      /*  Intervalle beim autom. zurückziehen */
00141  double   BackTime;       /*  Zeit, die zurückgezogen bleibt */
00142  SHORT    MinAbhebDA;     /*   Referenzstrom beim Zurückziehen */
00143  SHORT    RefSpanDA;      /*  Sollstrom am externen Eingang der Regelung */
00144  unsigned short   Kennung;       /*  Kennung: sinnvolle Werte */
00145  short    GateOutTime;
00146  CHAR     dummy [DUMMYSIZE];      /*    Noch Platz */
00147  double   SpecDAtoVolt;   /* Umrechnung DA zu RampenVolt*/
00148  double   SpecADtoNanAmp; /*    "       AD in Nano- Ampere*/
00149  SHORT    NumOfSpecVolts; /* wieviel Spannungsschritte auf der Rampe*/
00150  SHORT    SpecXDist;      /* Abstand von Spectroskopie Pkt in X*/
00151  SHORT    SpecYDist;      /*           "                   In Y  */
00152  double   brightfac;      /* Nulloffset fuer Graudarstellung        */
00153 } HEADER;
00154 
00155 typedef struct {
00156   double X,Y,X1,X2,Y1,Y2,dx,dy;          // im prinzip frei
00157   double Xo,Yo,GateTime,XYdist,CpsHigh;  //
00158   double CpsLow,Alpha;                   //
00159   double usr1;                           // IFaktor,IntInt :frei
00160   unsigned char CReg1,CReg2,CReg3,CReg4; // BYTE
00161   unsigned char CReg5,CReg6,CReg7,CReg8; // BYTE
00162   double Energy,Focus1,Current;          // DOUBLE
00163   double usr2,usr3,usr4;                 // TotalInt,IntRadius,PeakBottom :frei
00164   double focus2,extractor;               //
00165   double dum6;                           //
00166   short  Scanmarker,PointsX,PointsY;     // Integer
00167   char   dateofscan[20];                 // String[20]
00168   char   comment[100];                   // String[100]
00169 } D2D_SPA_DAT_HEADER;
00170 
00171 typedef struct {
00172   short x,y;
00173 } XYCoord;
00174 
00175 typedef struct {
00176   short lx,yo,rx,yu;
00177 } Rectangle;
00178 
00179 typedef union {
00180   HEADER kopf;
00181   D2D_SPA_DAT_HEADER d2dkopf;  
00182   XYCoord xydim;
00183 } FILEHEAD;
00184 
00185 /***********************/
00186 /* Function Prototypes */
00187 /***********************/
00188 
00189 void *salloc (long, unsigned short);
00190 void sfree (void *);
00191 int stricmp(const char *s1, const char *s2);
00192 char *strupr(char *s1);
00193 
00194 long FileCheck (char*, FILETYPE*, FILEHEAD*, FILE**);
00195 int  FileRead  (FILE*, char*, long);
00196 int  FileWrite (char*, char*, FILEHEAD*);
00197 
00198 
00199 #endif

Generated on Sat Apr 1 09:04:24 2006 for GXSM by  doxygen 1.4.6