可是解释,追加校深工具条,开发第一项整体校深

This commit is contained in:
jiayulong 2026-01-19 18:08:03 +08:00
parent d3fb6a43cd
commit 06b4e53da6
15 changed files with 905 additions and 29 deletions

View File

@ -118,7 +118,7 @@ signals:
QString newFillType, QString newTargetLine, QColor newColor, QString newLithosImage, QString newHeadFill,
float vMin, float vMax, QString strOtherScaleType, QColor frontColor, QColor backColor, QString newFillMode, bool bFillNow);
//置顶层,并取消其他表格的选中状态
void sig_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
void sig_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType);
//插件测试
void sig_testPlugin(QString strInfo);

326
logPlus/CStringType.cpp Normal file
View 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
logPlus/CStringType.h Normal file
View 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

View File

@ -108,15 +108,16 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName)
this, SLOT(s_addTDT(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int)));
}
void FormTrack::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
void FormTrack::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType)
{
if(m_strUuid == strUuid &&
m_strWellName == strWellName &&
m_strTrackName == strTrackName)
m_strTrackName == strTrackName &&
iTableType==3)
{
//
}
@ -909,3 +910,32 @@ QJsonObject FormTrack::makeJson()
return rootObj;
}
QStringList FormTrack::getLineList(QString strWellName, QString strTrackName)
{
QStringList listLine;
if(strWellName == m_strWellName && strTrackName == m_strTrackName)
{
}
else
{
return listLine;
}
//
int rowCount = ui->tableWidget->rowCount();
for(int i=0; i<rowCount; i++)
{
if( ui->tableWidget->cellWidget(i, 0) != nullptr )
{
auto myWidget = ui->tableWidget->cellWidget(i, 0);
//
FormInfo *formInfo = (FormInfo*)myWidget;//获得widget
if(formInfo)
{
listLine.append(formInfo->m_strLineName);
}
}
}
return listLine;
}

View File

@ -65,6 +65,7 @@ public:
void setDrawDt(QStringList listdt, float vmax, float vmin);
QJsonObject makeJson();
QStringList getLineList(QString strWellName, QString strTrackName);
signals:
void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
@ -107,7 +108,7 @@ public slots:
void s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
void s_addTDT(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType);
};

View File

@ -31,7 +31,7 @@ FormWell::FormWell(QWidget *parent, QString strWellName) :
connect(CallManage::getInstance(), SIGNAL(sig_NewTrack_No_Line(QString, QString, QString)), this, SLOT(s_NewTrack_No_Line(QString, QString, QString)));
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int)));
connect(CallManage::getInstance(), SIGNAL(sig_NewCol(QStringList)), this, SLOT(s_NewCol(QStringList)));
}
@ -53,11 +53,19 @@ int FormWell::insertColumn(int nw)
return ncolCount;
}
void FormWell::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
void FormWell::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType)
{
//选中了曲线置顶
//取消表格选中状态
ui->tableWidget->clearSelection();
if(m_strUuid == strUuid &&
m_strWellName == strWellName &&
iTableType==2)
{
//
}
else {
//选中了曲线置顶
//取消表格选中状态
ui->tableWidget->clearSelection();
}
}
void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfName, QString strLineName, QString strType,int nW)
@ -107,6 +115,9 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa
ui->tableWidget->setRowHeight(i, 100);
//
QTableWidgetItem* item = new QTableWidgetItem(strTrackName);
item->setData(Qt::UserRole+1, m_strUuid);
item->setData(Qt::UserRole+2, m_strWellName);
item->setData(Qt::UserRole+3, m_strSlfName);
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
item->setTextAlignment(Qt::AlignCenter); //设置文本居中
ui->tableWidget->setItem(i, columnCount, item);
@ -270,6 +281,9 @@ void FormWell::s_NewTrack_No_Line(QString strUuid, QString strWellName, QString
ui->tableWidget->setRowHeight(i, 100);
//
QTableWidgetItem* item = new QTableWidgetItem(strTrackName);
item->setData(Qt::UserRole+1, m_strUuid);
item->setData(Qt::UserRole+2, m_strWellName);
item->setData(Qt::UserRole+3, m_strSlfName);
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
item->setTextAlignment(Qt::AlignCenter); //设置文本居中
ui->tableWidget->setItem(i, columnCount, item);
@ -371,6 +385,9 @@ void FormWell::s_NewCol(QStringList listdt)
ui->tableWidget->setRowHeight(i, 100);
//
QTableWidgetItem* item = new QTableWidgetItem(strTrackName);
item->setData(Qt::UserRole+1, m_strUuid);
item->setData(Qt::UserRole+2, m_strWellName);
item->setData(Qt::UserRole+3, m_strSlfName);
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
item->setTextAlignment(Qt::AlignCenter); //设置文本居中
ui->tableWidget->setItem(i, columnCount, item);
@ -457,3 +474,33 @@ QJsonObject FormWell::makeJson()
return rootObj;
}
QStringList FormWell::getLineList(QString strWellName, QString strTrackName)
{
QStringList listLine;
if(strWellName != m_strWellName)
{
return listLine;
}
//
int columnCount = ui->tableWidget->columnCount();//总列数
for(int i=0; i<columnCount; i++)
{
if( ui->tableWidget->cellWidget(1, i) != nullptr )
{
auto myWidget = ui->tableWidget->cellWidget(1, i);
//
FormTrack *formTrack = (FormTrack*)myWidget;//获得widget
if(formTrack)
{
QStringList listTemp = formTrack->getLineList(strWellName, strTrackName);
if(listTemp.size()>0)
{
listLine.append(listTemp);
}
}
}
}
return listLine;
}

View File

@ -32,6 +32,8 @@ public:
public:
QJsonObject makeJson();
QStringList getLineList(QString strWellName, QString strTrackName);
void setRowHeight(double dHight, QProgressBar *progressBar, int iSplit);
public slots:
@ -41,7 +43,7 @@ public slots:
//新建空白道,没有曲线
void s_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType);
};
#endif // FORMWELL_H

View File

@ -29,6 +29,7 @@ CONFIG += c++11
SOURCES += \
../CallManage/CallManage.cpp \
../common/geometryutils.cpp \
CStringType.cpp \
ConsoleOutputWidget.cpp \
DrawFac.cpp \
DrawNrad.cpp \
@ -84,6 +85,7 @@ SOURCES += \
HEADERS += \
../CallManage/CallManage.h \
../common/geometryutils.h \
CStringType.h \
ConsoleOutputWidget.h \
DraggablePixmap.h \
DrawFac.h \

View File

@ -39,10 +39,14 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
// 设置工具栏的位置,此处设置为在左侧
addToolBar(Qt::LeftToolBarArea, ui->toolBar);
addToolBar(Qt::RightToolBarArea, ui->toolBar_2);
//初始化工具栏
initMainToolBar();
initToolBar();
//校深
initToolBar_2();
ui->toolBar_2->hide();
//加载样式
loadStyle(":/qrc/qss/flatgray.css");
@ -110,7 +114,7 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
connect(CallManage::getInstance(), SIGNAL(sig_mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
connect(CallManage::getInstance(), SIGNAL(sig_changeScale(int)), this, SLOT(s_changeScale(int)));
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int)));
//图头
m_dock1=new QDockWidget(tr(""),this);
@ -162,6 +166,7 @@ void MainWindowCurve::initMainToolBar()
QIcon fixwellsectionHeaderIcon(::GetImagePath()+"icon/fixwellsectionHeader.png");
QIcon currtempliteIcon(::GetImagePath()+"icon/currtemplite.png");
QIcon saveastemplateIcon(::GetImagePath()+"icon/saveastemplate.png");
QIcon executeDepthShiftIcon(::GetImagePath()+"icon/ExecuteDepthShift.png");
QIcon ModuleOpenIcon(::GetImagePath()+"icon/ModuleOne.png");
QIcon openFileIcon(":/image/open.png");
QIcon runIcon(":/image/capacity.png");
@ -172,6 +177,7 @@ void MainWindowCurve::initMainToolBar()
QAction* m_fixwellsectionHeaderAc = nullptr; //锁头
QAction* m_currtempliteAc = nullptr; //加载图文件
QAction* m_saveastemplateAc = nullptr; //另存为图文件
QAction* m_executeDepthShiftAc = nullptr; //校深
QAction* m_ModuleOpenAc = nullptr; //处理方法
//QAction* m_openAc = nullptr; //打开
// QAction* m_runAc = nullptr;//
@ -181,6 +187,7 @@ void MainWindowCurve::initMainToolBar()
m_fixwellsectionHeaderAc = new QAction(fixwellsectionHeaderIcon, "锁头", this);
m_currtempliteAc = new QAction(currtempliteIcon, "加载图文件", this);
m_saveastemplateAc = new QAction(saveastemplateIcon, "另存为图文件", this);
m_executeDepthShiftAc = new QAction(executeDepthShiftIcon, "校深", this);
m_ModuleOpenAc = new QAction(ModuleOpenIcon, "处理方法", this);
// m_runAc = new QAction(runIcon, "设置井", this);
// m_debugAc = new QAction(debugIcon, "撤销", this);
@ -193,15 +200,18 @@ void MainWindowCurve::initMainToolBar()
ui->mainToolBar->addAction(m_fixwellsectionHeaderAc);
ui->mainToolBar->addAction(m_currtempliteAc);
ui->mainToolBar->addAction(m_saveastemplateAc);
ui->mainToolBar->addAction(m_executeDepthShiftAc);
ui->mainToolBar->addAction(m_ModuleOpenAc);
// ui->mainToolBar->addAction(m_runAc);
// ui->mainToolBar->addAction(m_debugAc);
// ui->mainToolBar->addAction(m_loadAc);
//ui->mainToolBar->addAction(m_openAc);
connect(m_saveastemplateAc, &QAction::triggered, this, &MainWindowCurve::s_Save);
connect(m_ModuleOpenAc, &QAction::triggered, this, &MainWindowCurve::s_ModuleOpen);
connect(m_fixwellsectionHeaderAc, &QAction::triggered, this, &MainWindowCurve::s_showHeadTable);
connect(m_saveastemplateAc, &QAction::triggered, this, &MainWindowCurve::s_Save);
connect(m_executeDepthShiftAc, &QAction::triggered, this, &MainWindowCurve::s_ExecuteDepthShift);
connect(m_ModuleOpenAc, &QAction::triggered, this, &MainWindowCurve::s_ModuleOpen);
// connect(m_grepAc, &QAction::triggered, this, &MainWindow::s_Risize);
// connect(m_compileAc, &QAction::triggered, this, &MainWindow::s_AddOne);
@ -402,6 +412,216 @@ void MainWindowCurve::initToolBar()
}
//初始化工具栏
void MainWindowCurve::initToolBar_2()
{
QSize toolIconSize(18, 18);
ui->toolBar_2->setIconSize(toolIconSize); //设置工具栏图标大小
QIcon ShiftIcon(::GetImagePath()+"icon/Shift.png");
QIcon MoveShiftIcon(::GetImagePath()+"icon/MoveShift.png");
QIcon DepthShiftIcon(::GetImagePath()+"icon/DepthShift.png");
QIcon StandardIcon(::GetImagePath()+"icon/Standard.png");
QIcon CorrectionIcon(::GetImagePath()+"icon/Correction.png");
QIcon ShiftotherIcon(::GetImagePath()+"icon/Shiftother.png");
QIcon autocorIcon(::GetImagePath()+"icon/autocor.png");
QIcon runcorIcon(::GetImagePath()+"icon/runcor.png");
QIcon ClearAllSetCurveIcon(::GetImagePath()+"icon/ClearAllSetCurve.png");
QIcon ClearSetCurveIcon(::GetImagePath()+"icon/ClearSetCurve.png");
//工具栏
QAction* m_ShiftAc = nullptr;
QAction* m_MoveShiftAc = nullptr;
QAction* m_DepthShiftAc = nullptr;
QAction* m_StandardAc = nullptr;
QAction* m_CorrectionAc = nullptr;
QAction* m_ShiftotherAc = nullptr;
QAction* m_autocorAc = nullptr;
QAction* m_runcorAc = nullptr;
QAction* m_ClearAllSetCurveAc = nullptr;
QAction* m_ClearSetCurveAc = nullptr;
m_ShiftAc = new QAction(ShiftIcon, "", this);
m_MoveShiftAc = new QAction(MoveShiftIcon, "", this);
m_DepthShiftAc = new QAction(DepthShiftIcon, "", this);
m_StandardAc = new QAction(StandardIcon, "", this);
m_CorrectionAc = new QAction(CorrectionIcon, "", this);
m_ShiftotherAc = new QAction(ShiftotherIcon, "", this);
m_autocorAc = new QAction(autocorIcon, "", this);
m_runcorAc = new QAction(runcorIcon, "", this);
m_ClearAllSetCurveAc = new QAction(ClearAllSetCurveIcon, "", this);
m_ClearSetCurveAc = new QAction(ClearSetCurveIcon, "", this);
m_ShiftAc->setToolTip("整体深度平移校正");
m_MoveShiftAc->setToolTip("深度分段平移校正");
m_DepthShiftAc->setToolTip("参数卡深度平移校正");
m_StandardAc->setToolTip("设置/取消标准曲线");
m_CorrectionAc->setToolTip("设置/取消校正曲线");
m_ShiftotherAc->setToolTip("批量设置从校正曲线");
m_autocorAc->setToolTip("自动对比");
m_runcorAc->setToolTip("执行校正");
m_ClearAllSetCurveAc->setToolTip("清除全部曲线设置");
m_ClearSetCurveAc->setToolTip("清除全部从曲线设置");
//此种方式为文字显示在图标右侧
ui->toolBar_2->setToolButtonStyle(Qt::ToolButtonIconOnly);
//add QAction to Widget.
ui->toolBar_2->addAction(m_ShiftAc);
ui->toolBar_2->addAction(m_MoveShiftAc);
ui->toolBar_2->addAction(m_DepthShiftAc);
ui->toolBar_2->addSeparator();
ui->toolBar_2->addAction(m_StandardAc);
ui->toolBar_2->addAction(m_CorrectionAc);
ui->toolBar_2->addAction(m_ShiftotherAc);
ui->toolBar_2->addSeparator();
ui->toolBar_2->addAction(m_autocorAc);
ui->toolBar_2->addAction(m_runcorAc);
ui->toolBar_2->addSeparator();
ui->toolBar_2->addAction(m_ClearAllSetCurveAc);
ui->toolBar_2->addAction(m_ClearSetCurveAc);
connect(m_ShiftAc, &QAction::triggered, this, &MainWindowCurve::s_Shift);
connect(m_MoveShiftAc, &QAction::triggered, this, &MainWindowCurve::s_MoveShift);
// connect(m_DepthShiftAc, &QAction::triggered, this, &MainWindowCurve::s_DepthShift);
// connect(m_StandardAc, &QAction::triggered, this, &MainWindowCurve::s_Standard);
// connect(m_CorrectionAc, &QAction::triggered, this, &MainWindowCurve::s_Correction);
// connect(m_ShiftotherAc, &QAction::triggered, this, &MainWindowCurve::s_Shiftother);
// connect(m_autocorAc, &QAction::triggered, this, &MainWindowCurve::s_autocor);
// connect(m_runcorAc, &QAction::triggered, this, &MainWindowCurve::s_runcor);
// connect(m_ClearAllSetCurveAc, &QAction::triggered, this, &MainWindowCurve::s_ClearAllSetCurve);
// connect(m_ClearSetCurveAc, &QAction::triggered, this, &MainWindowCurve::s_ClearSetCurve);
}
QStringList MainWindowCurve::getLineList(QString strWellName, QString strTrackName)
{
// 创建根对象
QStringList listLine;
//
int columnCount = ui->tableWidget_2->columnCount();//总列数
for(int i=0; i<columnCount; i++)
{
if(i%2==0)
{
}
else
{
//空白列
continue;
}
if( ui->tableWidget_2->cellWidget(1, i) != nullptr )
{
auto myWidget = ui->tableWidget_2->cellWidget(1, i);
//
FormWell *widgetWell = (FormWell*)myWidget;//获得widget
if(widgetWell)
{
QStringList listTemp = widgetWell->getLineList(strWellName, strTrackName);
if(listTemp.size()>0)
{
listLine.append(listTemp);
}
}
}
}
return listLine;
}
void MainWindowCurve::ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset)
{
//1.修改内存数据
if(strSlfName=="") return ;
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
//AppendConsole(pai::log::PAI_ERROR,"SLF文件打开失败请检查");
return ;
};
bool isok=0;
//TODO 目前对于表格类,参数卡类不支持,会崩溃
int curveindex=logio->FindObjectName((char *)strLineName.toStdString().c_str());
if(curveindex>=0) {
CString szBuffer="";
szBuffer=QString::number(DepthOffset,'f',3)+"\r\n";
WriteShiftMessage(*logio,szBuffer,strLineName);
logio->CorrectObjectDepth(curveindex, DepthOffset);
isok=1;
}
// Slf_CURVE acurveinfo;
// logio->GetCurveInfo(curveindex,&acurveinfo);
delete logio;
//DepthOffset = 0;
// if(isRun&&isok) {
// isLoad=false;
// LoadFromSLF();
// }
}
void MainWindowCurve::s_Shift()
{
if(m_SelectTableItem.m_iTableType==0) {
QMessageBox::warning(this, "提示", "请选择要校正的对象!");
return;
}
if(m_SelectTableItem.m_iTableType==1) {
QMessageBox::warning(this, "提示", "该功能不支持对井次校正,如果需要井次校正请到数据树上进行!");
return;
}
if(m_SelectTableItem.m_iTableType==2 || m_SelectTableItem.m_iTableType==3)
{
//道,曲线
bool ok=0;
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
if(!ok) return;
if(depthshift==0) return;
if(depthshift>10)
{
int flag = QMessageBox::warning(this->parentWidget(),"提示",QString("深度移动量 =")+QString::number(depthshift)+"m\n"+"\n您确定执行校正?",
QMessageBox::Yes,QMessageBox::No);
if(flag==QMessageBox::No)
{
return;
}
}
if(m_SelectTableItem.m_iTableType==2)
{
//道
QStringList listLine = getLineList(m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName);
if(listLine.size()>0)
{
for(int i=0; i<listLine.size(); i++)
{
//单条曲线校深
ApplyShiftDepth(m_SelectTableItem.m_strSlfName, listLine[i], depthshift);
}
}
else
{
QMessageBox::warning(this, "提示", "道内曲线对象为空,无对象可校正!");
return;
}
}
else if(m_SelectTableItem.m_iTableType==3)
{
//单条曲线校深
ApplyShiftDepth(m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strLineName, depthshift);
}
}
}
void MainWindowCurve::s_MoveShift()
{
}
QStringList MainWindowCurve::insertCol(int nW)
{
QStringList sret;
@ -554,6 +774,19 @@ void MainWindowCurve::s_Save()
}
}
//校深
void MainWindowCurve::s_ExecuteDepthShift()
{
if(ui->toolBar_2->isHidden())
{
ui->toolBar_2->show();
}
else
{
ui->toolBar_2->hide();
}
}
void MainWindowCurve::s_ModuleOpen()
{
QString strSlfName = "";
@ -764,12 +997,35 @@ void MainWindowCurve::mousePressEvent(QMouseEvent *event)
PropertyService()->initWidgetProperty();
//取消所有选中单元格
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "");
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 1);
}
void MainWindowCurve::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
void MainWindowCurve::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType)
{
if(m_strUuid == strUuid)
{
//选中井次
m_SelectTableItem.m_iTableType=iTableType;
m_SelectTableItem.m_strUuid = strUuid;
m_SelectTableItem.m_strWellName = strWellName;
m_SelectTableItem.m_strSlfName=strSlfName;
m_SelectTableItem.m_strTrackName=strTrackName;
m_SelectTableItem.m_strLineName=strLineName;
//m_SelectTableItem.m_strType="";//类型curve, wave
}
else
{
m_SelectTableItem.m_iTableType=0;
m_SelectTableItem.m_strUuid = "";
m_SelectTableItem.m_strWellName = "";
m_SelectTableItem.m_strSlfName="";
m_SelectTableItem.m_strTrackName="";
m_SelectTableItem.m_strLineName="";
}
if(m_strUuid == strUuid &&
iTableType==1)
{
//
}
@ -790,7 +1046,8 @@ void MainWindowCurve::onItemClicked(QTableWidgetItem* item)
PropertyService()->initWellProperty();
//取消所有选中单元格
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "");
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 1);
}
void MainWindowCurve::s_NewTrack()

View File

@ -9,6 +9,18 @@
#pragma execution_character_set("utf-8")
struct SelectTableItem
{
int m_iTableType=0; // 当前选中数据表格的类型1:井次, 2:道, 3:曲线\表格\波列\参数卡
QString m_strUuid="";
QString m_strWellName="";
QString m_strSlfName="";
QString m_strTrackName="";
QString m_strLineName="";
QString m_strType="";//类型curve, wave
};
namespace Ui {
class MainWindowCurve;
}
@ -39,7 +51,7 @@ public slots:
void s_changeScale(int iNewScale);
void onItemClicked(QTableWidgetItem* item);
void mousePressEvent(QMouseEvent *event);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType);
public slots:
void dragEnterEvent(QDragEnterEvent* event);
@ -55,6 +67,8 @@ public slots:
public:
QString m_strUuid;
QStringList m_listWell;
//当前选中数据表格
SelectTableItem m_SelectTableItem;
FormMultiHeads *m_formMultiHeads; //左侧工程区
@ -84,6 +98,7 @@ public:
//初始化工具栏
void initMainToolBar();
void initToolBar();
void initToolBar_2();
// 返回 strWellName << strSlfName
QStringList insertCol(int nW);
@ -98,6 +113,7 @@ public:
void NewWellAndTrack(QString strWellName, QString strSlfName, QString strLineName, QString strType);
QJsonObject makeJson();
QStringList getLineList(QString strWellName, QString strTrackName);
signals:
void sig_NewTrackChangeWidth(QString strWellName, int nW=0);//新建道后,改变井宽
@ -136,15 +152,21 @@ public slots:
void s_NewLogface(); // 沉积相
void s_NewMCals(); // 多臂井径
void s_NewTubingstring(); // 套管组件
void s_NewTDT(); // TDT
void s_NewTDT(); // TDT
//校深
void ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset);
void s_Shift(); // 整体深度平移校正
void s_MoveShift(); // 深度分段平移校正
//
void s_Save();//保存
void s_ModuleOpen(); //处理算法
void s_showHeadTable(); //显示/隐藏图头
void s_Save(); //保存图文件
void s_ExecuteDepthShift(); //校深
void s_ModuleOpen(); //处理算法
//void s_Open(QString fileFull);//打开
void s_showHeadTable();//显示/隐藏图头
//图头右键菜单响应函数
void slotContextMenu(QPoint pos);
void slotMerge();//合并

View File

@ -63,6 +63,17 @@
<bool>false</bool>
</attribute>
</widget>
<widget class="QToolBar" name="toolBar_2">
<property name="windowTitle">
<string>toolBar_2</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
</widget>
<resources/>
<connections/>

View File

@ -308,7 +308,7 @@ void PreQTableWidget::mouseReleaseEvent(QMouseEvent *event)
PropertyService()->initCurveProperty(formInfo, strListOtherLine, listMin, listMax, strListOtherScaleType);
//曲线置顶显示,激活可选
emit CallManage::getInstance()->sig_Raise(m_strUuid, formInfo->m_strSlfName, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName);
emit CallManage::getInstance()->sig_Raise(m_strUuid, formInfo->m_strSlfName, formInfo->m_strWellName, formInfo->m_strTrackName, formInfo->m_strLineName, 3);
}
}
}

View File

@ -64,7 +64,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
connect(CallManage::getInstance(), SIGNAL(sig_ChangeScaleType(QString, QString, QString, QString, QString, QString)), this, SLOT(s_ChangeScaleType(QString, QString, QString, QString, QString, QString)));
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int)));
//颜色
connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineColor(QString, QString, QString, QString, QString, QColor)), this, SLOT(s_ChangeLineColor(QString, QString, QString, QString, QString, QColor)));
//线宽
@ -639,13 +639,14 @@ void QMyCustomPlot::removeSelectedGraphByTitle()
// }
}
void QMyCustomPlot::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
void QMyCustomPlot::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType)
{
if(m_strUuid == strUuid &&
m_strSlfName == strSlfName &&
m_strWellName == strWellName &&
m_strTrackName == strTrackName &&
m_strLineName == strLineName)
m_strLineName == strLineName &&
iTableType==3)
{
raise();
}

View File

@ -114,7 +114,7 @@ public slots:
void removeSelectedGraph();
void removeSelectedGraphByTitle();
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType);
//属性
//左刻度

View File

@ -130,10 +130,18 @@ void QMyTableWidget::mouseReleaseEvent(QMouseEvent *event)
if(iCurrentRow<0)
{
//未选中
PropertyService()->initWidgetProperty();
}
else {
QTableWidgetItem *item = currentItem();
QString strTrackName = item->text();
QString strUuid = item->data(Qt::UserRole+1).toString();
QString strWellName = item->data(Qt::UserRole+2).toString();
QString strSlfName = item->data(Qt::UserRole+3).toString();
//
emit CallManage::getInstance()->sig_Raise(strUuid, strSlfName, strWellName, strTrackName, "", 2);
}
}
}