实现频率统计图显示效果,表格,曲线还未实现
左侧添加 深度,新建道,频率统计图
This commit is contained in:
parent
ca28be2e50
commit
31f492fd50
|
|
@ -41,6 +41,8 @@ signals:
|
|||
void sig_ShowTable(QString strSlfName, QString strName);//表格数据查看
|
||||
void sig_WelllogInformation(QString strSlfName, QString strName);//编辑测井信息
|
||||
|
||||
// 0.Uuid 1.WellName 2.SlfName 3.lineName 4.Type 5.W
|
||||
void sig_NewCol(QStringList listdt);
|
||||
void sig_NewTrack(QString strUuid, QString strWellName, QString strSlfName, QString strLineName, QString strType, int nW = 0);//新建道
|
||||
void sig_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName);//新建空白道,没有曲线
|
||||
void sig_AddLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);//新建曲线
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "ConsoleOutputWidget.h"
|
||||
#include "DraggablePixmap.h"
|
||||
#include "TransparentDraggableRect.h"
|
||||
#include <QtMath>
|
||||
|
||||
//以下参数从配置文件读取
|
||||
extern int g_iIndex;
|
||||
|
|
@ -59,8 +60,6 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) :
|
|||
connect(CallManage::getInstance(), SIGNAL(sig_AddTableLine(QString, QString, QString, QString, QString)), this, SLOT(s_addTableLine(QString, QString, QString, QString, QString)));
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_delTableLine(QString, QString, QString, QString)), this, SLOT(s_delTableLine(QString, QString, QString, QString)));
|
||||
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_AddDepth(QString, QString, QString, QString, QString, int)), this, SLOT(s_addDepth(QString, QString, QString, QString, QString,int)));
|
||||
|
||||
}
|
||||
|
||||
FormDraw::~FormDraw()
|
||||
|
|
@ -68,6 +67,62 @@ FormDraw::~FormDraw()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void FormDraw::setDrawData(QStringList listdt)
|
||||
{
|
||||
QString strWellName = listdt.at(1);
|
||||
QString strSlfName = listdt.at(2);
|
||||
QString strLineName = listdt.at(3);
|
||||
QString strType = listdt.at(4);
|
||||
int nW = listdt.at(5).toInt();
|
||||
|
||||
m_strSlfName = strSlfName;
|
||||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
qDebug() << "FormDraw strLineName already exist! " << strLineName;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, m_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;
|
||||
}
|
||||
if(dHight>32767)
|
||||
{
|
||||
dHight = 32767;
|
||||
}
|
||||
curv->setGeometry(0, 0, nW, (int)dHight);//7500-3184
|
||||
|
||||
curv->show();
|
||||
|
||||
// 深度
|
||||
if("depthObject" == strType)
|
||||
{
|
||||
initDepth(curv);
|
||||
}
|
||||
else if("plObject" == strType)
|
||||
{
|
||||
initFgrq(curv);
|
||||
}
|
||||
curv->replot();
|
||||
|
||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||
|
||||
//道-对象
|
||||
m_formTrack->setDrawDt(listdt, m_vmax, m_vmin);
|
||||
//
|
||||
m_listLineName.push_back(strLineName);
|
||||
}
|
||||
|
||||
|
||||
void FormDraw::paintEvent(QPaintEvent*)
|
||||
{
|
||||
|
|
@ -411,7 +466,8 @@ void FormDraw::setRowHeight(double dHight, QProgressBar *progressBar, int iSplit
|
|||
//progressBar->setValue(iBeginValue+ i*iSplitCurv); // 更新进度条的值
|
||||
//
|
||||
QMyCustomPlot *form = (QMyCustomPlot*)childWidget;
|
||||
form->setGeometry(0, 0, g_iOneWidth, (int)dHight);//7500-3184
|
||||
int nw = form->geometry().width();
|
||||
form->setGeometry(0, 0, nw, (int)dHight);//7500-3184
|
||||
//深度改变
|
||||
form->xAxis->setRange(g_iY1, g_iY2);
|
||||
|
||||
|
|
@ -770,80 +826,6 @@ void FormDraw::s_selectionRectAccepted(const QRect &rect, QMouseEvent *event)
|
|||
// double y2 = widget->yAxis->pixelToCoord(rect.bottom());
|
||||
}
|
||||
|
||||
void FormDraw::s_addDepth(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;");
|
||||
//
|
||||
//QRect rect = this->rect();
|
||||
//curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height());
|
||||
curv->yAxis->setTickLabels(true);
|
||||
curv->yAxis->setTickLabelSide(QCPAxis::lsInside);
|
||||
QFont font1("微软雅黑", 16); //fontSize 10
|
||||
curv->yAxis->setTickLabelFont(font1);
|
||||
|
||||
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;
|
||||
|
||||
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->setMaximumHeight((int)dHight);
|
||||
//curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184
|
||||
curv->setGeometry(0, 0, nW, (int)dHight);//7500-3184
|
||||
|
||||
curv->show();
|
||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||
|
||||
QString strAliasName = "深度";
|
||||
QString strUnit = "";
|
||||
QColor newlineColor=QColor(0,0,0);
|
||||
double width=2;
|
||||
QString strScaleType = "";
|
||||
//道-对象
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_vmax, m_vmin, strScaleType, "depthObject");
|
||||
//
|
||||
m_listLineName.push_back(strLineName);
|
||||
}
|
||||
|
||||
void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
|
||||
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle)
|
||||
{
|
||||
|
|
@ -1648,9 +1630,12 @@ void FormDraw::initTableLine(QMyCustomPlot *widget, QString strSlfName, QString
|
|||
m_bTableData=0;//表格或曲线
|
||||
m_LeftVal2=0;
|
||||
m_RightVal2=360;
|
||||
//m_csCurveDDIR="DDIR";
|
||||
//m_csCurveDANG="DANG";
|
||||
//m_csCurveGrad="GRAD";
|
||||
|
||||
m_csCurveDDIR = "DDIR"; // 方位 曲线名
|
||||
m_csCurveDANG = "DANG";//倾角
|
||||
m_csCurveGrad = "GRAD";
|
||||
|
||||
|
||||
m_nTailWidth=2;
|
||||
m_crTail=qRgb(0,0,0);
|
||||
m_crPointFill=qRgb(0,0,0);
|
||||
|
|
@ -2684,6 +2669,87 @@ bool FormDraw::LoadFromSLF_Gujing(QMyCustomPlot *widget, QString strSlfName, QSt
|
|||
return true;
|
||||
}
|
||||
|
||||
void FormDraw::initDepth(QMyCustomPlot *curv)
|
||||
{
|
||||
curv->yAxis->setTickLabels(true);
|
||||
curv->yAxis->setTickLabelSide(QCPAxis::lsInside);
|
||||
QFont font1("微软雅黑", 16); //fontSize 10
|
||||
curv->yAxis->setTickLabelFont(font1);
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
void FormDraw::initFgrq(QMyCustomPlot *widget)
|
||||
{
|
||||
widget->m_iX1 = 0;
|
||||
widget->m_iX2 = 1024;
|
||||
widget->m_iY1 = g_iY1;
|
||||
widget->m_iY2 = g_iY2;
|
||||
//
|
||||
widget->xAxis->setRange(widget->m_iX1, widget->m_iX2);
|
||||
widget->yAxis->setRange(g_iY1, g_iY2);
|
||||
|
||||
//对调XY轴,在最前面设置
|
||||
QCPAxis *yAxis = widget->yAxis;
|
||||
QCPAxis *xAxis = widget->xAxis;
|
||||
widget->xAxis = yAxis;
|
||||
widget->yAxis = xAxis;
|
||||
|
||||
if(m_Value == NULL)
|
||||
{
|
||||
Refurbish();
|
||||
}
|
||||
|
||||
double nR = 50;
|
||||
|
||||
QPen wPen(Qt::black, 2);
|
||||
double centerX = widget->m_iX2/2;
|
||||
|
||||
int nstep = 10;
|
||||
int tmp = m_SDep / nstep;
|
||||
float flDep = tmp * nstep;
|
||||
while ( 1)
|
||||
{
|
||||
if((flDep>=m_EDep+nstep)||flDep>=m_EDep)break;
|
||||
|
||||
double tempf = flDep+(float)(nstep)/2.;
|
||||
double centerY = tempf * -1.0;
|
||||
|
||||
QCPItemEllipse* pEse = new QCPItemEllipse(widget);
|
||||
pEse->setPen(wPen);
|
||||
pEse->m_bCustom = true;
|
||||
pEse->m_nRadius = nR;
|
||||
pEse->topLeft->setCoords(centerY, centerX);
|
||||
pEse->bottomRight->setCoords(centerY, centerX);
|
||||
|
||||
for(int k = 0; k < 4; k++)
|
||||
{
|
||||
QCPItemLine* pLine1 = new QCPItemLine(widget);
|
||||
pLine1->m_bCustom = true;
|
||||
pLine1->m_dr = qDegreesToRadians(k*90.0);
|
||||
pLine1->m_nRadius = 0;
|
||||
pLine1->m_nTailLen=nR;
|
||||
pLine1->setPen(wPen);
|
||||
pLine1->start->setCoords(centerY,centerX);
|
||||
pLine1->end->setCoords(centerY,centerX);
|
||||
}
|
||||
|
||||
flDep += nstep;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FormDraw::CalcDipWidth(int nColumn,float *flWidth,float factor,int x1,int x2,float flHoriRatio)
|
||||
{
|
||||
float scale ;
|
||||
|
|
@ -3099,21 +3165,16 @@ void FormDraw::ReadFracDef()
|
|||
|
||||
void FormDraw::Refurbish()
|
||||
{
|
||||
// if we are in the valid range for the property
|
||||
// set the new property value
|
||||
// update the property
|
||||
// let the control know that the property has changed
|
||||
// if(this->m_bTableData)
|
||||
// {
|
||||
// this->ReadData();//read table
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this->ReadData(m_csCurveDDIR,0,&m_Curve);
|
||||
// this->ReadData(m_csCurveDANG,1,&m_Curve2);
|
||||
// this->ReadData(m_csCurveGrad,2,&m_Curve3);
|
||||
// }
|
||||
// redraw the control
|
||||
if (m_bTableData)
|
||||
{
|
||||
ReadData(m_strSlfName, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve);
|
||||
this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2);
|
||||
this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3);
|
||||
}
|
||||
}
|
||||
|
||||
//曲线
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public:
|
|||
explicit FormDraw(QWidget *parent = nullptr, QString m_strWellName="", QString strTrackName="");
|
||||
~FormDraw();
|
||||
|
||||
void setDrawData(QStringList slist);
|
||||
private:
|
||||
Ui::FormDraw *ui;
|
||||
|
||||
|
|
@ -110,18 +111,19 @@ public:
|
|||
//CString m_csUnit;
|
||||
//
|
||||
Slf_CURVE m_Curve,m_Curve2,m_Curve3;
|
||||
char *m_Value,*m_Value2,*m_Value3;
|
||||
char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL;
|
||||
// 以下变量需保存在模板里
|
||||
// 绘制时,方位/倾角/可信度曲线的深度、采样间隔应该一致
|
||||
//CString m_csCurveDDIR,m_csCurveDANG,m_csCurveGrad; // 方位/倾角/可信度 曲线名
|
||||
float m_LeftVal2,m_RightVal2;
|
||||
float m_flGrad1,m_flGrad2; // 可信度
|
||||
int m_bTableData;//表格或曲线
|
||||
int m_bTableData = 0;//表格或曲线
|
||||
QRectF m_Rect;
|
||||
float m_nRadius,m_nCircleWidth; // 半径,圆线宽度
|
||||
float m_nTailWidth,m_nTailLen; // 尾宽度、尾长
|
||||
QColor m_crPointFill,m_crTail,m_crCircle;
|
||||
QColor m_crGridSmall;
|
||||
QString m_strSlfName;
|
||||
//TabDip
|
||||
QString m_qsWellName,m_qsTable; //
|
||||
QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线
|
||||
|
|
@ -155,7 +157,10 @@ public:
|
|||
void initGujing(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
bool LoadFromSLF_Gujing(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
|
||||
|
||||
//深度
|
||||
void initDepth(QMyCustomPlot *widget);
|
||||
//频率统计图
|
||||
void initFgrq(QMyCustomPlot *widget);
|
||||
signals:
|
||||
//void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||||
|
||||
|
|
@ -170,8 +175,6 @@ public slots:
|
|||
void s_handleRectRangeChange(QCPRange newRange);
|
||||
void s_selectionRectAccepted(const QRect &rect, QMouseEvent *event);
|
||||
|
||||
void s_addDepth(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);
|
||||
|
|
|
|||
|
|
@ -222,7 +222,8 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
|||
//文字结论,不绘制左右范围
|
||||
}
|
||||
else {
|
||||
if(m_strType!="depthObject")
|
||||
if(m_strType=="waveObject"
|
||||
|| m_strType=="curveObject")
|
||||
{
|
||||
painter.drawText(rect.left(), rect.top()+rect.height()*2/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, QString::number(m_vmin)+" ~ "+QString::number(m_vmax));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,57 @@ void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackNam
|
|||
}
|
||||
}
|
||||
|
||||
void FormTrack::setDrawDt(QStringList listdt, float vmax, float vmin)
|
||||
{
|
||||
QString strWellName = listdt.at(1);
|
||||
QString strSlfName = listdt.at(2);
|
||||
QString strLineName = listdt.at(3);
|
||||
QString strType = listdt.at(4);
|
||||
// int nW = listdt.at(5).toInt();
|
||||
|
||||
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);
|
||||
|
||||
QString strAliasName = "深度";
|
||||
if("depthObject" == strType)
|
||||
{
|
||||
strAliasName = "深度";
|
||||
}
|
||||
else if("plObject" == strType)
|
||||
{
|
||||
strAliasName = "频率统计图";
|
||||
}
|
||||
QString strUnit = "";
|
||||
QColor lineColor=QColor(0,0,0);
|
||||
double width=2;
|
||||
QString strScaleType = "";
|
||||
|
||||
//曲线信息栏
|
||||
FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, m_strTrackName, strLineName, lineColor);
|
||||
formInfo->m_strUuid = m_strUuid;
|
||||
formInfo->m_strAliasName = strAliasName;
|
||||
formInfo->m_strUnit = strUnit;
|
||||
formInfo->m_strScaleType = strScaleType;
|
||||
formInfo->m_strType = strType;
|
||||
formInfo->m_nJg = 2;
|
||||
formInfo->setLineWidth(width);
|
||||
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);
|
||||
}
|
||||
|
||||
void FormTrack::s_addLine(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_addLine";
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ public:
|
|||
public:
|
||||
void Add(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QString strType);
|
||||
|
||||
void setDrawDt(QStringList listdt, float vmax, float vmin);
|
||||
|
||||
QJsonObject makeJson();
|
||||
|
||||
signals:
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ FormWell::FormWell(QWidget *parent, QString strWellName) :
|
|||
|
||||
//曲线选中,置顶
|
||||
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_NewCol(QStringList)), this, SLOT(s_NewCol(QStringList)));
|
||||
}
|
||||
|
||||
FormWell::~FormWell()
|
||||
|
|
@ -39,6 +41,18 @@ FormWell::~FormWell()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
int FormWell::insertColumn(int nw)
|
||||
{
|
||||
auto table = ui->tableWidget;
|
||||
int ncolCount = table->columnCount();
|
||||
table->insertColumn(ncolCount);
|
||||
table->setColumnWidth(ncolCount, nw);
|
||||
|
||||
table->setHorizontalHeaderItem(ncolCount, new QTableWidgetItem(""));
|
||||
// ncolCount = table->columnCount();
|
||||
return ncolCount;
|
||||
}
|
||||
|
||||
void FormWell::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName)
|
||||
{
|
||||
//选中了曲线置顶
|
||||
|
|
@ -153,8 +167,8 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa
|
|||
//ui->tableWidget->update();
|
||||
|
||||
// 设置右键菜单策略
|
||||
// ui->tableWidget_2->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
// connect(ui->tableWidget_2, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)));
|
||||
// ui->tableWidget_2->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
// connect(ui->tableWidget_2, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)));
|
||||
}
|
||||
|
||||
void FormWell::s_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName)
|
||||
|
|
@ -240,18 +254,98 @@ void FormWell::setRowHeight(double dHight, QProgressBar *progressBar, int iSplit
|
|||
{
|
||||
if( ui->tableWidget->cellWidget(1, i) != nullptr )
|
||||
{
|
||||
auto myWidget = ui->tableWidget->cellWidget(2, i);
|
||||
//
|
||||
FormDraw *formDraw = (FormDraw*)myWidget;//获得widget
|
||||
if(formDraw)
|
||||
{
|
||||
//progressBar->setValue(iBeginValue+ i*iSplitWell); // 更新进度条的值
|
||||
formDraw->setRowHeight(dHight, progressBar, iSplitWell);
|
||||
}
|
||||
auto myWidget = ui->tableWidget->cellWidget(2, i);
|
||||
//
|
||||
FormDraw *formDraw = (FormDraw*)myWidget;//获得widget
|
||||
if(formDraw)
|
||||
{
|
||||
//progressBar->setValue(iBeginValue+ i*iSplitWell); // 更新进度条的值
|
||||
formDraw->setRowHeight(dHight, progressBar, iSplitWell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormWell::s_NewCol(QStringList listdt)
|
||||
{
|
||||
QString strUuid = listdt.at(0);
|
||||
QString strWellName = listdt.at(1);
|
||||
QString strSlfName = listdt.at(2);
|
||||
QString strLineName = listdt.at(3);
|
||||
QString strType = listdt.at(4);
|
||||
int nW = listdt.at(5).toInt();
|
||||
|
||||
//判断当前井是否与自己同名
|
||||
if(strUuid != m_strUuid || strWellName != m_strWellName)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(nW <= 0)
|
||||
nW = g_iOneWidth;
|
||||
|
||||
//增加1列
|
||||
int columnCount = this->insertColumn(nW);
|
||||
|
||||
//道名
|
||||
QString strTrackName = "道" + QString::number(columnCount+1);
|
||||
if(strType == "depthObject")
|
||||
strTrackName = "深度";
|
||||
|
||||
FormTrack *formTrack = NULL;
|
||||
//总行数
|
||||
for(int i = 0; i< 3; i++)
|
||||
{
|
||||
if(i==0)
|
||||
{
|
||||
//设置高度
|
||||
ui->tableWidget->setRowHeight(i, 100);
|
||||
//
|
||||
QTableWidgetItem* item = new QTableWidgetItem(strTrackName);
|
||||
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
|
||||
item->setTextAlignment(Qt::AlignCenter); //设置文本居中
|
||||
ui->tableWidget->setItem(i, columnCount, item);
|
||||
}
|
||||
else if(i==1)
|
||||
{
|
||||
//设置高度
|
||||
ui->tableWidget->setRowHeight(i, 300);
|
||||
|
||||
//曲线名称栏
|
||||
formTrack = new FormTrack(this, m_strWellName, strTrackName);
|
||||
formTrack->m_strUuid = m_strUuid;
|
||||
formTrack->show();
|
||||
ui->tableWidget->setCellWidget(i, columnCount, formTrack);
|
||||
}
|
||||
else if(i==2)
|
||||
{
|
||||
double dHight = 0;
|
||||
dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm;
|
||||
if(g_iShow==1)
|
||||
{
|
||||
//显示刻度
|
||||
dHight = dHight+30;
|
||||
}
|
||||
if(dHight>32767)
|
||||
{
|
||||
dHight = 32767;
|
||||
}
|
||||
|
||||
//设置高度
|
||||
ui->tableWidget->setRowHeight(i, (int)dHight);//7582
|
||||
//曲线绘制栏
|
||||
FormDraw *formDraw = new FormDraw(this, m_strWellName, strTrackName);
|
||||
formDraw->m_strUuid = m_strUuid;
|
||||
formDraw->m_formTrack = formTrack;
|
||||
formDraw->setDrawData(listdt);
|
||||
|
||||
ui->tableWidget->setCellWidget(i, columnCount, formDraw);
|
||||
}
|
||||
}
|
||||
// emit CallManage::getInstance()->sig_AddDepth(m_strUuid, strSlfName, strWellName, strTrackName, strLineName, nW);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject FormWell::makeJson()
|
||||
{
|
||||
// 创建根对象
|
||||
|
|
@ -267,17 +361,17 @@ QJsonObject FormWell::makeJson()
|
|||
{
|
||||
if( ui->tableWidget->cellWidget(1, i) != nullptr )
|
||||
{
|
||||
auto myWidget = ui->tableWidget->cellWidget(1, i);
|
||||
//
|
||||
FormTrack *formTrack = (FormTrack*)myWidget;//获得widget
|
||||
if(formTrack)
|
||||
{
|
||||
//options
|
||||
QJsonObject formTrackObj;
|
||||
formTrackObj["id"] = i;
|
||||
formTrackObj["info"] = formTrack->makeJson();
|
||||
subcaseArray.append(formTrackObj);
|
||||
}
|
||||
auto myWidget = ui->tableWidget->cellWidget(1, i);
|
||||
//
|
||||
FormTrack *formTrack = (FormTrack*)myWidget;//获得widget
|
||||
if(formTrack)
|
||||
{
|
||||
//options
|
||||
QJsonObject formTrackObj;
|
||||
formTrackObj["id"] = i;
|
||||
formTrackObj["info"] = formTrack->makeJson();
|
||||
subcaseArray.append(formTrackObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
rootObj["formTracks"]=subcaseArray;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ public:
|
|||
explicit FormWell(QWidget *parent = nullptr, QString strWellName="");
|
||||
~FormWell();
|
||||
|
||||
// 插入列,返回列索引
|
||||
int insertColumn(int nw);
|
||||
|
||||
private:
|
||||
Ui::FormWell *ui;
|
||||
|
||||
|
|
@ -31,6 +34,8 @@ public:
|
|||
void setRowHeight(double dHight, QProgressBar *progressBar, int iSplit);
|
||||
|
||||
public slots:
|
||||
void s_NewCol(QStringList listdt);
|
||||
|
||||
void s_NewTrack(QString strUuid, QString strWellName, QString strSlfName, QString strLineName, QString strType,int nW);
|
||||
//新建空白道,没有曲线
|
||||
void s_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName);
|
||||
|
|
|
|||
|
|
@ -366,7 +366,8 @@ void MainWindowCurve::initToolBar()
|
|||
ui->toolBar->addAction(m_LogMudAc);
|
||||
|
||||
//connect(m_newAc2, &QAction::triggered, this, &MainWindowCurve::s_NewWell);
|
||||
connect(m_depthAc, &QAction::triggered, this, &MainWindowCurve::s_NewDepth);
|
||||
connect(m_depthAc, &QAction::triggered, this, &MainWindowCurve::s_NewDepth);
|
||||
connect(m_pinlvAc, &QAction::triggered, this, &MainWindowCurve::s_pinLvAc);
|
||||
// connect(m_compileAc, &QAction::triggered, this, &MainWindow::s_AddOne);
|
||||
// connect(m_runAc, &QAction::triggered, this, &MainWindow::s_SaveImage);
|
||||
// connect(m_debugAc, &QAction::triggered, this, &MainWindow::s_DrawImg);
|
||||
|
|
@ -659,13 +660,14 @@ void MainWindowCurve::s_NewDepth()
|
|||
{
|
||||
int column = -1;
|
||||
int nW = 100;
|
||||
QString strSlfName = "";
|
||||
QString strLeft = m_leftWidgets->getLeftTreeString();
|
||||
if(strLeft.length() > 0)
|
||||
{
|
||||
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
|
||||
if (list.size() > 3)
|
||||
{
|
||||
// QString strSlfName = list[0];
|
||||
strSlfName = list[0];
|
||||
QString strWellName = list[1];
|
||||
// QString strLineName = list[2];
|
||||
// QString strType = list[3];
|
||||
|
|
@ -714,8 +716,86 @@ void MainWindowCurve::s_NewDepth()
|
|||
//设置列宽
|
||||
ui->tableWidget_2->setColumnWidth(column, iWidth+nW+8);
|
||||
|
||||
QStringList dt;
|
||||
dt << m_strUuid;
|
||||
dt << strWellName;
|
||||
dt << strSlfName;
|
||||
dt << "深度";
|
||||
dt << "depthObject";
|
||||
dt << QString::number(nW);
|
||||
//新建道
|
||||
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, "", "深度", "depthObject", nW);
|
||||
emit CallManage::getInstance()->sig_NewCol(dt);
|
||||
}
|
||||
|
||||
void MainWindowCurve::s_pinLvAc()
|
||||
{
|
||||
int column = -1;
|
||||
int nW = 160;
|
||||
QString strSlfName = "";
|
||||
QString strLeft = m_leftWidgets->getLeftTreeString();
|
||||
if(strLeft.length() > 0)
|
||||
{
|
||||
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
|
||||
if (list.size() > 3)
|
||||
{
|
||||
strSlfName = list[0];
|
||||
QString strWellName = list[1];
|
||||
// QString strLineName = list[2];
|
||||
// QString strType = list[3];
|
||||
|
||||
if(!m_listWell.contains(strWellName))
|
||||
{
|
||||
//井没创建,创建井+道+曲线
|
||||
//新建井
|
||||
s_NewWell(strWellName);
|
||||
m_listWell.push_back(strWellName);
|
||||
|
||||
column= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ui->tableWidget_2->columnCount()==0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int iWidth = 0;
|
||||
if(column < 0)
|
||||
{
|
||||
column = ui->tableWidget_2->currentColumn();//列编号从0开始
|
||||
iWidth = ui->tableWidget_2->columnWidth(column);
|
||||
}
|
||||
|
||||
if(column<0)
|
||||
{
|
||||
//当前没有选中井
|
||||
return;
|
||||
}
|
||||
|
||||
if(column%2==0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
//空白列
|
||||
return;
|
||||
}
|
||||
|
||||
QString strWellName = ui->tableWidget_2->item(0, column)->text();
|
||||
|
||||
//设置列宽
|
||||
ui->tableWidget_2->setColumnWidth(column, iWidth+nW+8);
|
||||
|
||||
QStringList dt;
|
||||
dt << m_strUuid;
|
||||
dt << strWellName;
|
||||
dt << strSlfName;
|
||||
dt << "";
|
||||
dt << "plObject";
|
||||
dt << QString::number(nW);
|
||||
//新建道
|
||||
emit CallManage::getInstance()->sig_NewCol(dt);
|
||||
}
|
||||
|
||||
void MainWindowCurve::s_NewTrackChangeWidth(QString strWellName)
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ public slots:
|
|||
void s_NewTrack();//新建道
|
||||
|
||||
void s_NewDepth(); // 深度
|
||||
|
||||
void s_pinLvAc(); // 频率统计
|
||||
//
|
||||
void s_Save();//保存
|
||||
//void s_Open(QString fileFull);//打开
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user