96
Appendix 2: Displaying Data Formats
#define GS_LONG 3 // signed 4-byte integer
#define GS_FLOAT 4 // 4-byte floating point
#define GS_DOUBLE 5 // 8-byte floating point
// A string type is indicated by the negative string length. For
example,
// a 10 byte string would be type -10. String data should be NULL
// terminated.
// --- dummy values ---
#define GS_U1DM (char ) 255U
#define GS_S1DM (signed char ) -127
#define GS_U2DM (unsigned short) 65535U
#define GS_S2DM (short ) -32767
#define GS_S4DM (long ) -2147483647L
#define GS_R8DM (double ) -1.0E32
// --- 4-byte float dummies require a variable to prevent compiler
problems ---
#ifndef GS_R4DM
float GBN_r4dm = (float) GS_R8DM
#define GS_R4DM (GBN_r4dum)
#endif
// --- display formats ---
#define GSF_NORMAL 0 // Normal decimal number format
#define GSF_EXP 1 // Exponential floating point
(1.2E+23)
#define GSF_TIME 2 // Time (HH:MM:SS.SSSS)
#define GSF_DATE 3 // Date (YYYY/MM/DD)
#define GSF_GGRAPH 4 // Geographical (DEG.MM.SS.SSS)
// --- end of defines ---
#endif
// --- simple channel record ---
typedef struct {char szName[64]; // channel name,
case tolerant,
// NULL terminated
/ ---------------------------------------------------------------
/ If the channel does not already exist, the following 4
parameters
// are used to create the Oasis montaj channel structure. If the
channel
// exists, this information is ignored.
// --------------------------------------------------------------
long lChannelType; // channel data type, one of GS_?
long lDisplayFormat; // one of GSF_?
long lDisplayWidth; // display width in characters
long lDisplayDecimals; // digits after decimal place
} GBN_ChanRec; // record type <01>
// --- Array channel record for array elements ---
typedef struct {
char szName[64]; // channel name, case tolerant,
// NULL terminated
// --------------------------------------------------------------
// If the channel does not already exist, the following 5
parameters
// are used to create the Oasis montaj channel structure. If the
channel
// exists, this information is ignored.
// --------------------------------------------------------------
long lChannelType; // channel data type, one of GS_?
long lArrayDepth; // number of samples per element
long lDisplayFormat; // one of GSF_?
long lDisplayWidth; // display width in characters
long lDisplayDecimals; // digits after decimal place
} GBN_ArrayChanRec; // record type <04>
// --- line record ---