Specifications
84 Appendix 2: Displaying Data Formats
} GBN_ParameterRec; // record type <05>
//----------------------------------------------------------------
// BINARY TYPES
//
// Some of the data types in a GBN file have special usage in
Oasis
// montaj. These are:
//
// GSF_TIME 2 // Time (HH:MM:SS.SSSS)
// GSF_DATE 3 // Date (YYYY/MM/DD)
// GSF_GGRAPH 4 // Geographical (DEG.MM.SS.SSS)
//
// They are stored as either GS_FLOAT or GS_DOUBLE in a channel
and can
// be display in Oasis montaj as a number of as their special
format (Time,Date).
//
// The following C functions can be used to create GEOSOFT dates
and times.
// Note that the GGRAPH format is just a TIME format with hours
between -360 and 360.
//
//
//---------------------------------------------------------------
//
// long RoundLong(double a)
// {
// if (a > 0.0)
// return((long) (a + 0.5));
// else
// return((long) (a - 0.5));
// }
//
//
// void
// BreakTime(double dVal, // Value to break
// long *plHour, // Hours
// short *psMin, // Minutes
// short *psSec, // Seconds
// double *pdFrac) // Fraction
// {
// double dI,dF;
// short sNeg = 0;
//
// // --- Take out the negative ---
//
// if (dVal < 0.0) { sNeg = 1; dVal = -dVal; }
//
//
// // --- Break into Fractional Components ---
//
// dF = modf(dVal,&dI);
//
//
// // --- Determine the Hour ---
//
// *plHour = (long) dI;
//
//
// // --- Determine the Minutes And Seconds/Frac ---
//
// *pdFrac = modf(dF * 3600.0,&dI);
// *psSec = (short) RoundLong(dI);