2025-10-29 17:23:30 +08:00
|
|
|
|
#include "qtprojectwidgets.h"
|
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
#include <QFuture>
|
|
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
|
|
|
|
|
#include <functional> // 需要包含这个头文件来使用 std::bind
|
|
|
|
|
|
#include <QMainWindow>
|
2025-12-02 15:23:42 +08:00
|
|
|
|
#include "mainwindow.h"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
#include "InDefTableDlg.h"
|
|
|
|
|
|
#include "qtcommonclass.h"
|
|
|
|
|
|
#include "CallManage.h"
|
2026-04-10 06:38:45 +08:00
|
|
|
|
#include "qmytreewidget.h"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//
|
|
|
|
|
|
#include "geometryutils.h"
|
|
|
|
|
|
#include "LogIO.h"
|
|
|
|
|
|
#include "WellLogProjectDialog.h"
|
|
|
|
|
|
#include "WellLogRoundDialog.h"
|
|
|
|
|
|
#include "WellLogDialog.h"
|
|
|
|
|
|
#include "WellDialog.h"
|
|
|
|
|
|
#include "ObjectGenralFactory.h"
|
|
|
|
|
|
#include "ImportdataDialog.h"
|
|
|
|
|
|
#include "CDataOutput.h"
|
2025-10-30 09:50:15 +08:00
|
|
|
|
#include "DataManagger.h"
|
2026-04-15 10:16:43 +08:00
|
|
|
|
#include "ObjWell.h"
|
2026-04-02 09:20:33 +08:00
|
|
|
|
#include "ObjWelllog.h"
|
2026-04-15 10:16:43 +08:00
|
|
|
|
#include "DataImport.h"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
extern QString g_prjname;
|
|
|
|
|
|
extern void AppendConsole(Priority priority, const QString &output);
|
|
|
|
|
|
|
|
|
|
|
|
QtProjectWidgets::QtProjectWidgets(QWidget *parent)
|
|
|
|
|
|
: QWidget(parent)
|
|
|
|
|
|
, ui(new Ui::QtProjectWidgetsClass())
|
|
|
|
|
|
{
|
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
//
|
|
|
|
|
|
QFont font("微软雅黑", 12, QFont::Bold, false);
|
|
|
|
|
|
QColor _fontColor = QColor(220, 220, 220);
|
|
|
|
|
|
QtCommonClass *qtCommon = new QtCommonClass(this);
|
2025-12-12 18:07:25 +08:00
|
|
|
|
qtCommon->setButtonIconWithText(ui->btnFind, ::GetImagePath()+"crossplot/search.png", "", font, _fontColor);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//initTreeWidget("", "wwer");
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->btnFind, &QPushButton::clicked, this, [ = ]()
|
|
|
|
|
|
{
|
|
|
|
|
|
qDebug()<<"btnFind clicked";
|
|
|
|
|
|
AppendConsole(PAI_INFO, "btnFind clicked...");
|
|
|
|
|
|
|
|
|
|
|
|
//emit CallManage::getInstance()->sig_Find();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//关联信号槽,新建评估工程
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_NewProject()), this, SLOT(s_NewProject()));
|
|
|
|
|
|
//关联信号槽,打开评估工程
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_OpenProject(QString)), this, SLOT(s_OpenProject(QString)));
|
2026-02-27 16:35:03 +08:00
|
|
|
|
//向左侧树图,追加固井结论表格
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_AddGujingToTree(QString,QString,QString)), this, SLOT(s_AddGujingToTree(QString,QString,QString)));
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//初始化树形控件中的右键菜单
|
|
|
|
|
|
initMenu();
|
|
|
|
|
|
|
|
|
|
|
|
//为树 tree 创建信号槽,鼠标press时会触发对应的信号。
|
|
|
|
|
|
connect(ui->treeWidget, &QTreeWidget::itemPressed, this, &QtProjectWidgets::onItemClicked);
|
2026-04-10 06:38:45 +08:00
|
|
|
|
connect(ui->treeWidget, SIGNAL(closeTreeEditor()), this, SLOT(oncloseTreeEditor()));
|
|
|
|
|
|
|
2025-11-20 09:32:51 +08:00
|
|
|
|
//connect(ui->treeWidget, &QTreeWidget::itemChanged, this, &QtProjectWidgets::onItemChanged);
|
2026-01-21 11:55:21 +08:00
|
|
|
|
|
|
|
|
|
|
// 设置选择模式为多选模式
|
|
|
|
|
|
ui->treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); // 或者使用 QAbstractItemView::MultiSelection
|
2026-04-01 09:23:19 +08:00
|
|
|
|
m_ReFlag = 0;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QtProjectWidgets::~QtProjectWidgets()
|
|
|
|
|
|
{
|
|
|
|
|
|
delete ui;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-16 16:33:56 +08:00
|
|
|
|
QString QtProjectWidgets::getLeftTreeString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return ui->treeWidget->getCurrentItemString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-01 09:23:19 +08:00
|
|
|
|
void QtProjectWidgets::slotButtonCancel()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_ReFlag=QDialogButtonBox::StandardButton::Cancel;
|
|
|
|
|
|
}
|
|
|
|
|
|
void QtProjectWidgets::slotButtonOk()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_ReFlag=QDialogButtonBox::StandardButton::Yes;
|
|
|
|
|
|
}
|
|
|
|
|
|
void QtProjectWidgets::slotButtonNo()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_ReFlag=QDialogButtonBox::StandardButton::No;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-10 06:38:45 +08:00
|
|
|
|
void QtProjectWidgets::slotAsendSort()
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
pItem->sortChildren(0,Qt::AscendingOrder);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::slotDesendSort()
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
pItem->sortChildren(0,Qt::DescendingOrder);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-21 09:18:53 +08:00
|
|
|
|
////初始化树图控件
|
|
|
|
|
|
//void QtProjectWidgets::initTreeWidget(QString fullPath, QString strProjectName)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// ui->treeWidget->setColumnCount(1); //设置列数
|
|
|
|
|
|
// ui->treeWidget->setHeaderHidden(true); // 隐藏表头
|
|
|
|
|
|
// ui->treeWidget->clear();//清理数据
|
|
|
|
|
|
|
|
|
|
|
|
// QTreeWidgetItem *itemRoot = new QTreeWidgetItem();
|
|
|
|
|
|
// itemRoot->setText(0, strProjectName);
|
|
|
|
|
|
// itemRoot->setData(0, Qt::UserRole, "root"); // 存储额外数据,如ID
|
|
|
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
|
// QIcon icon;
|
|
|
|
|
|
// icon.addPixmap(QPixmap(GetImagePath() + "newproject.png"), QIcon::Selected); //选中时的状态
|
|
|
|
|
|
// icon.addPixmap(QPixmap(GetImagePath() + "newproject.png"), QIcon::Normal); //未选中是的状态
|
|
|
|
|
|
// itemRoot->setIcon(0, icon);
|
|
|
|
|
|
// // 这是一个根节点
|
|
|
|
|
|
// ui->treeWidget->addTopLevelItem(itemRoot);
|
|
|
|
|
|
|
|
|
|
|
|
// //展开树图
|
|
|
|
|
|
// ui->treeWidget->expandAll();
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
////初始化树图控件
|
|
|
|
|
|
//void QtProjectWidgets::s_initTreeWidget(QString strName)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// //
|
|
|
|
|
|
// ui->treeWidget->setColumnCount(1); //设置列数
|
|
|
|
|
|
// ui->treeWidget->setHeaderHidden(true); // 隐藏表头
|
|
|
|
|
|
// ui->treeWidget->clear();//清理数据
|
|
|
|
|
|
|
|
|
|
|
|
// QTreeWidgetItem *item = new QTreeWidgetItem();
|
|
|
|
|
|
// item->setText(0, strName);
|
|
|
|
|
|
// item->setData(0, Qt::UserRole, "root"); // 存储额外数据,如ID
|
|
|
|
|
|
// //item->setData(0, Qt::UserRole + 1, evaluationInfo.guid); // 存储额外数据,如ID
|
|
|
|
|
|
// //
|
|
|
|
|
|
// QIcon icon;
|
|
|
|
|
|
// icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Selected);
|
|
|
|
|
|
// icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Normal);
|
|
|
|
|
|
// item->setIcon(0, icon);
|
|
|
|
|
|
// // 这是一个根节点
|
|
|
|
|
|
// ui->treeWidget->addTopLevelItem(item);
|
|
|
|
|
|
|
|
|
|
|
|
// //获取根节点
|
|
|
|
|
|
// QTreeWidgetItem *parent = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
|
|
|
|
|
|
// //指标体系
|
|
|
|
|
|
// QTreeWidgetItem *itemIndex = new QTreeWidgetItem();
|
|
|
|
|
|
// itemIndex->setText(0, "井组");
|
|
|
|
|
|
// itemIndex->setData(0, Qt::UserRole, "indexsys"); // 存储额外数据,如ID
|
|
|
|
|
|
// //
|
|
|
|
|
|
// QIcon icon_wellfolder;
|
|
|
|
|
|
// icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "wellfolder.png"), QIcon::Selected);
|
|
|
|
|
|
// icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "wellfolder.png"), QIcon::Normal);
|
|
|
|
|
|
// itemIndex->setIcon(0, icon_wellfolder);
|
|
|
|
|
|
// parent->addChild(itemIndex);//添加一级子节点
|
|
|
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
|
// QTreeWidgetItem *itemTask = new QTreeWidgetItem();
|
|
|
|
|
|
// itemTask->setText(0, ("数据分析"));
|
|
|
|
|
|
// itemTask->setData(0, Qt::UserRole, "task"); // 存储额外数据,如ID
|
|
|
|
|
|
// //
|
|
|
|
|
|
// QIcon icon_analysis;
|
|
|
|
|
|
// icon_analysis.addPixmap(QPixmap(GetImagePath() + "icon/analysis.png"), QIcon::Selected);
|
|
|
|
|
|
// icon_analysis.addPixmap(QPixmap(GetImagePath() + "icon/analysis.png"), QIcon::Normal);
|
|
|
|
|
|
// itemTask->setIcon(0, icon_analysis);
|
|
|
|
|
|
// parent->addChild(itemTask);//添加一级子节点
|
|
|
|
|
|
|
|
|
|
|
|
// //展开树图
|
|
|
|
|
|
// ui->treeWidget->expandItem(parent);
|
|
|
|
|
|
//}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//加载指标体系--树图节点
|
|
|
|
|
|
void QtProjectWidgets::s_loadTreeWidget(QString fileFull)
|
|
|
|
|
|
{
|
|
|
|
|
|
//
|
|
|
|
|
|
ui->treeWidget->setColumnCount(1); //设置列数
|
|
|
|
|
|
ui->treeWidget->setHeaderHidden(true); // 隐藏表头
|
|
|
|
|
|
ui->treeWidget->clear();//清理数据
|
|
|
|
|
|
|
|
|
|
|
|
QFileInfo fileinfo;
|
|
|
|
|
|
fileinfo = QFileInfo(fileFull);
|
|
|
|
|
|
//
|
|
|
|
|
|
QString fileName = fileinfo.fileName();
|
|
|
|
|
|
QString fileNameOnly = "";
|
|
|
|
|
|
if(fileName.right(4)==".wwl")
|
|
|
|
|
|
{
|
|
|
|
|
|
fileNameOnly = fileName.left(fileName.size()-strlen(".wwl"));
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
g_prjname = fileNameOnly;
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
|
|
|
|
|
item->setText(0, g_prjname);
|
|
|
|
|
|
item->setData(0, Qt::UserRole, "root"); // 存储额外数据,如ID
|
|
|
|
|
|
//item->setData(0, Qt::UserRole + 1, evaluationInfo.guid); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon icon;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Selected);
|
|
|
|
|
|
icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
item->setIcon(0, icon);
|
|
|
|
|
|
// 这是一个根节点
|
|
|
|
|
|
ui->treeWidget->addTopLevelItem(item);
|
|
|
|
|
|
|
|
|
|
|
|
//获取根节点
|
|
|
|
|
|
QTreeWidgetItem *parent = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
|
|
|
|
|
|
//井组
|
|
|
|
|
|
QTreeWidgetItem *itemIndex = new QTreeWidgetItem();
|
|
|
|
|
|
itemIndex->setText(0, ("井组"));
|
|
|
|
|
|
itemIndex->setData(0, Qt::UserRole, "wells"); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
2026-01-21 09:18:53 +08:00
|
|
|
|
QIcon icon_wellfolder;
|
|
|
|
|
|
icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "wellfolder.png"), QIcon::Selected);
|
|
|
|
|
|
icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "wellfolder.png"), QIcon::Normal);
|
|
|
|
|
|
itemIndex->setIcon(0, icon_wellfolder);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
parent->addChild(itemIndex);//添加一级子节点
|
|
|
|
|
|
//数据导入
|
2026-03-05 08:10:44 +08:00
|
|
|
|
m_qmapWellFiles.clear();
|
2025-10-29 17:23:30 +08:00
|
|
|
|
loadIndexSysTree(itemIndex, fileFull, g_prjname);
|
|
|
|
|
|
|
|
|
|
|
|
//数据分析
|
|
|
|
|
|
QTreeWidgetItem *itemTask = new QTreeWidgetItem();
|
|
|
|
|
|
itemTask->setText(0, ("数据分析"));
|
|
|
|
|
|
itemTask->setData(0, Qt::UserRole, "dataAnalyze"); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
2026-01-21 09:18:53 +08:00
|
|
|
|
QIcon icon_analysis;
|
|
|
|
|
|
icon_analysis.addPixmap(QPixmap(GetImagePath() + "icon/analysis.png"), QIcon::Selected);
|
|
|
|
|
|
icon_analysis.addPixmap(QPixmap(GetImagePath() + "icon/analysis.png"), QIcon::Normal);
|
|
|
|
|
|
itemTask->setIcon(0, icon_analysis);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
parent->addChild(itemTask);//添加一级子节点
|
|
|
|
|
|
//数据导入
|
|
|
|
|
|
//loadTaskTree(itemTask);
|
|
|
|
|
|
|
|
|
|
|
|
//展开树图
|
|
|
|
|
|
ui->treeWidget->expandItem(parent);
|
2026-03-30 15:02:34 +08:00
|
|
|
|
itemIndex->setExpanded(true);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname)
|
|
|
|
|
|
{
|
|
|
|
|
|
//Logdata
|
|
|
|
|
|
QString folderPath;
|
|
|
|
|
|
folderPath = GetLogdataPath();
|
|
|
|
|
|
folderPath = folderPath + prjname;
|
|
|
|
|
|
folderPath = folderPath + "/";
|
|
|
|
|
|
//
|
|
|
|
|
|
QDir dir;
|
|
|
|
|
|
if (!dir.exists(folderPath)) { // 如果目录不存在,则创建它。
|
|
|
|
|
|
if (!dir.mkpath(folderPath)) { // mkpath 尝试创建所有必需的中间目录。
|
|
|
|
|
|
qDebug() << "Failed to create directory:" << folderPath;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
qDebug() << "Directory created:" << folderPath;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------
|
|
|
|
|
|
QStringList listFolders;
|
|
|
|
|
|
QFileInfo mfi(folderPath);
|
|
|
|
|
|
if(!mfi.isDir())
|
|
|
|
|
|
{
|
|
|
|
|
|
//井文件 *.wwl
|
|
|
|
|
|
if(!mfi.isFile())
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//listFiles.append(folderPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
//井目录
|
|
|
|
|
|
//取当前当前目录内容
|
|
|
|
|
|
QDir dir(folderPath);
|
|
|
|
|
|
dir.setFilter(QDir::Dirs |QDir::NoDotAndDotDot |QDir::Files | QDir::NoSymLinks);
|
|
|
|
|
|
QFileInfoList list = dir.entryInfoList();
|
|
|
|
|
|
int file_count = list.count();
|
|
|
|
|
|
if(file_count <= 0)//判断目录是否为空,空目录返回
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//取当前目录内容,符合后缀文件
|
|
|
|
|
|
QStringList string_list;
|
|
|
|
|
|
for(int i=0; i<list.size();i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
QFileInfo file_info = list.at(i);
|
|
|
|
|
|
if(file_info.isDir())
|
|
|
|
|
|
{
|
|
|
|
|
|
//#JPH-307
|
|
|
|
|
|
QString absolute_file_path = file_info.absoluteFilePath();
|
|
|
|
|
|
if(absolute_file_path.at(absolute_file_path.length()-1)==' ') {
|
|
|
|
|
|
dir.rmdir(absolute_file_path);
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
listFolders.append(absolute_file_path);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
QStringList wellfiles;
|
|
|
|
|
|
foreach(QString wellFolder, listFolders )
|
|
|
|
|
|
{
|
|
|
|
|
|
QFileInfo w(wellFolder);//#JPH-307
|
|
|
|
|
|
if(w.isDir())
|
|
|
|
|
|
{
|
|
|
|
|
|
chakan(wellFolder, wellfiles, "*.well");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QStringList wellNames;
|
|
|
|
|
|
foreach(QString wellFile1, wellfiles )
|
|
|
|
|
|
{
|
|
|
|
|
|
QString filename=wellFile1;
|
|
|
|
|
|
//----------------
|
|
|
|
|
|
CLogIO * logio=new CLogIO();
|
|
|
|
|
|
if(!logio->Open(filename.toStdString().c_str(),CSlfIO::modeRead))
|
|
|
|
|
|
{
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
QString aa=filename+"文件打开失败,请检查!";
|
|
|
|
|
|
qDebug() << aa;
|
|
|
|
|
|
//AppendConsole(pai::log::PAI_ERROR,aa);
|
|
|
|
|
|
//return;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
//
|
|
|
|
|
|
QString wellname="";
|
|
|
|
|
|
Slf_FILE_MESSAGE mssage;
|
|
|
|
|
|
logio->GetFileMessage(mssage);
|
2026-01-09 15:40:04 +08:00
|
|
|
|
wellname=QString::fromLocal8Bit(mssage.WellName);
|
|
|
|
|
|
//wellname=wellname.toUpper();
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1)
|
|
|
|
|
|
{
|
|
|
|
|
|
//辨别井名是否有效,无效则采用文件名
|
|
|
|
|
|
QFileInfo fileInfo(filename);
|
|
|
|
|
|
QString strWellName = fileInfo.completeBaseName();
|
|
|
|
|
|
strWellName=strWellName.toUpper();
|
|
|
|
|
|
//
|
|
|
|
|
|
wellname=strWellName.toStdString().c_str();
|
|
|
|
|
|
int len=strlen(strWellName.toStdString().c_str());
|
|
|
|
|
|
if(len>sizeof(mssage.WellName)) len=sizeof(mssage.WellName);
|
|
|
|
|
|
strncpy(mssage.WellName,strWellName.toStdString().c_str(),len);
|
|
|
|
|
|
mssage.WellName[len]=0;
|
|
|
|
|
|
logio->SetFileMessage(mssage);
|
|
|
|
|
|
}
|
|
|
|
|
|
wellname=wellname.toUpper();
|
|
|
|
|
|
|
|
|
|
|
|
//查找是否已经存在该井和井次
|
|
|
|
|
|
if(wellNames.contains(wellname))
|
|
|
|
|
|
{
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
wellNames.append(wellname);
|
|
|
|
|
|
|
|
|
|
|
|
//挂接到树
|
|
|
|
|
|
//井名称
|
|
|
|
|
|
QTreeWidgetItem *itemIndex = new QTreeWidgetItem();
|
|
|
|
|
|
itemIndex->setText(0, wellname);
|
|
|
|
|
|
itemIndex->setData(0, Qt::UserRole, "wellname"); // 存储额外数据,如ID
|
|
|
|
|
|
itemIndex->setData(0, Qt::UserRole + 1, wellFile1); // 存储额外数据,项目名
|
2026-04-10 06:38:45 +08:00
|
|
|
|
itemIndex->setData(0, Qt::UserRole + 2, wellname); // 存储额外数据,井名
|
2026-04-15 10:16:43 +08:00
|
|
|
|
itemIndex->setData(0, Qt::UserRole + 3, wellname); // 存储额外数据,井名 QMyTreeWidget::closeEditor里判断是否修改
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//
|
|
|
|
|
|
QIcon icon;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
icon.addPixmap(QPixmap(GetImagePath() + "well.png"), QIcon::Selected);
|
|
|
|
|
|
icon.addPixmap(QPixmap(GetImagePath() + "well.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemIndex->setIcon(0, icon);
|
|
|
|
|
|
//
|
|
|
|
|
|
parent->addChild(itemIndex);//添加一级子节点
|
|
|
|
|
|
//关闭logio
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
|
|
|
|
|
|
//加载*.slf
|
|
|
|
|
|
QStringList slffiles;
|
|
|
|
|
|
QString pathTmp=GetLogdataPath();
|
|
|
|
|
|
pathTmp+=prjname+"/#"+wellname;
|
|
|
|
|
|
chakan(pathTmp, slffiles, "*.slf");
|
|
|
|
|
|
foreach(QString slfFile1, slffiles )
|
|
|
|
|
|
{
|
|
|
|
|
|
loadWellTree(itemIndex, slfFile1, wellname);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::loadWellTree(QTreeWidgetItem *parent, QString fileFull, QString parentWellname)
|
|
|
|
|
|
{
|
|
|
|
|
|
//表格数据
|
|
|
|
|
|
QTreeWidgetItem *itemSheet = new QTreeWidgetItem();
|
|
|
|
|
|
itemSheet->setText(0, "表格数据");
|
|
|
|
|
|
itemSheet->setData(0, Qt::UserRole, "Sheet"); // 存储额外数据,如ID
|
|
|
|
|
|
//itemSheet->setData(0, Qt::UserRole + 1, indexSysInfo.at(1).toString()); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon iconSheet;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
iconSheet.addPixmap(QPixmap(GetImagePath() + "icon/Sheet.png"), QIcon::Selected);
|
|
|
|
|
|
iconSheet.addPixmap(QPixmap(GetImagePath() + "icon/Sheet.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemSheet->setIcon(0, iconSheet);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//参数卡
|
|
|
|
|
|
QTreeWidgetItem *itemParameterCard = new QTreeWidgetItem();
|
|
|
|
|
|
itemParameterCard->setText(0, "参数卡");
|
|
|
|
|
|
itemParameterCard->setData(0, Qt::UserRole, "ParameterCard"); // 存储额外数据,如ID
|
|
|
|
|
|
//itemParameterCard->setData(0, Qt::UserRole + 1, indexSysInfo.at(1).toString()); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon iconParameterCard;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
iconParameterCard.addPixmap(QPixmap(GetImagePath() + "icon/ParameterCard.png"), QIcon::Selected);
|
|
|
|
|
|
iconParameterCard.addPixmap(QPixmap(GetImagePath() + "icon/ParameterCard.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemParameterCard->setIcon(0, iconParameterCard);
|
|
|
|
|
|
|
|
|
|
|
|
//曲线
|
|
|
|
|
|
QTreeWidgetItem *itemCurve = new QTreeWidgetItem();
|
|
|
|
|
|
itemCurve->setText(0, "曲线");
|
|
|
|
|
|
itemCurve->setData(0, Qt::UserRole, "Curve"); // 存储额外数据,如ID
|
|
|
|
|
|
//itemAddLog->setData(0, Qt::UserRole + 1, indexSysInfo.at(1).toString()); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon iconCurve;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
iconCurve.addPixmap(QPixmap(GetImagePath() + "icon/AddLog.png"), QIcon::Selected);
|
|
|
|
|
|
iconCurve.addPixmap(QPixmap(GetImagePath() + "icon/AddLog.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemCurve->setIcon(0, iconCurve);
|
|
|
|
|
|
|
2025-11-18 11:40:42 +08:00
|
|
|
|
//波列数据
|
2025-10-29 17:23:30 +08:00
|
|
|
|
QTreeWidgetItem *itemWave = new QTreeWidgetItem();
|
2025-11-18 11:40:42 +08:00
|
|
|
|
itemWave->setText(0, "波列数据");
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemWave->setData(0, Qt::UserRole, "Wave"); // 存储额外数据,如ID
|
|
|
|
|
|
//itemWave->setData(0, Qt::UserRole + 1, indexSysInfo.at(1).toString()); // 存储额外数据,如ID
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon iconWave;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
iconWave.addPixmap(QPixmap(GetImagePath() + "icon/Logs.png"), QIcon::Selected);
|
|
|
|
|
|
iconWave.addPixmap(QPixmap(GetImagePath() + "icon/Logs.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemWave->setIcon(0, iconWave);
|
|
|
|
|
|
|
|
|
|
|
|
CLogIO * logio=new CLogIO();
|
|
|
|
|
|
if(!logio->Open(fileFull.toStdString().c_str(),CSlfIO::modeRead))
|
|
|
|
|
|
{
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
QString aa=fileFull+"文件打开失败,请检查!";
|
|
|
|
|
|
qDebug() << aa;
|
|
|
|
|
|
//AppendConsole(pai::log::PAI_ERROR,aa);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Slf_FILE_MESSAGE mssage;
|
|
|
|
|
|
logio->GetFileMessage(mssage);
|
|
|
|
|
|
|
2026-01-09 15:40:04 +08:00
|
|
|
|
if(parent->text(0) != QString(QString::fromLocal8Bit(mssage.WellName)))
|
2025-10-29 17:23:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2026-01-09 15:40:04 +08:00
|
|
|
|
QString wellname=QString::fromLocal8Bit(mssage.WellName);
|
2026-03-05 08:10:44 +08:00
|
|
|
|
m_qmapWellFiles[wellname].append(fileFull);
|
|
|
|
|
|
// if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1)
|
2025-10-29 17:23:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
QFileInfo fileinfo;
|
|
|
|
|
|
fileinfo = QFileInfo(fileFull);
|
2026-03-05 08:10:44 +08:00
|
|
|
|
wellname = fileinfo.completeBaseName();//井次
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
2025-11-21 10:14:28 +08:00
|
|
|
|
// if(wellname != parentWellname)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// //井次名称不一致
|
|
|
|
|
|
// qDebug() << "井次名称不一致";
|
|
|
|
|
|
// delete logio;
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//井次名称
|
|
|
|
|
|
QTreeWidgetItem *itemwell = new QTreeWidgetItem();
|
|
|
|
|
|
itemwell->setText(0, wellname);
|
|
|
|
|
|
itemwell->setData(0, Qt::UserRole, "wellItem"); // 存储额外数据,如ID
|
2026-01-20 17:20:17 +08:00
|
|
|
|
itemwell->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,slf文件路径
|
2026-04-15 10:16:43 +08:00
|
|
|
|
itemwell->setData(0, Qt::UserRole + 3, wellname); // 存储额外数据,表井次名
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//
|
|
|
|
|
|
QIcon iconwell;
|
2026-01-21 09:18:53 +08:00
|
|
|
|
iconwell.addPixmap(QPixmap(GetImagePath() + "icon/WellRound.png"), QIcon::Selected);
|
|
|
|
|
|
iconwell.addPixmap(QPixmap(GetImagePath() + "icon/WellRound.png"), QIcon::Normal);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemwell->setIcon(0, iconwell);
|
|
|
|
|
|
|
|
|
|
|
|
parent->addChild(itemwell);//添加一级子节点
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// int nObjectCount = logio-> GetWisObjectCount();
|
|
|
|
|
|
// int nSlfCount = logio-> GetSlfObjectCount();
|
|
|
|
|
|
// Slf_TABLE_ENTRY *pEntry = new Slf_TABLE_ENTRY[nSlfCount];
|
|
|
|
|
|
// logio-> GetAllSlfObjectEntry(pEntry,nSlfCount);
|
|
|
|
|
|
|
|
|
|
|
|
char* curvename=new char[65];
|
|
|
|
|
|
curvename[64]='\0';
|
|
|
|
|
|
char* aliasname=new char[65];
|
|
|
|
|
|
aliasname[64]='\0';
|
|
|
|
|
|
//
|
|
|
|
|
|
int nSlfCount = logio->GetObjectCount();
|
|
|
|
|
|
for(int i = 0; i< nSlfCount; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
logio->GetObjectName(i,curvename,NULL,aliasname);
|
|
|
|
|
|
if(!logio->IsObject(i)) {
|
|
|
|
|
|
logio->DiscardObject(i);
|
|
|
|
|
|
continue;
|
|
|
|
|
|
};
|
|
|
|
|
|
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL)
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
short curvetype=logio->GetObjectType(i);
|
|
|
|
|
|
//
|
|
|
|
|
|
short Attribute=0,SubAttribute=0;
|
|
|
|
|
|
logio->GetObjectAttribute(i,&Attribute,&SubAttribute);
|
|
|
|
|
|
|
|
|
|
|
|
QString strCurveName = QString::fromLocal8Bit(curvename);
|
|
|
|
|
|
if(curvetype>CARD_OBJECT || 0 == curvetype)
|
|
|
|
|
|
{
|
|
|
|
|
|
qDebug() << "strCurveName: " << strCurveName;
|
|
|
|
|
|
//表格数据-》树图
|
|
|
|
|
|
QTreeWidgetItem *itemSheetChild = new QTreeWidgetItem();
|
|
|
|
|
|
itemSheetChild->setText(0, strCurveName);
|
|
|
|
|
|
itemSheetChild->setData(0, Qt::UserRole, "tableObject"); // 存储额外数据,如ID
|
|
|
|
|
|
itemSheetChild->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,井次文件路径
|
|
|
|
|
|
itemSheetChild->setData(0, Qt::UserRole + 2, wellname); // 存储额外数据,井名
|
2026-04-07 13:53:01 +08:00
|
|
|
|
itemSheetChild->setData(0, Qt::UserRole + 3, strCurveName); // 存储额外数据,表格名
|
2026-01-21 09:18:53 +08:00
|
|
|
|
//
|
2025-10-29 17:23:30 +08:00
|
|
|
|
itemSheetChild->setIcon(0, iconSheet);
|
|
|
|
|
|
//在创建的每个节点下,加上下面代码
|
2025-11-20 09:32:51 +08:00
|
|
|
|
// itemSheetChild->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsTristate | Qt::ItemIsDragEnabled); //设置树形控件子项的属性
|
|
|
|
|
|
// itemSheetChild->setCheckState(0, Qt::Unchecked);//也可以是其他状态
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
if (0 == itemSheet->childCount())
|
|
|
|
|
|
{
|
|
|
|
|
|
itemwell->addChild(itemSheet);//添加一级子节点
|
|
|
|
|
|
}
|
|
|
|
|
|
itemSheet->addChild(itemSheetChild);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(CURVE_OBJECT == curvetype)
|
|
|
|
|
|
{
|
|
|
|
|
|
//判断曲线有效性
|
|
|
|
|
|
Slf_CURVE acurveinfo;
|
|
|
|
|
|
logio->GetCurveInfo(i,&acurveinfo);
|
|
|
|
|
|
if(acurveinfo.DepLevel!=0&&(acurveinfo.EndDepth-acurveinfo.StartDepth>0))
|
|
|
|
|
|
{
|
|
|
|
|
|
if(acurveinfo.MaxValue==acurveinfo.MinValue||acurveinfo.MaxValue==-99999||acurveinfo.MaxValue==-9999||acurveinfo.MinValue==999999||acurveinfo.MinValue==999999||acurveinfo.MinValue==99999||acurveinfo.MinValue==99999||acurveinfo.MinValue==-9999){
|
|
|
|
|
|
int curveindex=logio->OpenSlfTable(i,-1);
|
|
|
|
|
|
if(curveindex>-1)
|
|
|
|
|
|
{
|
|
|
|
|
|
MyDataTypeEnum vVdl;
|
|
|
|
|
|
DWORD count=(acurveinfo.EndDepth-acurveinfo.StartDepth)/acurveinfo.DepLevel+1.5;
|
|
|
|
|
|
DWORD len=count*acurveinfo.CodeLen;
|
|
|
|
|
|
acurveinfo.MinValue=99999999;
|
|
|
|
|
|
acurveinfo.MaxValue=-99999999;
|
|
|
|
|
|
if(acurveinfo.CodeLen==8) acurveinfo.MinValue=99999999;
|
|
|
|
|
|
vVdl.vchar=new char[len];
|
|
|
|
|
|
len=logio->ReadCurve(curveindex, acurveinfo.StartDepth,count,(void *)vVdl.vchar);
|
|
|
|
|
|
if(!len) {
|
|
|
|
|
|
QString cs;
|
|
|
|
|
|
char buf[1000];
|
|
|
|
|
|
sprintf(buf,"%s %f-%f",acurveinfo.Name,acurveinfo.StartDepth,acurveinfo.EndDepth);
|
|
|
|
|
|
cs=buf;
|
|
|
|
|
|
int flag = QMessageBox::warning(NULL,"提示",QString(cs+"\n曲线信息异常!删除该曲线可能需要较长时间,建议复制正常曲线等信息到新文件,然后删除此文件。是否此时直接将该曲线删除?"),QMessageBox::Yes,QMessageBox::No);
|
|
|
|
|
|
if(flag==QMessageBox::Yes) logio->DiscardObject(i);
|
|
|
|
|
|
delete vVdl.vchar;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
for(int kk=0;kk<count;kk=kk+10)
|
|
|
|
|
|
{
|
|
|
|
|
|
float buf[200];
|
|
|
|
|
|
buf[0]=0;
|
|
|
|
|
|
float temp=logio->GetData(acurveinfo.RepCode,&vVdl.vchar[kk*acurveinfo.CodeLen],buf);
|
2025-12-02 15:23:42 +08:00
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
|
if(_isnan(temp)||!_finite(temp)) continue;
|
|
|
|
|
|
#else
|
|
|
|
|
|
if(__isnan(temp)||!__finite(temp)) continue;
|
|
|
|
|
|
#endif // WIN32
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
if(acurveinfo.MaxValue<temp) if(temp!=-9999.0&&temp!=-999.25&&temp!=-99999.0)acurveinfo.MaxValue=temp;
|
|
|
|
|
|
if(acurveinfo.MinValue>temp) if(temp!=-9999.0&&temp!=-999.25&&temp!=-99999.0)acurveinfo.MinValue=temp;
|
|
|
|
|
|
}
|
|
|
|
|
|
logio->SetCurveInfo(curveindex,&acurveinfo);
|
|
|
|
|
|
delete vVdl.vchar;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(acurveinfo.DepLevel==0||acurveinfo.StartDepth<-100000||acurveinfo.StartDepth>100000)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString cs;
|
|
|
|
|
|
char buf[1000];
|
|
|
|
|
|
sprintf(buf,"%s %f-%f",acurveinfo.Name,acurveinfo.StartDepth,acurveinfo.EndDepth);
|
|
|
|
|
|
cs=buf;
|
|
|
|
|
|
int flag = QMessageBox::warning(NULL,"提示",QString(cs+"\n曲线信息异常!删除该曲线可能需要较长时间,建议复制正常曲线等信息到新文件,然后删除此文件。是否此时直接将该曲线删除?"),QMessageBox::Yes,QMessageBox::No);
|
|
|
|
|
|
if(flag==QMessageBox::Yes) logio->DiscardObject(i);
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//曲线-》树图
|
|
|
|
|
|
QTreeWidgetItem *itemCurveLog = new QTreeWidgetItem();
|
|
|
|
|
|
itemCurveLog->setText(0, strCurveName);
|
|
|
|
|
|
itemCurveLog->setData(0, Qt::UserRole, "curveObject"); // 存储额外数据,如ID
|
|
|
|
|
|
itemCurveLog->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,井次文件路径
|
|
|
|
|
|
itemCurveLog->setData(0, Qt::UserRole + 2, wellname); // 存储额外数据,井名
|
2026-04-07 13:53:01 +08:00
|
|
|
|
itemCurveLog->setData(0, Qt::UserRole + 3, strCurveName); // 存储额外数据,曲线名
|
2026-01-21 09:18:53 +08:00
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon iconLog;
|
|
|
|
|
|
iconLog.addPixmap(QPixmap(GetImagePath() + "icon/Log.png"), QIcon::Selected);
|
|
|
|
|
|
iconLog.addPixmap(QPixmap(GetImagePath() + "icon/Log.png"), QIcon::Normal);
|
|
|
|
|
|
itemCurveLog->setIcon(0, iconLog);
|
2025-11-18 11:40:42 +08:00
|
|
|
|
//在创建的每个节点下,加上下面代码(check框)
|
2025-11-20 09:32:51 +08:00
|
|
|
|
// itemCurveLog->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsTristate | Qt::ItemIsDragEnabled); //设置树形控件子项的属性
|
|
|
|
|
|
// itemCurveLog->setCheckState(0, Qt::Unchecked);//也可以是其他状态
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if (0 == itemCurve->childCount())
|
|
|
|
|
|
{
|
|
|
|
|
|
itemwell->addChild(itemCurve);//添加一级子节点
|
|
|
|
|
|
}
|
|
|
|
|
|
itemCurve->addChild(itemCurveLog);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(CARD_OBJECT == curvetype)
|
|
|
|
|
|
{
|
|
|
|
|
|
//参数卡-》树图
|
|
|
|
|
|
QTreeWidgetItem *itemCardChild = new QTreeWidgetItem();
|
|
|
|
|
|
itemCardChild->setText(0, strCurveName);
|
2026-02-10 10:56:35 +08:00
|
|
|
|
itemCardChild->setData(0, Qt::UserRole, "cardObject"); // 存储额外数据,如ID
|
|
|
|
|
|
itemCardChild->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,井次文件路径
|
|
|
|
|
|
itemCardChild->setData(0, Qt::UserRole + 2, wellname); // 存储额外数据,井名
|
2026-04-07 13:53:01 +08:00
|
|
|
|
itemCardChild->setData(0, Qt::UserRole + 3, strCurveName); // 存储额外数据,参数卡
|
2026-01-21 09:18:53 +08:00
|
|
|
|
itemCardChild->setIcon(0, iconParameterCard);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if (0 == itemParameterCard->childCount())
|
|
|
|
|
|
{
|
|
|
|
|
|
itemwell->addChild(itemParameterCard);//添加一级子节点
|
|
|
|
|
|
}
|
|
|
|
|
|
itemParameterCard->addChild(itemCardChild);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(WAVE_OBJECT == curvetype)
|
|
|
|
|
|
{
|
|
|
|
|
|
//波列-》树图
|
|
|
|
|
|
QTreeWidgetItem *itemWaveChild = new QTreeWidgetItem();
|
|
|
|
|
|
itemWaveChild->setText(0, strCurveName);
|
2025-11-18 11:40:42 +08:00
|
|
|
|
itemWaveChild->setData(0, Qt::UserRole, "waveObject"); // 存储额外数据,如ID
|
|
|
|
|
|
itemWaveChild->setData(0, Qt::UserRole + 1, fileFull); // 存储额外数据,井次文件路径
|
|
|
|
|
|
itemWaveChild->setData(0, Qt::UserRole + 2, wellname); // 存储额外数据,井名
|
2026-04-07 13:53:01 +08:00
|
|
|
|
itemWaveChild->setData(0, Qt::UserRole + 3, strCurveName); // 存储额外数据,波列卡
|
2026-01-21 09:18:53 +08:00
|
|
|
|
itemWaveChild->setIcon(0, iconWave);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if (0 == itemWave->childCount())
|
|
|
|
|
|
{
|
|
|
|
|
|
itemwell->addChild(itemWave);//添加一级子节点
|
|
|
|
|
|
}
|
|
|
|
|
|
itemWave->addChild(itemWaveChild);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
delete []curvename;
|
|
|
|
|
|
delete []aliasname;
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
//delete []pEntry;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
void QtProjectWidgets::expandAll(QTreeWidgetItem* item) {
|
|
|
|
|
|
if (item) {
|
|
|
|
|
|
item->setExpanded(true); // 展开当前项
|
|
|
|
|
|
for (int i = 0; i < item->childCount(); ++i) {
|
|
|
|
|
|
expandAll(item->child(i)); // 递归展开所有子项
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//初始化树形控件中的右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initMenu()
|
|
|
|
|
|
{
|
2026-03-25 16:36:46 +08:00
|
|
|
|
m_action_Paste = new QAction("粘贴", ui->treeWidget);
|
|
|
|
|
|
m_action_Paste ->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(m_action_Paste, SIGNAL(triggered()), this, SLOT(onPasteSelObject()));
|
|
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
m_action_WellPaste = new QAction("粘贴井次", ui->treeWidget);
|
|
|
|
|
|
m_action_WellPaste ->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标
|
|
|
|
|
|
connect(m_action_WellPaste, SIGNAL(triggered()), this, SLOT(onPasteWell()));
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//根节点(项目名称)-右键菜单
|
|
|
|
|
|
_menuRoot = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initRootTreeMenu(_menuRoot, ui->treeWidget);
|
|
|
|
|
|
|
2026-02-10 10:56:35 +08:00
|
|
|
|
_menuWells = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initWellsTreeMenu(_menuWells, ui->treeWidget);
|
|
|
|
|
|
|
|
|
|
|
|
//参数卡对象-右键菜单
|
|
|
|
|
|
_menuCardObject = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initParameterCardTreeMenu(_menuCardObject, ui->treeWidget);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//曲线对象-右键菜单
|
|
|
|
|
|
_menuCurveObject = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initCurveObjectTreeMenu(_menuCurveObject, ui->treeWidget);
|
|
|
|
|
|
|
2026-01-21 11:55:21 +08:00
|
|
|
|
//波列对象-右键菜单
|
|
|
|
|
|
_menuWaveObject = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initWaveObjectTreeMenu(_menuWaveObject, ui->treeWidget);
|
|
|
|
|
|
|
2025-11-10 16:35:40 +08:00
|
|
|
|
//表格对象-右键菜单
|
|
|
|
|
|
_menuTableObject = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initTableObjectTreeMenu(_menuTableObject, ui->treeWidget);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
_menuWellName = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initWellNameTreeMenu(_menuWellName, ui->treeWidget);
|
2025-11-20 15:13:47 +08:00
|
|
|
|
|
|
|
|
|
|
_menuSlfName = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initSlfNameTreeMenu(_menuSlfName, ui->treeWidget);
|
|
|
|
|
|
|
2025-11-26 10:21:39 +08:00
|
|
|
|
_menuTableFolder = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initTableFolderTreeMenu(_menuTableFolder, ui->treeWidget);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
_menuCurveFolder = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initCurveFolderTreeMenu(_menuCurveFolder, ui->treeWidget);
|
|
|
|
|
|
|
|
|
|
|
|
_menuParCardFolder = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initParCardFolderTreeMenu(_menuParCardFolder, ui->treeWidget);
|
|
|
|
|
|
|
|
|
|
|
|
_menuWaveFolder = new QMenu(ui->treeWidget);
|
|
|
|
|
|
initWaveFolderTreeMenu(_menuWaveFolder, ui->treeWidget);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
// //评估方案-右键菜单
|
|
|
|
|
|
// _menuEvaluate = new QMenu(ui->treeWidget);
|
|
|
|
|
|
// initEvaluateTreeMenu(_menuEvaluate, ui->treeWidget);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//初始化根节点(项目名称)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initRootTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_action_New = new QAction("新建项目", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
m_action_New->setIcon(QIcon(GetImagePath() + "newproject.png")); // 设置图标
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(m_action_New, SIGNAL(triggered(bool)), this, SLOT(onNewProject(bool)));
|
|
|
|
|
|
menu->addAction(m_action_New);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
m_action_Open = new QAction("打开项目", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
m_action_Open->setIcon(QIcon(GetImagePath() + "openproject.png")); // 设置图标
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(m_action_Open, SIGNAL(triggered(bool)), this, SLOT(onOpenProject(bool)));
|
|
|
|
|
|
menu->addAction(m_action_Open);
|
2026-02-10 10:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//初始化根节点(项目名称)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initWellsTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-04-15 10:16:43 +08:00
|
|
|
|
QAction* action_New = new QAction("按目录导入测井数据", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "AddFolder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportFolder()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("数据导入", treeWidget);
|
2026-02-10 10:56:35 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "wellog.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSingleWellLogData()));
|
|
|
|
|
|
menu->addAction(action_New);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
2026-03-05 08:10:44 +08:00
|
|
|
|
// action_New = new QAction("导入离散数据", treeWidget);
|
|
|
|
|
|
// 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(GetImagePath() + "icon/Correction.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCopyObject()));
|
2026-02-10 10:56:35 +08:00
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
// action_New = new QAction("输出数据", treeWidget);
|
|
|
|
|
|
// action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标
|
|
|
|
|
|
// connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound()));
|
|
|
|
|
|
// menu->addAction(action_New);
|
|
|
|
|
|
}
|
|
|
|
|
|
//初始化参数卡-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initParameterCardTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
|
|
|
|
|
QAction* action_CardObject = new QAction("数据查看", treeWidget);
|
|
|
|
|
|
action_CardObject->setIcon(QIcon(GetImagePath() + "icon/Sheet.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_CardObject, SIGNAL(triggered(bool)), this, SLOT(onShowParameterCard(bool)));
|
|
|
|
|
|
menu->addAction(action_CardObject);
|
2026-03-25 16:36:46 +08:00
|
|
|
|
|
2026-04-07 13:53:01 +08:00
|
|
|
|
QAction* action_ReName = new QAction("重命名", treeWidget);
|
|
|
|
|
|
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
|
|
|
|
|
|
menu->addAction(action_ReName);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
QAction* action_Copy = new QAction("复制", treeWidget);
|
|
|
|
|
|
action_Copy->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Copy, SIGNAL(triggered()), this, SLOT(onCopySelObject()));
|
|
|
|
|
|
menu->addAction(action_Copy);
|
|
|
|
|
|
|
|
|
|
|
|
QAction* action_Delete = new QAction("删除", treeWidget);
|
|
|
|
|
|
action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject()));
|
|
|
|
|
|
menu->addAction(action_Delete);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//初始化曲线对象(AC、BS...)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initCurveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_action_ShowCurve = new QAction("数据查看", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
m_action_ShowCurve->setIcon(QIcon(GetImagePath() + "icon/Sheet.png")); // 设置图标":/image/u174.png"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(m_action_ShowCurve, SIGNAL(triggered(bool)), this, SLOT(onShowCurve(bool)));
|
|
|
|
|
|
menu->addAction(m_action_ShowCurve);
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_ReName = new QAction("重命名", treeWidget);
|
|
|
|
|
|
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
|
|
|
|
|
|
menu->addAction(action_ReName);
|
|
|
|
|
|
|
2026-01-20 17:20:17 +08:00
|
|
|
|
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);
|
2026-03-25 16:36:46 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_Copy = new QAction("复制", treeWidget);
|
|
|
|
|
|
action_Copy->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Copy, SIGNAL(triggered()), this, SLOT(onCopySelObject()));
|
|
|
|
|
|
menu->addAction(action_Copy);
|
|
|
|
|
|
|
|
|
|
|
|
QAction* action_Delete = new QAction("删除", treeWidget);
|
|
|
|
|
|
action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject()));
|
|
|
|
|
|
menu->addAction(action_Delete);
|
2025-11-10 16:35:40 +08:00
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
2026-01-21 11:55:21 +08:00
|
|
|
|
//初始化波列对象-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initWaveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-01-29 16:57:06 +08:00
|
|
|
|
QAction* action_WaveObject = new QAction("数据查看", treeWidget);
|
|
|
|
|
|
action_WaveObject->setIcon(QIcon(GetImagePath() + "icon/Sheet.png")); // 设置图标
|
|
|
|
|
|
connect(action_WaveObject, SIGNAL(triggered(bool)), this, SLOT(onShowWave(bool)));
|
|
|
|
|
|
menu->addAction(action_WaveObject);
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_ReName = new QAction("重命名", treeWidget);
|
|
|
|
|
|
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
|
|
|
|
|
|
menu->addAction(action_ReName);
|
|
|
|
|
|
|
2026-01-21 11:55:21 +08:00
|
|
|
|
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);
|
2026-03-25 16:36:46 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_Copy = new QAction("复制", treeWidget);
|
|
|
|
|
|
action_Copy->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Copy, SIGNAL(triggered()), this, SLOT(onCopySelObject()));
|
|
|
|
|
|
menu->addAction(action_Copy);
|
|
|
|
|
|
|
|
|
|
|
|
QAction* action_Delete = new QAction("删除", treeWidget);
|
|
|
|
|
|
action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject()));
|
|
|
|
|
|
menu->addAction(action_Delete);
|
2026-01-21 11:55:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-10 16:35:40 +08:00
|
|
|
|
//初始化表格对象-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initTableObjectTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
|
|
|
|
|
QAction* action_TableObject = new QAction("数据查看", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_TableObject->setIcon(QIcon(GetImagePath() + "icon/Sheet.png")); // 设置图标
|
2025-11-10 16:35:40 +08:00
|
|
|
|
connect(action_TableObject, SIGNAL(triggered(bool)), this, SLOT(onShowTable(bool)));
|
|
|
|
|
|
menu->addAction(action_TableObject);
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_ReName = new QAction("重命名", treeWidget);
|
|
|
|
|
|
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
|
|
|
|
|
|
menu->addAction(action_ReName);
|
|
|
|
|
|
|
2026-01-20 17:20:17 +08:00
|
|
|
|
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);
|
2026-03-25 16:36:46 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_Copy = new QAction("复制", treeWidget);
|
|
|
|
|
|
action_Copy->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Copy, SIGNAL(triggered()), this, SLOT(onCopySelObject()));
|
|
|
|
|
|
menu->addAction(action_Copy);
|
|
|
|
|
|
|
|
|
|
|
|
QAction* action_Delete = new QAction("删除", treeWidget);
|
|
|
|
|
|
action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject()));
|
|
|
|
|
|
menu->addAction(action_Delete);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//初始化根节点(井名称)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initWellNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-02-10 10:56:35 +08:00
|
|
|
|
QAction* action_New = new QAction("数据导入", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "wellog.png")); // 设置图标
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSingleWellLogData()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("导入离散数据", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/intable.png")); // 设置图标
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSlfTable()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("编辑井基本信息", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/Edit.png")); // 设置图标
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onEditWelllogRound()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
2026-04-10 06:38:45 +08:00
|
|
|
|
QAction* action_ReName = new QAction("重命名", treeWidget);
|
|
|
|
|
|
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
|
|
|
|
|
|
menu->addAction(action_ReName);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
action_New = new QAction("输出数据", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标
|
2025-10-29 17:23:30 +08:00
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound()));
|
|
|
|
|
|
menu->addAction(action_New);
|
2026-04-02 15:14:50 +08:00
|
|
|
|
|
|
|
|
|
|
menu->addAction(m_action_WellPaste);
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_Delete = new QAction("删除", treeWidget);
|
|
|
|
|
|
action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject()));
|
|
|
|
|
|
menu->addAction(action_Delete);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-20 15:13:47 +08:00
|
|
|
|
//初始化根节点(井次名称)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initSlfNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-02-10 10:56:35 +08:00
|
|
|
|
QAction* action_New = new QAction("数据导入", treeWidget);
|
|
|
|
|
|
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(GetImagePath() + "icon/intable.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSlfTable()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
action_New = new QAction("备份", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/Copy.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onSlfbackup()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
QAction* action_Cut = new QAction("剪切井次", treeWidget);
|
|
|
|
|
|
action_Cut->setIcon(QIcon(GetImagePath() + "icon/Cut.png")); // 设置图标
|
|
|
|
|
|
connect(action_Cut, SIGNAL(triggered()), this, SLOT(onCutSlf()));
|
|
|
|
|
|
menu->addAction(action_Cut);
|
|
|
|
|
|
|
2026-02-10 10:56:35 +08:00
|
|
|
|
action_New = new QAction("编辑测井信息", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/Edit.png")); // 设置图标
|
2025-11-20 15:13:47 +08:00
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onWelllogInformation()));
|
|
|
|
|
|
menu->addAction(action_New);
|
2026-04-02 15:14:50 +08:00
|
|
|
|
|
2026-04-10 06:38:45 +08:00
|
|
|
|
QAction* action_ReName = new QAction("重命名", treeWidget);
|
|
|
|
|
|
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
|
|
|
|
|
|
menu->addAction(action_ReName);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
menu->addAction(m_action_Paste);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
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);
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
QAction* action_Delete = new QAction("删除", treeWidget);
|
|
|
|
|
|
action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png"
|
|
|
|
|
|
connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject()));
|
|
|
|
|
|
menu->addAction(action_Delete);
|
2025-11-20 15:13:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-26 10:21:39 +08:00
|
|
|
|
//初始化根节点(表目录)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
|
|
|
|
|
QAction* action_New = new QAction("创建新表", treeWidget);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/CreateTable.png")); // 设置图标
|
2025-11-26 10:21:39 +08:00
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCreateNewTable()));
|
2026-04-10 06:38:45 +08:00
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("升序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("降序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
|
2025-11-26 10:21:39 +08:00
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
menu->addAction(m_action_Paste);
|
|
|
|
|
|
}
|
|
|
|
|
|
//初始化根节点(曲线表目录)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initCurveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-04-10 06:38:45 +08:00
|
|
|
|
QAction* action_New = new QAction("升序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("降序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
menu->addAction(m_action_Paste);
|
|
|
|
|
|
}
|
|
|
|
|
|
//初始化根节点(参数卡目录)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initParCardFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-04-10 06:38:45 +08:00
|
|
|
|
QAction* action_New = new QAction("升序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("降序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
menu->addAction(m_action_Paste);
|
|
|
|
|
|
}
|
|
|
|
|
|
//初始化根节点(波列目录)-右键菜单
|
|
|
|
|
|
void QtProjectWidgets::initWaveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|
|
|
|
|
{
|
2026-04-10 06:38:45 +08:00
|
|
|
|
QAction* action_New = new QAction("升序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
|
|
|
|
|
action_New = new QAction("降序", treeWidget);
|
|
|
|
|
|
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
|
|
|
|
|
|
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
|
|
|
|
|
|
menu->addAction(action_New);
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
menu->addAction(m_action_Paste);
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//新建项目
|
|
|
|
|
|
void QtProjectWidgets::onNewProject(bool checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
s_NewProject();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//打开项目
|
|
|
|
|
|
void QtProjectWidgets::onOpenProject(bool checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_Open();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::s_NewProject()
|
|
|
|
|
|
{
|
2026-04-01 18:08:00 +08:00
|
|
|
|
//
|
2025-10-29 17:23:30 +08:00
|
|
|
|
ui->treeWidget->clear();//清理数据
|
2026-04-01 18:08:00 +08:00
|
|
|
|
//emit CallManage::getInstance()->sig_CloseProject();//关闭tab页
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
// 创建对话框
|
|
|
|
|
|
CWellLogProjectDialog* dialog = new CWellLogProjectDialog();
|
2026-04-15 10:16:43 +08:00
|
|
|
|
dialog->Init(NULL);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
int result = dialog->exec();//对话框
|
|
|
|
|
|
if (result == QDialog::Accepted) {
|
|
|
|
|
|
// 处理用户点击了确定按钮的逻辑
|
|
|
|
|
|
qDebug() << "Accepted=" << dialog->m_strNewName;
|
|
|
|
|
|
//加载左侧树图
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + dialog->m_strNewName;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_loadTreeWidget(strProjectFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (result == QDialog::Rejected) {
|
|
|
|
|
|
// 处理用户点击了取消按钮的逻辑
|
|
|
|
|
|
qDebug() << "Rejected=";
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
// 处理其他情况的逻辑
|
|
|
|
|
|
qDebug() << "other=";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::s_OpenProject(QString fileFull)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui->treeWidget->clear();//清理数据
|
2026-04-01 18:08:00 +08:00
|
|
|
|
//emit CallManage::getInstance()->sig_CloseProject();//关闭tab页
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
s_loadTreeWidget(fileFull);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-10 10:56:35 +08:00
|
|
|
|
//参数表数据查看
|
|
|
|
|
|
void QtProjectWidgets::onShowParameterCard(bool checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_ShowParameterCard(m_strSlfName, m_strCurveObjectName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//曲线数据查看
|
2025-10-29 17:23:30 +08:00
|
|
|
|
void QtProjectWidgets::onShowCurve(bool checked)
|
|
|
|
|
|
{
|
2026-04-01 09:23:19 +08:00
|
|
|
|
m_mapShowObject.clear();
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
|
|
|
|
|
|
if (parentItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
if (strSlfName.contains(".slf"))
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strObjectName = pItem->text(0);
|
|
|
|
|
|
if(!m_mapShowObject.contains(strSlfName))
|
|
|
|
|
|
{
|
|
|
|
|
|
QList<QString> selList;
|
|
|
|
|
|
selList.clear();
|
|
|
|
|
|
m_mapShowObject.insert(strSlfName,selList);
|
|
|
|
|
|
}
|
|
|
|
|
|
m_mapShowObject[strSlfName].append(strObjectName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(m_mapShowObject.size()>0)
|
|
|
|
|
|
emit CallManage::getInstance()->sig_ShowCurve(m_mapShowObject);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-20 17:20:17 +08:00
|
|
|
|
//深度移动
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-21 11:55:21 +08:00
|
|
|
|
//支持多选
|
|
|
|
|
|
foreach(QTreeWidgetItem *item, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strTreeTag = item->data(0, Qt::UserRole).toString();
|
|
|
|
|
|
if (strTreeTag == "curveObject" || strTreeTag=="waveObject" || strTreeTag == "tableObject")
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strLineName = item->text(0);
|
|
|
|
|
|
QString strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
ApplyShiftDepth(strSlfName, strLineName, depthshift);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset)
|
|
|
|
|
|
{
|
2026-01-20 17:20:17 +08:00
|
|
|
|
//1.修改内存数据
|
2026-01-21 11:55:21 +08:00
|
|
|
|
if(strSlfName=="") return ;
|
2026-01-20 17:20:17 +08:00
|
|
|
|
CMemRdWt * logio=new CMemRdWt();
|
2026-01-21 11:55:21 +08:00
|
|
|
|
if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
|
2026-01-20 17:20:17 +08:00
|
|
|
|
{
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
//AppendConsole(pai::log::PAI_ERROR,"SLF文件打开失败,请检查!");
|
|
|
|
|
|
return ;
|
|
|
|
|
|
};
|
|
|
|
|
|
bool isok=0;
|
|
|
|
|
|
//TODO 目前对于表格类,参数卡类不支持,会崩溃
|
2026-01-21 11:55:21 +08:00
|
|
|
|
int curveindex=logio->FindObjectName((char *)strLineName.toStdString().c_str());
|
2026-01-20 17:20:17 +08:00
|
|
|
|
if(curveindex>=0) {
|
|
|
|
|
|
CString szBuffer="";
|
2026-01-21 11:55:21 +08:00
|
|
|
|
szBuffer=QString::number(DepthOffset,'f',3)+"\r\n";
|
|
|
|
|
|
WriteShiftMessage(*logio,szBuffer,strLineName);
|
|
|
|
|
|
logio->CorrectObjectDepth(curveindex, DepthOffset);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
isok=1;
|
|
|
|
|
|
}
|
|
|
|
|
|
delete logio;
|
2026-01-28 16:32:28 +08:00
|
|
|
|
|
|
|
|
|
|
//Plot重新加载数据
|
|
|
|
|
|
emit CallManage::getInstance()->sig_ReloadPlot("all", strSlfName, strLineName);
|
2026-01-20 17:20:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-10 16:35:40 +08:00
|
|
|
|
//表格数据查看
|
|
|
|
|
|
void QtProjectWidgets::onShowTable(bool checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_ShowTable(m_strSlfName, m_strCurveObjectName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-29 16:57:06 +08:00
|
|
|
|
//波列数据查看
|
|
|
|
|
|
void QtProjectWidgets::onShowWave(bool checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_ShowWave(m_strSlfName, m_strCurveObjectName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
//备份井次
|
|
|
|
|
|
void QtProjectWidgets::onSlfbackup()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(!m_strSlfName.isEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
QString path,strWellName,Slfname;
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem;
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
strWellName = parentItem->parent()->text(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
GetWellNameAndPath(m_strSlfName,Slfname,path);
|
|
|
|
|
|
QString newfile=path+"/"+Slfname+"_backup.slf";
|
|
|
|
|
|
if(QFile::copy(m_strSlfName,newfile)) {
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
|
|
|
|
|
|
|
|
|
|
|
int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量
|
|
|
|
|
|
if(topCount<1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
int childCount = item->childCount(); // 获取子节点数量
|
|
|
|
|
|
for (int i = 0; i < childCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellGroupItem = item->child(i);
|
|
|
|
|
|
QString wellGroupname = wellGroupItem->text(0);
|
|
|
|
|
|
if (wellGroupname == "井组")
|
|
|
|
|
|
{
|
|
|
|
|
|
int wellCount = wellGroupItem->childCount(); // 获取井节点数量
|
|
|
|
|
|
for (int j = 0; j < wellCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellItem = wellGroupItem->child(j);
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
if(wellname==strWellName)//井
|
|
|
|
|
|
{
|
|
|
|
|
|
wellItem->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return ;
|
|
|
|
|
|
}
|
|
|
|
|
|
else QMessageBox::information(NULL,"提示","备份失败!");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//剪切井次
|
|
|
|
|
|
void QtProjectWidgets::onCutSlf()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_mapCopyObject.clear();
|
|
|
|
|
|
m_strCutSlfName = m_strSlfName;
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem;
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_strCutWellname = parentItem->parent()->text(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-20 15:13:47 +08:00
|
|
|
|
//编辑测井信息
|
|
|
|
|
|
void QtProjectWidgets::onWelllogInformation()
|
|
|
|
|
|
{
|
2026-01-20 17:20:17 +08:00
|
|
|
|
emit CallManage::getInstance()->sig_WelllogInformation(m_strSlfName);
|
2025-11-26 10:21:39 +08:00
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem;
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
// qDeleteAll(parentItem->takeChildren());
|
|
|
|
|
|
QTreeWidgetItem *pWellItem = parentItem->parent();
|
|
|
|
|
|
QString Wellname = parentItem->text(0);
|
|
|
|
|
|
// parentItem->setExpanded(false);
|
|
|
|
|
|
loadWellTree(parentItem->parent(), m_strSlfName, Wellname);
|
|
|
|
|
|
pWellItem->removeChild(parentItem);
|
|
|
|
|
|
pWellItem->setExpanded(true);
|
|
|
|
|
|
|
|
|
|
|
|
int WellCount = pWellItem->childCount();
|
|
|
|
|
|
for (int i = 0; i < WellCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *childItem = pWellItem->child(i);
|
|
|
|
|
|
childItem->setExpanded(true);
|
|
|
|
|
|
int childCount = childItem->childCount();
|
|
|
|
|
|
for (int j = 0; j < childCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
childItem->child(j)->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-20 17:20:17 +08:00
|
|
|
|
//深度移动(井次)
|
|
|
|
|
|
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;
|
2026-01-28 16:32:28 +08:00
|
|
|
|
|
|
|
|
|
|
//整口井重新加载数据
|
|
|
|
|
|
logio=new CMemRdWt();
|
|
|
|
|
|
if(!logio->Open(m_strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
|
|
|
|
|
|
{
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
return ;
|
|
|
|
|
|
};
|
|
|
|
|
|
Count=logio->GetObjectCount();
|
|
|
|
|
|
for(int i=0;i<Count;i++) {
|
|
|
|
|
|
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue;
|
|
|
|
|
|
logio->GetObjectName(i,objname);
|
|
|
|
|
|
//Plot重新加载数据
|
|
|
|
|
|
emit CallManage::getInstance()->sig_ReloadPlot("all", m_strSlfName, objname);
|
|
|
|
|
|
}
|
2026-01-20 17:20:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-26 10:21:39 +08:00
|
|
|
|
//创建新表
|
|
|
|
|
|
void QtProjectWidgets::onCreateNewTable()
|
|
|
|
|
|
{
|
|
|
|
|
|
CDataManagger DataManagger;
|
|
|
|
|
|
DataManagger.CreateNewTable(m_strSlfName);
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem->parent();
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
// qDeleteAll(parentItem->takeChildren());
|
|
|
|
|
|
QTreeWidgetItem *pWellItem = parentItem->parent();
|
|
|
|
|
|
QString Wellname = parentItem->text(0);
|
|
|
|
|
|
// parentItem->setExpanded(false);
|
|
|
|
|
|
loadWellTree(parentItem->parent(), m_strSlfName, Wellname);
|
|
|
|
|
|
pWellItem->removeChild(parentItem);
|
|
|
|
|
|
pWellItem->setExpanded(true);
|
|
|
|
|
|
|
|
|
|
|
|
int WellCount = pWellItem->childCount();
|
|
|
|
|
|
for (int i = 0; i < WellCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *childItem = pWellItem->child(i);
|
|
|
|
|
|
childItem->setExpanded(true);
|
|
|
|
|
|
int childCount = childItem->childCount();
|
|
|
|
|
|
for (int j = 0; j < childCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
childItem->child(j)->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-20 15:13:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
//删除(曲线、表格、波列、参数卡)
|
|
|
|
|
|
void QtProjectWidgets::onDeleteObject()
|
|
|
|
|
|
{
|
2026-04-07 13:53:01 +08:00
|
|
|
|
QList<QString> listDeleteDir;
|
|
|
|
|
|
QList<QString> listDeleteSlf;
|
|
|
|
|
|
QList<QString> listwellname;
|
|
|
|
|
|
QMap<QString,QList<QString>> mapDeleteObject;// 复制Slf文件里对象名
|
|
|
|
|
|
|
|
|
|
|
|
mapDeleteObject.clear();
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strTreeTag = pItem->data(0, Qt::UserRole).toString();
|
|
|
|
|
|
if (strTreeTag == "wellname") //井名
|
|
|
|
|
|
{
|
|
|
|
|
|
QString pathTmp=GetLogdataPath();
|
|
|
|
|
|
pathTmp+=g_prjname+"/#"+pItem->text(0);
|
|
|
|
|
|
listDeleteDir.append(pathTmp);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strTreeTag == "wellItem") //井次
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strSlfName = pItem->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
listDeleteSlf.append(strSlfName);
|
|
|
|
|
|
listwellname.append(pItem->parent()->text(0));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
|
|
|
|
|
|
if (parentItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
if (strSlfName.contains(".slf"))
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strObjectName = pItem->text(0);
|
|
|
|
|
|
if(!mapDeleteObject.contains(strSlfName))
|
|
|
|
|
|
{
|
|
|
|
|
|
QList<QString> selList;
|
|
|
|
|
|
selList.clear();
|
|
|
|
|
|
mapDeleteObject.insert(strSlfName,selList);
|
|
|
|
|
|
}
|
|
|
|
|
|
mapDeleteObject[strSlfName].append(strObjectName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<listDeleteSlf.size(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strSlfName = listDeleteSlf.at(i);
|
|
|
|
|
|
QFile::remove(strSlfName);
|
|
|
|
|
|
if(mapDeleteObject.contains(strSlfName))
|
|
|
|
|
|
mapDeleteObject.remove(strSlfName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<listDeleteDir.size(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
QDir dir(listDeleteDir.at(i));
|
|
|
|
|
|
if (dir.exists())
|
|
|
|
|
|
dir.removeRecursively();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<QString> listSlfName = mapDeleteObject.keys();
|
|
|
|
|
|
for (int i=0; i<listSlfName.size(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strSlfName = listSlfName.at(i);
|
|
|
|
|
|
|
|
|
|
|
|
CLogIO *logio=new CLogIO;
|
|
|
|
|
|
if(!logio->Open(strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QList<QString> listDeleteObject = mapDeleteObject[strSlfName];
|
|
|
|
|
|
for (int j=0; j<listDeleteObject.size(); j++)
|
|
|
|
|
|
logio->DeleteObject(listDeleteObject.at(j).toLocal8Bit().data());
|
|
|
|
|
|
logio->Close();
|
2026-03-25 16:36:46 +08:00
|
|
|
|
delete logio;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
|
|
|
|
|
|
|
|
|
|
|
int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量
|
|
|
|
|
|
if(topCount<1)
|
2026-03-25 16:36:46 +08:00
|
|
|
|
{
|
2026-04-02 15:14:50 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
int childCount = item->childCount(); // 获取子节点数量
|
|
|
|
|
|
for (int i = 0; i < childCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellGroupItem = item->child(i);
|
|
|
|
|
|
QString wellGroupname = wellGroupItem->text(0);
|
|
|
|
|
|
if (wellGroupname == "井组")
|
|
|
|
|
|
{
|
|
|
|
|
|
int wellCount = wellGroupItem->childCount(); // 获取井节点数量
|
|
|
|
|
|
for (int j = 0; j < wellCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellItem = wellGroupItem->child(j);
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
|
|
|
|
|
|
int slfCount = wellItem->childCount(); // 获取井节点数量
|
|
|
|
|
|
// wellItem->sortChildren(0, Qt::SortOrder::AscendingOrder);
|
|
|
|
|
|
for (int k = 0; k < slfCount; ++k)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_strSlfName == wellItem->child(k)->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
wellItem->setExpanded(true);
|
|
|
|
|
|
expandAll(wellItem->child(k));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
for (int k=0; k<listwellname.size(); k++)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strwellname = listwellname.at(i);
|
|
|
|
|
|
if(strwellname== wellItem->text(0))//井
|
|
|
|
|
|
{
|
|
|
|
|
|
wellItem->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-04-02 15:14:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onCopySelObject() // 复制
|
|
|
|
|
|
{
|
2026-04-02 15:14:50 +08:00
|
|
|
|
m_strCutWellname = "";
|
2026-04-01 09:23:19 +08:00
|
|
|
|
m_mapCopyObject.clear();
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
|
|
|
|
|
|
if (parentItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
if (strSlfName.contains(".slf"))
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strObjectName = pItem->text(0);
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
2026-04-01 09:23:19 +08:00
|
|
|
|
if(!m_mapCopyObject.contains(strSlfName))
|
|
|
|
|
|
{
|
|
|
|
|
|
QList<QString> selList;
|
|
|
|
|
|
selList.clear();
|
|
|
|
|
|
m_mapCopyObject.insert(strSlfName,selList);
|
|
|
|
|
|
}
|
|
|
|
|
|
m_mapCopyObject[strSlfName].append(strObjectName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onPasteSelObject() // 粘贴
|
|
|
|
|
|
{
|
2026-04-01 09:23:19 +08:00
|
|
|
|
int flag=0;
|
|
|
|
|
|
int check=0;
|
|
|
|
|
|
m_ReFlag=0;
|
|
|
|
|
|
QList<QString> listCopySlfName = m_mapCopyObject.keys();
|
|
|
|
|
|
for(int i= 0; i < listCopySlfName.size(); i++)
|
2026-03-25 16:36:46 +08:00
|
|
|
|
{
|
2026-04-01 09:23:19 +08:00
|
|
|
|
QString strCopySlfName = listCopySlfName.at(i);
|
|
|
|
|
|
QList<QString> listObjectName = m_mapCopyObject[listCopySlfName.at(i)];
|
|
|
|
|
|
if (strCopySlfName == m_strSlfName)
|
|
|
|
|
|
{
|
|
|
|
|
|
CLogIO *logio=new CLogIO;
|
|
|
|
|
|
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
for(int j= 0; j < listObjectName.size(); j++)
|
|
|
|
|
|
{
|
|
|
|
|
|
char buf[1000];
|
|
|
|
|
|
int nindex=1;
|
|
|
|
|
|
while(1) {
|
|
|
|
|
|
sprintf(buf,"%s_%d",listObjectName.at(j).toLocal8Bit().data(),nindex++);
|
|
|
|
|
|
if (0>logio->FindObjectName(buf))
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
logio->CopyObject(listObjectName.at(j).toLocal8Bit().data(), buf);
|
|
|
|
|
|
}
|
|
|
|
|
|
logio->Close();
|
2026-03-25 16:36:46 +08:00
|
|
|
|
delete logio;
|
|
|
|
|
|
}
|
2026-04-01 09:23:19 +08:00
|
|
|
|
else
|
2026-03-25 16:36:46 +08:00
|
|
|
|
{
|
2026-04-01 09:23:19 +08:00
|
|
|
|
for(int j= 0; j < listObjectName.size(); j++)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bExistence = false;
|
|
|
|
|
|
CLogIO *logio=new CLogIO;
|
|
|
|
|
|
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (logio->FindObjectName(listObjectName.at(j).toLocal8Bit().data())>=0)
|
|
|
|
|
|
bExistence = true;
|
|
|
|
|
|
logio->Close();
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
|
|
|
|
|
|
if((!flag||!check)&&bExistence)
|
|
|
|
|
|
{
|
|
|
|
|
|
QDialog dialog(NULL);
|
|
|
|
|
|
Qt::WindowFlags flags = dialog.windowFlags();
|
|
|
|
|
|
flags |= Qt::WindowStaysOnTopHint;
|
|
|
|
|
|
flags &= ~Qt::WindowContextHelpButtonHint;
|
|
|
|
|
|
dialog.setWindowTitle("提示");
|
|
|
|
|
|
QString mess="已存在!\n 该功能只具覆盖或另创建能力,无法完成拼接操作。\n如需要进行拼接,请在图形区可视化编辑状态完成。\n请选择操作模式:\n";
|
|
|
|
|
|
QFormLayout form(&dialog);
|
|
|
|
|
|
form.addRow(new QLabel(listObjectName.at(j)+mess));
|
|
|
|
|
|
QCheckBox *pCheckBox=new QCheckBox("均按下列操作",&dialog);
|
|
|
|
|
|
form.addRow(pCheckBox);
|
|
|
|
|
|
QDialogButtonBox buttonBox(QDialogButtonBox::Yes |QDialogButtonBox::No | QDialogButtonBox::Cancel,
|
|
|
|
|
|
Qt::Horizontal, &dialog);
|
|
|
|
|
|
form.addRow(&buttonBox);
|
|
|
|
|
|
|
|
|
|
|
|
buttonBox.button(QDialogButtonBox::Yes)->setText(QString("覆盖"));
|
|
|
|
|
|
buttonBox.button(QDialogButtonBox::No)->setText(QString("增加"));
|
|
|
|
|
|
buttonBox.button(QDialogButtonBox::Cancel)->setText(QString("放弃"));
|
|
|
|
|
|
form.addRow(&buttonBox);
|
|
|
|
|
|
QObject::connect(buttonBox.button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(slotButtonCancel()));
|
|
|
|
|
|
QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), this, SLOT(slotButtonOk()));
|
|
|
|
|
|
QObject::connect(buttonBox.button(QDialogButtonBox::No), SIGNAL(clicked()), this, SLOT(slotButtonNo()));
|
|
|
|
|
|
QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
|
|
|
|
|
|
QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
|
|
|
|
|
|
dialog.exec();
|
|
|
|
|
|
flag=m_ReFlag;
|
|
|
|
|
|
check=pCheckBox->checkState();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (flag==QDialogButtonBox::Cancel)
|
|
|
|
|
|
{
|
|
|
|
|
|
QMessageBox::information(NULL,"Cancel","Cancel");
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (flag==QDialogButtonBox::Yes)
|
|
|
|
|
|
{
|
|
|
|
|
|
CLogIO *logio=new CLogIO;
|
|
|
|
|
|
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
logio->DeleteObject(listObjectName.at(j).toLocal8Bit().data());
|
|
|
|
|
|
logio->Close();
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
|
|
|
|
|
|
CObjWellLog* pcopyingwelllog= new CObjWellLog();
|
|
|
|
|
|
pcopyingwelllog->SetSlfFileName(strCopySlfName);
|
|
|
|
|
|
pcopyingwelllog->SetName(listObjectName.at(j));
|
|
|
|
|
|
pcopyingwelllog->CopyToSLFFile(m_strSlfName);
|
|
|
|
|
|
delete pcopyingwelllog;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (flag==QDialogButtonBox::No && bExistence)
|
|
|
|
|
|
{
|
|
|
|
|
|
CLogIO *logio=new CLogIO;
|
|
|
|
|
|
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
char buf[1000];
|
|
|
|
|
|
int nindex=1;
|
|
|
|
|
|
while(1) {
|
|
|
|
|
|
sprintf(buf,"%s_%d",listObjectName.at(j).toLocal8Bit().data(),nindex++);
|
|
|
|
|
|
if (0>logio->FindObjectName(buf))
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
logio->Close();
|
|
|
|
|
|
delete logio;
|
|
|
|
|
|
|
|
|
|
|
|
CObjWellLog* pcopyingwelllog= new CObjWellLog();
|
|
|
|
|
|
pcopyingwelllog->SetSlfFileName(strCopySlfName);
|
|
|
|
|
|
pcopyingwelllog->SetName(listObjectName.at(j));
|
|
|
|
|
|
pcopyingwelllog->CopyToSLFFile(m_strSlfName,false,buf);
|
|
|
|
|
|
delete pcopyingwelllog;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (!bExistence)
|
|
|
|
|
|
{
|
|
|
|
|
|
CObjWellLog* pcopyingwelllog= new CObjWellLog();
|
|
|
|
|
|
pcopyingwelllog->SetSlfFileName(strCopySlfName);
|
|
|
|
|
|
pcopyingwelllog->SetName(listObjectName.at(j));
|
|
|
|
|
|
pcopyingwelllog->CopyToSLFFile(m_strSlfName);
|
|
|
|
|
|
delete pcopyingwelllog;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
2026-04-01 09:23:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem/*->parent()*/; // 上一层目录是井次
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
RefreshWellRoundTree(parentItem);
|
|
|
|
|
|
parentItem = parentItem = pItem->parent();
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
RefreshWellRoundTree(parentItem);
|
|
|
|
|
|
break;
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
2026-04-07 13:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
m_mapCopyObject.clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onReNameObject()
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
pItem->setFlags(pItem->flags() | Qt::ItemIsEditable);
|
|
|
|
|
|
ui->treeWidget->editItem(pItem);
|
|
|
|
|
|
// ui->treeWidget->setCurrentItem(pItem); // 更常用的是这样设置当前项并触发编辑
|
|
|
|
|
|
// ui->treeWidget->setFocus(); // 确保控件获得焦点
|
|
|
|
|
|
}
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
// 粘贴井次
|
|
|
|
|
|
void QtProjectWidgets::onPasteWell()
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strNewName=m_strWellname;
|
|
|
|
|
|
QString name="您确信移动到"+strNewName+"井下吗?\n如果移动,该井数据将被移入(当前井下数据也被备份于Logdata/Temp下)。";
|
|
|
|
|
|
int flag = QMessageBox::warning(NULL,"提示",name,QMessageBox::Yes,QMessageBox::No);
|
|
|
|
|
|
if(flag==QMessageBox::Yes)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString wellfile=m_strCutSlfName;
|
|
|
|
|
|
QString newfilename;
|
|
|
|
|
|
int index=wellfile.lastIndexOf("#");
|
|
|
|
|
|
int index1=wellfile.lastIndexOf("\\");
|
|
|
|
|
|
int index2=wellfile.lastIndexOf("/");
|
|
|
|
|
|
if(index2>index1) index1=index2;
|
|
|
|
|
|
QString olddir=wellfile.left(index1);
|
|
|
|
|
|
QString newdir=wellfile.mid(index,index1-index);
|
|
|
|
|
|
newfilename=wellfile;
|
|
|
|
|
|
newfilename.replace(newdir,"#"+strNewName);
|
|
|
|
|
|
|
|
|
|
|
|
QFileInfo check_file(newfilename);
|
|
|
|
|
|
if (check_file.exists() && check_file.isFile()) {
|
|
|
|
|
|
QString strMessage="已存在井次文件"+newfilename+"确定要覆盖么?";
|
|
|
|
|
|
int flag1 =QMessageBox::warning(NULL,"提示",strMessage,QMessageBox::Yes,QMessageBox::No);
|
|
|
|
|
|
if(flag!=QMessageBox::Yes)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
QFile::remove(newfilename);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QDir ss;
|
|
|
|
|
|
if(ss.rename(wellfile,newfilename))
|
|
|
|
|
|
{
|
|
|
|
|
|
SetWellRoundWellName(newfilename,strNewName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
|
|
|
|
|
|
|
|
|
|
|
int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量
|
|
|
|
|
|
if(topCount<1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
int childCount = item->childCount(); // 获取子节点数量
|
|
|
|
|
|
for (int i = 0; i < childCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellGroupItem = item->child(i);
|
|
|
|
|
|
QString wellGroupname = wellGroupItem->text(0);
|
|
|
|
|
|
if (wellGroupname == "井组")
|
|
|
|
|
|
{
|
|
|
|
|
|
int wellCount = wellGroupItem->childCount(); // 获取井节点数量
|
|
|
|
|
|
for (int j = 0; j < wellCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellItem = wellGroupItem->child(j);
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
if(wellname==m_strWellname || wellname==m_strCutWellname)//井
|
|
|
|
|
|
{
|
|
|
|
|
|
wellItem->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_strCutWellname = "";
|
|
|
|
|
|
m_strCutSlfName = "";
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-25 16:36:46 +08:00
|
|
|
|
//刷新井次树
|
|
|
|
|
|
void QtProjectWidgets::RefreshWellRoundTree(QTreeWidgetItem *parentItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
// qDeleteAll(parentItem->takeChildren());
|
|
|
|
|
|
QTreeWidgetItem *pWellItem = parentItem->parent();
|
|
|
|
|
|
QString Wellname = parentItem->text(0);
|
|
|
|
|
|
// parentItem->setExpanded(false);
|
|
|
|
|
|
loadWellTree(parentItem->parent(), m_strSlfName, Wellname);
|
|
|
|
|
|
pWellItem->removeChild(parentItem);
|
|
|
|
|
|
pWellItem->setExpanded(true);
|
|
|
|
|
|
|
|
|
|
|
|
int WellCount = pWellItem->childCount();
|
|
|
|
|
|
for (int i = 0; i < WellCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *childItem = pWellItem->child(i);
|
2026-04-02 15:14:50 +08:00
|
|
|
|
if (childItem && m_strSlfName == childItem->data(0, Qt::UserRole+1).toString())
|
2026-03-25 16:36:46 +08:00
|
|
|
|
{
|
2026-04-02 15:14:50 +08:00
|
|
|
|
childItem->setExpanded(true);
|
|
|
|
|
|
int childCount = childItem->childCount();
|
|
|
|
|
|
for (int j = 0; j < childCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
childItem->child(j)->setExpanded(true);
|
|
|
|
|
|
}
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-04-02 15:14:50 +08:00
|
|
|
|
pWellItem->sortChildren(0, Qt::SortOrder::AscendingOrder);
|
2026-03-25 16:36:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
void QtProjectWidgets::onEditWelllogRound()
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin();
|
|
|
|
|
|
|
2026-04-15 10:16:43 +08:00
|
|
|
|
QString strWellFile = wellItem->data(0, Qt::UserRole + 1).toString();
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//WellLogDialog* wdia = new WellLogDialog();
|
|
|
|
|
|
//CWellLogRoundDialog* wdia = new CWellLogRoundDialog();
|
|
|
|
|
|
MyWelllogRound WelllogRound;
|
2026-04-15 10:16:43 +08:00
|
|
|
|
WelllogRound.LoadMeesge(strWellFile);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
CWellDialog* wdia = new CWellDialog();
|
2026-04-15 10:16:43 +08:00
|
|
|
|
CObjWell* pWell = new CObjWell;
|
|
|
|
|
|
pWell->SetWellFileName(strWellFile);
|
|
|
|
|
|
QString oldWellName = wellItem->text(0);
|
|
|
|
|
|
pWell->SetName(wellItem->text(0));
|
|
|
|
|
|
pWell->SetPrjname(g_prjname);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
wdia->wellLR = WelllogRound;
|
2026-04-15 10:16:43 +08:00
|
|
|
|
wdia->Init(pWell);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if ( wdia->exec() == QDialog::Accepted )
|
|
|
|
|
|
{
|
|
|
|
|
|
// if(strWelllogRoundName != "")
|
|
|
|
|
|
// {
|
|
|
|
|
|
// pWelllogRound->setObjectName(strWelllogRoundName);
|
|
|
|
|
|
// }
|
2026-04-15 10:16:43 +08:00
|
|
|
|
QString newWellName = pWell->GetName();
|
|
|
|
|
|
if (newWellName != oldWellName)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-15 10:16:43 +08:00
|
|
|
|
//QMessageBox::information(this,"1",strWellFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onImportFolder()
|
|
|
|
|
|
{
|
|
|
|
|
|
CDataImport::ImportWellTrajectorys(1);
|
|
|
|
|
|
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
|
|
|
|
|
return;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onImportSingleWellLogData()
|
|
|
|
|
|
{
|
|
|
|
|
|
MainWindow* pMainWindow = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QWidget *w, qApp->topLevelWidgets())
|
|
|
|
|
|
{
|
|
|
|
|
|
if (QMainWindow* mainWin = qobject_cast<QMainWindow*>(w))
|
|
|
|
|
|
{
|
|
|
|
|
|
pMainWindow = dynamic_cast<MainWindow *>(mainWin);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-05 08:10:44 +08:00
|
|
|
|
// if (pMainWindow)
|
2025-10-29 17:23:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
// InterfaceWidget *pInterfaceWidget = new InterfaceWidget();//中间工作区
|
|
|
|
|
|
// pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据");
|
|
|
|
|
|
pai::datamodel::LoadAllPlugin("windows");
|
|
|
|
|
|
DiDepthProgress DepthProgress;
|
|
|
|
|
|
ConvertorManager::GetInstance().LoadAllConvertorPlugin();
|
|
|
|
|
|
ConvertorManager &pManager=ConvertorManager::GetInstance();
|
|
|
|
|
|
pManager.all=0;
|
|
|
|
|
|
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
|
|
|
|
|
|
QString fileSuffix("数据文件(");
|
2026-04-10 06:38:45 +08:00
|
|
|
|
for (int i=0;i<vSuffix.size();i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString sSuffix="*.";
|
|
|
|
|
|
sSuffix.append(vSuffix[i]);
|
|
|
|
|
|
fileSuffix.append(sSuffix);
|
|
|
|
|
|
fileSuffix.append(" ");
|
|
|
|
|
|
}
|
|
|
|
|
|
fileSuffix.append(")");
|
|
|
|
|
|
QStringList listFiles;//=GetFileNames("选择数据文件",fileSuffix,QFileDialog::ExistingFiles);
|
|
|
|
|
|
QString file_name = QFileDialog::getOpenFileName(this,tr("打开测井数据文件"), "",fileSuffix/*"*.txt *"*/, 0);
|
|
|
|
|
|
// listFiles.append(QString("D:/LogPlus/OutData/jph-307.txt"));
|
|
|
|
|
|
listFiles.append(file_name);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
QVector<IConvertor*> vConvertor=pManager.GetSupportConvertors(listFiles[0], &DepthProgress);
|
|
|
|
|
|
// if (vConvertor.empty()) return ;
|
2026-04-10 10:55:04 +08:00
|
|
|
|
if (file_name.isEmpty())
|
|
|
|
|
|
return;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if (vConvertor.empty())
|
|
|
|
|
|
{
|
|
|
|
|
|
QMessageBox::information(NULL,"无法识别的文件",listFiles[0]);
|
|
|
|
|
|
return ;
|
|
|
|
|
|
}
|
|
|
|
|
|
QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin();
|
|
|
|
|
|
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
2026-03-30 15:02:34 +08:00
|
|
|
|
QString wellroundname = wellname;
|
2026-04-07 13:53:01 +08:00
|
|
|
|
QString strTreeTag = wellItem->data(0, Qt::UserRole).toString();
|
2026-03-30 15:02:34 +08:00
|
|
|
|
if (strTreeTag == "wells") //井组
|
2026-02-10 10:56:35 +08:00
|
|
|
|
{
|
|
|
|
|
|
QFileInfo temDir(file_name);
|
|
|
|
|
|
QString tempWellName=temDir.completeBaseName();
|
|
|
|
|
|
tempWellName.replace(" ","");//whp add 2020.3.3 删除井名中的空格
|
|
|
|
|
|
//m_WellLogRoundInfo->SetName(tempWellName.toStdString());
|
|
|
|
|
|
wellname = tempWellName;
|
2026-03-30 15:02:34 +08:00
|
|
|
|
wellroundname = wellname;
|
2026-02-10 10:56:35 +08:00
|
|
|
|
}
|
2026-03-30 15:02:34 +08:00
|
|
|
|
else if (strTreeTag == "wellname") //井名
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strTreeTag == "wellItem") //井次
|
|
|
|
|
|
{
|
|
|
|
|
|
wellname = wellItem->parent()->text(0);
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
ImportDataDialog *pDialog = new ImportDataDialog(NULL,wellname,wellroundname);
|
|
|
|
|
|
QTreeWidgetItem rootItem = *ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
pDialog->SetProjectname(rootItem.text(0));
|
|
|
|
|
|
pDialog->DisplayFileInformationAreaData(vConvertor,listFiles[0]);
|
|
|
|
|
|
if ( pDialog->exec() == QDialog::Accepted )
|
2026-03-30 15:02:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
return ;
|
2026-03-30 15:02:34 +08:00
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onImportSlfTable()
|
|
|
|
|
|
{
|
2025-10-30 09:50:15 +08:00
|
|
|
|
// CInDefTableDlg InDefTableDlg(0);
|
|
|
|
|
|
// InDefTableDlg.exec();
|
|
|
|
|
|
CDataManagger *magr=new CDataManagger();
|
|
|
|
|
|
int CurItemType=-1;
|
|
|
|
|
|
CurItemType = 1;
|
|
|
|
|
|
QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin();
|
|
|
|
|
|
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
QString wellroundname = wellname;
|
|
|
|
|
|
|
|
|
|
|
|
QString folderPath = GetLogdataPath();
|
|
|
|
|
|
folderPath = folderPath + g_prjname;
|
|
|
|
|
|
folderPath = folderPath + "/" + "#" + wellname + "/" + wellroundname + ".slf";
|
|
|
|
|
|
//QMessageBox::information(NULL,"标题",folderPath);
|
|
|
|
|
|
QStringList namelist;//=GetSelWellRound();
|
|
|
|
|
|
magr->dataInTable(CurItemType,wellname,folderPath);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QtProjectWidgets::onOutWellLogRound()
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin();
|
|
|
|
|
|
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
QString wellroundname = wellname;
|
|
|
|
|
|
|
|
|
|
|
|
QString folderPath = GetLogdataPath();
|
|
|
|
|
|
folderPath = folderPath + g_prjname;
|
|
|
|
|
|
folderPath = folderPath + "/" + "#" + wellname + "/" + wellroundname + ".slf";
|
|
|
|
|
|
QStringList namelist;//=GetSelWellRound();
|
|
|
|
|
|
namelist<<folderPath;
|
|
|
|
|
|
QStringList curvelist;//=GetSelCurve();
|
|
|
|
|
|
CDataOutPut* moutPut=new CDataOutPut();
|
|
|
|
|
|
if(!moutPut)return;
|
|
|
|
|
|
moutPut->outWellLogRound(namelist,curvelist);
|
|
|
|
|
|
delete moutPut;
|
|
|
|
|
|
moutPut=NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-05 08:10:44 +08:00
|
|
|
|
void QtProjectWidgets::onCopyObject()
|
|
|
|
|
|
{
|
|
|
|
|
|
// if (NULL==magr)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// QStringList wellnamelist=GetSelWellRound();
|
|
|
|
|
|
// #pragma region 判断当前选择项是“井”、Well、WellRound
|
|
|
|
|
|
// int CurItemType=-1;
|
|
|
|
|
|
// CBaseObject *pObject = GetOSGObject( this->currentItem() );
|
|
|
|
|
|
// pai::objectmodel::PaiObject* object = pObject->GetPaiObject();
|
|
|
|
|
|
// if(object == NULL)return;
|
|
|
|
|
|
// QString WellFileName="",WellName="";
|
|
|
|
|
|
// if(object->GetTypeID()==GetClassID_WellsFolder())
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CurItemType=0;
|
|
|
|
|
|
// WellName="";
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CObjWell *pWell=dynamic_cast<CObjWell*>(object);//this->currentItem());//井级
|
|
|
|
|
|
// if(pWell)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CurItemType=1;
|
|
|
|
|
|
// // WellFileName=pWell->GetWellFileName();
|
|
|
|
|
|
// WellName=pWell->GetName();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CObjWelllogRound *pWellRount=dynamic_cast<CObjWelllogRound*>(object);//this->currentItem());
|
|
|
|
|
|
// if(pWellRount)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CurItemType=2;
|
|
|
|
|
|
// WellFileName=pWellRount->GetSlfFileName();
|
|
|
|
|
|
// WellName=pWellRount->GetWell()->GetName();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if(CurItemType<0)return;
|
|
|
|
|
|
// #pragma endregion 判断当前选择项是“井”、Well、WellRound
|
|
|
|
|
|
// //whp change 2020.3.9 for 统一离散数据入口
|
|
|
|
|
|
// magr->CopyObject(CurItemType,WellName,WellFileName);
|
|
|
|
|
|
|
|
|
|
|
|
CDataManagger* magr=new CDataManagger();
|
|
|
|
|
|
int CurItemType=0;
|
|
|
|
|
|
QString WellFileName="",WellName="";
|
|
|
|
|
|
int nCount = m_qmapWellFiles.count();
|
|
|
|
|
|
magr->SetWellFiles(m_qmapWellFiles);
|
|
|
|
|
|
magr->CopyObject(CurItemType,WellName,WellFileName);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//点击树图节点
|
|
|
|
|
|
void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
QMenu *popMenu = NULL;
|
|
|
|
|
|
QString strTreeTag = item->data(0, Qt::UserRole).toString();
|
|
|
|
|
|
if (strTreeTag == "root")
|
|
|
|
|
|
{
|
|
|
|
|
|
//根节点(项目名称)-右键菜单
|
|
|
|
|
|
popMenu = _menuRoot;
|
|
|
|
|
|
}
|
2026-02-10 10:56:35 +08:00
|
|
|
|
else if (strTreeTag == "wells")
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组-右键菜单
|
|
|
|
|
|
popMenu = _menuWells;
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
else if (strTreeTag == "curveObject"){
|
|
|
|
|
|
//曲线对象(AC、BS...)-右键菜单
|
|
|
|
|
|
popMenu = _menuCurveObject;
|
|
|
|
|
|
m_strCurveObjectName = item->text(0);
|
|
|
|
|
|
m_strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
}
|
2026-01-21 13:45:08 +08:00
|
|
|
|
else if (strTreeTag == "waveObject"){
|
|
|
|
|
|
//波列对象
|
|
|
|
|
|
popMenu = _menuWaveObject;
|
|
|
|
|
|
m_strCurveObjectName = item->text(0);
|
|
|
|
|
|
m_strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
}
|
2026-02-10 10:56:35 +08:00
|
|
|
|
else if (strTreeTag == "cardObject"){
|
|
|
|
|
|
//参数卡对象
|
|
|
|
|
|
popMenu = _menuCardObject;
|
|
|
|
|
|
m_strCurveObjectName = item->text(0);
|
|
|
|
|
|
m_strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
}
|
2025-11-10 16:35:40 +08:00
|
|
|
|
else if (strTreeTag == "tableObject")
|
|
|
|
|
|
{
|
|
|
|
|
|
//表格对象
|
|
|
|
|
|
popMenu = _menuTableObject;
|
|
|
|
|
|
m_strCurveObjectName = item->text(0);
|
|
|
|
|
|
m_strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
else if (strTreeTag == "wellname")
|
|
|
|
|
|
{
|
2026-04-02 15:14:50 +08:00
|
|
|
|
m_strWellname = item->text(0);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//根节点(项目名称)-右键菜单
|
|
|
|
|
|
popMenu = _menuWellName;
|
|
|
|
|
|
}
|
2025-11-20 15:13:47 +08:00
|
|
|
|
else if (strTreeTag == "wellItem")
|
|
|
|
|
|
{
|
2026-01-20 17:20:17 +08:00
|
|
|
|
//井次名称-右键菜单
|
2025-11-20 15:13:47 +08:00
|
|
|
|
popMenu = _menuSlfName;
|
|
|
|
|
|
m_strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
}
|
2025-11-26 10:21:39 +08:00
|
|
|
|
else if (strTreeTag == "Sheet")
|
|
|
|
|
|
{
|
2026-01-20 17:20:17 +08:00
|
|
|
|
//表格数据-右键菜单
|
2025-11-26 10:21:39 +08:00
|
|
|
|
popMenu = _menuTableFolder;
|
2026-01-20 17:20:17 +08:00
|
|
|
|
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf
|
2025-11-26 10:21:39 +08:00
|
|
|
|
}
|
2026-03-25 16:36:46 +08:00
|
|
|
|
else if (strTreeTag == "ParameterCard")
|
|
|
|
|
|
{
|
|
|
|
|
|
//表格数据-右键菜单
|
|
|
|
|
|
popMenu = _menuParCardFolder;
|
|
|
|
|
|
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strTreeTag == "Wave")
|
|
|
|
|
|
{
|
|
|
|
|
|
//波列数据-右键菜单
|
|
|
|
|
|
popMenu = _menuWaveFolder;
|
|
|
|
|
|
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strTreeTag == "Curve")
|
|
|
|
|
|
{
|
|
|
|
|
|
//曲线数据-右键菜单
|
2026-04-10 06:38:45 +08:00
|
|
|
|
popMenu = _menuCurveFolder;
|
2026-03-25 16:36:46 +08:00
|
|
|
|
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
2026-04-01 09:23:19 +08:00
|
|
|
|
if (m_mapCopyObject.size()==0)
|
2026-03-25 16:36:46 +08:00
|
|
|
|
m_action_Paste->setVisible(false);
|
|
|
|
|
|
else
|
|
|
|
|
|
m_action_Paste->setVisible(true);
|
2026-04-01 09:23:19 +08:00
|
|
|
|
|
2026-04-02 15:14:50 +08:00
|
|
|
|
if (m_strWellname==m_strCutWellname || m_strCutWellname.isEmpty())
|
|
|
|
|
|
m_action_WellPaste->setVisible(false);
|
|
|
|
|
|
else
|
|
|
|
|
|
m_action_WellPaste->setVisible(true);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
if (qApp->mouseButtons() == Qt::RightButton) // 只针对鼠标右键,弹出菜单
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == popMenu)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
popMenu->exec(QCursor::pos());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//勾选/不勾选树图节点
|
|
|
|
|
|
void QtProjectWidgets::onItemChanged(QTreeWidgetItem* item, int index)
|
|
|
|
|
|
{
|
2025-11-20 09:32:51 +08:00
|
|
|
|
// qDebug() << "QtProjectWidgets onItemChanged";
|
|
|
|
|
|
// QString strTreeTag = item->data(0, Qt::UserRole).toString();
|
|
|
|
|
|
// if (strTreeTag == "curveObject" || strTreeTag == "tableObject"){
|
|
|
|
|
|
// //曲线对象(AC、BS...) || 表格对象
|
|
|
|
|
|
// m_strCurveObjectName = item->text(0);
|
|
|
|
|
|
// m_strSlfName = item->data(0, Qt::UserRole+1).toString();
|
|
|
|
|
|
// //
|
|
|
|
|
|
// bool bCkecked = false;
|
|
|
|
|
|
// if(item->checkState(0) == Qt::Checked)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// bCkecked = true;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// //曲线("*.slf", "AC", "curveObject", true)
|
|
|
|
|
|
// //表格("*.slf“, "LAYER_DATA", "tableObject", false)
|
|
|
|
|
|
// //(m_strSlfName, m_strCurveObjectName, strTreeTag, bCkecked)
|
|
|
|
|
|
|
|
|
|
|
|
// //插件测试(信号槽)
|
|
|
|
|
|
// emit CallManage::getInstance()->sig_testPlugin(m_strCurveObjectName);
|
|
|
|
|
|
// }
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
2026-02-27 16:35:03 +08:00
|
|
|
|
|
2026-04-10 06:38:45 +08:00
|
|
|
|
//勾选/不勾选树图节点
|
|
|
|
|
|
void QtProjectWidgets::oncloseTreeEditor()
|
|
|
|
|
|
{
|
|
|
|
|
|
QString newWellName,strTreeTag;
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
strTreeTag = pItem->data(0, Qt::UserRole).toString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!m_strSlfName.isEmpty()&&strTreeTag == "wellItem")
|
|
|
|
|
|
{
|
|
|
|
|
|
QString path,Slfname, newSlfname;
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem;
|
|
|
|
|
|
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
newWellName = parentItem->parent()->text(0);
|
|
|
|
|
|
newSlfname = parentItem->text(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
GetWellNameAndPath(m_strSlfName,Slfname,path);
|
|
|
|
|
|
// QString newfile=path+"/"+Slfname+"_backup.slf";
|
|
|
|
|
|
QString newfile=path+"/"+newSlfname+".slf";
|
|
|
|
|
|
if(!QFile::rename(m_strSlfName,newfile))
|
|
|
|
|
|
{
|
|
|
|
|
|
QMessageBox::information(NULL,"提示","重命名失败!");
|
|
|
|
|
|
return ;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strTreeTag == "wellname")
|
|
|
|
|
|
{
|
|
|
|
|
|
QString path,strWellName,Wellpath, newWellpath;
|
|
|
|
|
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *parentItem = pItem;
|
|
|
|
|
|
if (parentItem && "wellname" == parentItem->data(0, Qt::UserRole).toString())
|
|
|
|
|
|
{
|
|
|
|
|
|
strWellName = parentItem->data(0, Qt::UserRole + 2).toString();
|
|
|
|
|
|
newWellName = parentItem->text(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString pathTmp=GetLogdataPath();
|
|
|
|
|
|
Wellpath = pathTmp + g_prjname+"/#"+strWellName;
|
|
|
|
|
|
newWellpath = pathTmp + g_prjname+"/#"+newWellName;
|
|
|
|
|
|
|
|
|
|
|
|
QDir ss;
|
|
|
|
|
|
if(ss.rename(Wellpath,newWellpath))//改目录名
|
|
|
|
|
|
{
|
|
|
|
|
|
QString oldPath = newWellpath + "/" + strWellName + ".well";
|
|
|
|
|
|
QString newPath = newWellpath + "/" + newWellName + ".well";
|
|
|
|
|
|
if(ss.rename(oldPath,newPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
SetWellRoundWellName(newPath, newWellName);
|
|
|
|
|
|
|
|
|
|
|
|
QStringList slffiles;
|
|
|
|
|
|
chakan(newWellpath, slffiles, "*.slf");
|
|
|
|
|
|
foreach(QString slfFile1, slffiles )
|
|
|
|
|
|
{
|
|
|
|
|
|
SetWellRoundWellName(slfFile1, newWellName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
QMessageBox::warning(NULL,"提示","改目文件名不成功:\n"+oldPath+"\n 到 \n"+newWellpath);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
QMessageBox::warning(NULL,"提示","改目录名不成功:\n"+Wellpath+"\n 到 \n"+newWellpath);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString strProjectFolder = GetProjectFolder();
|
|
|
|
|
|
QString strProjectFile = strProjectFolder + g_prjname;
|
|
|
|
|
|
strProjectFile += ".wwl";
|
|
|
|
|
|
s_OpenProject(strProjectFile);
|
|
|
|
|
|
|
|
|
|
|
|
int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量
|
|
|
|
|
|
if(topCount<1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
int childCount = item->childCount(); // 获取子节点数量
|
|
|
|
|
|
for (int i = 0; i < childCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellGroupItem = item->child(i);
|
|
|
|
|
|
QString wellGroupname = wellGroupItem->text(0);
|
|
|
|
|
|
if (wellGroupname == "井组")
|
|
|
|
|
|
{
|
|
|
|
|
|
int wellCount = wellGroupItem->childCount(); // 获取井节点数量
|
|
|
|
|
|
for (int j = 0; j < wellCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellItem = wellGroupItem->child(j);
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
if(wellname==newWellName)//井
|
|
|
|
|
|
{
|
|
|
|
|
|
wellItem->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-27 16:35:03 +08:00
|
|
|
|
//向左侧树图,追加固井结论表格
|
|
|
|
|
|
void QtProjectWidgets::s_AddGujingToTree(QString strSlfName, QString strWellName, QString strLineName)
|
|
|
|
|
|
{
|
|
|
|
|
|
int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量
|
|
|
|
|
|
if(topCount<1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0);
|
|
|
|
|
|
int childCount = item->childCount(); // 获取子节点数量
|
|
|
|
|
|
for (int i = 0; i < childCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellGroupItem = item->child(i);
|
|
|
|
|
|
QString wellGroupname = wellGroupItem->text(0);
|
|
|
|
|
|
if (wellGroupname == "井组")
|
|
|
|
|
|
{
|
|
|
|
|
|
int wellCount = wellGroupItem->childCount(); // 获取井节点数量
|
|
|
|
|
|
for (int j = 0; j < wellCount; ++j)
|
|
|
|
|
|
{
|
|
|
|
|
|
//井组,数据分析...
|
|
|
|
|
|
QTreeWidgetItem *wellItem = wellGroupItem->child(j);
|
|
|
|
|
|
QString wellname = wellItem->text(0);
|
|
|
|
|
|
if(wellname==strWellName)//井
|
|
|
|
|
|
{
|
|
|
|
|
|
// 获取井次节点数量
|
|
|
|
|
|
int wellLogCount = wellItem->childCount();
|
|
|
|
|
|
for (int k = 0; k < wellLogCount; ++k)
|
|
|
|
|
|
{
|
|
|
|
|
|
QTreeWidgetItem *wellLogItem = wellItem->child(k);
|
|
|
|
|
|
wellItem->removeChild(wellLogItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
//井重新加载井次信息
|
|
|
|
|
|
loadWellTree(wellItem, strSlfName, strWellName);
|
|
|
|
|
|
wellItem->setExpanded(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|