追加地质层位道,显示地质分层视图
This commit is contained in:
parent
414d131a3c
commit
5cb225fec7
|
|
@ -65,6 +65,9 @@ signals:
|
|||
//裂痕
|
||||
void sig_AddCrack(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0);
|
||||
|
||||
//地质层位道
|
||||
void sig_AddGeoSection(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0);
|
||||
|
||||
//新建波列
|
||||
void sig_AddWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName);
|
||||
//删除波列
|
||||
|
|
|
|||
64
logPlus/ObjGeostratums.cpp
Normal file
64
logPlus/ObjGeostratums.cpp
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#include <cassert>
|
||||
#include "ObjGeostratums.h"
|
||||
#include "LogIO.h";
|
||||
#include <QTextStream>
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
|
||||
|
||||
CObjGeostratums::CObjGeostratums()
|
||||
{
|
||||
}
|
||||
|
||||
bool CObjGeostratums::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve)
|
||||
{
|
||||
LAYER_DATA m_Result;
|
||||
if(strSlfName=="") return false;
|
||||
CLogIO *logio=new CLogIO();
|
||||
if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
return false;
|
||||
}
|
||||
|
||||
int iIndex=logio->OpenTable(csCurve.toStdString().c_str());
|
||||
if (iIndex <0) {
|
||||
iIndex=logio->OpenTable("LAYER_DATA");
|
||||
}
|
||||
|
||||
if (iIndex >=0)
|
||||
{
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
|
||||
int ColorNum=6;
|
||||
if(ColorNum<1) ColorNum=1;
|
||||
QList<QRgb> rgbList;
|
||||
rgbList.append(QRgb(4294967295));
|
||||
rgbList.append(QRgb(4294966617));
|
||||
rgbList.append(QRgb(4294944512));
|
||||
rgbList.append(QRgb(4293345792));
|
||||
rgbList.append(QRgb(4288741473));
|
||||
rgbList.append(QRgb(4278190080));
|
||||
|
||||
for(int j=0;j<count;j++) {
|
||||
memset(&m_Result,0,sizeof(LAYER_DATA));
|
||||
logio->ReadTable(iIndex,j+1,&m_Result);
|
||||
float sdep=m_Result.StartDepth;
|
||||
float edep=m_Result.EndDepth;
|
||||
//
|
||||
char buf[490];
|
||||
buf[0]=0;
|
||||
::GetDescription(m_Result,buf);
|
||||
|
||||
QColor bkColor = rgbList.at(j%ColorNum);
|
||||
|
||||
//显示文本
|
||||
widget->addTextToPlot(-edep, -sdep, QString::fromLocal8Bit(buf), bkColor);
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
}
|
||||
delete logio;
|
||||
return true;
|
||||
}
|
||||
|
||||
24
logPlus/ObjGeostratums.h
Normal file
24
logPlus/ObjGeostratums.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef PAI_FRAME_OBJGEOSTRATUMS_H
|
||||
#define PAI_FRAME_OBJGEOSTRATUMS_H
|
||||
|
||||
#include <QObject>
|
||||
#include "qmycustomplot.h"
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @brief 地质分层
|
||||
* @see
|
||||
*/
|
||||
class CObjGeostratums :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CObjGeostratums();
|
||||
|
||||
virtual bool LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve);
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -31,7 +31,7 @@ void TransparentDraggableRect::setTitle(QString strTitle)
|
|||
{
|
||||
mstrTitle = strTitle;
|
||||
mItemTitle->setText(mstrTitle);
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
}
|
||||
|
||||
// 设置矩形范围
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <QtMath>
|
||||
#include "Gradient.h"
|
||||
#include "PickFrac.h"
|
||||
#include "ObjGeostratums.h"
|
||||
|
||||
//以下参数从配置文件读取
|
||||
extern int g_iIndex;
|
||||
|
|
@ -76,6 +77,9 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) :
|
|||
//裂缝
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_AddCrack(QString, QString, QString, QString, QString, int)), this, SLOT(s_addCrack(QString, QString, QString, QString, QString,int)));
|
||||
|
||||
//地质层位道
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_AddGeoSection(QString, QString, QString, QString, QString, int)), this, SLOT(s_addGeoSection(QString, QString, QString, QString, QString,int)));
|
||||
|
||||
}
|
||||
|
||||
FormDraw::~FormDraw()
|
||||
|
|
@ -1322,9 +1326,97 @@ void FormDraw::s_addCrack(QString strUuid, QString strSlfName, QString strWellNa
|
|||
QString strScaleType = "";
|
||||
//道-对象
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "CrackObject");
|
||||
}
|
||||
|
||||
//地质层位道
|
||||
void FormDraw::s_addGeoSection(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW)
|
||||
{
|
||||
//井名&道名不一致
|
||||
if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
qDebug() << "FormDraw strLineName already exist! " << strLineName;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strLineName);
|
||||
curv->m_strUuid = m_strUuid;
|
||||
//背景设置成透明色
|
||||
curv->setBackground(Qt::transparent);
|
||||
curv->setStyleSheet("background: transparent;");
|
||||
//
|
||||
double dHight = 0;
|
||||
dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm;
|
||||
if(g_iShow==1)
|
||||
{
|
||||
//显示刻度
|
||||
dHight = dHight+30;
|
||||
}
|
||||
qDebug() << "FormDraw dHight=" << QString::number((int)dHight);
|
||||
if(dHight>32767)
|
||||
{
|
||||
dHight = 32767;
|
||||
}
|
||||
|
||||
curv->setGeometry(0, 0, g_iOneWidth, (int)dHight);//7500-3184
|
||||
curv->show();
|
||||
|
||||
//-------------------
|
||||
int iMyWidth = curv->axisRect(0)->width();
|
||||
|
||||
m_LeftVal = 0;
|
||||
m_RightVal = iMyWidth;
|
||||
|
||||
float vmax = iMyWidth;
|
||||
float vmin = 0;
|
||||
curv->m_iX1 = vmin;
|
||||
curv->m_iX2 = vmax;
|
||||
curv->m_iY1 = g_iY1;
|
||||
curv->m_iY2 = g_iY2;
|
||||
//
|
||||
curv->xAxis->setRange(vmin, vmax);
|
||||
curv->yAxis->setRange(g_iY1, g_iY2);
|
||||
curv->axisRect()->setupFullAxesBox();
|
||||
//
|
||||
curv->xAxis->ticker()->setTickCount(10);//x个主刻度
|
||||
curv->yAxis->ticker()->setTickCount(60);//y个主刻度
|
||||
|
||||
//对调XY轴,在最前面设置
|
||||
QCPAxis *yAxis = curv->yAxis;
|
||||
QCPAxis *xAxis = curv->xAxis;
|
||||
curv->xAxis = yAxis;
|
||||
curv->yAxis = xAxis;
|
||||
|
||||
//地质层位道
|
||||
QString strWaveName = "LAYER_DATA";
|
||||
CObjGeostratums *objGeostratums = new CObjGeostratums();
|
||||
objGeostratums->LoadFromSLF(curv, strSlfName, strWaveName);
|
||||
|
||||
//
|
||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||
|
||||
//
|
||||
m_listLineName.push_back(strLineName);
|
||||
|
||||
QString strAliasName = "地质分层";
|
||||
QString strUnit = "";
|
||||
QColor newlineColor=QColor(0,0,0);
|
||||
double width=2;
|
||||
QString strScaleType = "";
|
||||
//道-对象
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "GeoSectionObject");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
|
||||
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle)
|
||||
{
|
||||
|
|
@ -2582,6 +2674,7 @@ bool FormDraw::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString st
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FormDraw::LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
{
|
||||
{
|
||||
|
|
|
|||
|
|
@ -213,6 +213,9 @@ public slots:
|
|||
//裂缝
|
||||
void s_addCrack(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||
|
||||
//地质层位道
|
||||
void s_addGeoSection(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||
|
||||
//
|
||||
void s_addWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName);
|
||||
void s_delWave(QString strUuid, QString strWellName, QString strTrackName, QString strLineName);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,10 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName)
|
|||
connect(this, SIGNAL(sig_AddCrack(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
|
||||
this, SLOT(s_addCrack(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
|
||||
|
||||
//地质层位道
|
||||
connect(this, SIGNAL(sig_AddGeoSection(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
|
||||
this, SLOT(s_addGeoSection(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)));
|
||||
|
||||
|
|
@ -148,6 +152,10 @@ void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackNam
|
|||
{
|
||||
emit sig_AddCrack(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
|
||||
}
|
||||
else if(strType=="GeoSectionObject")
|
||||
{
|
||||
emit sig_AddGeoSection(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
|
||||
}
|
||||
}
|
||||
|
||||
void FormTrack::setDrawDt(QStringList listdt, float vmax, float vmin)
|
||||
|
|
@ -581,6 +589,38 @@ void FormTrack::s_addCrack(QString strSlfName, QString strWellName, QString strT
|
|||
ui->tableWidget->setCellWidget(row, 0, formInfo);
|
||||
}
|
||||
|
||||
void FormTrack::s_addGeoSection(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType)
|
||||
{
|
||||
qDebug() << "FormTrack s_addGeoSection";
|
||||
|
||||
ui->tableWidget->m_strUuid = m_strUuid;
|
||||
int row = ui->tableWidget->rowCount();
|
||||
ui->tableWidget->setRowCount(row + 1);
|
||||
|
||||
//避免出现小滚动条
|
||||
//ui->tableWidget->resize(g_iOneWidth, 100*(row + 1)+10);
|
||||
//this->resize(g_iOneWidth, 100*(row + 1)+30);
|
||||
|
||||
//曲线信息栏
|
||||
FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, strTrackName, strLineName, lineColor);
|
||||
formInfo->m_strUuid = m_strUuid;
|
||||
formInfo->m_strAliasName = strAliasName;
|
||||
formInfo->m_strUnit = strUnit;
|
||||
formInfo->m_strScaleType = strScaleType;
|
||||
formInfo->m_strType = "GeoSectionObject";
|
||||
formInfo->m_nJg = 2;
|
||||
formInfo->setLineWidth(dWidth);
|
||||
formInfo->setVMax(vmax);
|
||||
formInfo->setVMin(vmin);
|
||||
formInfo->setFrontColor(QColor(0,0,0));
|
||||
formInfo->setBackColor(QColor(255,255,255));
|
||||
//设置高度
|
||||
ui->tableWidget->setRowHeight(row, 100);
|
||||
//单元格委托
|
||||
//ui->tableWidget->setItemDelegateForRow(row, m_delegate);
|
||||
//
|
||||
ui->tableWidget->setCellWidget(row, 0, formInfo);
|
||||
}
|
||||
|
||||
QJsonObject FormTrack::makeJson()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ signals:
|
|||
void sig_AddYanXinImage(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void sig_AddDrawImage(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void sig_AddCrack(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void sig_AddGeoSection(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
|
||||
|
||||
public slots:
|
||||
|
|
@ -92,8 +93,9 @@ public slots:
|
|||
void s_addYanXinImage(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void s_addDrawImage(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void s_addCrack(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void s_addGeoSection(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);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -186,6 +186,11 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa
|
|||
//裂缝
|
||||
emit CallManage::getInstance()->sig_AddCrack(m_strUuid, strSlfName, strWellName, strTrackName, strLineName);
|
||||
}
|
||||
else if(strType=="GeoSectionObject")
|
||||
{
|
||||
//地质层位道
|
||||
emit CallManage::getInstance()->sig_AddGeoSection(m_strUuid, strSlfName, strWellName, strTrackName, strLineName);
|
||||
}
|
||||
}
|
||||
|
||||
//ui->tableWidget->resizeColumnsToContents(); // 调整列宽以适应内容
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ SOURCES += \
|
|||
Gradient.cpp \
|
||||
InDefTableDlg.cpp \
|
||||
InterfaceWidget.cpp \
|
||||
ObjGeostratums.cpp \
|
||||
PickFrac.cpp \
|
||||
PropertyWidget.cpp \
|
||||
QCPSizeHandle.cpp \
|
||||
|
|
@ -78,6 +79,7 @@ HEADERS += \
|
|||
Gradient.h \
|
||||
InDefTableDlg.h \
|
||||
InterfaceWidget.h \
|
||||
ObjGeostratums.h \
|
||||
PickFrac.h \
|
||||
PropertyWidget.h \
|
||||
QCPSizeHandle.h \
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ void MainWindowCurve::initToolBar()
|
|||
connect(m_collapseAc, &QAction::triggered, this, &MainWindowCurve::s_Jykt);//井眼垮塌矢量图
|
||||
connect(m_deviAc, &QAction::triggered, this, &MainWindowCurve::s_Denv);//井斜方位图
|
||||
connect(m_electric_imagingAc, &QAction::triggered, this, &MainWindowCurve::s_DrawImage);//图像
|
||||
connect(m_GeoSectionAc, &QAction::triggered, this, &MainWindowCurve::s_NewGeoSection);//地质层位道
|
||||
}
|
||||
|
||||
QStringList MainWindowCurve::insertCol(int nW)
|
||||
|
|
@ -1263,6 +1264,17 @@ void MainWindowCurve::s_DrawImage()
|
|||
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, "成像", "DrawImageObject", nW);
|
||||
}
|
||||
|
||||
//地质层位道
|
||||
void MainWindowCurve::s_NewGeoSection()
|
||||
{
|
||||
QStringList sret = this->getSelectWell();
|
||||
if(sret.length() <= 0)
|
||||
return;
|
||||
|
||||
//新建井+道+曲线(首条)
|
||||
NewWellAndTrack(sret.at(0), sret.at(1), "LAYER_DATA", "GeoSectionObject");
|
||||
}
|
||||
|
||||
void MainWindowCurve::s_NewTrackChangeWidth(QString strWellName)
|
||||
{
|
||||
qDebug() << "MainWindowCurve s_NewTrackChangeWidth";
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@ public slots:
|
|||
void s_roseAc(); // 玫瑰图
|
||||
void s_Jykt(); // 井眼垮塌矢量图
|
||||
void s_Denv(); // 井斜方位图
|
||||
void s_DrawImage(); // 图像 成图
|
||||
void s_DrawImage(); // 图像 成图
|
||||
void s_NewGeoSection(); // 地质层位道
|
||||
|
||||
//
|
||||
void s_Save();//保存
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QS
|
|||
|
||||
}
|
||||
|
||||
void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QString strText)
|
||||
void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor)
|
||||
{
|
||||
QtCommonClass *qtCommon = new QtCommonClass(this);
|
||||
QString strUuid = qtCommon->getUUid();
|
||||
|
|
@ -383,7 +383,7 @@ void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QSt
|
|||
// 设置初始范围
|
||||
dragRect->setRange(left_Low, right_Hight);
|
||||
// 可选:设置颜色
|
||||
dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色
|
||||
dragRect->setColor(crColor); // 半透明白色
|
||||
//最小宽度
|
||||
dragRect->setMinWidth(0.1);
|
||||
dragRect->setTitle(strText);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public:
|
|||
void addRandomGraph(QVector<double> x, QVector<double> y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit,
|
||||
double newLeftScale, double newRightScale, QString strScaleType, QColor &newlineColor, double width, Qt::PenStyle lineStyle);
|
||||
|
||||
void addTextToPlot(double left_Low, double right_Hight, const QString strText);
|
||||
void addTextToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||||
|
||||
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText="");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user