logplus/logPlus/DepPairs.h

126 lines
3.9 KiB
C++

//////////////////////////////////////////////////////////////////
///
/// 测录井信息综合平台
///
/// 编制:王卫
///
/// 版权:中国石化集团石油工程技术研究院
///
/// 2010年10月-
///
#ifndef __DEPPAIR_H__
#define __DEPPAIR_H__
#include <qfile.h>
extern "C"
{
int GetDepPairs(float* curve1,float stdep1,float endep1,float rlev1,
float* curve2,float stdep2,float endep2,float rlev2,float cmins,
float winLength,float stepLength, float searchLength,
float *FirstDep,
float *SecondDep,
float *corc);
int getDepPairs(float* curve1,float stdep1,float endep1,float rlev1,
float* curve2,float stdep2,float endep2,float rlev2,
float *FirstDep,
float *SecondDep);
int AutoCompZone(char *Filename,char *Filename1,char *CurveName1,char *CurveName2,
float *FirstDep,
float *SecondDep);
bool AutoCompute(char *Filename,char *Filename1,char *CurveName1,char *CurveName2);
int AutoComp(char *Filename,char *Filename1,char *CurveName1,char *CurveName2,
float cmins,
float winLength,float stepLength, float searchLength,
float *FirstDep,
float *SecondDep,
float *corc);
}
class CMemRdWt;
// Draw depth-pairs 对象
struct CCurve{
float stdep,endep,rlev;
float *val;
float GetValue(float dep)
{
if(dep>=endep) return 0;
if(dep<stdep) return 0;
int k=(dep-stdep)/rlev+0.5;
return val[k];
}
};
struct DPoint
{
DPoint()
{
x=0;
y=0;
}
DPoint(float x1,float y1)
{
x=x1;
y=y1;
}
float x;
float y;
};
class DepPairs
{
protected:
public:
DepPairs::DepPairs(float* curve1,float stdep1,float endep1,float rlev1,
float* curve2,float stdep2,float endep2,float rlev2,float cmins,
float winLength,float stepLength, float searchLength
);
~DepPairs();
struct CCurve Curve1,Curve2;
int SetRef;
double fun(DPoint &p1, DPoint &p2, DPoint &p3);
int GetGDots(int n1,DPoint *x1,int n);
void DepthSort(float *xxx,int number);
int m_nDepPairsNum;
// Auto shift depth
float last_edep;
double DepLevel,StartDepth,EndDepth;
float *FirstDep;
float *SecondDep;
float *corc;
FILE *fp_temp;
int AdmRun(float *curve1,float *curve2,float *cc);
float wl,sl,step,dr1,dr2,cmin,elast;
float xmin1,xmin2,xmax1,xmax2;
int emp,size,type,way,ipar;
void qs(float *datx,float *daty,float *datc,int left,int right);
void detscl(float sdeps,float edeps);
float ampl(int n,float *x);
float corr(int n,float *x,float *y,int size,int emp);
void cor(int iwl,int isl,float *x,float *y,float *c,int size,int emp);
float act(float *x,int n,int way);
void actvty(int iwl,int isl,float *dr,int way,float *x,float *c);
void adjust(int n,int way,float *c);
int signum(float x);
int optim(int n,float *x,float *y,float *c,float cmins,float elast);
int paral(int n,float *x,float *y,float *c,int retype=0);
int joincurve(float sdeps,float edeps,float *datx,float *daty,float *datc,
float wl,float sl,float step,float dr1,float dr2,
int type,int size,int way,int emp,int ipar,
float cmins,float xelast);
int adm(float stem,float etem ,float cmins,
float winLength,float stepLength, float searchLength,float *datx1,float *daty1,float *datc1);
int MMax(float depth,int isl,float *x,float *y,float *c,float cmins);
int MMax(float depth,float ydep,int isl,float *c,float cmins);
int GetDots(int n1,float sdeps,float edeps,float rlev,float *x,int n);
int GetCompare(int datn,float sdeps,float edeps,float* datx1,float* daty1,float* datc1,float cmins,float xelast);
int mCurrent;
public:
// 显示比例改变时,重新对象计算边框
// 删除对象
int ShiftNum;
// 是否现实边框
};
#endif //__DEPPAIR_H__