logplus/logPlus/formtrack.cpp

1095 lines
42 KiB
C++
Raw Normal View History

2025-10-29 17:23:30 +08:00
#include "formtrack.h"
#include "ui_formtrack.h"
#include <QDebug>
#include "CallManage.h"
2025-10-29 17:23:30 +08:00
extern int g_iOneWidth; //道宽
2025-10-29 17:23:30 +08:00
//曲线名称栏(表格)
FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName) :
QWidget(parent),
ui(new Ui::FormTrack)
{
ui->setupUi(this);
m_strWellName = strWellName;
m_strTrackName = strTrackName;
//单元格委托
//m_delegate = new NoLRBorderDelegate();
//隐藏网格线
ui->tableWidget->setShowGrid(false);
//设置样式表竖直边框宽度为0隐藏
ui->tableWidget->setStyleSheet( "QTableView::item {border-left: 0px solid black;} \
QTableView::item:selected {border-left: 0px solid black; color:#57595B; background:#E4E4E4;}\
QTableView::item {border-right: 0px solid black;} \
QTableView::item:selected {border-right: 0px solid black;}");
2025-10-29 17:23:30 +08:00
//表格绑定井名,道名
ui->tableWidget->m_strWellName = strWellName;
ui->tableWidget->m_strTrackName = strTrackName;
//
ui->tableWidget->verticalHeader()->hide();//隐藏左侧系统序号栏
ui->tableWidget->horizontalHeader()->hide();//隐藏上方系统序号栏
//因为tableWidget需要提前规定好行数与列数
int recordcount = 0; //总行数
ui->tableWidget->setColumnCount(1);//总列数
ui->tableWidget->setRowCount(recordcount); //动态设置行数
//设置所有列均匀分布并填充满整个空间
QHeaderView *header = ui->tableWidget->horizontalHeader();
for (int i = 0; i < ui->tableWidget->columnCount(); ++i) {
header->setSectionResizeMode(i, QHeaderView::Stretch);
}
2026-01-23 14:53:34 +08:00
// 设置选择模式为单选模式
ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
//曲线
connect(this, SIGNAL(sig_AddLine(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)),
this, SLOT(s_addLine(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)));
//删除曲线
connect(CallManage::getInstance(), SIGNAL(sig_delLine(QString, QString, QString, QString)),
this, SLOT(s_delLine(QString, QString, QString, QString)));
//表格
connect(this, SIGNAL(sig_AddWave(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addWave(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_delTableLine(QString, QString, QString, QString)),
this, SLOT(s_delTableLine(QString, QString, QString, QString)));
2025-10-29 17:23:30 +08:00
//波列
connect(this, SIGNAL(sig_AddTableLine(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)),
this, SLOT(s_AddTableLine(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)));
// 深度
connect(this, SIGNAL(sig_AddDepth(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addDepth(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
2025-12-25 15:10:14 +08:00
// 杆状图
connect(this, SIGNAL(sig_AddGanZhuangTu(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addGanZhuangTu(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
// 井眼垮塌矢量图
connect(this, SIGNAL(sig_AddJykt(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addJykt(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
// 井斜方位图
connect(this, SIGNAL(sig_AddDenv(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addDenv(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
//岩心图片
connect(this, SIGNAL(sig_AddYanXinImage(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addYanXinImage(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)));
2026-01-04 16:54:55 +08:00
//裂缝
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_AddSantuyibiao(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addSantuyibiao(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
2026-01-04 16:54:55 +08:00
//地质层位道
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)));
//气测/FMT/射孔/文本
connect(this, SIGNAL(sig_AddJiegutext(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addJiegutext(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
2026-01-06 16:03:55 +08:00
//沉积相
connect(this, SIGNAL(sig_AddLogface(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addLogface(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
//多臂井径
connect(this, SIGNAL(sig_AddMCals(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addMCals(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
2026-01-06 16:03:55 +08:00
//套管组件
connect(this, SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString)));
}
void FormTrack::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType)
{
if(m_strUuid == strUuid &&
m_strWellName == strWellName &&
m_strTrackName == strTrackName &&
iTableType==3)
{
//
}
else {
//取消表格选中状态
ui->tableWidget->clearSelection();
}
2025-10-29 17:23:30 +08:00
}
FormTrack::~FormTrack()
{
delete ui;
}
//
// void FormTrack::setTrackPropert(QJsonObject trackObj)
// {
// if (!trackObj.contains("formInfos"))
// return;
//
// QJsonValue value = trackObj.value("formInfos");
// if (!value.isArray())
// return;
//
// QJsonArray linesArray = value.toArray();
//
// int iCount = linesArray.size();
// ui->tableWidget->setRowCount(iCount);
// for (int i = 0; i < iCount; i++)
// {
// //按照id顺序展示曲线
// QJsonValue lineValue = linesArray[i];
// QJsonObject lineObj = lineValue.toObject();
// QString strSlfName = lineObj.value("SlfName").toString();
// QString strLineName = lineObj.value("LineName").toString();
// QColor lineColor;
// lineColor.setNamedColor(lineObj.value("lineColor").toString());
// FormInfo *formInfo = new FormInfo(this, strSlfName, m_strWellName, m_strTrackName, strLineName, lineColor);
// formInfo->m_strUuid = m_strUuid;
// formInfo->initProperty(lineObj);
//
// ui->tableWidget->setRowHeight(i, 100);
// ui->tableWidget->setCellWidget(i, 0, formInfo);
//
// }
// }
2025-10-29 17:23:30 +08:00
void FormTrack::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, QStringList listOtherProperty)
2025-10-29 17:23:30 +08:00
{
qDebug()<< "Add";
if(strType=="curveObject")
{
emit sig_AddLine(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType, listOtherProperty);
}
else if(strType=="waveObject")
{
emit sig_AddWave(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
else if(strType=="tableObject")
{
//新建表格曲线
emit sig_AddTableLine(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType, listOtherProperty);
}
else if(strType=="depthObject")
{
emit sig_AddDepth(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
2025-12-25 15:10:14 +08:00
else if(strType=="ganzhuangtuObject")
{
emit sig_AddGanZhuangTu(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
else if(strType=="JyktObject")
{
emit sig_AddJykt(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
else if(strType=="DenvObject")
{
emit sig_AddDenv(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
// else if(strType=="yanxinImageObject")
// {
// emit sig_AddYanXinImage(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
// }
else if(strType=="DrawImageObject")
{
emit sig_AddDrawImage(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
2026-01-04 16:54:55 +08:00
else if(strType=="CrackObject")
{
emit sig_AddCrack(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
else if(strType=="SantuyibiaoObject")
{
emit sig_AddSantuyibiao(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
2026-01-04 16:54:55 +08:00
}
else if(strType=="GeoSectionObject")
{
emit sig_AddGeoSection(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
else if(strType=="JiegutextObject")
{
emit sig_AddJiegutext(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
2026-01-06 16:03:55 +08:00
else if(strType=="LogfaceObject")
{
emit sig_AddLogface(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
else if(strType=="MCalsObject")
{
emit sig_AddMCals(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
2026-01-06 16:03:55 +08:00
}
else if(strType=="TubingstringObject")
{
emit sig_AddTubingstring(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
}
2025-10-29 17:23:30 +08:00
}
FormInfo* FormTrack::setDrawDt(QStringList listdt, QJsonObject obj)
{
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);
QString strAliasName = "";
if (obj.contains("AliasName"))
{
strAliasName = obj.value("AliasName").toString();
}
else
{
if ("depthObject" == strType)
{
strAliasName = "深度";
}
else if ("plObject" == strType)
{
strAliasName = "频率统计图";
}
else if ("roseObject" == strType)
{
strAliasName = "玫瑰图";
}
else if ("dcaObject" == strType)
{
strAliasName = "裂缝检测";
}
else if ("tdtObject" == strType)
{
strAliasName = "TDT";
}
}
QColor lineColor=QColor(0,0,0);
double width=2;
QString strScaleType = "";
//曲线信息栏
FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, m_strTrackName, strLineName, lineColor);
formInfo->initProperty(obj);
formInfo->m_strUuid = m_strUuid;
formInfo->m_strAliasName = strAliasName;
formInfo->m_strScaleType = strScaleType;
formInfo->m_strType = strType;
formInfo->m_nJg = 2;
formInfo->setLineWidth(width);
//设置高度
ui->tableWidget->setRowHeight(row, 100);
//单元格委托
//ui->tableWidget->setItemDelegateForRow(row, m_delegate);
//
ui->tableWidget->setCellWidget(row, 0, formInfo);
return 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, QStringList listOtherProperty)
2025-10-29 17:23:30 +08:00
{
qDebug() << "FormTrack s_addLine";
ui->tableWidget->m_strUuid = m_strUuid;
2025-10-29 17:23:30 +08:00
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);
2025-10-29 17:23:30 +08:00
//曲线信息栏
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 = "curveObject";
2025-10-29 17:23:30 +08:00
formInfo->setLineWidth(dWidth);
formInfo->setVMax(vmax);
formInfo->setVMin(vmin);
formInfo->setFrontColor(QColor(0,0,0));
formInfo->setBackColor(QColor(255,255,255));
//
if(listOtherProperty.size()>=3)
{
QFont curveNameFont("微软雅黑", 10); // 名称字体
curveNameFont.fromString(listOtherProperty[2]);
formInfo->m_curveNameFont = curveNameFont;
}
if(listOtherProperty.size()>=7)
{
if(listOtherProperty[3]=="DrawLine")
{
formInfo->m_bDrawLine = true;
}
else
{
formInfo->m_bDrawLine = false;
}
//
if(listOtherProperty[4]=="DrawGan")
{
formInfo->m_bDrawGan = true;
}
else
{
formInfo->m_bDrawGan = false;
}
//
if(listOtherProperty[5]=="DrawPoint")
{
formInfo->m_bDrawPoint = true;
}
else
{
formInfo->m_bDrawPoint = false;
}
//
if(listOtherProperty[6]=="DrawSymmetry")
{
formInfo->m_bDrawSymmetry = true;
}
else
{
formInfo->m_bDrawSymmetry = false;
}
}
2025-10-29 17:23:30 +08:00
//设置高度
ui->tableWidget->setRowHeight(row, 100);
//单元格委托
//ui->tableWidget->setItemDelegateForRow(row, m_delegate);
2025-10-29 17:23:30 +08:00
//
ui->tableWidget->setCellWidget(row, 0, formInfo);
2025-10-29 17:23:30 +08:00
//------------------------------------
// QFont font("微软雅黑", 10, QFont::Bold, false);
// //
// QTableWidgetItem* item = new QTableWidgetItem(strLineName);
// item->setFlags(item->flags() & (~Qt::ItemIsEditable));
// item->setForeground(QBrush(lineColor));// 设置字体颜色
// item->setFont(font); // 应用新的字体
// item->setTextAlignment(Qt::AlignCenter);//居中
// //
// ui->tableWidget->setItem(row, 0, item);
}
void FormTrack::s_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName)
{
//井名&道名不一致
if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName)
{
}
else
{
return;
}
//
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 = qobject_cast<FormInfo*>(myWidget);//获得widget
if(formInfo)
{
if(strUuid == formInfo->m_strUuid
&& formInfo->m_strWellName == strWellName
&& formInfo->m_strTrackName == strTrackName
&& formInfo->m_strLineName == strLineName)
{
ui->tableWidget->removeRow(i);
}
}
}
}
}
void FormTrack::s_delTableLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName)
{
//井名&道名不一致
if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName)
{
}
else
{
return;
}
//
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 = qobject_cast<FormInfo*>(myWidget);//获得widget
if(formInfo)
{
if(strUuid == formInfo->m_strUuid
&& formInfo->m_strWellName == strWellName
&& formInfo->m_strTrackName == strTrackName
&& formInfo->m_strLineName == strLineName)
{
ui->tableWidget->removeRow(i);
}
}
}
}
}
void FormTrack::s_addWave(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_addWave";
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 = "waveObject";
formInfo->setLineWidth(dWidth);
formInfo->setVMax(vmax);
formInfo->setVMin(vmin);
2026-02-05 14:53:44 +08:00
formInfo->m_nDrawType = 2;
formInfo->m_nFillType = 1;
formInfo->m_curveNameFont = QFont("黑体", 12);
formInfo->m_curveUnitFont = QFont("黑体", 10);
formInfo->m_curveScaleFont = QFont("黑体", 10);
formInfo->m_fMaxAmp = 1023.0f;
//设置高度
ui->tableWidget->setRowHeight(row, 100);
//单元格委托
//ui->tableWidget->setItemDelegateForRow(row, m_delegate);
//
ui->tableWidget->setCellWidget(row, 0, formInfo);
}
void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty)
{
2025-12-22 18:22:45 +08:00
if(strLineName == "FRAC_HOLE.TABLE" || strLineName == "WORDS_RELUST" || strLineName == "RESULT"
2025-12-23 17:15:39 +08:00
|| strLineName == "GEO_LITH" || strLineName == "SWALL_CORE"
2025-12-25 15:10:14 +08:00
|| strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT"
|| strLineName == "CORE_PHYSICS" || strLineName == "IMAGE_DATA")
{
}
else
{
return;
}
qDebug() << "FormTrack s_AddTableLine";
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 = "tableObject";
formInfo->setLineWidth(dWidth);
formInfo->setVMax(vmax);
formInfo->setVMin(vmin);
formInfo->setFrontColor(QColor(0,0,0));
formInfo->setBackColor(QColor(255,255,255));
if(strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT"
|| strLineName == "SWALL_CORE")
{
//固井结论/ 井壁取心
if(listOtherProperty.size()>=3)
{
QFont curveNameFont("微软雅黑", 10); // 名称字体
curveNameFont.fromString(listOtherProperty[2]);
formInfo->m_curveNameFont = curveNameFont;
}
}
//设置高度
ui->tableWidget->setRowHeight(row, 100);
//单元格委托
//ui->tableWidget->setItemDelegateForRow(row, m_delegate);
//
ui->tableWidget->setCellWidget(row, 0, formInfo);
//------------------------------------
// QFont font("微软雅黑", 10, QFont::Bold, false);
// //
// QTableWidgetItem* item = new QTableWidgetItem(strLineName);
// item->setFlags(item->flags() & (~Qt::ItemIsEditable));
// item->setForeground(QBrush(lineColor));// 设置字体颜色
// item->setFont(font); // 应用新的字体
// item->setTextAlignment(Qt::AlignCenter);//居中
// //
// ui->tableWidget->setItem(row, 0, item);
}
2025-10-29 17:23:30 +08:00
void FormTrack::s_addDepth(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_addDepth";
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 = "depthObject";
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);
}
2025-12-25 15:10:14 +08:00
void FormTrack::s_addGanZhuangTu(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_addGanZhuangTu";
2025-12-25 15:10:14 +08:00
ui->tableWidget->m_strUuid = m_strUuid;
int row = ui->tableWidget->rowCount();
ui->tableWidget->setRowCount(row + 1);
2025-12-25 15:10:14 +08:00
//避免出现小滚动条
//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 = "ganzhuangtuObject";
2025-12-25 15:10:14 +08:00
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);
}
void FormTrack::s_addJykt(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_addJykt";
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 = "JyktObject";
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);
}
void FormTrack::s_addDenv(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_addDenv";
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 = "JyktObject";
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);
}
void FormTrack::s_addYanXinImage(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_addYanXinImage";
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 = "yanxinImageObject";
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);
}
void FormTrack::s_addDrawImage(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_addDrawImage";
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 = "DrawImageObject";
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);
}
//斜井三图一表
void FormTrack::s_addSantuyibiao(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_addSantuyibiao";
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 = "SantuyibiaoObject";
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);
}
2026-01-04 16:54:55 +08:00
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);
}
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);
2026-01-06 16:03:55 +08:00
//
ui->tableWidget->setCellWidget(row, 0, formInfo);
}
void FormTrack::s_addJiegutext(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_addJiegutext";
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 = "JiegutextObject";
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);
}
//沉积相
2026-01-06 16:03:55 +08:00
void FormTrack::s_addLogface(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_addLogface";
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 = "LogfaceObject";
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);
}
//多臂井径
void FormTrack::s_addMCals(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_addMCals";
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 = "MCalsObject";
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);
}
//套管
void FormTrack::s_addTubingstring(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_addTubingstring";
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 = "TubingstringObject";
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);
}
void FormTrack::s_addTDT(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_addTDT";
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 = "TDTObject";
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);
}
2026-01-04 16:54:55 +08:00
2025-10-29 17:23:30 +08:00
QJsonObject FormTrack::makeJson()
{
// 创建根对象
QJsonObject rootObj;
//
rootObj["WellName"] = m_strWellName;
// rootObj["TrackName"] = m_strTrackName;
2025-10-29 17:23:30 +08:00
// 创建JSON数组并填充数据
QJsonArray subcaseArray;
//
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 = qobject_cast<FormInfo*>(myWidget);//获得widget
2025-10-29 17:23:30 +08:00
if(formInfo)
{
//options
QJsonObject formInfoObj;
formInfoObj["id"] = i;
formInfoObj["info"] = formInfo->makeJson();
subcaseArray.append(formInfoObj);
}
}
}
rootObj["formInfos"]=subcaseArray;
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;
}