00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
00041
00042 #define VoltAnz 256
00043
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
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
00103 #define DUMMYSIZE 952
00104
00105 typedef struct {
00106
00107 short ScMode;
00108 USHORT NumOfVolts;
00109 long nx[VoltAnz];
00110 long ny[VoltAnz];
00111 long dx[VoltAnz];
00112 long dy[VoltAnz];
00113 long x_Offset[VoltAnz];
00114 long y_Offset[VoltAnz];
00115 short VoltScanStart[VoltAnz];
00116 short VoltScanEnd[VoltAnz];
00117 short CurVolt[VoltAnz];
00118 short NumOfTopAve;
00119 short NumOfSpecAve;
00120 long HV_MinVolt;
00121 long HV_MaxVolt;
00122 long MinDA;
00123 long MaxDA;
00124 double DAtoAng_X;
00125 double DAtoAng_Y;
00126 double DAtoAng_Z;
00127 long forw_delay;
00128 long back_delay;
00129 double greyfac;
00130 double linefac;
00131 short Rotation;
00132 short direction;
00133 short Instrument;
00134 DATETIME StartTime;
00135 DATETIME EndTime;
00136 char UserName[40];
00137 char comment[256];
00138 double VDriftX;
00139 double VDriftY;
00140 SHORT BackInter;
00141 double BackTime;
00142 SHORT MinAbhebDA;
00143 SHORT RefSpanDA;
00144 unsigned short Kennung;
00145 short GateOutTime;
00146 CHAR dummy [DUMMYSIZE];
00147 double SpecDAtoVolt;
00148 double SpecADtoNanAmp;
00149 SHORT NumOfSpecVolts;
00150 SHORT SpecXDist;
00151 SHORT SpecYDist;
00152 double brightfac;
00153 } HEADER;
00154
00155 typedef struct {
00156 double X,Y,X1,X2,Y1,Y2,dx,dy;
00157 double Xo,Yo,GateTime,XYdist,CpsHigh;
00158 double CpsLow,Alpha;
00159 double usr1;
00160 unsigned char CReg1,CReg2,CReg3,CReg4;
00161 unsigned char CReg5,CReg6,CReg7,CReg8;
00162 double Energy,Focus1,Current;
00163 double usr2,usr3,usr4;
00164 double focus2,extractor;
00165 double dum6;
00166 short Scanmarker,PointsX,PointsY;
00167 char dateofscan[20];
00168 char comment[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
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