You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//////////////////////////////////////////////////////////////////////////////
//文件 CurveBinary.h
//主要功能:
// 基础类库
//程序编写: 2005-12-07
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include <math.h>
#include "curve.h"
#define CB_CURVE 1
#define CB_POINT 2
#define CB_LAYER 3
#define CB_NAME 4
//////////////////////////////////////对*.dfx文件进行读写///////////////////////////////////////////
class AFX_EXT_CLASS CCurveBinary
{
protected:
int WriteCurveX(__int32 num, double* x, double* y);
int WritePoint(__int32 num, double* x, double* y);
int GetCurve(void* pList,CCurve &cu);
int iFile;
char* m_class;
public:
CCurveBinary(void);
~CCurveBinary(void);
BOOL Open(char* pstrFileName, int IsWrite); //IsWrite=1为新建打开写=2为追加方式写
BOOL IsOpen(void);
void Close(void);
int GetFileHandle(void);
static int ToText(CString strBinaryName, CString strDfdName); //转换二进制曲线数据到DFD格式文件中
CString GetCurrentLayer(void);
int Seek(char * pNameLayer); //定位到指定层名处
int GetNextLayer(); //获得下一个层名位置,返回 CB_LAYER 为层名
int GetLayers(CStringList& sList); //获得文件中所有层名
int ReplaceLayer(char* pstrFileName, char* pOldLayer, char* pNewLayer);
int DeleteLayer(char* pstrFileName, char* pNameLayer); //删除一个层位,当文件为空时将自动删除该文件
int WriteClass(char* pNameLayer); //写一个层名
int WriteClass(int nFileHandle, char* pNameLayer);
int WriteCurve(CCurve &cu); //写一条曲线
int Read(CCurve &cu);
//m_cross中为指针列表,该指针的前8个字节为交点值,后面的字节为该交点的层名
void Cross(char* pstrFileName, int x0, CPtrList& m_cross); //计算所有交点
int CrossOne(int x0, CPtrList& m_cross); //计算一个交点,
};