1校深工具条,追加深度分段平移校正功能。 2.左侧树图,井次和表格、曲线追加深度移动右键菜单。

This commit is contained in:
jiayulong 2026-01-20 17:20:17 +08:00
parent 1375eba120
commit 9e076cc17e
8 changed files with 300 additions and 22 deletions

View File

@ -38,8 +38,9 @@ signals:
void sig_CloseProject();//关闭项目
void sig_ShowCurve(QString strSlfName, QString strName);//曲线数据查看
void sig_DepthShift(QString strSlfName, QString strName, double DepthOffset);//深度移动
void sig_ShowTable(QString strSlfName, QString strName);//表格数据查看
void sig_WelllogInformation(QString strSlfName, QString strName);//编辑测井信息
void sig_WelllogInformation(QString strSlfName);//编辑测井信息
// 0.Uuid 1.WellName 2.SlfName 3.lineName 4.Type 5.W
void sig_NewCol(QStringList listdt);

View File

@ -87,7 +87,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(CallManage::getInstance(), SIGNAL(sig_ShowTable(QString, QString)), this, SLOT(s_ShowTable(QString, QString)));
//关联信号槽,测井信息表数据查看
connect(CallManage::getInstance(), SIGNAL(sig_WelllogInformation(QString, QString)), this, SLOT(s_WelllogInformation(QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_WelllogInformation(QString)), this, SLOT(s_WelllogInformation(QString)));
}
MainWindow::~MainWindow()
@ -519,7 +519,7 @@ void MainWindow::s_ShowTable(QString strSlfName, QString strName)
}
//编辑测井信息
void MainWindow::s_WelllogInformation(QString strSlfName, QString strName)
void MainWindow::s_WelllogInformation(QString strSlfName)
{
if(m_centerWidgets)
{

View File

@ -91,7 +91,7 @@ public slots:
void s_ShowCurve(QString strSlfName, QString strName);//曲线数据查看
void s_ShowTable(QString strSlfName, QString strName);//表格数据查看
void s_WelllogInformation(QString strSlfName, QString strName);//编辑测井信息
void s_WelllogInformation(QString strSlfName);//编辑测井信息
};

View File

@ -116,6 +116,7 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
//曲线选中,置顶
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int)));
//图头
m_dock1=new QDockWidget(tr(""),this);
m_dock1->setFeatures(QDockWidget::NoDockWidgetFeatures);//QDockWidget::DockWidgetMovable
@ -617,9 +618,171 @@ void MainWindowCurve::s_Shift()
}
}
void MainWindowCurve::MoveShift(QString strSlfName, QString strLineName, float sdep,float edep,float delta)
{
if(sdep>=edep&&delta==0) return;
if(strSlfName=="") return;
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
//AppendConsole(pai::log::PAI_ERROR,"SLF文件打开失败请检查");
return;
}
int curveindex=logio->FindObjectName((char*)strLineName.toStdString().c_str());
if(curveindex<0)
{
delete logio;
return;
}
CString szBuffer="";
if(sdep==edep&&sdep==-9999.0) {
szBuffer=QString::number(delta,'f',3)+"\r\n";
WriteShiftMessage(*logio,szBuffer,strLineName);
logio->CorrectObjectDepth(curveindex,delta);
delete logio;
// if(isRun) {
// isLoad=false;
// LoadFromSLF();
// }
return;
}
curveindex=logio->OpenChannel(strLineName.toStdString().c_str());
if(curveindex>-1) {
szBuffer.Format("%10.3f %10.3f %10.3f\r\n",sdep,edep,delta);
WriteShiftMessage(*logio,szBuffer,strLineName);
logio->MoveDepth(curveindex,sdep,edep,delta);
}
else {
int ObjectType=logio->GetObjectType(strLineName.toStdString().c_str());
float sdeps[2],edeps[2];
sdeps[0]=sdep;
edeps[0]=sdep+delta;
sdeps[1]=edep;
edeps[1]=edep+delta;
szBuffer.Format("%10.3f %10.3f\r\n%10.3f %10.3f\r\n",sdeps[0],edeps[0],sdeps[1],edeps[1]);
WriteShiftMessage(*logio,szBuffer,strLineName);
if(ObjectType >CARD_OBJECT||ObjectType==0)
{
int index=logio->OpenTable(strLineName.toStdString().c_str());
if(index>-1)
{
logio->EShiftTableDepth((char*)strLineName.toStdString().c_str(),2,sdeps,edeps);
}
}
else if(ObjectType==CARD_OBJECT) {
logio->EshiftStreamDepth((char *)strLineName.toStdString().c_str(),2,sdeps,edeps);
}
}
delete logio;
// if(isRun) {
// isLoad=false;
// LoadFromSLF();
// }
}
void MainWindowCurve::slotRun()
{
double depthshift=spinbox3->text().toFloat();
if(depthshift==0) return;
float sdep=spinbox1->text().toFloat();
float edep=spinbox2->text().toFloat();
if(sdep>edep) {
float depp=sdep;
sdep=edep;
edep=sdep;
}
if(m_SelectTableItem.m_iTableType==2)
{
//道
QStringList listLine = getLineList(m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName);
if(listLine.size()>0)
{
for(int i=0; i<listLine.size(); i++)
{
//单条曲线校深
MoveShift(m_SelectTableItem.m_strSlfName, listLine[i], sdep, edep, depthshift);
}
}
else
{
QMessageBox::warning(this, "提示", "道内曲线对象为空,无对象可校正!");
return;
}
}
else if(m_SelectTableItem.m_iTableType==3)
{
//单条曲线校深
MoveShift(m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strLineName, sdep, edep, depthshift);
}
}
void MainWindowCurve::s_MoveShift()
{
if(m_SelectTableItem.m_iTableType==0) {
QMessageBox::warning(this, "提示", "请选择要校正的对象!");
return;
}
if(m_SelectTableItem.m_iTableType==1) {
QMessageBox::warning(this, "提示", "该功能不支持对井次校正,如果需要井次校正请到数据树上进行!");
return;
}
if(m_SelectTableItem.m_iTableType==2 || m_SelectTableItem.m_iTableType==3)
{
//道,曲线
QDialog dialog(NULL);
dialog.setModal(false);
Qt::WindowFlags flags = dialog.windowFlags();
flags |= Qt::WindowStaysOnTopHint;
flags &= ~Qt::WindowContextHelpButtonHint;
dialog.setWindowFlags(flags);
dialog.setWindowTitle("深度分段平移");
QFormLayout form(&dialog);
form.addWidget(new QLabel("输入深度参数:"));
// Value1
QString value1 = QString("起始深度: ");
spinbox1 = new QLineEdit(&dialog);
if(1) {
float yGeoNormal =-g_iY2;
spinbox1->setText(toString(((int)(yGeoNormal*10+0.5))/10.0));
}
else spinbox1->setText("-9999.0");
form.addRow(value1, spinbox1);
value1 = QString("终止深度: ");
spinbox2 = new QLineEdit(&dialog);
form.addRow(value1, spinbox2);
if(1)
{
spinbox2->setText(toString(-g_iY1));
}
else spinbox2->setText("-9999.0");
value1 = QString("移动量(上移-,下移+): ");
spinbox3 = new QLineEdit(&dialog);
form.addRow(value1, spinbox3);
spinbox3->setText("0");
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal, &dialog);
//m_ButtonBox=&buttonBox;
form.addWidget(&buttonBox);
//m_LOGS=logs;
//QObject::connect(spinbox1, SIGNAL(returnPressed()), this, SLOT(slotSetDep()));
//QObject::connect(spinbox2, SIGNAL(returnPressed()), this, SLOT(slotSetDep()));
QObject::connect(buttonBox.button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(slotRun()));
QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
buttonBox.button(QDialogButtonBox::Ok)->setAutoDefault(false);
//slotSetDep();
dialog.show();
if (dialog.exec() == QDialog::Accepted) {
// Do something here
}
}
}
QStringList MainWindowCurve::insertCol(int nW)

View File

@ -76,6 +76,10 @@ public:
QtProjectWidgets *m_leftWidgets = NULL; //左侧工程区
QLineEdit *spinbox1;
QLineEdit *spinbox2;
QLineEdit *spinbox3;
public:
//展示所有井
void DisplayWells(QJsonArray wellsArray);
@ -157,8 +161,9 @@ public slots:
//校深
void ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset);
void s_Shift(); // 整体深度平移校正
void s_MoveShift(); // 深度分段平移校正
void MoveShift(QString strSlfName, QString strLineName, float sdep,float edep,float delta);
void s_MoveShift(); // 深度分段平移校正
void slotRun();
//
void s_showHeadTable(); //显示/隐藏图头

View File

@ -25,7 +25,7 @@ QString QMyTreeWidget::getCurrentItemString()
}
QString strTreeTag = item->data(0, Qt::UserRole).toString();
if (strTreeTag == "wellItem")
if (strTreeTag == "wellItem")//井次名称
{
//曲线
QString strSlfName = item->data(0, Qt::UserRole+1).toString();

View File

@ -424,7 +424,7 @@ void QtProjectWidgets::loadWellTree(QTreeWidgetItem *parent, QString fileFull, Q
QTreeWidgetItem *itemwell = new QTreeWidgetItem();
itemwell->setText(0, wellname);
itemwell->setData(0, Qt::UserRole, "wellItem"); // 存储额外数据如ID
itemwell->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,井次文件路径
itemwell->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,slf文件路径
//
QIcon iconwell;
iconwell.addPixmap(QPixmap(":/image/left_index.png"), QIcon::Selected);
@ -627,13 +627,13 @@ void QtProjectWidgets::initMenu()
void QtProjectWidgets::initRootTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
m_action_New = new QAction("新建项目", treeWidget);
m_action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
m_action_New->setIcon(QIcon(GetImagePath() + "newproject.png")); // 设置图标
connect(m_action_New, SIGNAL(triggered(bool)), this, SLOT(onNewProject(bool)));
menu->addAction(m_action_New);
//
m_action_Open = new QAction("打开项目", treeWidget);
m_action_Open->setIcon(QIcon(":/image/u174.png")); // 设置图标
m_action_Open->setIcon(QIcon(GetImagePath() + "openproject.png")); // 设置图标
connect(m_action_Open, SIGNAL(triggered(bool)), this, SLOT(onOpenProject(bool)));
menu->addAction(m_action_Open);
@ -643,40 +643,50 @@ void QtProjectWidgets::initRootTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
void QtProjectWidgets::initCurveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
m_action_ShowCurve = new QAction("数据查看", treeWidget);
m_action_ShowCurve->setIcon(QIcon(":/image/u174.png")); // 设置图标
m_action_ShowCurve->setIcon(QIcon(GetImagePath() + "icon/Sheet.png")); // 设置图标":/image/u174.png"
connect(m_action_ShowCurve, SIGNAL(triggered(bool)), this, SLOT(onShowCurve(bool)));
menu->addAction(m_action_ShowCurve);
//
m_action_DepthShift = new QAction("深度移动", treeWidget);
m_action_DepthShift->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); // 设置图标
connect(m_action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool)));
menu->addAction(m_action_DepthShift);
}
//初始化表格对象-右键菜单
void QtProjectWidgets::initTableObjectTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_TableObject = new QAction("数据查看", treeWidget);
action_TableObject->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_TableObject->setIcon(QIcon(GetImagePath() + "icon/Sheet.png")); // 设置图标
connect(action_TableObject, SIGNAL(triggered(bool)), this, SLOT(onShowTable(bool)));
menu->addAction(action_TableObject);
//
QAction* action_DepthShift = new QAction("深度移动", treeWidget);
action_DepthShift->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); // 设置图标
connect(action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool)));
menu->addAction(action_DepthShift);
}
//初始化根节点(井名称)-右键菜单
void QtProjectWidgets::initWellNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_New = new QAction("导入数据", treeWidget);
action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_New->setIcon(QIcon(GetImagePath() + "wellog.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSingleWellLogData()));
menu->addAction(action_New);
action_New = new QAction("导入离散数据", treeWidget);
action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_New->setIcon(QIcon(GetImagePath() + "icon/intable.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSlfTable()));
menu->addAction(action_New);
action_New = new QAction("编辑井基本信息", treeWidget);
action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_New->setIcon(QIcon(GetImagePath() + "icon/Edit.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onEditWelllogRound()));
menu->addAction(action_New);
action_New = new QAction("输出数据", treeWidget);
action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound()));
menu->addAction(action_New);
}
@ -685,16 +695,22 @@ void QtProjectWidgets::initWellNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget
void QtProjectWidgets::initSlfNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_New = new QAction("编辑测井信息", treeWidget);
action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_New->setIcon(QIcon(GetImagePath() + "icon/Edit.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onWelllogInformation()));
menu->addAction(action_New);
//
QAction* action_DepthShift = new QAction("深度移动", treeWidget);
action_DepthShift->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); // 设置图标
connect(action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift_Well(bool)));
menu->addAction(action_DepthShift);
}
//初始化根节点(表目录)-右键菜单
void QtProjectWidgets::initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_New = new QAction("创建新表", treeWidget);
action_New->setIcon(QIcon(":/image/u174.png")); // 设置图标
action_New->setIcon(QIcon(GetImagePath() + "icon/CreateTable.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCreateNewTable()));
menu->addAction(action_New);
}
@ -753,6 +769,47 @@ void QtProjectWidgets::onShowCurve(bool checked)
emit CallManage::getInstance()->sig_ShowCurve(m_strSlfName, m_strCurveObjectName);
}
//深度移动
void QtProjectWidgets::onDepthShift(bool checked)
{
//道,曲线
bool ok=0;
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
if(!ok) return;
if(depthshift==0) return;
if(depthshift>10)
{
int flag = QMessageBox::warning(this->parentWidget(),"提示",QString("深度移动量 =")+QString::number(depthshift)+"m\n"+"\n您确定执行校正?",
QMessageBox::Yes,QMessageBox::No);
if(flag==QMessageBox::No)
{
return;
}
}
//emit CallManage::getInstance()->sig_DepthShift(m_strSlfName, m_strCurveObjectName, depthshift);
//1.修改内存数据
if(m_strSlfName=="") return ;
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(m_strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
//AppendConsole(pai::log::PAI_ERROR,"SLF文件打开失败请检查");
return ;
};
bool isok=0;
//TODO 目前对于表格类,参数卡类不支持,会崩溃
int curveindex=logio->FindObjectName((char *)m_strCurveObjectName.toStdString().c_str());
if(curveindex>=0) {
CString szBuffer="";
szBuffer=QString::number(depthshift,'f',3)+"\r\n";
WriteShiftMessage(*logio,szBuffer,m_strCurveObjectName);
logio->CorrectObjectDepth(curveindex, depthshift);
isok=1;
}
delete logio;
}
//表格数据查看
void QtProjectWidgets::onShowTable(bool checked)
{
@ -762,7 +819,7 @@ void QtProjectWidgets::onShowTable(bool checked)
//编辑测井信息
void QtProjectWidgets::onWelllogInformation()
{
emit CallManage::getInstance()->sig_WelllogInformation(m_strSlfName, m_strCurveObjectName);
emit CallManage::getInstance()->sig_WelllogInformation(m_strSlfName);
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
QTreeWidgetItem *parentItem = pItem;
@ -791,6 +848,53 @@ void QtProjectWidgets::onWelllogInformation()
}
}
//深度移动(井次)
void QtProjectWidgets::onDepthShift_Well(bool checked)
{
//道,曲线
bool ok=0;
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
if(!ok) return;
if(depthshift==0) return;
if(depthshift>10)
{
int flag = QMessageBox::warning(this->parentWidget(),"提示",QString("深度移动量 =")+QString::number(depthshift)+"m\n"+"\n您确定执行校正?",
QMessageBox::Yes,QMessageBox::No);
if(flag==QMessageBox::No)
{
return;
}
}
//emit CallManage::getInstance()->sig_DepthShift(m_strSlfName, m_strCurveObjectName, depthshift);
//1.修改内存数据
if(m_strSlfName=="") return ;
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(m_strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
return ;
};
int Count=logio->GetObjectCount();
char objname[100];
for(int i=0;i<Count;i++) {
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue;
logio->GetObjectName(i,objname);
int index=logio->OpenChannel(objname);
if(index==-1) continue;
int iIndex=logio->FindObjectName(objname);
if(iIndex>-1)
{
logio->CorrectObjectDepth(iIndex,depthshift);
}
CString szBuffer="";
szBuffer=QString::number(depthshift,'f',3);
szBuffer+="\r\n";
WriteShiftMessage(*logio,szBuffer,objname);
}
delete logio;
}
//创建新表
void QtProjectWidgets::onCreateNewTable()
{
@ -966,15 +1070,15 @@ void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index)
}
else if (strTreeTag == "wellItem")
{
//根节点(项目名称)-右键菜单
//井次名称-右键菜单
popMenu = _menuSlfName;
m_strSlfName = item->data(0, Qt::UserRole+1).toString();
}
else if (strTreeTag == "Sheet")
{
//根节点(项目名称)-右键菜单
//表格数据-右键菜单
popMenu = _menuTableFolder;
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点井次获取slf
}
//

View File

@ -40,13 +40,17 @@ public slots:
//曲线
void onShowCurve(bool checked = false); //数据查看
void onDepthShift(bool checked = false); //深度移动
//表格
void onShowTable(bool checked = false); //数据查看
void onEditWelllogRound();
void onImportSingleWellLogData();
void onImportSlfTable();
void onOutWellLogRound();
//井次
void onWelllogInformation(); //编辑测井信息
void onDepthShift_Well(bool checked = false); //深度移动
//表格数据 根节点
void onCreateNewTable(); //创建新表
public:
//初始化树图控件
@ -69,6 +73,7 @@ public:
//曲线对象(AC、BS...)-右键菜单
QAction* m_action_ShowCurve;
QAction* m_action_DepthShift;
QString m_strSlfName;
QString m_strCurveObjectName;