From e55444d3cccc961db985cd8880169bc7f5fc414b Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Sun, 19 Apr 2026 23:49:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=9C=89=E6=B1=89=E5=AD=97?= =?UTF-8?q?=E7=9A=84=E8=A7=A3=E7=BC=96=E6=96=87=E4=BB=B6=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E6=B1=89=E5=AD=97=E4=BA=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include}/DataImport.h | 4 +- ConvertorManager/include/ImportdataDialog.h | 2 +- ConvertorManager/src/CStringType.cpp | 326 ++++++++++++++ ConvertorManager/src/CStringType.h | 169 +++++++ ConvertorManager/src/ConvertorManager.pro | 1 + .../src}/DataImport.cpp | 37 +- ConvertorManager/src/ImportdataDialog.cpp | 415 ++++-------------- ConvertorManager/src/InterIConvertor.cpp | 3 +- ConvertorManager/src/tishidialog.cpp | 14 +- ConvertorManager/src/tishidialog.h | 6 +- ConvertorManager/src/tishidialog.ui | 9 +- OSGDataModel/src/ObjWell.cpp | 2 +- WellLogUI/src/WellDialog.cpp | 4 +- WellLogUI/src/WellLogDialog.cpp | 4 +- logPlus/logPlus.pro | 7 +- logPlus/mainwindow.cpp | 3 +- logPlus/qtprojectwidgets.cpp | 4 +- logPlus/tishidialog.cpp | 55 --- logPlus/tishidialog.h | 28 -- logPlus/tishidialog.ui | 180 -------- 20 files changed, 651 insertions(+), 622 deletions(-) rename {logPlus => ConvertorManager/include}/DataImport.h (96%) create mode 100644 ConvertorManager/src/CStringType.cpp create mode 100644 ConvertorManager/src/CStringType.h rename {logPlus => ConvertorManager/src}/DataImport.cpp (98%) delete mode 100644 logPlus/tishidialog.cpp delete mode 100644 logPlus/tishidialog.h delete mode 100644 logPlus/tishidialog.ui diff --git a/logPlus/DataImport.h b/ConvertorManager/include/DataImport.h similarity index 96% rename from logPlus/DataImport.h rename to ConvertorManager/include/DataImport.h index 478de23..d05efa5 100644 --- a/logPlus/DataImport.h +++ b/ConvertorManager/include/DataImport.h @@ -10,6 +10,7 @@ #include "DepthProgress.h" #include "ConvertorManager.h" #pragma warning( pop ) +#pragma execution_character_set("utf-8") // class QUuid; // class QString; @@ -23,7 +24,7 @@ // void /*OSGWINDOWSHARED_EXPORT*/ slotImportSingleWellLogData(CVecViewCommand &viewCommand,QUuid /*e*/,bool bShow); -class /*OSGWINDOWSHARED_EXPORT*/ CDataImport +class CONVERTOR_EXPORT CDataImport { public: static bool m_bImportByFolder; @@ -61,6 +62,7 @@ public: static CObjWell *ChangetoSlf(QString wellFile,DiDepthProgress *DepthProgress=NULL); //whp change 2019.12.12 static QString ConvertorWellLogFiles(ConvertorManager &pManager,QString wellname,DiDepthProgress *DepthProgress=NULL); + static QString m_prjname; static int flag1; static int flag_check; static int m_flag; diff --git a/ConvertorManager/include/ImportdataDialog.h b/ConvertorManager/include/ImportdataDialog.h index a05d539..e281899 100644 --- a/ConvertorManager/include/ImportdataDialog.h +++ b/ConvertorManager/include/ImportdataDialog.h @@ -91,7 +91,7 @@ public: void DisplayFileInformationAreaData( const QVectorConvertorVector,const QString filePath); bool IsHaveSameCurve(int NumLog,vector &OutCurveNo,vector &OutCurve); void SetProjectname(const QString projectname){m_projectname = projectname;} - //int CheckExistCurve(QString outputfilename,int NumLog,vector& OutCurveNo,vector& OutCurve); + int CheckExistCurve(QString outputfilename,int NumLog,vector& OutCurveNo,vector& OutCurve); private: /** diff --git a/ConvertorManager/src/CStringType.cpp b/ConvertorManager/src/CStringType.cpp new file mode 100644 index 0000000..efbe49f --- /dev/null +++ b/ConvertorManager/src/CStringType.cpp @@ -0,0 +1,326 @@ +#include "CStringType.h" +#include +char *m_temp=NULL; +CString::CString(const char *str) +{ + m_temp=NULL; + if(str==NULL) + m_data =""; + else + m_data=QString::fromLocal8Bit(str); +} +CString::CString(const QString str) +{ + m_temp=NULL; + if(str==NULL) + m_data =""; + else + m_data=str; +} + +CString::~CString() +{ + if(m_temp) delete m_temp; + m_temp=NULL; +}; +void CString::Empty() +{ + m_data =""; +} + +CString::CString(const CString &other) +{ + m_temp=NULL; + m_data=other.m_data; +} +int CString::GetLength()const +{ + return m_data.length(); +} +int CString::Find(char *str) +{ + std::string dataStr=m_data.toStdString(); + return dataStr.find(str); +} +int CString::Find(CString &another) +{ + return m_data.toStdString().find(another.m_data.toStdString()); +} +int CString::Find(char str) +{ + std::string dataStr=m_data.toStdString(); + return dataStr.find(str); +} +/* + +*/ +int CString::Find(char str[],int start) +{ + std::string dataStr=m_data.toStdString(); + int npos=dataStr.find(str); + if(npos==-1) + return -1; + if(nposStrVector; + int left=0; + for (int i=0;i-1;i--) + { + if(tempstr[i]==findStr.at(0)) { + continue; + } + else { + flag=i; + break; + } + } + m_data=temp.left(flag+1); + return *this; +} +bool CString::operator==(const char* other ) +{ + QString srcStr=QString::fromLocal8Bit(other); + if(this->m_data==srcStr) + return true; + return false; +} +bool CString::operator!=(const char* other ) +{ + QString srcStr=QString::fromLocal8Bit(other); + if(this->m_data!=srcStr) + return true; + return false; +} +char CString::operator[](int i) +{ + char ch=GetChar(i); + return ch; +} +CString CString::Right(int count)const +{ + if (count<0) + { + count=0; + } + if (count>m_data.length()) + { + return *this; + } + int length=m_data.length(); + QString temp=m_data; + QString lastdata=temp.remove(0,length-count); + CString RightStr(lastdata); + return RightStr; +} +CString CString::Mid(int pos,int count)const +{ + if (count<0) + { + count=0; + } + QString temp=m_data.mid(pos,count); + CString mstr(temp); + return mstr; +} +CString CString::Mid(int pos)const +{ + QString temp=m_data.mid(pos); + CString mstr(temp); + return mstr; +} + +CString CString::Left(int count)const +{ + if (count<0) + { + count=0; + } + if (count>m_data.length()) + { + return *this; + } + int length=m_data.length(); + QString temp=m_data; + QString lastdata=temp.remove(count,length-count); + CString leftStr(lastdata); + return leftStr; +} + +CString CString::operator + (const CString& SrcStr) +{ + CString str; + str.m_data=m_data+SrcStr.m_data; + return str; +} +/* +CString CString::operator = (const QString& SrcStr) +{ +CString str; +str.m_data=SrcStr; +return str; +} +*/ +CString CString::operator += (CString& SrcStr) +{ + m_data = m_data+SrcStr.m_data ; + return *this; +} +CString CString::operator += (const CString& SrcStr) +{ + m_data = m_data+SrcStr.m_data ; + return *this; +} +bool CString::operator!=(const CString& other ) +{ + return m_data!=other.m_data; +} +bool CString::operator==(const CString& other ) +{ + return m_data==other.m_data; +} + +void CString::Alloc(int len) +{ +} +char* CString::GetString() const +{ + int length=((string)(m_data.toLocal8Bit().data())).length(); + if(m_temp) delete m_temp; + m_temp=new char[length+1]; + // Alloc(length); + strcpy(m_temp,m_data.toLocal8Bit().data()); + return m_temp; +} +char CString::GetChar(int n) +{ + return GetString()[n]; +} +char CString::GetAt(int n) +{ + return GetChar(n); +} + +void CString::Format(const char *format,...) +{ + //char *str=GetString(); + va_list args; + va_start(args,format); + m_data.vsprintf(format,args); + char *buf=new char[2*strlen(m_data.toStdString().c_str())+1]; + vsprintf(buf,format,args); + m_data=buf; + delete buf; + va_end(args); +} +//void ShowMessage(QString mess) +//{ +// QDialog dialog(NULL); +// dialog.setModal(false); +// Qt::WindowFlags flags = dialog.windowFlags(); +// flags |= Qt::WindowStaysOnTopHint; +// flags &= ~Qt::WindowContextHelpButtonHint; +// dialog.setWindowFlags(flags); +// dialog.setWindowTitle("提示"); +// QFormLayout form(&dialog); +// QLabel edit(&dialog); +// form.addRow(&edit); +// edit.setText(mess); +//// QDialogButtonBox buttonBox(QDialogButtonBox::Yes,Qt::Horizontal, &dialog); +//// form.addRow(&buttonBox); +//// if(buttonBox.button(QDialogButtonBox::Yes)) buttonBox.button(QDialogButtonBox::Yes)->setText("退出"); +//// QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), NULL, SLOT(reject())); +// dialog.show(); +// dialog.exec(); +//} +//int AfxMessageBox(CString str) +//{ +// QDialog dialog(NULL); +// dialog.setModal(false); +// Qt::WindowFlags flags = dialog.windowFlags(); +// flags |= Qt::WindowStaysOnTopHint; +// flags &= ~Qt::WindowContextHelpButtonHint; +// dialog.setWindowFlags(flags); +// dialog.setWindowTitle("提示"); +// QFormLayout form(&dialog); +// form.addWidget(new QLabel(str.GetString())); +//// dialog.show(); +// if (dialog.exec() == QDialog::Accepted) { +// // Do something here +// } +//// return MessageBox(NULL,"提示",str.GetString(),NULL ); +//// QString cstr=str.GetString(); +//// QMessageBox msgBox; +//// msgBox.setText(cstr); +//// return msgBox.exec(); +// return 1; +//} + +//int MessageBox(QWidget *parent,char lpText[128],char*lpCaption, int UINTuType) +//{ +// if (!parent) +// { +// char *tempName=lpCaption; +// QString addStr=QString::fromLocal8Bit(tempName); +// return QMessageBox::information(NULL,lpText,addStr,QMessageBox::Ok); +// } +// return 0; +//} diff --git a/ConvertorManager/src/CStringType.h b/ConvertorManager/src/CStringType.h new file mode 100644 index 0000000..657dda7 --- /dev/null +++ b/ConvertorManager/src/CStringType.h @@ -0,0 +1,169 @@ +/** +* @file CStringTyle.h +* @brief CString数据自定义、井以及井次结构体 +* @date 2014-10-10 +* @author: ZhouWenfei +*/ + +#ifndef PAI_FRAME_CSTRING_H__ +#define PAI_FRAME_CSTRING_H__ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#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; +typedef unsigned char byte; +typedef bool BOOL; +#endif +typedef unsigned char BYTE; +typedef char* LPSTR; +typedef void* LPVOID; + +class CString; +typedef QList CStringList; + +using namespace std; + + +#pragma execution_character_set("utf-8") + +//#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 + diff --git a/ConvertorManager/src/ConvertorManager.pro b/ConvertorManager/src/ConvertorManager.pro index cf9a921..b974315 100644 --- a/ConvertorManager/src/ConvertorManager.pro +++ b/ConvertorManager/src/ConvertorManager.pro @@ -57,6 +57,7 @@ HEADERS += \ ../../common/geometryutils.h \ ../include/ConvertorExport.h \ ../include/ConvertorManager.h \ + ../include/DataImport.h \ ../include/IConvertor.h \ ../include/ImportdataDialog.h \ ../include/InterfaceWidget.h \ diff --git a/logPlus/DataImport.cpp b/ConvertorManager/src/DataImport.cpp similarity index 98% rename from logPlus/DataImport.cpp rename to ConvertorManager/src/DataImport.cpp index 877fcb3..950a02b 100644 --- a/logPlus/DataImport.cpp +++ b/ConvertorManager/src/DataImport.cpp @@ -35,7 +35,7 @@ // #include "ObjWellLogTrack.h" #include "ObjWelllogRound.h" // #include "ObjWellTrack.h" -#include "ConsoleOutputWidget.h" +// #include "ConsoleOutputWidget.h" // #include "ObjGeostratums.h" #include "ObjWelllogWavefile.h" @@ -56,7 +56,7 @@ // void OSGFRAMEWORK_EXPORT AppendConsole(pai::log::Priority priority,const QString &output); // BEGIN_OSGGRAPHICS_NAMESPACE; -extern QString g_prjname; +QString CDataImport::m_prjname; int CDataImport::flag1=-1; int CDataImport::m_flag=-1; int CDataImport::flag_check=0; @@ -194,7 +194,7 @@ QList CDataImport::ImportWellTrajectorys(bool IsDir) path=path1; } else { - ConvertorManager::GetInstance().LoadAllConvertorPlugin(); + // ConvertorManager::GetInstance().LoadAllConvertorPlugin(); ConvertorManager &pManager=ConvertorManager::GetInstance(); pManager.all=0; QVectorvSuffix=pManager.GetSupportFileExtensions(); @@ -392,7 +392,7 @@ QList CDataImport::ImportWells(QString path,QStringList &wellfs,char fileSuffix.append(sSuffix); } else { - ConvertorManager::GetInstance().LoadAllConvertorPlugin(); + // ConvertorManager::GetInstance().LoadAllConvertorPlugin(); QVectorvSuffix=pManager.GetSupportFileExtensions(); for (int i=0;i CDataImport::ImportWells(QString path,QStringList &wellfs,char sname=w.completeBaseName()+"数据导入中"; DepthProgress.SetShowName(sname.toStdString().c_str(),0); DepthProgress.SetDepth(progress++,0); - CObjWell *pWell=ChangetoSlf(wellFile,&DepthProgress,IsTran); + // QString strCh(wellFile); // 汉字路径转换 + CObjWell *pWell=ChangetoSlf(wellFile/*strCh.toLocal8Bit()*/,&DepthProgress,IsTran); if(!pSuffix) { if(pWell) { wells.push_back(pWell); @@ -726,7 +727,7 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg if(!filename.endsWith(".slf",Qt::CaseInsensitive)&& !filename.endsWith(".well",Qt::CaseInsensitive)&&IsTran) { - QString logdata=GetLogdataPath()+g_prjname/*::GetProject()->GetName()*/; + QString logdata=GetLogdataPath()+m_prjname/*::GetProject()->GetName()*/; logdata.replace('\\','/'); logdata.replace("//","/"); filename.replace("//","/"); @@ -734,7 +735,8 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg if(filename.indexOf(logdata,0,Qt::CaseInsensitive)>-1) return pWell; ConvertorManager &pManager=ConvertorManager::GetInstance(); //按目录加载原始数据时解编入口 - QString slfName=ConvertorWellLogFiles(pManager,filename,pDepthProgress); + // QString strCh(filename); // 汉字路径转换 + QString slfName=ConvertorWellLogFiles(pManager,filename/*strCh.toLocal8Bit().data()*/,pDepthProgress); if(slfName!=""&&slfName!="abandoned"){//2020.3.19 放弃加载的文件名如何加入到提示中 pWell=ChangetoSlf(slfName,pDepthProgress);//whp add 2019.12.12 } @@ -742,8 +744,9 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg } else { QString wellname1,path1; - GetWellNameAndPath(filename,wellname1,path1); - QString prjname = g_prjname; + // QString strCh(filename); // 汉字路径转换 + GetWellNameAndPath(filename/*strCh.toLocal8Bit().data()*/,wellname1,path1); + QString prjname = m_prjname; // if(GetProject()) prjname=GetProject()->GetName(); QString path2="LogData\\"+prjname; QString path3="LogData/"+prjname; @@ -835,7 +838,7 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg QString welln; if(filename.endsWith(".slf",Qt::CaseInsensitive)) { - QString dirpath=GetLogdataPath()+g_prjname/*GetProject()->GetName()*/; + QString dirpath=GetLogdataPath()+m_prjname/*GetProject()->GetName()*/; char szTemp[64]; strcpy(szTemp, ".well"); @@ -1080,7 +1083,6 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg } return pWell; -return NULL; } void CDataImport::ImportCoreImage() { @@ -1385,7 +1387,7 @@ QString CDataImport::ConvertorWellLogFiles(ConvertorManager &pManager,QString we // { // strWellName = pProject->GetName(); // } - strWellName = g_prjname; + strWellName = m_prjname; QString dir0,dir=::GetLogdataPath();//whp add 2020.2.19 for 非法井名,无法产生井目录 QDir w; if(!strWellName.isEmpty()) { @@ -1612,7 +1614,7 @@ QString CDataImport::ConvertorWellLogFiles(ConvertorManager &pManager,QString we // bool CheckExistCurve(QString outputfilename,int NumLog,vector& OutCurveNo,vector& OutCurve); - if(logio->Open(qss.toStdString().c_str(),CSlfIO::modeRead)) + if(logio->Open(UTF8ToGBK(qss).data()/*qss.toStdString().c_str()*/,CSlfIO::modeRead)) { Slf_FILE_MESSAGE FILE_MESSAGE=v->FILE_MESSAGE; logio->GetFileMessage(v->FILE_MESSAGE); @@ -1672,19 +1674,20 @@ QString CDataImport::ConvertorWellLogFiles(ConvertorManager &pManager,QString we delete logio; //v->Transfer(logfilename,outfile,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow); //whp change 2019.12.10 for写入井名 - if(v->Transfer(logfilename,outfile,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow)) + // QString strCh(logfilename); // 汉字路径转换 + if(v->Transfer(/*strCh.toLocal8Bit().data()*/UTF8ToGBK(logfilename).data(),outfile,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow)) { CLogIO * logio=new CLogIO(); - logio->Open(outfile,CSlfIO::modeReadWrite); + logio->Open(outfile/*UTF8ToGBK(outfile).data()*/,CSlfIO::modeReadWrite); Slf_FILE_MESSAGE mssage; logio->GetFileMessage(mssage); - strcpy(mssage.WellName,WellName.toStdString().c_str()); + strcpy(mssage.WellName,UTF8ToGBK(WellName).data()/*WellName.toStdString().c_str()*/); logio->SetFileMessage(mssage); delete logio; } else return "";//whp add 2019.12.12 //whp change 2020.2.18 for 汉字井名转换有乱码 - QString slfname=QString(QString::fromLocal8Bit(outfile));//QString(QLatin1String(outfile)); + QString slfname=outfile;//QString(QString::fromLocal8Bit(outfile));//QString(QLatin1String(outfile)); delete []logfilename; delete []outfile; //return 1;////whp add 2019.12.08 for 输出成功加载的文件个数 diff --git a/ConvertorManager/src/ImportdataDialog.cpp b/ConvertorManager/src/ImportdataDialog.cpp index cfc2f61..a66090b 100644 --- a/ConvertorManager/src/ImportdataDialog.cpp +++ b/ConvertorManager/src/ImportdataDialog.cpp @@ -5,7 +5,7 @@ //#include "ObjWelllogRound.h" #include #include -//#include "DataImport.h" +#include "DataImport.h" #include "CStringType.h" #include "MyWelllogRound.h" #include "tishidialog.h" @@ -242,8 +242,8 @@ void ImportDataDialog::UpdateWell(InterfaceWidget *pInterfaceWidget,IConvertor * InterIConvertor*pIC=dynamic_cast(pConvertor); MyWelllogRound* wellInfo=pConvertor->GetWellLogRoundInfo(); QString wellname=pInterfaceWidget->GetWellNameLineEdit()->text(); - wellname=wellname.toUpper(); - if(pIC) strcpy(pIC->FILE_MESSAGE.WellName,wellname.toStdString().c_str()); + wellname=wellname.toUpper(); + if(pIC) strcpy(pIC->FILE_MESSAGE.WellName,wellname.toLocal8Bit().data()); wellInfo->SetWellName(wellname.toStdString()); wellInfo->SetName(wellname.toStdString()); // @@ -523,89 +523,89 @@ bool ImportDataDialog::IsHaveSameCurve(int NumLog,vector &OutCurveNo,vector } return 0; } -// int ImportDataDialog::CheckExistCurve(QString filename,int NumLog,vector& OutCurveNo,vector& OutCurve) -// { //1-有输出曲线,需要继续输出,0-经跳过功能后,没有曲线要输出了,-1退回原界面 -// CMemRdWt *logio=new CMemRdWt(); -// if(!logio->Open(filename.toStdString().c_str(),CSlfIO::modeRead)) -// { -// delete logio; -// return 1; -// } -// CString str,mes=""; -// vector ExistCurveNo; -// vector ExistCurve; -// int ExistCurveNum=0; -// for(int i=0;iFindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL); -// if(logio->FindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL)<0)continue; -// ExistCurve.push_back(OutCurve[i]); -// ExistCurveNo.push_back(i); -// } -// if(ExistCurve.size()==0) -// { -// delete logio; -// return 1; -// } -// TiShiDialog *dlg=new TiShiDialog(NULL); -// dlg->init(ExistCurve); -// if(dlg->exec()==Accepted) -// { -// if(dlg->flag==0)//跳过 -// { -// for(int i=0;iflag==1)//替换 -// { -// for(int i=0;iDiscardObject(ExistCurve[i]); -// } -// } -// else if(dlg->flag==3)//另存 -// { -// QStringList OutCurveList; -// for(int i=0;iGetObjectCount();i++) -// { -// char name[64]; -// if(logio->GetObjectStatus(i)!=OBJECT_NORMAL)continue; -// logio->GetObjectName(i,name); -// OutCurveList.append(QString(name)); -// } -// for(int i=0;itoStdString()->c_str()); -// delete temp; -// } -// } -// delete logio; -// delete dlg; -// } -// else -// { -// delete logio; -// delete dlg; -// return -1; -// } -// for(int i=0;i=0) return 1; -// } -// return 0; -// } +int ImportDataDialog::CheckExistCurve(QString filename,int NumLog,vector& OutCurveNo,vector& OutCurve) +{ //1-有输出曲线,需要继续输出,0-经跳过功能后,没有曲线要输出了,-1退回原界面 + CMemRdWt *logio=new CMemRdWt(); + if(!logio->Open(filename.toStdString().c_str(),CSlfIO::modeRead)) + { + delete logio; + return 1; + } + CString str,mes=""; + vector ExistCurveNo; + vector ExistCurve; + int ExistCurveNum=0; + for(int i=0;iFindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL); + if(logio->FindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL)<0)continue; + ExistCurve.push_back(OutCurve[i]); + ExistCurveNo.push_back(i); + } + if(ExistCurve.size()==0) + { + delete logio; + return 1; + } + TiShiDialog *dlg=new TiShiDialog(NULL); + dlg->init(ExistCurve,""); + if(dlg->exec()==Accepted) + { + if(dlg->flag==0)//跳过 + { + for(int i=0;iflag==1)//替换 + { + for(int i=0;iDiscardObject(ExistCurve[i]); + } + } + else if(dlg->flag==3)//另存 + { + QStringList OutCurveList; + for(int i=0;iGetObjectCount();i++) + { + char name[64]; + if(logio->GetObjectStatus(i)!=OBJECT_NORMAL)continue; + logio->GetObjectName(i,name); + OutCurveList.append(QString(name)); + } + for(int i=0;itoStdString()->c_str()); + delete temp; + } + } + delete logio; + delete dlg; + } + else + { + delete logio; + delete dlg; + return -1; + } + for(int i=0;i=0) return 1; + } + return 0; +} void CreateWellFile(CLogIO *logio,Slf_FILE_MESSAGE &mssage,QString wellFile,CObjWell *pWell) { @@ -648,233 +648,6 @@ void CreateWellFile(CLogIO *logio,Slf_FILE_MESSAGE &mssage,QString wellFile,CObj } } } -// 参考 CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProgress,bool IsTran) -CObjWell *ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProgress,bool IsTran) -{ - QString filename=wellFile1; - QString slffilename=filename; - - ///从文件内部读取井名 - CLogIO * logio=new CLogIO(); - if(!logio->Open(slffilename.toStdString().c_str(),CSlfIO::modeRead)) - { - delete logio; - QString aa=slffilename+"文件打开失败,请检查!"; - return NULL; - // AppendConsole(pai::log::PAI_ERROR,aa); - // return pWell; - } - //说明从项目或者井节点发起attachSLF,需要读取slf获得井名和井次信息 - QString wellname=""; - Slf_FILE_MESSAGE mssage; - logio->GetFileMessage(mssage); - wellname=mssage.WellName; - wellname=wellname.toUpper(); - //辨别井名是否有效,无效则采用文件名 - QFileInfo fileInfo(filename); - QString strWellName = fileInfo.completeBaseName(); - strWellName=strWellName.toUpper(); - QString wellRoundname=strWellName; - - CObjWell *pWell = new CObjWell(); - CObjWelllogRound* pWelllogRound=new CObjWelllogRound(); - pWelllogRound->SetWell(pWell); - // pWell->AddChild(pWelllogRound); - - pWell->SetCurrentObjWellRound(pWelllogRound); - - wellRoundname=wellRoundname.toUpper(); - // pWelllogRound->SetName(wellRoundname); - pWelllogRound->SetSlfFileName(filename); - if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1) - { - wellname=strWellName.toStdString().c_str(); - int len=strlen(strWellName.toStdString().c_str()); - if(len>sizeof(mssage.WellName)) len=sizeof(mssage.WellName); - strncpy(mssage.WellName,strWellName.toStdString().c_str(),len); - mssage.WellName[len]=0; - logio->SetFileMessage(mssage); - } - wellname=wellname.toUpper(); - QString welln; - if(filename.endsWith(".slf",Qt::CaseInsensitive)) - { - // QString dirpath=GetLogdataPath()+GetProject()->GetName(); - - // welln=GetWellFileFromDir(dirpath,wellname,".well"); - // if(welln.isEmpty()||(!pWell->GetName().isEmpty()&&wellname!=pWell->GetName())) { - // wellname=pWell->GetName(); - int index=filename.lastIndexOf("\\"); - int index1=filename.lastIndexOf("/"); - if(index1>index) index=index1; - // welln=GetWellFileFromCurrentDir(filename.left(index+1),wellname,".well"); - - if(welln.isEmpty()) { - welln=filename.left(index+1)+wellname+".well"; - QFileInfo check_file(welln); - if (!check_file.exists() || !check_file.isFile()) {//文件不存在 - CreateWellFile(logio,mssage,welln,pWell); - } - - // CDataTree::SetTree(welln,pWell,NULL,(DepthProgress *)pDepthProgress,1); - } - } - int iX=-1,iY=-1,iZ=-1; - int isrefress=true; - QString temp = ::GetConfPath()+"data.ini"; - QSettings settings(temp,QSettings::IniFormat,0); - settings.setIniCodec(QTextCodec::codecForName("UTF-8")); - QStringList serials=settings.value("wellType",0).toStringList(); - int type=serials.indexOf(mssage.WellType); - - if(type>-1) pWell->SetWellSymbol("well" + QString::number(type) + ".png"); - - //else isrefress=true; - float Altitude=mssage.Altitude; - float X_COORDINATE=mssage.Xcoor; - float Y_COORDINATE=mssage.Ycoor;//井斜x,y坐标 - WellHead &mWellHead=pWell->GetWellHead(); - if(mssage.Kelly==9999999) mssage.Kelly=0; - if(mssage.Kelly==-9999) mssage.Kelly=0; - if(mssage.Kelly==-99999) mssage.Kelly=0; - if(mssage.azca) mWellHead.azca=mssage.azca; - if(mssage.Kelly)mWellHead.dEle=ConvertDataByFloat(mssage.Kelly).toFloat(); - if(mssage.WellName[0])mWellHead.wellName=mssage.WellName; - if(X_COORDINATE)mWellHead.x=X_COORDINATE; - if(Y_COORDINATE)mWellHead.y=Y_COORDINATE; - if(Altitude)mWellHead.earthEle=Altitude; - if(mssage.X0)mWellHead.dxe=mssage.X0; - if(mssage.Y0)mWellHead.dyn=mssage.Y0; - if(mssage.TVD)mWellHead.tvd=mssage.TVD; - Slf_CURVE acurveinfo; - memset(&acurveinfo,0,sizeof(Slf_CURVE)); - int curveCount=logio->GetObjectCount(); - if(isrefress) { - logio->DiscardObject("X"); - logio->DiscardObject("Y"); - logio->DiscardObject("Z"); - logio->DiscardObject("TVD"); - } - iX=logio->OpenCurve("X"); - iY=logio->OpenCurve("Y"); - iZ=logio->OpenCurve("Z"); - if(iX>-1) logio->GetCurveInfo(iX,&acurveinfo); - - mWellHead.depth=acurveinfo.StartDepth; - if(mWellHead.tvd==0&&acurveinfo.StartDepth!=0)mWellHead.tvd=acurveinfo.StartDepth; - mWellHead.z=mWellHead.earthEle-mWellHead.tvd+mWellHead.dEle; - mWellHead.startDepth=acurveinfo.StartDepth; - mWellHead.endDepth=acurveinfo.EndDepth; - mWellHead.rlev=acurveinfo.DepLevel; - int iDepth=-1; - iDepth=logio->OpenCurve("TVD"); - if(iX>=0&&iY>=0&&iZ>=0&&iDepth>=0) { - logio->GetCurveInfo(iX,&acurveinfo); - if(acurveinfo.DepLevel==0) { - logio->DiscardObject(iX); - logio->DiscardObject(iY); - logio->DiscardObject(iZ); - logio->DiscardObject(iDepth); - delete logio; - pWell->ComputeTrajectory(pWell,filename); - } else { - delete logio; - pWell->SetDepth(pWell); - } - } - else { - delete logio; - pWell->ComputeTrajectory(pWell,slffilename); - } - logio=new CLogIO(); - if(!logio->Open(slffilename.toStdString().c_str(),CSlfIO::modeRead)) - { - delete logio; - QString aa=slffilename+"文件打开失败,请检查!"; - // AppendConsole(pai::log::PAI_ERROR,aa); - return pWell; - } - curveCount=logio->GetObjectCount(); - char* curvename=new char[65]; - curvename[64]='\0'; - char* aliasname=new char[65]; - aliasname[64]='\0'; - for(int i=0;iGetObjectName(i,curvename,NULL,aliasname); - if(!logio->IsObject(i)) { - logio->DiscardObject(i); - continue; - }; - if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue; - short curvetype=logio->GetObjectType(i); - short Attribute=0,SubAttribute=0; - logio->GetObjectAttribute(i,&Attribute,&SubAttribute); - if(curvetype==CURVE_OBJECT) - { - Slf_CURVE acurveinfo; - logio->GetCurveInfo(i,&acurveinfo); - if(acurveinfo.DepLevel!=0&&(acurveinfo.EndDepth-acurveinfo.StartDepth>0)) - { - if(acurveinfo.MaxValue==acurveinfo.MinValue||acurveinfo.MaxValue==-99999||acurveinfo.MaxValue==-9999||acurveinfo.MinValue==999999||acurveinfo.MinValue==999999||acurveinfo.MinValue==99999||acurveinfo.MinValue==99999||acurveinfo.MinValue==-9999){ - int curveindex=logio->OpenSlfTable(i,-1); - if(curveindex>-1) - { - MyDataTypeEnum vVdl; - DWORD count=(acurveinfo.EndDepth-acurveinfo.StartDepth)/acurveinfo.DepLevel+1.5; - DWORD len=count*acurveinfo.CodeLen; - acurveinfo.MinValue=99999999; - acurveinfo.MaxValue=-99999999; - if(acurveinfo.CodeLen==8) acurveinfo.MinValue=99999999; - vVdl.vchar=new char[len]; - len=logio->ReadCurve(curveindex, acurveinfo.StartDepth,count,(void *)vVdl.vchar); - if(!len) { - QString cs; - char buf[1000]; - sprintf(buf,"%s %f-%f",acurveinfo.Name,acurveinfo.StartDepth,acurveinfo.EndDepth); - cs=buf; - int flag = QMessageBox::warning(NULL,"提示",QString(cs+"\n曲线信息异常!删除该曲线可能需要较长时间,建议复制正常曲线等信息到新文件,然后删除此文件。是否此时直接将该曲线删除?"),QMessageBox::Yes,QMessageBox::No); - if(flag==QMessageBox::Yes) logio->DiscardObject(i); - delete vVdl.vchar; - continue; - } - for(int kk=0;kkGetData(acurveinfo.RepCode,&vVdl.vchar[kk*acurveinfo.CodeLen],buf); - if(_isnan(temp)||!_finite(temp)) continue; - - if(acurveinfo.MaxValuetemp) if(temp!=-9999.0&&temp!=-999.25&&temp!=-99999.0)acurveinfo.MinValue=temp; - } - logio->SetCurveInfo(curveindex,&acurveinfo); - delete vVdl.vchar; - } - } - } - else if(acurveinfo.DepLevel==0||acurveinfo.StartDepth<-100000||acurveinfo.StartDepth>100000) - { - QString cs; - char buf[1000]; - sprintf(buf,"%s %f-%f",acurveinfo.Name,acurveinfo.StartDepth,acurveinfo.EndDepth); - cs=buf; - int flag = QMessageBox::warning(NULL,"提示",QString(cs+"\n曲线信息异常!删除该曲线可能需要较长时间,建议复制正常曲线等信息到新文件,然后删除此文件。是否此时直接将该曲线删除?"),QMessageBox::Yes,QMessageBox::No); - if(flag==QMessageBox::Yes) logio->DiscardObject(i); - continue; - } - } - } - delete []curvename; - delete []aliasname; - DepthProgress *pd=new DepthProgress; - pd->CreatProgress(0,2,"正在整理数据..."); - pd->SetDepth(1); - delete logio; - delete pd; - - delete pWelllogRound; - delete pWell; -} bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurrentInterfaceWidget,int ColumnCount,IConvertor *pConvertor) { @@ -935,7 +708,7 @@ bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurren } int HaveOut=1; if(tpConvertor->m_TableName.isEmpty()) { - //HaveOut=CheckExistCurve(outputfilename,iRow,OutCurveNo,OutCurve); + HaveOut=CheckExistCurve(outputfilename,iRow,OutCurveNo,OutCurve); } else { vector OutCurveNo; @@ -944,7 +717,7 @@ bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurren char *buf=new char[strlen(tpConvertor->m_TableName.toStdString().c_str())+1]; strcpy(buf,tpConvertor->m_TableName.toStdString().c_str()); OutCurve.push_back(buf); -// HaveOut=CheckExistCurve(outputfilename,1,OutCurveNo,OutCurve); + HaveOut=CheckExistCurve(outputfilename,1,OutCurveNo,OutCurve); delete buf; } if(HaveOut==0){ @@ -966,7 +739,7 @@ bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurren } //此时测井专业模块开始执行,输出为slf文件 char *outfile = new char[outputfilename.toStdString().size()+300]; - strcpy(outfile, outputfilename.toStdString().c_str()); + strcpy(outfile, outputfilename.toStdString().c_str()); char *logfilename = new char[m_FilePath.toStdString().size()+1]; @@ -991,15 +764,18 @@ bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurren //TODO l+=strlen(&outfile[l])+1; *(int*)&outfile[l]=iRow; - if(((InterIConvertor*)(pCurrentInterfaceWidget->m_pConvertor))->Transfer(logfilename,outfile,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow)) + + // QString strCh(logfilename); // 汉字路径转换 + // // QString strChOut(outfile); // 汉字路径转换 + if(((InterIConvertor*)(pCurrentInterfaceWidget->m_pConvertor))->Transfer(/*strCh.toLocal8Bit().data()*/UTF8ToGBK(logfilename).data(),outfile/*strChOut.toLocal8Bit().data()*/,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow)) { MyWelllogRound *wellRound=pCurrentInterfaceWidget->m_pConvertor->GetWellLogRoundInfo(); if(wellRound) { ((InterIConvertor*)(pCurrentInterfaceWidget->m_pConvertor))->InitWellInfo(outfile); wellRound->SaveMeesge(outfile); } - // CDataImport::ChangetoSlf(outfile,NULL); - ChangetoSlf(outfile,NULL,true); + CDataImport::ChangetoSlf(outfile,NULL); + // ChangetoSlf(outfile,NULL,true); } for(int i=0;i(tempStr.c_str()); - int Value= ScanLogFile(filePath,m_fileMessage,&m_vCurverName[0],&m_vCurverUnit[0]); + // QString strCh(filePath); // 汉字路径转换 + int Value= ScanLogFile(UTF8ToGBK(filePath).data()/*strCh.toLocal8Bit().data()*/,m_fileMessage,&m_vCurverName[0],&m_vCurverUnit[0]); m_CurveData.Curve_Num=Value; if(Value<=0) return 0;//ww return Value; diff --git a/ConvertorManager/src/tishidialog.cpp b/ConvertorManager/src/tishidialog.cpp index 528c70e..05d69cf 100644 --- a/ConvertorManager/src/tishidialog.cpp +++ b/ConvertorManager/src/tishidialog.cpp @@ -1,4 +1,4 @@ -#include "tishidialog.h" +#include "tishidialog.h" TiShiDialog::TiShiDialog(QWidget *parent) : QDialog(parent) @@ -8,8 +8,15 @@ TiShiDialog::TiShiDialog(QWidget *parent) QObject::connect(m_pUI.pushButtonHB, SIGNAL(clicked()), this, SLOT(slotHB())); QObject::connect(m_pUI.pushButtonLC, SIGNAL(clicked()), this, SLOT(slotLC())); QObject::connect(m_pUI.pushButtonTG, SIGNAL(clicked()), this, SLOT(slotTG())); + QObject::connect(m_pUI.checkBox, SIGNAL(clicked()), this, SLOT(slotCheck())); + check=0; + m_pUI.checkBox->setCheckState(Qt::Unchecked); +} +void TiShiDialog::slotCheck() +{ + if(m_pUI.checkBox->checkState()==Qt::Unchecked)check=0; + else check=1; } - TiShiDialog::~TiShiDialog() { @@ -38,10 +45,11 @@ void TiShiDialog::slotTG() accept(); return ; } -void TiShiDialog::init(std::vector OutCurve) +void TiShiDialog::init(std::vector OutCurve,QString qss) { for(int i=0;iappend(QString(OutCurve[i])); } + m_pUI.label->setText(qss+"井次中下列数据已存在"); } \ No newline at end of file diff --git a/ConvertorManager/src/tishidialog.h b/ConvertorManager/src/tishidialog.h index 7215b66..fa41aa9 100644 --- a/ConvertorManager/src/tishidialog.h +++ b/ConvertorManager/src/tishidialog.h @@ -4,9 +4,7 @@ #include #include "ui_tishidialog.h" #include - #pragma execution_character_set("utf-8") - class TiShiDialog : public QDialog { Q_OBJECT @@ -14,8 +12,9 @@ class TiShiDialog : public QDialog public: TiShiDialog(QWidget *parent = 0); ~TiShiDialog(); - void init(std::vector OutCurve); + void init(std::vector OutCurve,QString); int flag; + int check; private: Ui::TiShiDialog m_pUI; private slots: @@ -23,6 +22,7 @@ private slots: void slotHB(); void slotLC(); void slotTG(); + void slotCheck(); }; #endif // TISHIDIALOG_H diff --git a/ConvertorManager/src/tishidialog.ui b/ConvertorManager/src/tishidialog.ui index 10979c8..2804b89 100644 --- a/ConvertorManager/src/tishidialog.ui +++ b/ConvertorManager/src/tishidialog.ui @@ -7,7 +7,7 @@ 0 0 382 - 319 + 333 @@ -42,6 +42,13 @@ + + + + 后面所有井均执行此操作 + + + diff --git a/OSGDataModel/src/ObjWell.cpp b/OSGDataModel/src/ObjWell.cpp index 26637e5..c966c17 100644 --- a/OSGDataModel/src/ObjWell.cpp +++ b/OSGDataModel/src/ObjWell.cpp @@ -833,7 +833,7 @@ int CObjWell::ComputeTrajectory(CObjWell *pWell,QString slffilename) int len=slffilename.indexOf(".slf",0,Qt::CaseInsensitive); slf=slffilename.mid(0,len)+".well"; } - else slf=path+"/"+mssage.WellName+".well"; + else slf=path+"/"+QString::fromLocal8Bit(mssage.WellName)+".well"; CMemRdWt sf(slf.toStdString().c_str(),CSlfIO::modeReadWrite); Slf_FILE_MESSAGE sm; sf.GetFileMessage(sm); diff --git a/WellLogUI/src/WellDialog.cpp b/WellLogUI/src/WellDialog.cpp index d517a55..40716b1 100644 --- a/WellLogUI/src/WellDialog.cpp +++ b/WellLogUI/src/WellDialog.cpp @@ -67,7 +67,7 @@ void CWellDialog::DataToView() wellLR.SetBottomDepth(pWell->GetWellHead().endDepth); QString title = pWell->GetName() == "" ? "新建井基本信息":"编辑井基本信息"; this->setWindowTitle(title); - m_pUI->wellName->setText(wellLR.GetWellName().c_str()); + m_pUI->wellName->setText(GBKToUTF8(wellLR.GetWellName().c_str())); m_pUI->companyName->setText(QString::fromStdString(wellLR.GetOilCompanyName())); m_pUI->wellCode->setText(QString::fromStdString("")); m_pUI->areaName->setText(QString::fromStdString(wellLR.GetAreaName())); @@ -349,7 +349,7 @@ void CWellDialog::ViewToData() hd.wellName=welln; // CObjWell *pOldWell=dynamic_cast(::GetProject()->GetObjectByName(welln)); pWell->SetName(welln); - wellLR.SetWellName(welln.toStdString()); + wellLR.SetWellName(UTF8ToGBK(welln).data()); wellLR.SetAreaName(m_pUI->areaName->text().toStdString()); wellLR.SetOilCompanyName(m_pUI->companyName->text().toStdString()); QString xcode=m_pUI->xCode->text(); diff --git a/WellLogUI/src/WellLogDialog.cpp b/WellLogUI/src/WellLogDialog.cpp index c6e09a1..e64790d 100644 --- a/WellLogUI/src/WellLogDialog.cpp +++ b/WellLogUI/src/WellLogDialog.cpp @@ -14,9 +14,9 @@ int SetWellRoundWellName(QString filename, QString strNewName) { Slf_FILE_MESSAGE mssage; a_cslfio.GetFileMessage(mssage); - int len=strlen(strNewName.toStdString().c_str()); + int len=strlen(strNewName.toLocal8Bit().data()); if(len>sizeof(mssage.WellName)) len=sizeof(mssage.WellName); - strncpy(mssage.WellName,strNewName.toStdString().c_str(),len); + strncpy(mssage.WellName,strNewName.toLocal8Bit().data(),len); mssage.WellName[len]=0; a_cslfio.SetFileMessage(mssage); ret=true; diff --git a/logPlus/logPlus.pro b/logPlus/logPlus.pro index f8d7298..85b9248 100644 --- a/logPlus/logPlus.pro +++ b/logPlus/logPlus.pro @@ -32,7 +32,6 @@ SOURCES += \ CStringType.cpp \ ConsoleOutputWidget.cpp \ CurveLine.cpp \ - DataImport.cpp \ DepPairs.cpp \ DrawNrad.cpp \ DrawTvd.cpp \ @@ -85,7 +84,6 @@ SOURCES += \ qtcommonclass.cpp \ qtprojectwidgets.cpp \ selectwelldialog.cpp \ - tishidialog.cpp \ totalTitleBar.cpp \ transparentdraggableGuan.cpp \ transparentdraggableRightList.cpp \ @@ -100,7 +98,6 @@ HEADERS += \ CStringType.h \ ConsoleOutputWidget.h \ CurveLine.h \ - DataImport.h \ DepPairs.h \ DraggablePixmap.h \ DrawNrad.h \ @@ -153,7 +150,6 @@ HEADERS += \ qtcommonclass.h \ qtprojectwidgets.h \ selectwelldialog.h \ - tishidialog.h \ totalTitleBar.h \ transparentdraggableGuan.h \ transparentdraggableRightList.h \ @@ -179,8 +175,7 @@ FORMS += \ mainwindowsplitter.ui \ newheaddialog.ui \ qtprojectwidgets.ui \ - selectwelldialog.ui \ - tishidialog.ui + selectwelldialog.ui INCLUDEPATH += ../include/ \ ../CallManage \ diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index c622ac1..502f2d7 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -25,6 +25,7 @@ #include "ObjWell.h" #include "wellloginformation.h" #include "mainwindowsplitter.h" +#include "ConvertorManager.h" using namespace pai::gui; // @@ -105,7 +106,7 @@ MainWindow::MainWindow(QWidget *parent) : //关联信号槽,测井信息表数据查看 connect(CallManage::getInstance(), SIGNAL(sig_WelllogInformation(QString)), this, SLOT(s_WelllogInformation(QString))); - + ConvertorManager::GetInstance().LoadAllConvertorPlugin(); QTimer::singleShot(100, this, [=]() { QRect geoRect = m_centerWidgets->geometry(); g_WorkSpace_Width = geoRect.width(); diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index 8b5869f..20c37d1 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -1839,6 +1839,7 @@ void QtProjectWidgets::onEditWelllogRound() void QtProjectWidgets::onImportFolder() { + CDataImport::m_prjname = g_prjname; CDataImport::ImportWellTrajectorys(1); QString strProjectFolder = GetProjectFolder(); @@ -1866,7 +1867,7 @@ void QtProjectWidgets::onImportSingleWellLogData() // pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据"); pai::datamodel::LoadAllPlugin("windows"); DiDepthProgress DepthProgress; - ConvertorManager::GetInstance().LoadAllConvertorPlugin(); + // ConvertorManager::GetInstance().LoadAllConvertorPlugin(); ConvertorManager &pManager=ConvertorManager::GetInstance(); pManager.all=0; QVectorvSuffix=pManager.GetSupportFileExtensions(); @@ -1914,6 +1915,7 @@ void QtProjectWidgets::onImportSingleWellLogData() { wellname = wellItem->parent()->text(0); } + CDataImport::m_prjname = g_prjname; ImportDataDialog *pDialog = new ImportDataDialog(NULL,wellname,wellroundname); QTreeWidgetItem rootItem = *ui->treeWidget->topLevelItem(0); pDialog->SetProjectname(rootItem.text(0)); diff --git a/logPlus/tishidialog.cpp b/logPlus/tishidialog.cpp deleted file mode 100644 index 05d69cf..0000000 --- a/logPlus/tishidialog.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "tishidialog.h" - -TiShiDialog::TiShiDialog(QWidget *parent) - : QDialog(parent) -{ - m_pUI.setupUi(this); - QObject::connect(m_pUI.pushButtonTH, SIGNAL(clicked()), this, SLOT(slotTH())); - QObject::connect(m_pUI.pushButtonHB, SIGNAL(clicked()), this, SLOT(slotHB())); - QObject::connect(m_pUI.pushButtonLC, SIGNAL(clicked()), this, SLOT(slotLC())); - QObject::connect(m_pUI.pushButtonTG, SIGNAL(clicked()), this, SLOT(slotTG())); - QObject::connect(m_pUI.checkBox, SIGNAL(clicked()), this, SLOT(slotCheck())); - check=0; - m_pUI.checkBox->setCheckState(Qt::Unchecked); -} -void TiShiDialog::slotCheck() -{ - if(m_pUI.checkBox->checkState()==Qt::Unchecked)check=0; - else check=1; -} -TiShiDialog::~TiShiDialog() -{ - -} -void TiShiDialog::slotTH() -{ - flag=1; - accept(); - return ; -} -void TiShiDialog::slotHB() -{ - flag=2; - accept(); - return ; -} -void TiShiDialog::slotLC() -{ - flag=3; - accept(); - return ; -} -void TiShiDialog::slotTG() -{ - flag=0; - accept(); - return ; -} -void TiShiDialog::init(std::vector OutCurve,QString qss) -{ - for(int i=0;iappend(QString(OutCurve[i])); - } - m_pUI.label->setText(qss+"井次中下列数据已存在"); -} \ No newline at end of file diff --git a/logPlus/tishidialog.h b/logPlus/tishidialog.h deleted file mode 100644 index fa41aa9..0000000 --- a/logPlus/tishidialog.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef TISHIDIALOG_H -#define TISHIDIALOG_H - -#include -#include "ui_tishidialog.h" -#include -#pragma execution_character_set("utf-8") -class TiShiDialog : public QDialog -{ - Q_OBJECT - -public: - TiShiDialog(QWidget *parent = 0); - ~TiShiDialog(); - void init(std::vector OutCurve,QString); - int flag; - int check; -private: - Ui::TiShiDialog m_pUI; -private slots: - void slotTH(); - void slotHB(); - void slotLC(); - void slotTG(); - void slotCheck(); -}; - -#endif // TISHIDIALOG_H diff --git a/logPlus/tishidialog.ui b/logPlus/tishidialog.ui deleted file mode 100644 index 2804b89..0000000 --- a/logPlus/tishidialog.ui +++ /dev/null @@ -1,180 +0,0 @@ - - - TiShiDialog - - - - 0 - 0 - 382 - 333 - - - - TiShiDialog - - - - - - - - 当前井次中下列数据已存在 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - - - - - 后面所有井均执行此操作 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - 替换 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - 合并 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - 另存 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - 跳过 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - -