logplus/ConvertorManager/include/InterIConvertor.h
2025-10-29 17:23:30 +08:00

188 lines
4.9 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file InterIConvertor.h
* @brief 格式解析器
* @date 2014-10-10
* @author: ZhouWenfei
*/
#ifndef PAI_FRAME_INTERICONVERTOR_H__
#define PAI_FRAME_INTERICONVERTOR_H__
#pragma warning( push ,0)
#include <vector>
#include <QUuid>
#include <QFileInfo>
#include <QDir>
#include "CStringType.h"
#include "IConvertor.h"
#include "ConvertorExport.h"
#include "ObjectGenralFactory.h"
//#include "ObjWell.h"
//#include "ObjWelllog.h"
#include "DepthProgress.h"
#include "LogIO.h"
#pragma warning( pop )
BEGIN_OSGGRAPHICS_NAMESPACE;
//曲线关键信息结构体
struct WellCurve
{
int Curve_Num;
float Curve_Step;
float Curve_StartDepth;
float Curver_EndDepth;
int Curver_MaxDim;
};
class CONVERTOR_EXPORT InterIConvertor:public IConvertor
{
public:
InterIConvertor();
virtual ~InterIConvertor();
virtual bool Init();
/**
* @brief 文件是否支持这种格式
* @param[in]filename 文件名
* @return if true support filename else not
*/
virtual bool IsSupport(const QString &filename);
virtual QVector<QString>GetSupportFileExtensions();
/**
* @brief 指定文件的测井曲线的元数据并初始化井和井次信息
* @param[in]filename 文件名
* @return QVector<CObjWellLog*> file contains all welllog curve
*/
// virtual QList<CObjWellLog*> GetWellLogList(const QString &filename);
/**
* @brief 指定文件的解编出来的文件头内容
* @param[in]filename 文件名
* @return QString file content
*/
virtual QString GetFileContent( const QString &filename );
/**
*本接口是旧接口,请勿使用
* @brief 读取文件基本信息和文件是否读取成功
* @param[FileName]FileName 文件名
* @param[Message]Message 文件头基本信息
* @param[CurveName]CurveName 各个曲线名
* @param[_Curve]_Curve 曲线结构体
* @return int 读取曲线条数
*/
virtual int ScanLogFile(char *FileName,char *Message,char **CurveName,char **CurveUnit,QList<QString>&DimCurvesList){return 0;};
/**
*本接口是旧接口,请勿使用
* @brief 读取文件中曲线的属性值和深度值
* @param[filename]filename 文件名
* @param[Depth]Depth 井深度值
* @param[Property]Property 曲线属性值
* @param[vMutiDimensionProperty] 多维数据
* @return bool 读取文件是否正确
*/
virtual bool Transfer(char *filename,float *&Depth,float **Property){return false;};
/**
* ScanDiskData 对待转换文件进行扫描,提取测井曲线元数据
* @param FileName 待转换文件名
* @param Message 转换中提示信息
* @param CurveName 文件中所包含的曲线名
* @param CurveUnit 文件中所包含的曲线单位
* @return 返回曲线条数如果文件格式无法识别返回0或者-1
*/
virtual int ScanLogFile(char *FileName,char *Message,char **CurveName,char **CurveUnit){return 0;};
/**
* Tran 对文件中的测井曲线进行读取
* @param vars 待转换文件名、x、y坐标、输出深度段 以\0分割
* @param outfile 输出文件名
* @param OutCurveNo 输出曲线号,-1标定该曲线不输出
* @param OutCurve 输出曲线名
* @param strChineseName 输出曲线别名
* @param strUnit 输出曲线单位
* @return 是否成功输出
*/
virtual bool Transfer(char *vars,char *outfile,int *OutCurveNo,char **OutCurve,char **strChineseName,char **strUnit,int dCurveNum){return false;};
vector<char *> &GetCurveNames()
{
return m_vCurverName;
}
vector<char *> &GetCurveUnits()
{
return m_vCurverUnit;
}
WellCurve & GetWellCurves()
{
return m_CurveData;
}
char * GetfileMessage()
{
return m_fileMessage;
}
public:
QString m_TableName;
WELL_DYNAMIC_INFO WellDynamicInfo;
Slf_FILE_MESSAGE FILE_MESSAGE;
WELL_STATIC_INFO WellStaticInfo;
//private:
/**
* @brief 指定文件的测井曲线的所有数据
* @param[in]strWellLogPath curvefile path
* @param[out]vWellLog file contains all wellog curves
*/
// void GetWellLogObjects( QList<CObjWellLog*> &vWellLog, QString strWellLogPath);
/**
* @brief 指定文件的测井曲线的元数据
* @param[in]strWellLogPath curvefile path
* @param[out]vWellLog file contains all wellog curves
*/
// void GetWellLogMetas( QList<CObjWellLog*> &vWellLog, QString strWellLogPath);
/**
* @brief 初始化井基本信息
* @param[in]wellInfo
* @param[in]filename
*/
void InitWellInfo(const QString &filename);
/**
* @brief 初始化井次基本信息
* @param[in]welllogRoundInfo
*/
void InitWelllogRoundInfo(QString FileName);
protected:
static QString GetfilePath(const char *FileName);
vector<char *>m_vCurverName;
vector<char *>m_vCurverUnit;//ww
char *m_fileMessage;
WellCurve m_CurveData;
int m_DepthLength;
// QList<CObjWellLog*>m_vWellLogCurve;
//多维曲线
QList<QString>m_DimCurvesList;
//多维曲线保存路径
QString m_DimCurvefilePath;
};
END_OSGGRAPHICS_NAMESPACE
using namespace pai::graphics;
#endif