|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//<2F><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>:
|
|
|
|
|
|
// SegY<67><59>д<EFBFBD><D0B4>
|
|
|
|
|
|
//
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д: 2008-11-09
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "file64.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(__FILE64_SEGY__)
|
|
|
|
|
|
#define __FILE64_SEGY__
|
|
|
|
|
|
|
|
|
|
|
|
//nFormatCode is
|
|
|
|
|
|
//1 = 4-byte IBM floating-point
|
|
|
|
|
|
//2 = 4-byte, two's complement integer
|
|
|
|
|
|
//3 = 2-byte, two's complement integer
|
|
|
|
|
|
//4 = 4-byte fixed-point with gain (obsolete)
|
|
|
|
|
|
//5 = 4-byte IEEE floating-point
|
|
|
|
|
|
//6 = Not currently used
|
|
|
|
|
|
//7 = Not currently used
|
|
|
|
|
|
//8 = 1-byte, two's complement integer
|
|
|
|
|
|
|
|
|
|
|
|
//CreateIoFile(...) parameter
|
|
|
|
|
|
|
|
|
|
|
|
namespace NFile64
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
#define FILE_DEFAULT 0
|
|
|
|
|
|
#define FILE_MAPPING 1
|
|
|
|
|
|
#define FILE_HTTP 2
|
|
|
|
|
|
|
|
|
|
|
|
class CFileSegy :
|
|
|
|
|
|
public CFile64
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CFileSegy(void);
|
|
|
|
|
|
virtual ~CFileSegy(void);
|
|
|
|
|
|
|
|
|
|
|
|
enum EDataType
|
|
|
|
|
|
{
|
|
|
|
|
|
typeError = 0, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
typeIbmFloat = 1, // 4-byte IBM floating-point
|
|
|
|
|
|
typeIbmLong = 2, // 4-byte, two's complement integer
|
|
|
|
|
|
typeIbmShort = 3, // 2-byte, two's complement integer
|
|
|
|
|
|
typeIbmGainLong = 4, // 4-byte fixed-point with gain (obsolete)
|
|
|
|
|
|
typeIeeFloat = 5, // IEEE floating-point
|
|
|
|
|
|
// 8-bit, integer
|
|
|
|
|
|
// 7 Ϊ<>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>е<EFBFBD><D0B5><EFBFBD>չ
|
|
|
|
|
|
typeChar = 8, // signed char (1 byte)
|
|
|
|
|
|
typeIbmUShort = 9, // 2-byte, two's complement integer
|
|
|
|
|
|
typeIeeShort = 10, //
|
|
|
|
|
|
typeIeeLong = 11, //
|
|
|
|
|
|
typeIeeDouble = 12, // IEEE˫<45><CBAB><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>8<EFBFBD>ֽڣ<D6BD>
|
|
|
|
|
|
};
|
|
|
|
|
|
//<2F><><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棨SEGY<47>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
static int SizeofDataType(EDataType dt); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ij<CDB5><C4B3><EFBFBD>
|
|
|
|
|
|
static CString GetFormatString(EDataType code);
|
|
|
|
|
|
static EDataType GetFormatCode(CString name);
|
|
|
|
|
|
|
|
|
|
|
|
//Ŀǰ<C4BF><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CFileSegy<67><79>CFileSegyMapping<6E><67><EFBFBD><EFBFBD>
|
|
|
|
|
|
static CFileSegy* CreateIoFile(int nCreateMode = FILE_DEFAULT); //newһ<77><D2BB><EFBFBD>¶<EFBFBD><C2B6><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
double ReadBinary(EDataType dt, int IsPC); //<2F><>ȡһ<C8A1><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int ReadBinary(float * x, int num, EDataType dt, int IsSwap);
|
|
|
|
|
|
int ReadBinary(double* x, int num, EDataType dt, int IsSwap);
|
|
|
|
|
|
|
|
|
|
|
|
double GetBinary(BYTE *lpValue, EDataType dt, int IsSwap);
|
|
|
|
|
|
int GetBinary(BYTE *lpValue, EDataType dt, int IsSwap, void* toValue); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>toValue<75>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ʾ<EFBFBD><CABE><EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
int WriteBinary(double v, EDataType dt, int IsSwap); //дһ<D0B4><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteBinary(double *pv, int num, EDataType dt, int IsSwap);
|
|
|
|
|
|
|
|
|
|
|
|
long FloatToLong(double value);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
using namespace NFile64;
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>HTTP<54><50>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
extern bool IsURL(LPCTSTR name, DWORD *pdwServiceType=NULL);
|
|
|
|
|
|
|
|
|
|
|
|
inline long NFile64::CFileSegy::FloatToLong(double value)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(value<0) return (long)(value-0.5);
|
|
|
|
|
|
return (long)(value+0.5);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // !defined(__FILE64_SEGY__)
|
|
|
|
|
|
|
|
|
|
|
|
|