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

75 lines
2.1 KiB
C++
Raw Permalink 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 <QDir>
#include <QFileDialog>
#include <QTextStream>
//#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];
};
//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 WisTableTran
{
public:
WisTableTran();
~WisTableTran();
int m_TranNum;//用户定义的需要匹配和转换的表数
TRANTABLEINF *m_TTI;//m_TranTableInf;//用户定义的需要匹配和转换的表信息
DEFAULTTABLE *WisDefTable;
DEFAULTTABLE *SlfDefTable;
inline QStringList GetStringList(QString line,bool IsSpa,bool IsTab,bool IsCom,bool IsSem,bool DelDubSpa);
void GetTTI(TRANTABLEINF &m_TTI,QStringList temp);
//DEFAULTTABLE SetTableInf(QString TableName,int num,QStringList ZdName,QStringList ZdLen,QStringList ZdType,QStringList HzName);
DEFAULTTABLE SetTableInf(QString TableName,QString TableHzName,int num,QStringList ZdName,QStringList HzName,QStringList ZdUnit,QStringList ZdType,QStringList ZdLen,QStringList ZdRes);
bool GetTranTableInf();
bool HaveTranTable();//QStringList TableList);
int GetTranTableNo(QString TableName,int fieldNum,Slf_TABLE_FIELD* tableFieldInfo,bool IsS2W);
OUTINF *outinf;
void GetOutInf(int TranTable);
bool ReadWisDefTable();
bool ReadSlfDefTable();
//void InitDefauleTable(QString fileName,DEFAULTTABLE *DefauleTable);
void InitDefauleTable(bool isWis);
};