Merge branch 'main' of http://git.hivekion.com:3000/jiayulong/logplus
This commit is contained in:
commit
a93d63cf2b
|
|
@ -10,6 +10,7 @@
|
||||||
#include "DepthProgress.h"
|
#include "DepthProgress.h"
|
||||||
#include "ConvertorManager.h"
|
#include "ConvertorManager.h"
|
||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
// class QUuid;
|
// class QUuid;
|
||||||
// class QString;
|
// class QString;
|
||||||
|
|
@ -23,7 +24,7 @@
|
||||||
|
|
||||||
// void /*OSGWINDOWSHARED_EXPORT*/ slotImportSingleWellLogData(CVecViewCommand &viewCommand,QUuid /*e*/,bool bShow);
|
// void /*OSGWINDOWSHARED_EXPORT*/ slotImportSingleWellLogData(CVecViewCommand &viewCommand,QUuid /*e*/,bool bShow);
|
||||||
|
|
||||||
class /*OSGWINDOWSHARED_EXPORT*/ CDataImport
|
class CONVERTOR_EXPORT CDataImport
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool m_bImportByFolder;
|
static bool m_bImportByFolder;
|
||||||
|
|
@ -61,6 +62,7 @@ public:
|
||||||
static CObjWell *ChangetoSlf(QString wellFile,DiDepthProgress *DepthProgress=NULL);
|
static CObjWell *ChangetoSlf(QString wellFile,DiDepthProgress *DepthProgress=NULL);
|
||||||
//whp change 2019.12.12
|
//whp change 2019.12.12
|
||||||
static QString ConvertorWellLogFiles(ConvertorManager &pManager,QString wellname,DiDepthProgress *DepthProgress=NULL);
|
static QString ConvertorWellLogFiles(ConvertorManager &pManager,QString wellname,DiDepthProgress *DepthProgress=NULL);
|
||||||
|
static QString m_prjname;
|
||||||
static int flag1;
|
static int flag1;
|
||||||
static int flag_check;
|
static int flag_check;
|
||||||
static int m_flag;
|
static int m_flag;
|
||||||
|
|
@ -91,7 +91,7 @@ public:
|
||||||
void DisplayFileInformationAreaData( const QVector<IConvertor*>ConvertorVector,const QString filePath);
|
void DisplayFileInformationAreaData( const QVector<IConvertor*>ConvertorVector,const QString filePath);
|
||||||
bool IsHaveSameCurve(int NumLog,vector<int> &OutCurveNo,vector<char*> &OutCurve);
|
bool IsHaveSameCurve(int NumLog,vector<int> &OutCurveNo,vector<char*> &OutCurve);
|
||||||
void SetProjectname(const QString projectname){m_projectname = projectname;}
|
void SetProjectname(const QString projectname){m_projectname = projectname;}
|
||||||
//int CheckExistCurve(QString outputfilename,int NumLog,vector<int>& OutCurveNo,vector<char*>& OutCurve);
|
int CheckExistCurve(QString outputfilename,int NumLog,vector<int>& OutCurveNo,vector<char*>& OutCurve);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
326
ConvertorManager/src/CStringType.cpp
Normal file
326
ConvertorManager/src/CStringType.cpp
Normal file
|
|
@ -0,0 +1,326 @@
|
||||||
|
#include "CStringType.h"
|
||||||
|
#include <QLabel>
|
||||||
|
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(npos<start)
|
||||||
|
return -1;
|
||||||
|
return dataStr.find(str);
|
||||||
|
}
|
||||||
|
int CString::ReverseFind(char ch)
|
||||||
|
{
|
||||||
|
int index=m_data.lastIndexOf(ch);
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int CString::Insert(int pos ,const CString Sctr)
|
||||||
|
{
|
||||||
|
m_data.insert(pos,Sctr.m_data);
|
||||||
|
return m_data.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
int CString::Replace(const char *Src,const char *Dest)
|
||||||
|
{
|
||||||
|
int length=((std::string)Src).length();
|
||||||
|
QString srcStr=QString::fromLocal8Bit(Src);
|
||||||
|
QString destStr=QString::fromLocal8Bit(Dest);
|
||||||
|
m_data.replace(srcStr,destStr);
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
void CString::Delete(int fromIndex,int length)
|
||||||
|
{
|
||||||
|
m_data=m_data.remove(fromIndex,length);
|
||||||
|
}
|
||||||
|
CString & CString::TrimLeft()
|
||||||
|
{
|
||||||
|
std::string findStr=" ";
|
||||||
|
std::string tempstr=m_data.toStdString();
|
||||||
|
QString temp=m_data;
|
||||||
|
vector<char>StrVector;
|
||||||
|
int left=0;
|
||||||
|
for (int i=0;i<tempstr.length();i++)
|
||||||
|
{
|
||||||
|
if(tempstr.at(i)==findStr.at(0)) {
|
||||||
|
left++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else break;
|
||||||
|
}
|
||||||
|
m_data=temp.mid(left);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
CString & CString::MakeUpper()
|
||||||
|
{
|
||||||
|
m_data=m_data.toUpper();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
CString& CString::MakeLower()
|
||||||
|
{
|
||||||
|
m_data=m_data.toLower();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
CString & CString::TrimRight()
|
||||||
|
{
|
||||||
|
std::string findStr=" ";
|
||||||
|
std::string tempstr=m_data.toStdString();
|
||||||
|
QString temp=m_data;
|
||||||
|
int flag=0;
|
||||||
|
for (int i=tempstr.length()-1;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;
|
||||||
|
//}
|
||||||
169
ConvertorManager/src/CStringType.h
Normal file
169
ConvertorManager/src/CStringType.h
Normal file
|
|
@ -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 <iostream>
|
||||||
|
#include <QString>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QTextEdit>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#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<CString> 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
|
||||||
|
|
||||||
|
|
@ -57,6 +57,7 @@ HEADERS += \
|
||||||
../../common/geometryutils.h \
|
../../common/geometryutils.h \
|
||||||
../include/ConvertorExport.h \
|
../include/ConvertorExport.h \
|
||||||
../include/ConvertorManager.h \
|
../include/ConvertorManager.h \
|
||||||
|
../include/DataImport.h \
|
||||||
../include/IConvertor.h \
|
../include/IConvertor.h \
|
||||||
../include/ImportdataDialog.h \
|
../include/ImportdataDialog.h \
|
||||||
../include/InterfaceWidget.h \
|
../include/InterfaceWidget.h \
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
// #include "ObjWellLogTrack.h"
|
// #include "ObjWellLogTrack.h"
|
||||||
#include "ObjWelllogRound.h"
|
#include "ObjWelllogRound.h"
|
||||||
// #include "ObjWellTrack.h"
|
// #include "ObjWellTrack.h"
|
||||||
#include "ConsoleOutputWidget.h"
|
// #include "ConsoleOutputWidget.h"
|
||||||
|
|
||||||
// #include "ObjGeostratums.h"
|
// #include "ObjGeostratums.h"
|
||||||
#include "ObjWelllogWavefile.h"
|
#include "ObjWelllogWavefile.h"
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
// void OSGFRAMEWORK_EXPORT AppendConsole(pai::log::Priority priority,const QString &output);
|
// void OSGFRAMEWORK_EXPORT AppendConsole(pai::log::Priority priority,const QString &output);
|
||||||
|
|
||||||
// BEGIN_OSGGRAPHICS_NAMESPACE;
|
// BEGIN_OSGGRAPHICS_NAMESPACE;
|
||||||
extern QString g_prjname;
|
QString CDataImport::m_prjname;
|
||||||
int CDataImport::flag1=-1;
|
int CDataImport::flag1=-1;
|
||||||
int CDataImport::m_flag=-1;
|
int CDataImport::m_flag=-1;
|
||||||
int CDataImport::flag_check=0;
|
int CDataImport::flag_check=0;
|
||||||
|
|
@ -194,7 +194,7 @@ QList<CObjWell *> CDataImport::ImportWellTrajectorys(bool IsDir)
|
||||||
path=path1;
|
path=path1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
// ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
||||||
ConvertorManager &pManager=ConvertorManager::GetInstance();
|
ConvertorManager &pManager=ConvertorManager::GetInstance();
|
||||||
pManager.all=0;
|
pManager.all=0;
|
||||||
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
||||||
|
|
@ -392,7 +392,7 @@ QList<CObjWell *> CDataImport::ImportWells(QString path,QStringList &wellfs,char
|
||||||
fileSuffix.append(sSuffix);
|
fileSuffix.append(sSuffix);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
// ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
||||||
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
||||||
for (int i=0;i<vSuffix.size();i++)
|
for (int i=0;i<vSuffix.size();i++)
|
||||||
{
|
{
|
||||||
|
|
@ -461,7 +461,8 @@ QList<CObjWell *> CDataImport::ImportWells(QString path,QStringList &wellfs,char
|
||||||
sname=w.completeBaseName()+"数据导入中";
|
sname=w.completeBaseName()+"数据导入中";
|
||||||
DepthProgress.SetShowName(sname.toStdString().c_str(),0);
|
DepthProgress.SetShowName(sname.toStdString().c_str(),0);
|
||||||
DepthProgress.SetDepth(progress++,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(!pSuffix) {
|
||||||
if(pWell) {
|
if(pWell) {
|
||||||
wells.push_back(pWell);
|
wells.push_back(pWell);
|
||||||
|
|
@ -726,7 +727,7 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg
|
||||||
if(!filename.endsWith(".slf",Qt::CaseInsensitive)&&
|
if(!filename.endsWith(".slf",Qt::CaseInsensitive)&&
|
||||||
!filename.endsWith(".well",Qt::CaseInsensitive)&&IsTran)
|
!filename.endsWith(".well",Qt::CaseInsensitive)&&IsTran)
|
||||||
{
|
{
|
||||||
QString logdata=GetLogdataPath()+g_prjname/*::GetProject()->GetName()*/;
|
QString logdata=GetLogdataPath()+m_prjname/*::GetProject()->GetName()*/;
|
||||||
logdata.replace('\\','/');
|
logdata.replace('\\','/');
|
||||||
logdata.replace("//","/");
|
logdata.replace("//","/");
|
||||||
filename.replace("//","/");
|
filename.replace("//","/");
|
||||||
|
|
@ -734,7 +735,8 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg
|
||||||
if(filename.indexOf(logdata,0,Qt::CaseInsensitive)>-1) return pWell;
|
if(filename.indexOf(logdata,0,Qt::CaseInsensitive)>-1) return pWell;
|
||||||
ConvertorManager &pManager=ConvertorManager::GetInstance();
|
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 放弃加载的文件名如何加入到提示中
|
if(slfName!=""&&slfName!="abandoned"){//2020.3.19 放弃加载的文件名如何加入到提示中
|
||||||
pWell=ChangetoSlf(slfName,pDepthProgress);//whp add 2019.12.12
|
pWell=ChangetoSlf(slfName,pDepthProgress);//whp add 2019.12.12
|
||||||
}
|
}
|
||||||
|
|
@ -742,8 +744,9 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString wellname1,path1;
|
QString wellname1,path1;
|
||||||
GetWellNameAndPath(filename,wellname1,path1);
|
// QString strCh(filename); // 汉字路径转换
|
||||||
QString prjname = g_prjname;
|
GetWellNameAndPath(filename/*strCh.toLocal8Bit().data()*/,wellname1,path1);
|
||||||
|
QString prjname = m_prjname;
|
||||||
// if(GetProject()) prjname=GetProject()->GetName();
|
// if(GetProject()) prjname=GetProject()->GetName();
|
||||||
QString path2="LogData\\"+prjname;
|
QString path2="LogData\\"+prjname;
|
||||||
QString path3="LogData/"+prjname;
|
QString path3="LogData/"+prjname;
|
||||||
|
|
@ -835,7 +838,7 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg
|
||||||
QString welln;
|
QString welln;
|
||||||
if(filename.endsWith(".slf",Qt::CaseInsensitive))
|
if(filename.endsWith(".slf",Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
QString dirpath=GetLogdataPath()+g_prjname/*GetProject()->GetName()*/;
|
QString dirpath=GetLogdataPath()+m_prjname/*GetProject()->GetName()*/;
|
||||||
|
|
||||||
char szTemp[64];
|
char szTemp[64];
|
||||||
strcpy(szTemp, ".well");
|
strcpy(szTemp, ".well");
|
||||||
|
|
@ -1080,7 +1083,6 @@ CObjWell *CDataImport::ChangetoSlf(QString wellFile1,DiDepthProgress *pDepthProg
|
||||||
}
|
}
|
||||||
|
|
||||||
return pWell;
|
return pWell;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
void CDataImport::ImportCoreImage()
|
void CDataImport::ImportCoreImage()
|
||||||
{
|
{
|
||||||
|
|
@ -1385,7 +1387,7 @@ QString CDataImport::ConvertorWellLogFiles(ConvertorManager &pManager,QString we
|
||||||
// {
|
// {
|
||||||
// strWellName = pProject->GetName();
|
// strWellName = pProject->GetName();
|
||||||
// }
|
// }
|
||||||
strWellName = g_prjname;
|
strWellName = m_prjname;
|
||||||
QString dir0,dir=::GetLogdataPath();//whp add 2020.2.19 for 非法井名,无法产生井目录
|
QString dir0,dir=::GetLogdataPath();//whp add 2020.2.19 for 非法井名,无法产生井目录
|
||||||
QDir w;
|
QDir w;
|
||||||
if(!strWellName.isEmpty()) {
|
if(!strWellName.isEmpty()) {
|
||||||
|
|
@ -1612,7 +1614,7 @@ QString CDataImport::ConvertorWellLogFiles(ConvertorManager &pManager,QString we
|
||||||
// bool CheckExistCurve(QString outputfilename,int NumLog,vector<int>& OutCurveNo,vector<char*>& OutCurve);
|
// bool CheckExistCurve(QString outputfilename,int NumLog,vector<int>& OutCurveNo,vector<char*>& 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;
|
Slf_FILE_MESSAGE FILE_MESSAGE=v->FILE_MESSAGE;
|
||||||
logio->GetFileMessage(v->FILE_MESSAGE);
|
logio->GetFileMessage(v->FILE_MESSAGE);
|
||||||
|
|
@ -1672,19 +1674,20 @@ QString CDataImport::ConvertorWellLogFiles(ConvertorManager &pManager,QString we
|
||||||
delete logio;
|
delete logio;
|
||||||
//v->Transfer(logfilename,outfile,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow);
|
//v->Transfer(logfilename,outfile,&OutCurveNo[0],&OutCurve[0],&strChineseName[0],&strUnit[0],iRow);
|
||||||
//whp change 2019.12.10 for写入井名
|
//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();
|
CLogIO * logio=new CLogIO();
|
||||||
logio->Open(outfile,CSlfIO::modeReadWrite);
|
logio->Open(outfile/*UTF8ToGBK(outfile).data()*/,CSlfIO::modeReadWrite);
|
||||||
Slf_FILE_MESSAGE mssage;
|
Slf_FILE_MESSAGE mssage;
|
||||||
logio->GetFileMessage(mssage);
|
logio->GetFileMessage(mssage);
|
||||||
strcpy(mssage.WellName,WellName.toStdString().c_str());
|
strcpy(mssage.WellName,UTF8ToGBK(WellName).data()/*WellName.toStdString().c_str()*/);
|
||||||
logio->SetFileMessage(mssage);
|
logio->SetFileMessage(mssage);
|
||||||
delete logio;
|
delete logio;
|
||||||
}
|
}
|
||||||
else return "";//whp add 2019.12.12
|
else return "";//whp add 2019.12.12
|
||||||
//whp change 2020.2.18 for 汉字井名转换有乱码
|
//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 []logfilename;
|
||||||
delete []outfile;
|
delete []outfile;
|
||||||
//return 1;////whp add 2019.12.08 for 输出成功加载的文件个数
|
//return 1;////whp add 2019.12.08 for 输出成功加载的文件个数
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
//#include "ObjWelllogRound.h"
|
//#include "ObjWelllogRound.h"
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <qDebug>
|
#include <qDebug>
|
||||||
//#include "DataImport.h"
|
#include "DataImport.h"
|
||||||
#include "CStringType.h"
|
#include "CStringType.h"
|
||||||
#include "MyWelllogRound.h"
|
#include "MyWelllogRound.h"
|
||||||
#include "tishidialog.h"
|
#include "tishidialog.h"
|
||||||
|
|
@ -243,7 +243,7 @@ void ImportDataDialog::UpdateWell(InterfaceWidget *pInterfaceWidget,IConvertor *
|
||||||
MyWelllogRound* wellInfo=pConvertor->GetWellLogRoundInfo();
|
MyWelllogRound* wellInfo=pConvertor->GetWellLogRoundInfo();
|
||||||
QString wellname=pInterfaceWidget->GetWellNameLineEdit()->text();
|
QString wellname=pInterfaceWidget->GetWellNameLineEdit()->text();
|
||||||
wellname=wellname.toUpper();
|
wellname=wellname.toUpper();
|
||||||
if(pIC) strcpy(pIC->FILE_MESSAGE.WellName,wellname.toStdString().c_str());
|
if(pIC) strcpy(pIC->FILE_MESSAGE.WellName,wellname.toLocal8Bit().data());
|
||||||
wellInfo->SetWellName(wellname.toStdString());
|
wellInfo->SetWellName(wellname.toStdString());
|
||||||
wellInfo->SetName(wellname.toStdString());
|
wellInfo->SetName(wellname.toStdString());
|
||||||
//
|
//
|
||||||
|
|
@ -523,89 +523,89 @@ bool ImportDataDialog::IsHaveSameCurve(int NumLog,vector<int> &OutCurveNo,vector
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// int ImportDataDialog::CheckExistCurve(QString filename,int NumLog,vector<int>& OutCurveNo,vector<char*>& OutCurve)
|
int ImportDataDialog::CheckExistCurve(QString filename,int NumLog,vector<int>& OutCurveNo,vector<char*>& OutCurve)
|
||||||
// { //1-有输出曲线,需要继续输出,0-经跳过功能后,没有曲线要输出了,-1退回原界面
|
{ //1-有输出曲线,需要继续输出,0-经跳过功能后,没有曲线要输出了,-1退回原界面
|
||||||
// CMemRdWt *logio=new CMemRdWt();
|
CMemRdWt *logio=new CMemRdWt();
|
||||||
// if(!logio->Open(filename.toStdString().c_str(),CSlfIO::modeRead))
|
if(!logio->Open(filename.toStdString().c_str(),CSlfIO::modeRead))
|
||||||
// {
|
{
|
||||||
// delete logio;
|
delete logio;
|
||||||
// return 1;
|
return 1;
|
||||||
// }
|
}
|
||||||
// CString str,mes="";
|
CString str,mes="";
|
||||||
// vector<int> ExistCurveNo;
|
vector<int> ExistCurveNo;
|
||||||
// vector<char*> ExistCurve;
|
vector<char*> ExistCurve;
|
||||||
// int ExistCurveNum=0;
|
int ExistCurveNum=0;
|
||||||
// for(int i=0;i<NumLog;i++)
|
for(int i=0;i<NumLog;i++)
|
||||||
// {
|
{
|
||||||
// if(OutCurveNo[i]<0)continue;
|
if(OutCurveNo[i]<0)continue;
|
||||||
// int hh=logio->FindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL);
|
int hh=logio->FindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL);
|
||||||
// if(logio->FindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL)<0)continue;
|
if(logio->FindObjectName(OutCurve[i],-1,-1,OBJECT_NORMAL)<0)continue;
|
||||||
// ExistCurve.push_back(OutCurve[i]);
|
ExistCurve.push_back(OutCurve[i]);
|
||||||
// ExistCurveNo.push_back(i);
|
ExistCurveNo.push_back(i);
|
||||||
// }
|
}
|
||||||
// if(ExistCurve.size()==0)
|
if(ExistCurve.size()==0)
|
||||||
// {
|
{
|
||||||
// delete logio;
|
delete logio;
|
||||||
// return 1;
|
return 1;
|
||||||
// }
|
}
|
||||||
// TiShiDialog *dlg=new TiShiDialog(NULL);
|
TiShiDialog *dlg=new TiShiDialog(NULL);
|
||||||
// dlg->init(ExistCurve);
|
dlg->init(ExistCurve,"");
|
||||||
// if(dlg->exec()==Accepted)
|
if(dlg->exec()==Accepted)
|
||||||
// {
|
{
|
||||||
// if(dlg->flag==0)//跳过
|
if(dlg->flag==0)//跳过
|
||||||
// {
|
{
|
||||||
// for(int i=0;i<ExistCurve.size();i++)
|
for(int i=0;i<ExistCurve.size();i++)
|
||||||
// {
|
{
|
||||||
// int nn=ExistCurveNo[i];
|
int nn=ExistCurveNo[i];
|
||||||
// OutCurveNo[ExistCurveNo[i]]=-1;
|
OutCurveNo[ExistCurveNo[i]]=-1;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// else if(dlg->flag==1)//替换
|
else if(dlg->flag==1)//替换
|
||||||
// {
|
{
|
||||||
// for(int i=0;i<ExistCurve.size();i++)
|
for(int i=0;i<ExistCurve.size();i++)
|
||||||
// {
|
{
|
||||||
// logio->DiscardObject(ExistCurve[i]);
|
logio->DiscardObject(ExistCurve[i]);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// else if(dlg->flag==3)//另存
|
else if(dlg->flag==3)//另存
|
||||||
// {
|
{
|
||||||
// QStringList OutCurveList;
|
QStringList OutCurveList;
|
||||||
// for(int i=0;i<logio->GetObjectCount();i++)
|
for(int i=0;i<logio->GetObjectCount();i++)
|
||||||
// {
|
{
|
||||||
// char name[64];
|
char name[64];
|
||||||
// if(logio->GetObjectStatus(i)!=OBJECT_NORMAL)continue;
|
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL)continue;
|
||||||
// logio->GetObjectName(i,name);
|
logio->GetObjectName(i,name);
|
||||||
// OutCurveList.append(QString(name));
|
OutCurveList.append(QString(name));
|
||||||
// }
|
}
|
||||||
// for(int i=0;i<ExistCurve.size();i++)
|
for(int i=0;i<ExistCurve.size();i++)
|
||||||
// {
|
{
|
||||||
// QString name1,name=QString(ExistCurve[i])+"_";
|
QString name1,name=QString(ExistCurve[i])+"_";
|
||||||
// for(int j=0;j<100;j++)
|
for(int j=0;j<100;j++)
|
||||||
// {
|
{
|
||||||
// name1=name+QString::number(j+1);
|
name1=name+QString::number(j+1);
|
||||||
// if(OutCurveList.indexOf(name1)<0)break;
|
if(OutCurveList.indexOf(name1)<0)break;
|
||||||
// }
|
}
|
||||||
// char *temp = new char[name1.toStdString().size()+1];
|
char *temp = new char[name1.toStdString().size()+1];
|
||||||
// strcpy(temp, name1.toStdString().c_str());
|
strcpy(temp, name1.toStdString().c_str());
|
||||||
// strcpy(OutCurve[ExistCurveNo[i]],temp);//name1->toStdString()->c_str());
|
strcpy(OutCurve[ExistCurveNo[i]],temp);//name1->toStdString()->c_str());
|
||||||
// delete temp;
|
delete temp;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// delete logio;
|
delete logio;
|
||||||
// delete dlg;
|
delete dlg;
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// delete logio;
|
delete logio;
|
||||||
// delete dlg;
|
delete dlg;
|
||||||
// return -1;
|
return -1;
|
||||||
// }
|
}
|
||||||
// for(int i=0;i<NumLog;i++)
|
for(int i=0;i<NumLog;i++)
|
||||||
// {
|
{
|
||||||
// if(OutCurveNo[i]>=0) return 1;
|
if(OutCurveNo[i]>=0) return 1;
|
||||||
// }
|
}
|
||||||
// return 0;
|
return 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
void CreateWellFile(CLogIO *logio,Slf_FILE_MESSAGE &mssage,QString wellFile,CObjWell *pWell)
|
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;i<curveCount;i++) {
|
|
||||||
logio->GetObjectName(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;kk<count;kk=kk+10)
|
|
||||||
{
|
|
||||||
float buf[200];
|
|
||||||
buf[0]=0;
|
|
||||||
float temp=logio->GetData(acurveinfo.RepCode,&vVdl.vchar[kk*acurveinfo.CodeLen],buf);
|
|
||||||
if(_isnan(temp)||!_finite(temp)) continue;
|
|
||||||
|
|
||||||
if(acurveinfo.MaxValue<temp) if(temp!=-9999.0&&temp!=-999.25&&temp!=-99999.0)acurveinfo.MaxValue=temp;
|
|
||||||
if(acurveinfo.MinValue>temp) 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)
|
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;
|
int HaveOut=1;
|
||||||
if(tpConvertor->m_TableName.isEmpty()) {
|
if(tpConvertor->m_TableName.isEmpty()) {
|
||||||
//HaveOut=CheckExistCurve(outputfilename,iRow,OutCurveNo,OutCurve);
|
HaveOut=CheckExistCurve(outputfilename,iRow,OutCurveNo,OutCurve);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vector<int> OutCurveNo;
|
vector<int> OutCurveNo;
|
||||||
|
|
@ -944,7 +717,7 @@ bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurren
|
||||||
char *buf=new char[strlen(tpConvertor->m_TableName.toStdString().c_str())+1];
|
char *buf=new char[strlen(tpConvertor->m_TableName.toStdString().c_str())+1];
|
||||||
strcpy(buf,tpConvertor->m_TableName.toStdString().c_str());
|
strcpy(buf,tpConvertor->m_TableName.toStdString().c_str());
|
||||||
OutCurve.push_back(buf);
|
OutCurve.push_back(buf);
|
||||||
// HaveOut=CheckExistCurve(outputfilename,1,OutCurveNo,OutCurve);
|
HaveOut=CheckExistCurve(outputfilename,1,OutCurveNo,OutCurve);
|
||||||
delete buf;
|
delete buf;
|
||||||
}
|
}
|
||||||
if(HaveOut==0){
|
if(HaveOut==0){
|
||||||
|
|
@ -991,15 +764,18 @@ bool ImportDataDialog::SelectAndDeleteWellLog(int iRow,InterfaceWidget *pCurren
|
||||||
//TODO
|
//TODO
|
||||||
l+=strlen(&outfile[l])+1;
|
l+=strlen(&outfile[l])+1;
|
||||||
*(int*)&outfile[l]=iRow;
|
*(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();
|
MyWelllogRound *wellRound=pCurrentInterfaceWidget->m_pConvertor->GetWellLogRoundInfo();
|
||||||
if(wellRound) {
|
if(wellRound) {
|
||||||
((InterIConvertor*)(pCurrentInterfaceWidget->m_pConvertor))->InitWellInfo(outfile);
|
((InterIConvertor*)(pCurrentInterfaceWidget->m_pConvertor))->InitWellInfo(outfile);
|
||||||
wellRound->SaveMeesge(outfile);
|
wellRound->SaveMeesge(outfile);
|
||||||
}
|
}
|
||||||
// CDataImport::ChangetoSlf(outfile,NULL);
|
CDataImport::ChangetoSlf(outfile,NULL);
|
||||||
ChangetoSlf(outfile,NULL,true);
|
// ChangetoSlf(outfile,NULL,true);
|
||||||
}
|
}
|
||||||
for(int i=0;i<OutCurveNo.size();i++)
|
for(int i=0;i<OutCurveNo.size();i++)
|
||||||
{
|
{
|
||||||
|
|
@ -1103,6 +879,7 @@ QString ImportDataDialog::GenerateSlfFileName(InterfaceWidget *pCurrentInterfac
|
||||||
// QString wellSlfFile = "D:/LogPlus/LogData/";
|
// QString wellSlfFile = "D:/LogPlus/LogData/";
|
||||||
// wellSlfFile +=m_projectname + "/"+"#"+wellname + "/" + filename +".slf";
|
// wellSlfFile +=m_projectname + "/"+"#"+wellname + "/" + filename +".slf";
|
||||||
QString wellSlfFile = GetLogdataPath() +m_projectname + "/"+"#"+wellname + "/" + filename +".slf";
|
QString wellSlfFile = GetLogdataPath() +m_projectname + "/"+"#"+wellname + "/" + filename +".slf";
|
||||||
|
//QString wellSlfFile = GetLogdataPath() +m_projectname + "/"+"#"+wellname.toLocal8Bit() + "/" + filename.toLocal8Bit() +".slf";
|
||||||
return wellSlfFile;
|
return wellSlfFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,8 @@ bool InterIConvertor::IsSupport( const QString &filename )
|
||||||
IConvertor::IsSupport(filename);
|
IConvertor::IsSupport(filename);
|
||||||
string tempStr=filename.toStdString();
|
string tempStr=filename.toStdString();
|
||||||
char *filePath=const_cast<char*>(tempStr.c_str());
|
char *filePath=const_cast<char*>(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;
|
m_CurveData.Curve_Num=Value;
|
||||||
if(Value<=0) return 0;//ww
|
if(Value<=0) return 0;//ww
|
||||||
return Value;
|
return Value;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "tishidialog.h"
|
#include "tishidialog.h"
|
||||||
|
|
||||||
TiShiDialog::TiShiDialog(QWidget *parent)
|
TiShiDialog::TiShiDialog(QWidget *parent)
|
||||||
: QDialog(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.pushButtonHB, SIGNAL(clicked()), this, SLOT(slotHB()));
|
||||||
QObject::connect(m_pUI.pushButtonLC, SIGNAL(clicked()), this, SLOT(slotLC()));
|
QObject::connect(m_pUI.pushButtonLC, SIGNAL(clicked()), this, SLOT(slotLC()));
|
||||||
QObject::connect(m_pUI.pushButtonTG, SIGNAL(clicked()), this, SLOT(slotTG()));
|
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()
|
TiShiDialog::~TiShiDialog()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -38,10 +45,11 @@ void TiShiDialog::slotTG()
|
||||||
accept();
|
accept();
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
void TiShiDialog::init(std::vector<char*> OutCurve)
|
void TiShiDialog::init(std::vector<char*> OutCurve,QString qss)
|
||||||
{
|
{
|
||||||
for(int i=0;i<OutCurve.size();i++)
|
for(int i=0;i<OutCurve.size();i++)
|
||||||
{
|
{
|
||||||
m_pUI.textEdit_2->append(QString(OutCurve[i]));
|
m_pUI.textEdit_2->append(QString(OutCurve[i]));
|
||||||
}
|
}
|
||||||
|
m_pUI.label->setText(qss+"井次中下列数据已存在");
|
||||||
}
|
}
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "ui_tishidialog.h"
|
#include "ui_tishidialog.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
class TiShiDialog : public QDialog
|
class TiShiDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -14,8 +12,9 @@ class TiShiDialog : public QDialog
|
||||||
public:
|
public:
|
||||||
TiShiDialog(QWidget *parent = 0);
|
TiShiDialog(QWidget *parent = 0);
|
||||||
~TiShiDialog();
|
~TiShiDialog();
|
||||||
void init(std::vector<char*> OutCurve);
|
void init(std::vector<char*> OutCurve,QString);
|
||||||
int flag;
|
int flag;
|
||||||
|
int check;
|
||||||
private:
|
private:
|
||||||
Ui::TiShiDialog m_pUI;
|
Ui::TiShiDialog m_pUI;
|
||||||
private slots:
|
private slots:
|
||||||
|
|
@ -23,6 +22,7 @@ private slots:
|
||||||
void slotHB();
|
void slotHB();
|
||||||
void slotLC();
|
void slotLC();
|
||||||
void slotTG();
|
void slotTG();
|
||||||
|
void slotCheck();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TISHIDIALOG_H
|
#endif // TISHIDIALOG_H
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>382</width>
|
<width>382</width>
|
||||||
<height>319</height>
|
<height>333</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -42,6 +42,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>后面所有井均执行此操作</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
|
|
@ -833,7 +833,7 @@ int CObjWell::ComputeTrajectory(CObjWell *pWell,QString slffilename)
|
||||||
int len=slffilename.indexOf(".slf",0,Qt::CaseInsensitive);
|
int len=slffilename.indexOf(".slf",0,Qt::CaseInsensitive);
|
||||||
slf=slffilename.mid(0,len)+".well";
|
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);
|
CMemRdWt sf(slf.toStdString().c_str(),CSlfIO::modeReadWrite);
|
||||||
Slf_FILE_MESSAGE sm;
|
Slf_FILE_MESSAGE sm;
|
||||||
sf.GetFileMessage(sm);
|
sf.GetFileMessage(sm);
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ void CWellDialog::DataToView()
|
||||||
wellLR.SetBottomDepth(pWell->GetWellHead().endDepth);
|
wellLR.SetBottomDepth(pWell->GetWellHead().endDepth);
|
||||||
QString title = pWell->GetName() == "" ? "新建井基本信息":"编辑井基本信息";
|
QString title = pWell->GetName() == "" ? "新建井基本信息":"编辑井基本信息";
|
||||||
this->setWindowTitle(title);
|
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->companyName->setText(QString::fromStdString(wellLR.GetOilCompanyName()));
|
||||||
m_pUI->wellCode->setText(QString::fromStdString(""));
|
m_pUI->wellCode->setText(QString::fromStdString(""));
|
||||||
m_pUI->areaName->setText(QString::fromStdString(wellLR.GetAreaName()));
|
m_pUI->areaName->setText(QString::fromStdString(wellLR.GetAreaName()));
|
||||||
|
|
@ -349,7 +349,7 @@ void CWellDialog::ViewToData()
|
||||||
hd.wellName=welln;
|
hd.wellName=welln;
|
||||||
// CObjWell *pOldWell=dynamic_cast<CObjWell *>(::GetProject()->GetObjectByName(welln));
|
// CObjWell *pOldWell=dynamic_cast<CObjWell *>(::GetProject()->GetObjectByName(welln));
|
||||||
pWell->SetName(welln);
|
pWell->SetName(welln);
|
||||||
wellLR.SetWellName(welln.toStdString());
|
wellLR.SetWellName(UTF8ToGBK(welln).data());
|
||||||
wellLR.SetAreaName(m_pUI->areaName->text().toStdString());
|
wellLR.SetAreaName(m_pUI->areaName->text().toStdString());
|
||||||
wellLR.SetOilCompanyName(m_pUI->companyName->text().toStdString());
|
wellLR.SetOilCompanyName(m_pUI->companyName->text().toStdString());
|
||||||
QString xcode=m_pUI->xCode->text();
|
QString xcode=m_pUI->xCode->text();
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ int SetWellRoundWellName(QString filename, QString strNewName)
|
||||||
{
|
{
|
||||||
Slf_FILE_MESSAGE mssage;
|
Slf_FILE_MESSAGE mssage;
|
||||||
a_cslfio.GetFileMessage(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);
|
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;
|
mssage.WellName[len]=0;
|
||||||
a_cslfio.SetFileMessage(mssage);
|
a_cslfio.SetFileMessage(mssage);
|
||||||
ret=true;
|
ret=true;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ SOURCES += \
|
||||||
CStringType.cpp \
|
CStringType.cpp \
|
||||||
ConsoleOutputWidget.cpp \
|
ConsoleOutputWidget.cpp \
|
||||||
CurveLine.cpp \
|
CurveLine.cpp \
|
||||||
DataImport.cpp \
|
|
||||||
DepPairs.cpp \
|
DepPairs.cpp \
|
||||||
DrawNrad.cpp \
|
DrawNrad.cpp \
|
||||||
DrawTvd.cpp \
|
DrawTvd.cpp \
|
||||||
|
|
@ -85,7 +84,6 @@ SOURCES += \
|
||||||
qtcommonclass.cpp \
|
qtcommonclass.cpp \
|
||||||
qtprojectwidgets.cpp \
|
qtprojectwidgets.cpp \
|
||||||
selectwelldialog.cpp \
|
selectwelldialog.cpp \
|
||||||
tishidialog.cpp \
|
|
||||||
totalTitleBar.cpp \
|
totalTitleBar.cpp \
|
||||||
transparentdraggableGuan.cpp \
|
transparentdraggableGuan.cpp \
|
||||||
transparentdraggableRightList.cpp \
|
transparentdraggableRightList.cpp \
|
||||||
|
|
@ -100,7 +98,6 @@ HEADERS += \
|
||||||
CStringType.h \
|
CStringType.h \
|
||||||
ConsoleOutputWidget.h \
|
ConsoleOutputWidget.h \
|
||||||
CurveLine.h \
|
CurveLine.h \
|
||||||
DataImport.h \
|
|
||||||
DepPairs.h \
|
DepPairs.h \
|
||||||
DraggablePixmap.h \
|
DraggablePixmap.h \
|
||||||
DrawNrad.h \
|
DrawNrad.h \
|
||||||
|
|
@ -153,7 +150,6 @@ HEADERS += \
|
||||||
qtcommonclass.h \
|
qtcommonclass.h \
|
||||||
qtprojectwidgets.h \
|
qtprojectwidgets.h \
|
||||||
selectwelldialog.h \
|
selectwelldialog.h \
|
||||||
tishidialog.h \
|
|
||||||
totalTitleBar.h \
|
totalTitleBar.h \
|
||||||
transparentdraggableGuan.h \
|
transparentdraggableGuan.h \
|
||||||
transparentdraggableRightList.h \
|
transparentdraggableRightList.h \
|
||||||
|
|
@ -179,8 +175,7 @@ FORMS += \
|
||||||
mainwindowsplitter.ui \
|
mainwindowsplitter.ui \
|
||||||
newheaddialog.ui \
|
newheaddialog.ui \
|
||||||
qtprojectwidgets.ui \
|
qtprojectwidgets.ui \
|
||||||
selectwelldialog.ui \
|
selectwelldialog.ui
|
||||||
tishidialog.ui
|
|
||||||
|
|
||||||
INCLUDEPATH += ../include/ \
|
INCLUDEPATH += ../include/ \
|
||||||
../CallManage \
|
../CallManage \
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "ObjWell.h"
|
#include "ObjWell.h"
|
||||||
#include "wellloginformation.h"
|
#include "wellloginformation.h"
|
||||||
#include "mainwindowsplitter.h"
|
#include "mainwindowsplitter.h"
|
||||||
|
#include "ConvertorManager.h"
|
||||||
|
|
||||||
using namespace pai::gui;
|
using namespace pai::gui;
|
||||||
//
|
//
|
||||||
|
|
@ -105,7 +106,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
|
|
||||||
//关联信号槽,测井信息表数据查看
|
//关联信号槽,测井信息表数据查看
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_WelllogInformation(QString)), this, SLOT(s_WelllogInformation(QString)));
|
connect(CallManage::getInstance(), SIGNAL(sig_WelllogInformation(QString)), this, SLOT(s_WelllogInformation(QString)));
|
||||||
|
ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
||||||
QTimer::singleShot(100, this, [=]() {
|
QTimer::singleShot(100, this, [=]() {
|
||||||
QRect geoRect = m_centerWidgets->geometry();
|
QRect geoRect = m_centerWidgets->geometry();
|
||||||
g_WorkSpace_Width = geoRect.width();
|
g_WorkSpace_Width = geoRect.width();
|
||||||
|
|
|
||||||
|
|
@ -1839,6 +1839,7 @@ void QtProjectWidgets::onEditWelllogRound()
|
||||||
|
|
||||||
void QtProjectWidgets::onImportFolder()
|
void QtProjectWidgets::onImportFolder()
|
||||||
{
|
{
|
||||||
|
CDataImport::m_prjname = g_prjname;
|
||||||
CDataImport::ImportWellTrajectorys(1);
|
CDataImport::ImportWellTrajectorys(1);
|
||||||
|
|
||||||
QString strProjectFolder = GetProjectFolder();
|
QString strProjectFolder = GetProjectFolder();
|
||||||
|
|
@ -1866,7 +1867,7 @@ void QtProjectWidgets::onImportSingleWellLogData()
|
||||||
// pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据");
|
// pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据");
|
||||||
pai::datamodel::LoadAllPlugin("windows");
|
pai::datamodel::LoadAllPlugin("windows");
|
||||||
DiDepthProgress DepthProgress;
|
DiDepthProgress DepthProgress;
|
||||||
ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
// ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
||||||
ConvertorManager &pManager=ConvertorManager::GetInstance();
|
ConvertorManager &pManager=ConvertorManager::GetInstance();
|
||||||
pManager.all=0;
|
pManager.all=0;
|
||||||
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
||||||
|
|
@ -1914,6 +1915,7 @@ void QtProjectWidgets::onImportSingleWellLogData()
|
||||||
{
|
{
|
||||||
wellname = wellItem->parent()->text(0);
|
wellname = wellItem->parent()->text(0);
|
||||||
}
|
}
|
||||||
|
CDataImport::m_prjname = g_prjname;
|
||||||
ImportDataDialog *pDialog = new ImportDataDialog(NULL,wellname,wellroundname);
|
ImportDataDialog *pDialog = new ImportDataDialog(NULL,wellname,wellroundname);
|
||||||
QTreeWidgetItem rootItem = *ui->treeWidget->topLevelItem(0);
|
QTreeWidgetItem rootItem = *ui->treeWidget->topLevelItem(0);
|
||||||
pDialog->SetProjectname(rootItem.text(0));
|
pDialog->SetProjectname(rootItem.text(0));
|
||||||
|
|
|
||||||
|
|
@ -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<char*> OutCurve,QString qss)
|
|
||||||
{
|
|
||||||
for(int i=0;i<OutCurve.size();i++)
|
|
||||||
{
|
|
||||||
m_pUI.textEdit_2->append(QString(OutCurve[i]));
|
|
||||||
}
|
|
||||||
m_pUI.label->setText(qss+"井次中下列数据已存在");
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
#ifndef TISHIDIALOG_H
|
|
||||||
#define TISHIDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include "ui_tishidialog.h"
|
|
||||||
#include <vector>
|
|
||||||
#pragma execution_character_set("utf-8")
|
|
||||||
class TiShiDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
TiShiDialog(QWidget *parent = 0);
|
|
||||||
~TiShiDialog();
|
|
||||||
void init(std::vector<char*> 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
|
|
||||||
|
|
@ -1,180 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>TiShiDialog</class>
|
|
||||||
<widget class="QDialog" name="TiShiDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>382</width>
|
|
||||||
<height>333</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>TiShiDialog</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>当前井次中下列数据已存在</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QTextEdit" name="textEdit_2">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>后面所有井均执行此操作</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButtonTH">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>替换</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButtonHB">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>合并</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButtonLC">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>另存</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButtonTG">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>跳过</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
Loading…
Reference in New Issue
Block a user