追加裂痕视图
This commit is contained in:
parent
71e7d97178
commit
b27ab19ef8
|
|
@ -62,6 +62,9 @@ signals:
|
||||||
//图像 成像
|
//图像 成像
|
||||||
void sig_AddDrawImage(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0);
|
void sig_AddDrawImage(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0);
|
||||||
|
|
||||||
|
//裂痕
|
||||||
|
void sig_AddCrack(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);
|
void sig_AddWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName);
|
||||||
//删除波列
|
//删除波列
|
||||||
|
|
|
||||||
|
|
@ -7482,7 +7482,7 @@ public:
|
||||||
QCPItemAnchor *const bottomLeft;
|
QCPItemAnchor *const bottomLeft;
|
||||||
QCPItemAnchor *const left;
|
QCPItemAnchor *const left;
|
||||||
|
|
||||||
bool m_bCustom;
|
bool m_bCustom = false;
|
||||||
float m_fx;
|
float m_fx;
|
||||||
float m_fy;
|
float m_fy;
|
||||||
|
|
||||||
|
|
|
||||||
220
logPlus/PickFrac.cpp
Normal file
220
logPlus/PickFrac.cpp
Normal file
|
|
@ -0,0 +1,220 @@
|
||||||
|
#include <math.h>
|
||||||
|
#include <cassert>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QDebug>
|
||||||
|
#include "memrdwt.h"
|
||||||
|
#include "PickFrac.h"
|
||||||
|
#include "geometryutils.h"
|
||||||
|
|
||||||
|
CPickFrac::CPickFrac(QMyCustomPlot *myCustomPlot, QString strSlfName, QString csCurve, int iMyWidth)
|
||||||
|
{
|
||||||
|
m_myCustomPlot = myCustomPlot;
|
||||||
|
m_iMyWidth = iMyWidth;
|
||||||
|
|
||||||
|
m_Name="Frac_Hole.Table";
|
||||||
|
m_strDevi = "DEVI";
|
||||||
|
m_strHazi = "HAZI";
|
||||||
|
|
||||||
|
ReadFracDef();
|
||||||
|
|
||||||
|
for (int i = 0 ; i < iFracType ; i++)
|
||||||
|
{
|
||||||
|
m_bTypeDraw[i] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReadData(strSlfName, csCurve);
|
||||||
|
}
|
||||||
|
|
||||||
|
CPickFrac::~CPickFrac(void)
|
||||||
|
{
|
||||||
|
m_FracDef.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPickFrac::ReadFracDef()
|
||||||
|
{
|
||||||
|
m_FracDef.clear();
|
||||||
|
|
||||||
|
QString fracFilePath = GetConfPath() + "FRAC.CFG";
|
||||||
|
|
||||||
|
//
|
||||||
|
FRAC_DEF_Crack fd;
|
||||||
|
char str[512],name[512];
|
||||||
|
int r,g,b,id;
|
||||||
|
FILE *fp;
|
||||||
|
QString qs;
|
||||||
|
fp = fopen(fracFilePath.toStdString().c_str(),"r");
|
||||||
|
if ( fp !=NULL )
|
||||||
|
{
|
||||||
|
fgets(str,256,fp); // 跳过第一行
|
||||||
|
while (!feof(fp))
|
||||||
|
{
|
||||||
|
fgets(str,256,fp);
|
||||||
|
qs = str;
|
||||||
|
qs.trimmed();
|
||||||
|
if (qs.length() < 8) break ;
|
||||||
|
//代码 名称 形状代码(1:正弦曲线 2:连线 3:封闭区域) 颜色(红 绿 蓝) 线宽度
|
||||||
|
sscanf(str,"%d %s %d %d %d %d %d",&fd.iCode,name,&fd.iType,&r,&g,&b,&fd.nLineWidth);
|
||||||
|
fd.crColor = QColor(r,g,b);//RGB(r,g,b);
|
||||||
|
fd.csName = name;
|
||||||
|
fd.csName = fd.csName.trimmed();//.Trim();
|
||||||
|
fd.bDraw = 0;
|
||||||
|
m_FracDef.append(fd);
|
||||||
|
if ( feof(fp))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(name,"打开裂缝参数配置文件错误:%s!",str);
|
||||||
|
QMessageBox::information(NULL, "读取文件失败", name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPickFrac::ReadData(QString strSlfName, QString csCurve)
|
||||||
|
{
|
||||||
|
if(strSlfName.isEmpty()) return;
|
||||||
|
|
||||||
|
if(csCurve=="AC"||csCurve=="")
|
||||||
|
{
|
||||||
|
csCurve="Frac_Hole.Table";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString cs;
|
||||||
|
int nLineWidth=2;
|
||||||
|
int nField;
|
||||||
|
QColor crColor(255,0,0);
|
||||||
|
FRAC_TABLE_Crack frac;
|
||||||
|
FRAC_TABLE_OLD_Crack fracold;
|
||||||
|
CMemRdWt mrw;
|
||||||
|
char strFracTable[256];
|
||||||
|
int i,j,iIndex,nCount,iType=1;
|
||||||
|
|
||||||
|
if (mrw.Open(strSlfName.toStdString().c_str()) ) // 打开井文件
|
||||||
|
{
|
||||||
|
QString name(csCurve);
|
||||||
|
iIndex=mrw.OpenTable(name.toStdString().c_str());
|
||||||
|
if(iIndex>=0)
|
||||||
|
{
|
||||||
|
nField=mrw.GetTableFieldCount(iIndex);
|
||||||
|
nCount=mrw.GetTableRecordCount(iIndex);
|
||||||
|
cs ="";
|
||||||
|
for(i=0;i<nCount;i++)
|
||||||
|
{
|
||||||
|
if ( nField == 7 ) //老的裂缝表
|
||||||
|
{
|
||||||
|
mrw.ReadTable(iIndex,i+1,(void*)&fracold);
|
||||||
|
frac.AorX = fracold.AorX;
|
||||||
|
frac.DEP = fracold.DEP;
|
||||||
|
frac.DIPorS = fracold.DIPorS;
|
||||||
|
frac.DIR = fracold.DIR;
|
||||||
|
frac.W = fracold.W;
|
||||||
|
frac.ID = fracold.ID;
|
||||||
|
frac.XETAorH = fracold.XETAorH;
|
||||||
|
frac.NUM = 0;
|
||||||
|
for (j=0; j<16; j++)
|
||||||
|
frac.point[j].x = frac.point[j].y = 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// 扩充后的裂缝表
|
||||||
|
mrw.ReadTable(iIndex,i+1,(void*)&frac);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j=0; j<m_FracDef.count(); j++)
|
||||||
|
{
|
||||||
|
if ( m_FracDef[j].iCode == frac.ID )
|
||||||
|
{
|
||||||
|
cs = m_FracDef[j].csName;
|
||||||
|
iType = m_FracDef[j].iType;
|
||||||
|
nLineWidth = m_FracDef[j].nLineWidth;
|
||||||
|
crColor = m_FracDef[j].crColor;
|
||||||
|
|
||||||
|
//
|
||||||
|
drawOne(frac, cs, iType, nLineWidth, crColor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mrw.CloseTable(iIndex);
|
||||||
|
}
|
||||||
|
mrw.Close(); //关闭井文件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void CPickFrac::drawOne(FRAC_TABLE_Crack frac, QString cs, int iType, int nLineWidth, QColor crColor)
|
||||||
|
{
|
||||||
|
int j,nPoint=360;
|
||||||
|
float x,y,h,oy;
|
||||||
|
float PI,xScale,xx;
|
||||||
|
PI=2.*3.14159265/nPoint;
|
||||||
|
h = frac.AorX/2.0;
|
||||||
|
oy = -(frac.DEP+h);
|
||||||
|
|
||||||
|
xScale=(float)(nPoint)/(float)(m_iMyWidth);
|
||||||
|
|
||||||
|
QPen pPen(crColor, nLineWidth);
|
||||||
|
QVector<double> xVec, yVec;
|
||||||
|
|
||||||
|
switch ( iType )
|
||||||
|
{
|
||||||
|
case 1: //正弦曲线
|
||||||
|
nPoint = 360;
|
||||||
|
for(j=0; j<nPoint; j++)
|
||||||
|
{
|
||||||
|
x=(float)(j)/xScale;
|
||||||
|
float tempValue = oy - (float)(h)*cos((j-frac.XETAorH)*PI);
|
||||||
|
y=tempValue;//m_myCustomPlot->xAxis->coordToPixel(tempValue)
|
||||||
|
|
||||||
|
xVec.append(x);
|
||||||
|
yVec.append(y);
|
||||||
|
}
|
||||||
|
for(j=0; j<nPoint-1; j++)
|
||||||
|
{
|
||||||
|
QCPItemLine *qcpItemLine = new QCPItemLine(m_myCustomPlot);
|
||||||
|
qcpItemLine->start->setCoords(yVec[j], xVec[j]);
|
||||||
|
qcpItemLine->end->setCoords(yVec[j+1], xVec[j+1]);
|
||||||
|
qcpItemLine->setPen(pPen);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2: //连线
|
||||||
|
nPoint = frac.NUM;
|
||||||
|
for(j=0; j<nPoint-1; j++)
|
||||||
|
{
|
||||||
|
QCPItemLine *qcpItemLine = new QCPItemLine(m_myCustomPlot);
|
||||||
|
qcpItemLine->start->setCoords(-frac.point[j].y, frac.point[j].x);
|
||||||
|
qcpItemLine->end->setCoords(-frac.point[j+1].y, frac.point[j+1].x);
|
||||||
|
qcpItemLine->setPen(pPen);
|
||||||
|
j++;//j+2
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3: // 封闭区域
|
||||||
|
nPoint = frac.NUM;
|
||||||
|
for(j=0; j<nPoint; j++)
|
||||||
|
{
|
||||||
|
QCPItemLine *qcpItemLine = new QCPItemLine(m_myCustomPlot);
|
||||||
|
qcpItemLine->start->setCoords(-frac.point[j].y, frac.point[j].x);
|
||||||
|
if(j>=(nPoint-1))
|
||||||
|
{
|
||||||
|
qcpItemLine->end->setCoords(-frac.point[0].y, frac.point[0].x);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qcpItemLine->end->setCoords(-frac.point[j+1].y, frac.point[j+1].x);
|
||||||
|
}
|
||||||
|
qcpItemLine->setPen(pPen);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 4: //直线
|
||||||
|
nPoint = frac.NUM;
|
||||||
|
if(nPoint>=2)
|
||||||
|
{
|
||||||
|
QCPItemStraightLine *qcpItemLine = new QCPItemStraightLine(m_myCustomPlot);
|
||||||
|
qcpItemLine->point1->setCoords(-frac.point[0].y, frac.point[0].x);//位置
|
||||||
|
qcpItemLine->point2->setCoords(-frac.point[1].y, frac.point[1].x);//位置
|
||||||
|
qcpItemLine->setPen(pPen);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
75
logPlus/PickFrac.h
Normal file
75
logPlus/PickFrac.h
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
#ifndef DrawFrac_H
|
||||||
|
#define DrawFrac_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include "qmycustomplot.h"
|
||||||
|
|
||||||
|
//const int iFracType=15;
|
||||||
|
|
||||||
|
typedef struct tagPOINTF
|
||||||
|
{
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
} POINTF;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int iCode; //代码
|
||||||
|
QString csName;// 名称
|
||||||
|
int iType; //形状代码(1:正弦曲线 2:连线 3:封闭区域)
|
||||||
|
QColor crColor; //颜色(红 绿 蓝)
|
||||||
|
int nLineWidth;//线宽度
|
||||||
|
int bDraw; // 是否显示
|
||||||
|
}FRAC_DEF_Crack;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float DEP;
|
||||||
|
float AorX; //XRMI_DYN_DipHeight
|
||||||
|
float XETAorH;//XRMI_DYN_Azimuth
|
||||||
|
float W;
|
||||||
|
float DIPorS;//XRMI_DYN_Dip_APP
|
||||||
|
float DIR;//XRMI_DYN_Azimuth
|
||||||
|
float TDIP; //真倾角 Dip_TRU
|
||||||
|
float TDIR; //真倾向 Azimuth
|
||||||
|
float ID;//裂缝代码,type
|
||||||
|
float NUM;
|
||||||
|
//float X[16],Y[16];//X0,Y0,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6,X7,Y7,X8,Y8,X9,Y9;
|
||||||
|
POINTF point[16];
|
||||||
|
}FRAC_TABLE_Crack;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float DEP;
|
||||||
|
float AorX;
|
||||||
|
float XETAorH;
|
||||||
|
float W;
|
||||||
|
float DIPorS;
|
||||||
|
float DIR;
|
||||||
|
float ID;//裂缝代码
|
||||||
|
}FRAC_TABLE_OLD_Crack;
|
||||||
|
|
||||||
|
class CPickFrac:public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CPickFrac(QMyCustomPlot *widget, QString strSlfName, QString csCurve, int iMyWidth);
|
||||||
|
virtual ~CPickFrac(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
QString m_Name;
|
||||||
|
QString m_strDevi, m_strHazi;
|
||||||
|
QList <FRAC_DEF_Crack> m_FracDef;
|
||||||
|
bool m_bTypeDraw[iFracType];
|
||||||
|
|
||||||
|
QMyCustomPlot *m_myCustomPlot;
|
||||||
|
int m_iMyWidth=0;
|
||||||
|
public:
|
||||||
|
void ReadFracDef();
|
||||||
|
void ReadData(QString strSlfName, QString csCurve);
|
||||||
|
void drawOne(FRAC_TABLE_Crack frac, QString cs, int iType, int nLineWidth, QColor crColor);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include "TransparentDraggableRect.h"
|
#include "TransparentDraggableRect.h"
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include "Gradient.h"
|
#include "Gradient.h"
|
||||||
|
#include "PickFrac.h"
|
||||||
|
|
||||||
//以下参数从配置文件读取
|
//以下参数从配置文件读取
|
||||||
extern int g_iIndex;
|
extern int g_iIndex;
|
||||||
|
|
@ -72,6 +73,9 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) :
|
||||||
//图像 成图
|
//图像 成图
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_AddDrawImage(QString, QString, QString, QString, QString, int)), this, SLOT(s_addDrawImage(QString, QString, QString, QString, QString,int)));
|
connect(CallManage::getInstance(), SIGNAL(sig_AddDrawImage(QString, QString, QString, QString, QString, int)), this, SLOT(s_addDrawImage(QString, QString, QString, QString, QString,int)));
|
||||||
|
|
||||||
|
//裂缝
|
||||||
|
connect(CallManage::getInstance(), SIGNAL(sig_AddCrack(QString, QString, QString, QString, QString, int)), this, SLOT(s_addCrack(QString, QString, QString, QString, QString,int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FormDraw::~FormDraw()
|
FormDraw::~FormDraw()
|
||||||
|
|
@ -1234,6 +1238,93 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormDraw::s_addCrack(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();
|
||||||
|
|
||||||
|
//-------------------
|
||||||
|
m_LeftVal = 0;
|
||||||
|
m_RightVal = 360;
|
||||||
|
|
||||||
|
int iMyWidth = curv->axisRect(0)->width();
|
||||||
|
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 = "FRAC_HOLE.TABLE";
|
||||||
|
int _nSamples = 360;
|
||||||
|
|
||||||
|
CPickFrac *pickFrac = new CPickFrac(curv, strSlfName, strWaveName, iMyWidth);
|
||||||
|
|
||||||
|
//
|
||||||
|
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, "CrackObject");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
|
void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
|
||||||
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle)
|
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
const int iFracType=15;
|
//const int iFracType=15;
|
||||||
//蝌蚪图
|
//蝌蚪图
|
||||||
typedef struct FRACDEF
|
typedef struct FRACDEF
|
||||||
{
|
{
|
||||||
|
|
@ -210,6 +210,8 @@ public slots:
|
||||||
void s_addDenv(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
void s_addDenv(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||||
//图像 成像
|
//图像 成像
|
||||||
void s_addDrawImage(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
void s_addDrawImage(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||||
|
//裂缝
|
||||||
|
void s_addCrack(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_addWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName);
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
//岩心分析,不绘制左右范围
|
//岩心分析,不绘制左右范围
|
||||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "岩心实验数据");
|
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "岩心实验数据");
|
||||||
}
|
}
|
||||||
else if(m_strLineName=="FRAC_HOLE.TABLE")
|
else if(m_strLineName=="FRAC_HOLE.TABLE" && m_strType=="tableObject")
|
||||||
{
|
{
|
||||||
//蝌蚪图,不绘制左右范围
|
//蝌蚪图,不绘制左右范围
|
||||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "蝌蚪图");
|
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "蝌蚪图");
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,10 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName)
|
||||||
connect(this, SIGNAL(sig_AddDrawImage(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
|
connect(this, SIGNAL(sig_AddDrawImage(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
|
||||||
this, SLOT(s_addDrawImage(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
|
this, SLOT(s_addDrawImage(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
|
||||||
|
|
||||||
|
//裂缝
|
||||||
|
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(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)), this, SLOT(s_Raise(QString, QString, QString, QString, QString)));
|
||||||
|
|
||||||
|
|
@ -140,6 +144,10 @@ void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackNam
|
||||||
{
|
{
|
||||||
emit sig_AddDrawImage(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
|
emit sig_AddDrawImage(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
|
||||||
}
|
}
|
||||||
|
else if(strType=="CrackObject")
|
||||||
|
{
|
||||||
|
emit sig_AddCrack(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormTrack::setDrawDt(QStringList listdt, float vmax, float vmin)
|
void FormTrack::setDrawDt(QStringList listdt, float vmax, float vmin)
|
||||||
|
|
@ -540,6 +548,40 @@ void FormTrack::s_addDrawImage(QString strSlfName, QString strWellName, QString
|
||||||
ui->tableWidget->setCellWidget(row, 0, formInfo);
|
ui->tableWidget->setCellWidget(row, 0, formInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormTrack::s_addCrack(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_addCrack";
|
||||||
|
|
||||||
|
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 = "CrackObject";
|
||||||
|
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()
|
QJsonObject FormTrack::makeJson()
|
||||||
{
|
{
|
||||||
// 创建根对象
|
// 创建根对象
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ signals:
|
||||||
void sig_AddDenv(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
void sig_AddDenv(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||||
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_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_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);
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
@ -90,6 +91,7 @@ public slots:
|
||||||
void s_addDenv(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
void s_addDenv(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||||
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_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_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_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,11 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa
|
||||||
//图像 成图
|
//图像 成图
|
||||||
emit CallManage::getInstance()->sig_AddDrawImage(m_strUuid, strSlfName, strWellName, strTrackName, strLineName);
|
emit CallManage::getInstance()->sig_AddDrawImage(m_strUuid, strSlfName, strWellName, strTrackName, strLineName);
|
||||||
}
|
}
|
||||||
|
else if(strType=="CrackObject")
|
||||||
|
{
|
||||||
|
//裂缝
|
||||||
|
emit CallManage::getInstance()->sig_AddCrack(m_strUuid, strSlfName, strWellName, strTrackName, strLineName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//ui->tableWidget->resizeColumnsToContents(); // 调整列宽以适应内容
|
//ui->tableWidget->resizeColumnsToContents(); // 调整列宽以适应内容
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ SOURCES += \
|
||||||
Gradient.cpp \
|
Gradient.cpp \
|
||||||
InDefTableDlg.cpp \
|
InDefTableDlg.cpp \
|
||||||
InterfaceWidget.cpp \
|
InterfaceWidget.cpp \
|
||||||
|
PickFrac.cpp \
|
||||||
PropertyWidget.cpp \
|
PropertyWidget.cpp \
|
||||||
QCPSizeHandle.cpp \
|
QCPSizeHandle.cpp \
|
||||||
QCPSizeHandleManager.cpp \
|
QCPSizeHandleManager.cpp \
|
||||||
|
|
@ -77,6 +78,7 @@ HEADERS += \
|
||||||
Gradient.h \
|
Gradient.h \
|
||||||
InDefTableDlg.h \
|
InDefTableDlg.h \
|
||||||
InterfaceWidget.h \
|
InterfaceWidget.h \
|
||||||
|
PickFrac.h \
|
||||||
PropertyWidget.h \
|
PropertyWidget.h \
|
||||||
QCPSizeHandle.h \
|
QCPSizeHandle.h \
|
||||||
QCPSizeHandleManager.h \
|
QCPSizeHandleManager.h \
|
||||||
|
|
|
||||||
|
|
@ -376,6 +376,7 @@ void MainWindowCurve::initToolBar()
|
||||||
connect(m_mudloggingAc, &QAction::triggered, this, &MainWindowCurve::s_NewMudlogging);//录井剖面
|
connect(m_mudloggingAc, &QAction::triggered, this, &MainWindowCurve::s_NewMudlogging);//录井剖面
|
||||||
connect(m_txtAc, &QAction::triggered, this, &MainWindowCurve::s_NewTxt);//岩性描述
|
connect(m_txtAc, &QAction::triggered, this, &MainWindowCurve::s_NewTxt);//岩性描述
|
||||||
connect(m_coreimageAc, &QAction::triggered, this, &MainWindowCurve::s_NewCoreImage);//岩心照片
|
connect(m_coreimageAc, &QAction::triggered, this, &MainWindowCurve::s_NewCoreImage);//岩心照片
|
||||||
|
connect(m_crackAc, &QAction::triggered, this, &MainWindowCurve::s_NewCrack);//裂缝
|
||||||
connect(m_showdipAc, &QAction::triggered, this, &MainWindowCurve::s_NewShowDip);//蝌蚪图
|
connect(m_showdipAc, &QAction::triggered, this, &MainWindowCurve::s_NewShowDip);//蝌蚪图
|
||||||
|
|
||||||
connect(m_pinlvAc, &QAction::triggered, this, &MainWindowCurve::s_pinLvAc);//频率统计图
|
connect(m_pinlvAc, &QAction::triggered, this, &MainWindowCurve::s_pinLvAc);//频率统计图
|
||||||
|
|
@ -989,6 +990,17 @@ void MainWindowCurve::s_NewCoreImage()
|
||||||
NewWellAndTrack(sret.at(0), sret.at(1), "IMAGE_DATA", "tableObject");
|
NewWellAndTrack(sret.at(0), sret.at(1), "IMAGE_DATA", "tableObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//裂缝
|
||||||
|
void MainWindowCurve::s_NewCrack()
|
||||||
|
{
|
||||||
|
QStringList sret = this->getSelectWell();
|
||||||
|
if(sret.length() <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//新建井+道+曲线(首条)
|
||||||
|
NewWellAndTrack(sret.at(0), sret.at(1), "FRAC_HOLE.TABLE", "CrackObject");
|
||||||
|
}
|
||||||
|
|
||||||
//蝌蚪图
|
//蝌蚪图
|
||||||
void MainWindowCurve::s_NewShowDip()
|
void MainWindowCurve::s_NewShowDip()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ public slots:
|
||||||
void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
||||||
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性
|
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性
|
||||||
|
|
||||||
void s_NewTrack(); //新建道
|
void s_NewTrack(); // 新建道
|
||||||
void s_NewDepth(); // 深度
|
void s_NewDepth(); // 深度
|
||||||
void s_NewLogs(); // 曲线
|
void s_NewLogs(); // 曲线
|
||||||
void s_NewWave(); // 波列
|
void s_NewWave(); // 波列
|
||||||
|
|
@ -121,6 +121,7 @@ public slots:
|
||||||
void s_NewMudlogging(); // 录井剖面
|
void s_NewMudlogging(); // 录井剖面
|
||||||
void s_NewTxt(); // 岩性描述
|
void s_NewTxt(); // 岩性描述
|
||||||
void s_NewCoreImage(); // 岩心照片
|
void s_NewCoreImage(); // 岩心照片
|
||||||
|
void s_NewCrack(); // 裂缝
|
||||||
void s_NewShowDip(); // 蝌蚪图
|
void s_NewShowDip(); // 蝌蚪图
|
||||||
void s_pinLvAc(); // 频率统计
|
void s_pinLvAc(); // 频率统计
|
||||||
void s_NewGanZhuangTu(); // 杆状图
|
void s_NewGanZhuangTu(); // 杆状图
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
|
const int iFracType=15;
|
||||||
|
|
||||||
class QMyCustomPlot : public QCustomPlot
|
class QMyCustomPlot : public QCustomPlot
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user