157 lines
3.5 KiB
C++
157 lines
3.5 KiB
C++
/**
|
|
* @file IConvertor.h
|
|
* @brief 格式解析器抽象类
|
|
* @date 2014-7-29
|
|
* @author: ZhouWenfei
|
|
*/
|
|
|
|
#ifndef PAI_FRAME_ICONVERTOR_H__
|
|
#define PAI_FRAME_ICONVERTOR_H__
|
|
|
|
#pragma warning( push ,0)
|
|
|
|
#include <vector>
|
|
#include <QUuid>
|
|
|
|
#include "ConvertorExport.h"
|
|
#include "ObjectGenralFactory.h"
|
|
//#include "ObjWell.h"
|
|
//#include "ObjWelllog.h"
|
|
#include "MyWelllogRound.h"
|
|
#include "DepthProgress.h"
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
#pragma warning( pop )
|
|
|
|
BEGIN_OSGGRAPHICS_NAMESPACE;
|
|
|
|
struct CONVERTOR_EXPORT sConvertorKey
|
|
{
|
|
public:
|
|
|
|
sConvertorKey();
|
|
|
|
sConvertorKey(QUuid ConvertorTypeClassIDTmp,QString strConvertorTypeName);
|
|
|
|
bool operator !=( const sConvertorKey& s );
|
|
|
|
bool operator< ( const sConvertorKey& s ) const;
|
|
|
|
public:
|
|
|
|
QUuid m_ConvertorTypeClassID; // Convertor type ID
|
|
QString m_strConvertorTypeName; // Convertor type name
|
|
};
|
|
|
|
class CONVERTOR_EXPORT IConvertor
|
|
{
|
|
|
|
public:
|
|
|
|
IConvertor();
|
|
|
|
virtual ~IConvertor();
|
|
|
|
public:
|
|
/**
|
|
* 本接口仅供测试模块使用,请勿使用
|
|
*/
|
|
virtual bool OnlyForTest(){return false;};
|
|
virtual bool Init()
|
|
{
|
|
// m_WellInfo->Init();
|
|
m_WellLogRoundInfo->Init();
|
|
// memset(&m_WellInfo,0,sizeof(m_WellInfo));
|
|
// memset(&m_WellLogRoundInfo,0,sizeof(m_WellLogRoundInfo));
|
|
return true;
|
|
};
|
|
/**
|
|
* @brief 文件是否支持这种格式
|
|
* @param[in]filename 文件名
|
|
* @return if true support filename else not
|
|
*/
|
|
virtual bool IsSupport(const QString &filename)
|
|
{
|
|
Init();
|
|
return 0;
|
|
};
|
|
|
|
|
|
/**
|
|
* @brief 该格式解析器支持的文件后缀名
|
|
* @return QVector<QString> this convertor support all suffix file
|
|
*/
|
|
virtual QVector<QString>GetSupportFileExtensions()=0;
|
|
virtual void InitFormatSuffixName();
|
|
QString m_thisModuleName;
|
|
|
|
/**
|
|
* @brief 指定文件的解编出来的文件头内容
|
|
* @param[in]filename 文件名
|
|
* @return QString file content
|
|
*/
|
|
virtual QString GetFileContent(const QString &filename)=0;
|
|
virtual QStringList &GetListHead(){
|
|
return m_FileHead;
|
|
};
|
|
virtual void SetListHead(QStringList FileHead){
|
|
m_FileHead=FileHead;
|
|
};
|
|
|
|
virtual void SetDepthProgress(DiDepthProgress *pDepthProgress)
|
|
{
|
|
m_pDepthProgress=pDepthProgress;
|
|
}
|
|
|
|
/**
|
|
* @brief 指定文件的测井曲线的元数据
|
|
* @param[in]filename 文件名
|
|
* @return QVector<CObjWellLog*> file contains all welllog curve
|
|
*/
|
|
//virtual QList<CObjWellLog*> GetWellLogList(const QString &filename)=0;
|
|
|
|
/**
|
|
* @brief 获取井信息
|
|
* @return well
|
|
*/
|
|
|
|
//pai::ios::welllog::Well *GetWellInfo();
|
|
|
|
/**
|
|
* @brief 获取井次
|
|
* @return WelllogRound 井次
|
|
*/
|
|
MyWelllogRound *GetWellLogRoundInfo();
|
|
|
|
static pai::datamodel::CObjectGenralFactory<sConvertorKey,IConvertor>& GetFatory();
|
|
|
|
void SetConvertorTypeName(QString TypeName) {m_ConvertorTypeName=TypeName;};
|
|
|
|
QString GetConvertorTypeName(){ return m_ConvertorTypeName;}
|
|
int m_ColumnCount;
|
|
|
|
protected:
|
|
|
|
// pai::ios::welllog::Well* m_WellInfo;
|
|
DiDepthProgress *m_pDepthProgress;
|
|
QStringList m_FileHead;
|
|
MyWelllogRound* m_WellLogRoundInfo;
|
|
QString m_ConvertorTypeName;
|
|
};
|
|
|
|
/**
|
|
* @brief 成图窗口插件注册宏
|
|
*/
|
|
#define BEGIN_REGISTER_ICONVERTOR(className) BEGIN_REGISTER(sConvertorKey,IConvertor,className)
|
|
#define END_REGISTER_ICONVERTOR(className) END_REGISTER( sConvertorKey,IConvertor,className )
|
|
|
|
/**
|
|
* @brief 格式转换器插件工厂
|
|
*/
|
|
typedef pai::datamodel::CObjectGenralFactory<sConvertorKey,IConvertor> IConvertorFactory;
|
|
|
|
END_OSGGRAPHICS_NAMESPACE
|
|
// using namespace pai::graphics;
|
|
#endif
|