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

78 lines
2.2 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.

#pragma once
#include "MemRdWt.h"
//#include "BaseFun.h"
#include "geometryutils.h"
#include "ConvertorExport.h"
#include <QDir>
#include <QFileDialog>
#include <QTextStream>
#pragma execution_character_set("utf-8")
//#include <QMap>
/*struct INFORMATION
{
char Name[80];
int index;
};*/
//whp add 2020.7.10 for 数据表自动匹配和转换
/*struct DEFAULTTABLE
{
QString TableName;
int ZdNum;
Slf_TABLE_FIELD *tinfo;
};*/
struct DEFAULTTABLE
{
public:
QString TableName;
QString TableAliasName;
int ZdNum;
Slf_OBJECT_FIELD tinfo[50];//*tinfo;
QString menuinfo[50];
QString toName[50];
};
//whp add 2020.7.10 for 数据表自动匹配和转换
struct ZdInf
{
QString OutZd,InZd,ZdType,ZdLen,ZdAlias;
};
struct TRANTABLEINF
{
QString OutName,InName,AliasName;
int ZdNum;
ZdInf *tinfo;
//输入字段名列表如果没有字段运算应该就是tinfo.InZd集合
//如果有字段运算(如BTMDEP-THICKEDEP-SDEP)则需要提取字段名集合到InNameList中
QStringList InNameList;
};
struct OUTINF
{
char OutName[64];//slf字段名
int CodeType,CodeLen,Pos;
int CodeType2,CodeLen2,Pos2;
char InName1[64],InName2[64];//wis字段名
QString Sep;
};
class CONVERTOR_EXPORT WisTableTran
{
public:
WisTableTran();
~WisTableTran();
int m_TranNum;//用户定义的需要匹配和转换的表数
TRANTABLEINF *m_TTI;//m_TranTableInf;//用户定义的需要匹配和转换的表信息
DEFAULTTABLE *WisDefTable;
DEFAULTTABLE *SlfDefTable;
void GetTTI(TRANTABLEINF &m_TTI,QStringList temp);
DEFAULTTABLE SetTableInf(QString TableName,QString TableHzName,int num,QStringList ZdName,QStringList HzName,QStringList ZdUnit,QStringList ZdType,QStringList ZdLen,QStringList ZdRes,QString*);
bool GetTranTableInf();
bool HaveTranTable(QString wistype="");//QStringList TableList);
int GetTranTableNo(QString TableName,int fieldNum,Slf_TABLE_FIELD* tableFieldInfo,bool IsS2W);
OUTINF *outinf;
void GetOutInf(int TranTable);
bool ReadDefTable(DEFAULTTABLE *&table,QString table_inf);
//void InitDefauleTable(QString fileName,DEFAULTTABLE *DefauleTable);
void InitDefauleTable(bool isWis);
};