提交DataMgr头文件
This commit is contained in:
parent
71c120ba2f
commit
95308877f0
167
DataMgr/include/CStringType.h
Normal file
167
DataMgr/include/CStringType.h
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
/**
|
||||||
|
* @file CStringTyle.h
|
||||||
|
* @brief CString数据自定义、井以及井次结构体
|
||||||
|
* @date 2014-10-10
|
||||||
|
* @author: ZhouWenfei
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PAI_FRAME_CSTRING_H__
|
||||||
|
#define PAI_FRAME_CSTRING_H__
|
||||||
|
#pragma once
|
||||||
|
#include <iostream>
|
||||||
|
#include <QString>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QTextEdit>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
#pragma warning( push ,0)
|
||||||
|
//#include "BaseFunExport.h"
|
||||||
|
#pragma warning( pop )
|
||||||
|
//#ifdef MessageBox
|
||||||
|
//#define MessageBox MessageBox
|
||||||
|
//#endif
|
||||||
|
#define MAX_PATH 1024
|
||||||
|
//#define _MAX_PATH 1024
|
||||||
|
#define MaxCurve 1024
|
||||||
|
#define curve_name_len 256
|
||||||
|
#define curve_unit_len 256
|
||||||
|
#define MIN_RANK rank_char
|
||||||
|
#define MAX_RANK rank_longlong
|
||||||
|
|
||||||
|
#define INTMAX_RANK rank_longlong
|
||||||
|
#define SIZE_T_RANK rank_long
|
||||||
|
#define PTRDIFF_T_RANK rank_long
|
||||||
|
#define MB_OK QMessageBox::Ok
|
||||||
|
typedef unsigned short WORD;
|
||||||
|
#ifdef WIN32
|
||||||
|
typedef unsigned long DWORD;
|
||||||
|
typedef DWORD *LPDWORD;
|
||||||
|
typedef void *HANDLE;
|
||||||
|
#else
|
||||||
|
typedef unsigned int DWORD;
|
||||||
|
typedef DWORD *LPDWORD;
|
||||||
|
typedef void *HANDLE;
|
||||||
|
#endif
|
||||||
|
typedef unsigned char BYTE;
|
||||||
|
typedef char* LPSTR;
|
||||||
|
typedef void* LPVOID;
|
||||||
|
|
||||||
|
class CString;
|
||||||
|
typedef QList<CString> CStringList;
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//#define REPR_INT 1
|
||||||
|
//#define REPR_SHORT 2
|
||||||
|
//#define REPR_LONG 3
|
||||||
|
//#define REPR_FLOAT 4
|
||||||
|
//#define REPR_DOUBLE 5
|
||||||
|
//#define REPR_STRING 6
|
||||||
|
//#define REPR_CHAR 7
|
||||||
|
//#define REPR_UCHAR 8
|
||||||
|
//#define REPR_USHORT 9
|
||||||
|
//#define REPR_UINT 10
|
||||||
|
//#define REPR_ULONG 11
|
||||||
|
//class BASEFUN_EXPORT CString;
|
||||||
|
|
||||||
|
//构建CString
|
||||||
|
class CString
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CString(const char *str = nullptr);
|
||||||
|
CString(const QString str);
|
||||||
|
CString(const CString &other);
|
||||||
|
~CString();
|
||||||
|
|
||||||
|
int GetLength()const;
|
||||||
|
int Find(char *str);
|
||||||
|
int Find(char str);
|
||||||
|
int Find(CString &another);
|
||||||
|
int Find(char str[],int start);
|
||||||
|
int ReverseFind(char ch);
|
||||||
|
int Insert(int pos ,const CString Sctr);
|
||||||
|
int Replace(const char *Src,const char *Dest);
|
||||||
|
CString & TrimLeft();
|
||||||
|
CString & MakeUpper();
|
||||||
|
CString& MakeLower();
|
||||||
|
CString & TrimRight();
|
||||||
|
bool operator==(const char* other );
|
||||||
|
bool operator!=(const char* other );
|
||||||
|
bool operator==(const CString& other );
|
||||||
|
bool operator!=(const CString& other );
|
||||||
|
char operator[](int i);
|
||||||
|
CString Right(int count)const;
|
||||||
|
CString Left(int count)const;
|
||||||
|
// CString operator = (const QString& SrcStr) ;
|
||||||
|
CString operator + (const CString& SrcStr) ;
|
||||||
|
CString operator += (CString& SrcStr) ;
|
||||||
|
CString operator += (const CString& SrcStr) ;
|
||||||
|
char* GetString()const;
|
||||||
|
char GetChar(int n);
|
||||||
|
char GetAt(int n);
|
||||||
|
CString Mid(int pos,int count)const;
|
||||||
|
CString Mid(int pos)const;
|
||||||
|
void Format(const char *format,...);
|
||||||
|
void Delete(int fromIndex,int length);
|
||||||
|
// const char *m_temp;
|
||||||
|
void Alloc(int len);
|
||||||
|
void Empty();
|
||||||
|
private:
|
||||||
|
QString m_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum flags {
|
||||||
|
FL_SPLAT0 = 0x00,/* Drop the value, do not assign */
|
||||||
|
|
||||||
|
FL_SPLAT = 0x01,/* Drop the value, do not assign */
|
||||||
|
FL_INV = 0x02,/* Character-set with inverse */
|
||||||
|
FL_WIDTH = 0x04,/* Field width specified */
|
||||||
|
FL_MINUS = 0x08,/* Negative number */
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ranks {
|
||||||
|
|
||||||
|
rank_char = -2,
|
||||||
|
rank_short = -1,
|
||||||
|
rank_int = 0,
|
||||||
|
rank_long = 1,
|
||||||
|
rank_longlong = 2,
|
||||||
|
rank_ptr = INT_MAX/* Special value used for pointers */
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum bail {
|
||||||
|
|
||||||
|
bail_none = 0,/* No error condition */
|
||||||
|
bail_eof,/* Hit EOF */
|
||||||
|
bail_err/* Conversion mismatch */
|
||||||
|
|
||||||
|
};
|
||||||
|
int AfxMessageBox(CString str);
|
||||||
|
int MessageBox(QWidget *parent,char lpText[128],char*lpCaption, int UINTuType);
|
||||||
|
void ShowMessage(QString mess);
|
||||||
|
|
||||||
|
//构建AfxMessageBox()函数
|
||||||
|
//extern int BASEFUN_EXPORT AfxMessageBox(CString str);
|
||||||
|
//extern int BASEFUN_EXPORT MessageBox(QWidget *parent,char lpText[128],char*lpCaption, int UINTuType);
|
||||||
|
// using namespace pai::graphics;
|
||||||
|
#endif
|
||||||
|
|
||||||
111
DataMgr/include/DataHelper.h
Normal file
111
DataMgr/include/DataHelper.h
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
#ifndef DATAHELPER_H
|
||||||
|
#define DATAHELPER_H
|
||||||
|
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include "MemRdWt.h"
|
||||||
|
#include "datamanagerdefs.h"
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
//#define DefTabNum 10//9 whp change 2020.5.25
|
||||||
|
//for 曲线计算
|
||||||
|
#define MaxArg 26 // 最大自变量数
|
||||||
|
#define DELIMITER 1
|
||||||
|
#define VARIABLE 2
|
||||||
|
#define MNUMBER 3
|
||||||
|
struct DEFAULTTABLE
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString TableName;
|
||||||
|
QString TableAliasName;
|
||||||
|
int ZdNum;
|
||||||
|
Slf_OBJECT_FIELD *tinfo;
|
||||||
|
//Slf_TABLE_FIELD *tinfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
#pragma endregion 导入表数据定义的函数,可以单独建立动态库文件
|
||||||
|
|
||||||
|
|
||||||
|
class DATAMGS_EXPORT DataHelper
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DataHelper();
|
||||||
|
~DataHelper();
|
||||||
|
#pragma region 导入表数据定义的函数,可以单独建立动态库文件
|
||||||
|
//whp change 2020.3.9 for 统一离散数据入口
|
||||||
|
//static QStringList GetVlidTable(QStringList listFiles);//过滤掉无效数据表
|
||||||
|
static QStringList GetVlidTable(int curitemType,QStringList listFiles,QStringList &BadlistFiles);//过滤掉无效数据表
|
||||||
|
static int StrType(QString str);//IsNumberStr(QString str)判断字符串是否为数值,是整数还是浮点数
|
||||||
|
|
||||||
|
static DEFAULTTABLE SetTableInf(QString TableName,QString TableHzName,int num,QStringList ZdName,QStringList HzName,QStringList ZdUnit,QStringList ZdType,QStringList ZdLen,QStringList ZdRes);
|
||||||
|
static void InitDefauleTable();
|
||||||
|
|
||||||
|
static void DelDefauleTable();
|
||||||
|
|
||||||
|
static int GetSimilarTable(int ZdNum,int *FieldType);//匹配缺省表,返回缺省表序号m=1,BOOL IsSem=1,BOOL DelDubSpa=1);
|
||||||
|
static bool IsNullLine(QByteArray line);
|
||||||
|
static bool m_IsGc;
|
||||||
|
static QStringList GetAllWellName();
|
||||||
|
static QStringList GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList);
|
||||||
|
};
|
||||||
|
class Function
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CMemRdWt *Slffile;
|
||||||
|
float val[10];
|
||||||
|
//whp add 2011.7.19 for字符型字段计算
|
||||||
|
char cval[10][30];
|
||||||
|
char *prog;
|
||||||
|
//int d_iProgramInCurvePos[MaxCurve];
|
||||||
|
// float xx[MaxCurve];
|
||||||
|
// -----------------------------
|
||||||
|
// 计算产生新曲线定义开始
|
||||||
|
//char *prog;
|
||||||
|
char token[80];
|
||||||
|
char tok_type;
|
||||||
|
char vars[MaxArg];
|
||||||
|
// A-Z 26 user's variable
|
||||||
|
// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||||
|
int get_exp(float *result);
|
||||||
|
int level2(float *result);
|
||||||
|
int level3(float *result);
|
||||||
|
int level4(float *result);
|
||||||
|
int level5(float *result);
|
||||||
|
int level6(float *result);
|
||||||
|
int primitive(float *result);
|
||||||
|
void get_token();
|
||||||
|
void arith(char o,float *r,float *h);
|
||||||
|
void unary(char o,float *r);
|
||||||
|
void serror(int error);
|
||||||
|
void putback();
|
||||||
|
int level1(float *result);
|
||||||
|
float find_var(char *s,int *ret);
|
||||||
|
int is_in(char ch,char *s);
|
||||||
|
int isdelim(char c);
|
||||||
|
int iswhite(char c);
|
||||||
|
//int ComputeCurve(CString csExpress,float sdeps,float edeps,BOOL IsCurrentOpen);
|
||||||
|
BOOL GetKey();
|
||||||
|
BOOL CheckKey();
|
||||||
|
int GetCodeLen(int Code);
|
||||||
|
//add whp
|
||||||
|
QString csName[MaxArg],csOutName;
|
||||||
|
char TempProg[150];
|
||||||
|
int GetExpress(QString csExpress);//返回输入变量个数(曲线条数)
|
||||||
|
// 计算产生新曲线定义结束
|
||||||
|
};
|
||||||
|
class Resample
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static float GetXstep(float x2,float x1);
|
||||||
|
static void Linear(float *x,float *y,int n,float *a,float *b);
|
||||||
|
static void Parabola(float *x,float *y,int n,float *a,float *b,float *c);
|
||||||
|
static void Akima(float *x,float *y,int n,float *a,float *b,float *c,float *d);
|
||||||
|
static bool LReSampling(float *aDep,float *aVal,int anp,float *tDep,float *curve,int tnp,int method);
|
||||||
|
static void qs(float *datx,float*mr,int left,int right,int Col);
|
||||||
|
static void qs(float *datx,short*mr,int left,int right,int Col);
|
||||||
|
static void ReOrder(float *mr,int Row,int Col,float *tDep);
|
||||||
|
static void ReOrder(short *mr,int Row,int Col,float *tDep);
|
||||||
|
static void ReSampling(float *mr,int Row,int Col,float *aDep,float *tDep,int tnp);
|
||||||
|
static void ReSampling(short *mr,int Row,int Col,float *aDep,float *tDep,int tnp);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
10
DataMgr/include/DataManagerDefs.h
Normal file
10
DataMgr/include/DataManagerDefs.h
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifdef DATAMGR_LIB
|
||||||
|
#define DATAMGS_EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define DATAMGS_EXPORT __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define DATAMGS_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
105
DataMgr/include/DataManagger.h
Normal file
105
DataMgr/include/DataManagger.h
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
#pragma once
|
||||||
|
#include <QObject>
|
||||||
|
#include <QScrollBar>
|
||||||
|
#include <qtablewidget.h>
|
||||||
|
#include "DataManagerDefs.h"
|
||||||
|
#include "slf.h"
|
||||||
|
// #include "objwelllogRound.h"
|
||||||
|
// #include "ObjWelllog.h"
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
class DEFAULTTABLE;
|
||||||
|
class DATAMGS_EXPORT CDataManagger:public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CDataManagger();
|
||||||
|
~CDataManagger();
|
||||||
|
int GetDefTabNum();
|
||||||
|
DEFAULTTABLE *GetDefauleTable();
|
||||||
|
//whp change 2020.3.9 for 统一离散数据入口
|
||||||
|
//交互导入数据表
|
||||||
|
//void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName);
|
||||||
|
void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName,const QString& inFile);
|
||||||
|
//数据表自动导入
|
||||||
|
//void dataInTable(const QStringList& lst );
|
||||||
|
//QStringList dataInTable(int curitemType,const QString& showWellName,const QString& wellFileName);//返回不能识别的非定式的数据文件列表
|
||||||
|
void dataInTable(int curitemType,QString& showWellName,QString& wellFileName);
|
||||||
|
// void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName);
|
||||||
|
//
|
||||||
|
//曲线属性编辑
|
||||||
|
void CurvePropertyEdit(int Type,const QString& FileName,const QString& CurveName);
|
||||||
|
//whp add 2020.4.9 for 波列曲线预览
|
||||||
|
void DisplayWave(const QString& FileName,const QString& CurveName);
|
||||||
|
//whp add 2020.5.12 for 常规曲线预览
|
||||||
|
void DisplayCurve(const QString& FileName,const QString& CurveName);
|
||||||
|
//曲线数值统计
|
||||||
|
void DataStatistics(int Type,const QString& FileName,const QString& CurveName);
|
||||||
|
//创建新曲线
|
||||||
|
QString CreateNewCurve(const QString& wellname);
|
||||||
|
//whp 2020.7.21
|
||||||
|
//创建新表
|
||||||
|
QString CreateNewTable(const QString& wellname);
|
||||||
|
//2020.7.21 表属性编辑
|
||||||
|
QString TableProEdit(const QString& wellname,const QString& tablename);
|
||||||
|
//2021.3.19 表转曲线
|
||||||
|
QString Table2Curve(const QString& wellname,const QString& tablename);
|
||||||
|
//2021.3.23曲线转结论表格
|
||||||
|
QString Curve2ResultTable(const QString& wellname,const QString& tablename);
|
||||||
|
//曲线计算
|
||||||
|
// void CurveCompute(QList<CObjWellLog*>objs,int No=0);
|
||||||
|
|
||||||
|
void CurveCompute(const QString& FileName,const QStringList& CurveNameList);
|
||||||
|
//whp add 2020.4.14 合成阵列曲线
|
||||||
|
QString WaveCompose(const QString& FileName,const QStringList& CurveNameList);
|
||||||
|
//单位转换
|
||||||
|
void UnitConvert(const QString& Filename);//,CObjWelllogRound* pround);
|
||||||
|
//通用列表函数
|
||||||
|
//void ListMessage(const QString& listName,const QStringList& header,const QStringList& listMessage);
|
||||||
|
//外部接口
|
||||||
|
//曲线数值统计
|
||||||
|
void CallDisplayWaveOrCurve(int Type,
|
||||||
|
const QString& FileName,
|
||||||
|
const QString& CurveName,
|
||||||
|
QWidget* parent);
|
||||||
|
//曲线数值统计
|
||||||
|
//20210111 GZL add 纵滑块联动
|
||||||
|
void CDataManagger::CallDisplayCurveVerChange(int Type,
|
||||||
|
const QString& FileName,
|
||||||
|
const QString& CurveName,
|
||||||
|
QWidget* parent,
|
||||||
|
int value,
|
||||||
|
float tipValue);
|
||||||
|
void sendTableP2Mgr(QWidget* parent, QScrollBar *p, QTableWidget *t);
|
||||||
|
|
||||||
|
void DataStatistics(int Type,
|
||||||
|
const QString& FileName,
|
||||||
|
const QString& CurveName,
|
||||||
|
QWidget* parent);
|
||||||
|
//曲线属性编辑
|
||||||
|
void CurvePropertyEdit(int Type,
|
||||||
|
const QString& FileName,
|
||||||
|
const QString& CurveName,
|
||||||
|
QWidget* parent);
|
||||||
|
//曲线计算
|
||||||
|
void CurveCompute(const QString& FileName,
|
||||||
|
const QStringList& CurveNameList,
|
||||||
|
QWidget* parent);
|
||||||
|
QString m_CurveName,m_FileName;
|
||||||
|
QLineEdit *m_edit1,*m_edit2,*m_edit3;
|
||||||
|
QDialog *m_pDialog;
|
||||||
|
//void curveViewMousePress(int pos);
|
||||||
|
signals:
|
||||||
|
//void mousePressPos(int);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slotCurveComputeGc(QStringList listCurveNames);
|
||||||
|
void slotCurvePropertyGc();
|
||||||
|
void accept1();
|
||||||
|
void accept2();
|
||||||
|
private:
|
||||||
|
QString m_fileName;
|
||||||
|
QStringList m_CurveNameList;
|
||||||
|
// QList<CObjWellLog*> m_ObjList;
|
||||||
|
};
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user