2025-10-29 17:23:30 +08:00
|
|
|
|
#include "mainwindow.h"
|
|
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <QSplitter>
|
|
|
|
|
|
#include <QFile>
|
|
|
|
|
|
#include <QTextStream>
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
|
|
#include "totalTitleBar.h"
|
|
|
|
|
|
//
|
|
|
|
|
|
#include "geometryutils.h"
|
|
|
|
|
|
#include "LogIO.h"
|
|
|
|
|
|
#include "WellLogTableDialogNew.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "qtcommonclass.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "PluginName.h"
|
|
|
|
|
|
#include "CallManage.h"
|
|
|
|
|
|
#include "CallPlugin.h"
|
2025-10-31 17:56:50 +08:00
|
|
|
|
#include <QFuture>
|
|
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
|
|
|
|
|
#include "fileopenthread.h"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//以下参数从配置文件读取
|
|
|
|
|
|
int g_iIndex = 0;
|
|
|
|
|
|
int g_iNum = 0;
|
|
|
|
|
|
int g_iOneWidth = 200; //道宽
|
|
|
|
|
|
int g_iHeadHigh = 30; //道头高度
|
|
|
|
|
|
int g_iTitleHigh = 303; //道对象高度
|
|
|
|
|
|
int g_iCurveHigh = 3020;//曲线高度
|
|
|
|
|
|
int g_iMove = 12; //道头偏移
|
|
|
|
|
|
int g_iPointNum = 30000; // number of points in graph
|
|
|
|
|
|
int g_iLineNum = 0; // number of Line
|
|
|
|
|
|
int g_iWidth = 2500; //道宽
|
|
|
|
|
|
//
|
|
|
|
|
|
int g_iX1 = -15;
|
|
|
|
|
|
int g_iX2 = 15;
|
|
|
|
|
|
int g_iY1 = -3000;
|
|
|
|
|
|
int g_iY2 = 0;
|
|
|
|
|
|
int g_iCanZoom = 0;
|
|
|
|
|
|
|
2025-11-21 17:32:16 +08:00
|
|
|
|
int g_iScale = 200;//2500
|
2025-10-29 17:23:30 +08:00
|
|
|
|
QString g_prjname="";
|
|
|
|
|
|
|
2025-11-26 16:56:00 +08:00
|
|
|
|
//是否隐藏刻度
|
|
|
|
|
|
int g_iShow = 0;
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
MainWindow::MainWindow(QWidget *parent) :
|
|
|
|
|
|
QMainWindow(parent),
|
|
|
|
|
|
ui(new Ui::MainWindow)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
|
|
|
|
//setWindowState(Qt::WindowMaximized);//最大化
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
this->setWindowTitle(tr(" 中国石化一体化测井软件平台 LogPlus"));
|
|
|
|
|
|
this->setWindowIcon(QIcon(":/qrc/logo.ico"));
|
|
|
|
|
|
|
|
|
|
|
|
//加载样式
|
|
|
|
|
|
//loadStyle(":/qrc/qss/lightblue.css");
|
|
|
|
|
|
//loadStyle(":/qrc/qss/blacksoft.css");
|
|
|
|
|
|
loadStyle(":/qrc/qss/flatgray.css");
|
|
|
|
|
|
|
2025-10-31 17:56:50 +08:00
|
|
|
|
ReadConfig();
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
initTitleBar(); //菜单栏
|
|
|
|
|
|
initToolBar(); //工具栏
|
|
|
|
|
|
initProjectView(); //左侧-项目区 初始化在前
|
|
|
|
|
|
initWorkSpaceView(); //中间-工作区 初始化在后
|
|
|
|
|
|
dockLayout();
|
|
|
|
|
|
//
|
|
|
|
|
|
this->setStatusBar(::GetStatusBar());//状态栏
|
|
|
|
|
|
|
|
|
|
|
|
//关联信号槽,打开项目
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_Open()), this, SLOT(s_Open()));
|
|
|
|
|
|
//关联信号槽,关闭项目
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_CloseProject()), this, SLOT(s_CloseProject()));
|
|
|
|
|
|
|
|
|
|
|
|
//曲线
|
|
|
|
|
|
//关联信号槽,数据查看
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_ShowCurve(QString, QString)), this, SLOT(s_ShowCurve(QString, QString)));
|
|
|
|
|
|
|
2025-11-10 16:35:40 +08:00
|
|
|
|
//关联信号槽,数据查看
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_ShowTable(QString, QString)), this, SLOT(s_ShowTable(QString, QString)));
|
2025-11-20 15:13:47 +08:00
|
|
|
|
|
|
|
|
|
|
//关联信号槽,测井信息表数据查看
|
|
|
|
|
|
connect(CallManage::getInstance(), SIGNAL(sig_WelllogInformation(QString, QString)), this, SLOT(s_WelllogInformation(QString, QString)));
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
delete ui;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::ReadConfig()
|
|
|
|
|
|
{
|
|
|
|
|
|
int iIndex;
|
|
|
|
|
|
int iNum;
|
|
|
|
|
|
int iOneWidth;
|
|
|
|
|
|
int iHeadHigh;
|
|
|
|
|
|
int iTitleHigh;
|
|
|
|
|
|
int iCurveHigh;
|
|
|
|
|
|
int iMove;
|
|
|
|
|
|
int iPointNum;
|
|
|
|
|
|
int iLineNum;
|
|
|
|
|
|
|
|
|
|
|
|
// 1.获取当前运行程序的目录路径
|
|
|
|
|
|
QString applicationDirPath = QCoreApplication::applicationDirPath();
|
|
|
|
|
|
QString configPath;
|
|
|
|
|
|
configPath = applicationDirPath + "/config/config.ini";
|
|
|
|
|
|
|
|
|
|
|
|
//从配置文件读取
|
|
|
|
|
|
QtCommonClass *qtCommon = new QtCommonClass(this);
|
|
|
|
|
|
qtCommon->readConfigSize(configPath, iIndex, iNum, iOneWidth, iHeadHigh, iTitleHigh, iCurveHigh, iMove, iPointNum, iLineNum);
|
|
|
|
|
|
|
|
|
|
|
|
g_iIndex = iIndex;
|
|
|
|
|
|
g_iNum = iNum;
|
|
|
|
|
|
g_iOneWidth = iOneWidth; //道宽
|
|
|
|
|
|
g_iHeadHigh = iHeadHigh; //道头高度
|
|
|
|
|
|
g_iTitleHigh = iTitleHigh; //道对象高度
|
|
|
|
|
|
g_iCurveHigh = iCurveHigh;//曲线高度
|
|
|
|
|
|
g_iMove = iMove; //道头偏移
|
|
|
|
|
|
g_iPointNum = iPointNum; // number of points in graph
|
|
|
|
|
|
g_iLineNum = iLineNum; // number of Line
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
qtCommon->readXyRange(configPath, g_iX1, g_iX2, g_iY1, g_iY2);
|
2025-11-26 16:56:00 +08:00
|
|
|
|
|
|
|
|
|
|
//读取,是否隐藏刻度
|
|
|
|
|
|
int iShow = 0;
|
|
|
|
|
|
qtCommon->readShowScale(configPath, iShow);
|
|
|
|
|
|
g_iShow = iShow;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
2025-10-31 17:56:50 +08:00
|
|
|
|
CallManage* MainWindow::getInstanceCallManage()
|
|
|
|
|
|
{
|
|
|
|
|
|
return CallManage::getInstance();
|
|
|
|
|
|
}
|
2025-10-29 17:23:30 +08:00
|
|
|
|
void MainWindow::loadStyle(const QString &qssFile)
|
|
|
|
|
|
{
|
|
|
|
|
|
//加载样式表
|
|
|
|
|
|
QString qss;
|
|
|
|
|
|
QFile file(qssFile);
|
|
|
|
|
|
if (file.open(QFile::ReadOnly)) {
|
|
|
|
|
|
//用QTextStream读取样式文件不用区分文件编码 带bom也行
|
|
|
|
|
|
QStringList list;
|
|
|
|
|
|
QTextStream in(&file);
|
|
|
|
|
|
//in.setCodec("utf-8");
|
|
|
|
|
|
while (!in.atEnd()) {
|
|
|
|
|
|
QString line;
|
|
|
|
|
|
in >> line;
|
|
|
|
|
|
list << line;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
|
|
qss = list.join("\n");
|
|
|
|
|
|
QString paletteColor = qss.mid(20, 7);
|
|
|
|
|
|
this->setPalette(QPalette(paletteColor));
|
|
|
|
|
|
//用时主要在下面这句
|
|
|
|
|
|
this->setStyleSheet(qss);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//初始化菜单栏
|
|
|
|
|
|
void MainWindow::initTitleBar()
|
|
|
|
|
|
{
|
|
|
|
|
|
QMenuBar* m_MenuBar = this->menuBar();
|
|
|
|
|
|
m_MenuBar->setStyleSheet("QMenuBar{font-size: 10.5pt; min-height:28px;}");
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
QMenu* m_projectMenu = this->menuBar()->addMenu(tr("工区管理(&F)"));
|
|
|
|
|
|
//
|
|
|
|
|
|
QMenu* m_dataMenu = this->menuBar()->addMenu(tr("数据管理(&D)"));
|
|
|
|
|
|
//
|
|
|
|
|
|
QMenu* m_resultMenu = this->menuBar()->addMenu(tr("成果输出(&R)"));
|
|
|
|
|
|
//
|
|
|
|
|
|
QMenu* m_analyzeToolMenu = this->menuBar()->addMenu(tr("分析工具(&W)"));
|
|
|
|
|
|
//
|
|
|
|
|
|
QMenu* m_SystemToolMenu = this->menuBar()->addMenu(tr("系统工具(&T)"));
|
|
|
|
|
|
//
|
|
|
|
|
|
QMenu* m_helpMenu = this->menuBar()->addMenu(tr("帮助(&H)"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//初始化工具栏
|
|
|
|
|
|
void MainWindow::initToolBar()
|
|
|
|
|
|
{
|
|
|
|
|
|
QSize toolIconSize(18, 18);
|
|
|
|
|
|
ui->mainToolBar->setIconSize(toolIconSize); //设置工具栏图标大小
|
|
|
|
|
|
|
2025-12-12 18:07:25 +08:00
|
|
|
|
QIcon newprojectIcon(::GetImagePath()+"newproject.png");
|
|
|
|
|
|
QIcon openprojectIcon(::GetImagePath()+"openproject.png");
|
|
|
|
|
|
QIcon saveprojectIcon(::GetImagePath()+"saveproject.png");
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon wellogIcon(::GetImagePath()+"wellog.png");
|
|
|
|
|
|
QIcon outcurvesIcon(::GetImagePath()+"outcurves.png");
|
|
|
|
|
|
//
|
|
|
|
|
|
QIcon wellsectionwindowIcon(::GetImagePath()+"wellsectionwindow.png");
|
|
|
|
|
|
QIcon developmentIcon(::GetImagePath()+"development.png");
|
|
|
|
|
|
|
|
|
|
|
|
m_newprojectAc = new QAction(newprojectIcon, "新建项目", this);
|
|
|
|
|
|
m_openprojectAc = new QAction(openprojectIcon, "打开项目", this);
|
|
|
|
|
|
m_saveprojectAc = new QAction(saveprojectIcon, "保存项目", this);
|
|
|
|
|
|
m_wellsectionwindowAc = new QAction(wellsectionwindowIcon, "可视解释", this);
|
|
|
|
|
|
m_wellogAc = new QAction(wellogIcon, "数据导入", this);
|
|
|
|
|
|
m_outcurvesAc = new QAction(outcurvesIcon, "数据导出", this);
|
|
|
|
|
|
m_developmentAc = new QAction(developmentIcon, "开发工具", this);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
ui->mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); //此种方式为文字显示在图标右侧
|
|
|
|
|
|
|
|
|
|
|
|
//add QAction to Widget.
|
2025-12-12 18:07:25 +08:00
|
|
|
|
ui->mainToolBar->addAction(m_newprojectAc);
|
|
|
|
|
|
ui->mainToolBar->addAction(m_openprojectAc);
|
|
|
|
|
|
ui->mainToolBar->addAction(m_saveprojectAc);
|
|
|
|
|
|
ui->mainToolBar->addSeparator();//添加分隔符
|
|
|
|
|
|
//
|
|
|
|
|
|
ui->mainToolBar->addAction(m_wellogAc);
|
|
|
|
|
|
ui->mainToolBar->addAction(m_outcurvesAc);
|
|
|
|
|
|
ui->mainToolBar->addSeparator();//添加分隔符
|
|
|
|
|
|
//
|
|
|
|
|
|
ui->mainToolBar->addAction(m_wellsectionwindowAc);
|
|
|
|
|
|
ui->mainToolBar->addAction(m_developmentAc);
|
|
|
|
|
|
|
|
|
|
|
|
connect(m_newprojectAc, &QAction::triggered, this, &MainWindow::s_New);
|
|
|
|
|
|
connect(m_openprojectAc, &QAction::triggered, this, &MainWindow::s_Open);
|
|
|
|
|
|
connect(m_wellsectionwindowAc, &QAction::triggered, this, &MainWindow::s_showView);//s_Risize
|
|
|
|
|
|
// connect(m_compileAc, &QAction::triggered, this, &MainWindow::s_AddOne);
|
|
|
|
|
|
// connect(m_runAc, &QAction::triggered, this, &MainWindow::s_SaveImage);
|
|
|
|
|
|
// connect(m_debugAc, &QAction::triggered, this, &MainWindow::s_DrawImg);
|
|
|
|
|
|
// connect(m_loadAc, &QAction::triggered, this, &MainWindow::s_DrawLine);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//左侧
|
|
|
|
|
|
void MainWindow::initProjectView()
|
|
|
|
|
|
{
|
|
|
|
|
|
// if (nullptr == m_projectView) {
|
|
|
|
|
|
// m_projectView = new QDockWidget("项目区", this);
|
|
|
|
|
|
// m_projectView->setFeatures(QDockWidget::DockWidgetMovable); // | QDockWidget::DockWidgetFloatable QDockWidget::DockWidgetClosable
|
|
|
|
|
|
// // 设置标题栏字体颜色
|
|
|
|
|
|
// TotalTitleBar *totalTitleBar = new TotalTitleBar(m_projectView);
|
|
|
|
|
|
// totalTitleBar->setAttr(QColor(11, 118, 193), 10, "数据组织与管理树", QColor(255, 255, 255));
|
|
|
|
|
|
// m_projectView->setTitleBarWidget(totalTitleBar);
|
|
|
|
|
|
|
|
|
|
|
|
// m_projectWidgets = new QtProjectWidgets(this);
|
|
|
|
|
|
// m_projectView->setWidget(m_projectWidgets);
|
|
|
|
|
|
|
|
|
|
|
|
// qDebug() << "项目区 id:" << m_projectView->winId() << ", name:" << m_projectView->windowTitle();
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//初始化中间区域
|
|
|
|
|
|
void MainWindow::initWorkSpaceView()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (nullptr == m_stackedWidget_Center) {
|
|
|
|
|
|
m_centerWidgets = new CustomTabWidget();//中间工作区
|
|
|
|
|
|
//m_centerWidgets = new MainWindowNew();//中间工作区
|
|
|
|
|
|
|
|
|
|
|
|
m_stackedWidget_Center = new QStackedWidget;
|
|
|
|
|
|
m_stackedWidget_Center->addWidget(m_centerWidgets);
|
|
|
|
|
|
m_stackedWidget_Center->setWindowTitle("工作区");
|
|
|
|
|
|
//
|
|
|
|
|
|
m_stackedWidget_Center->setCurrentWidget(m_centerWidgets);//默认展示
|
|
|
|
|
|
|
|
|
|
|
|
this->setCentralWidget(m_stackedWidget_Center);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//----
|
2025-10-30 11:55:37 +08:00
|
|
|
|
//MainWindowCurve *mainWindowNew2 = new MainWindowCurve();//中间工作区
|
|
|
|
|
|
//m_centerWidgets->addTab(mainWindowNew2, "解释视图2");
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//----
|
2025-10-30 11:55:37 +08:00
|
|
|
|
//MainWindowNew *mainWindowNew = new MainWindowNew();//中间工作区
|
|
|
|
|
|
//m_centerWidgets->addTab(mainWindowNew, "解释视图");
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
//加载插件显示
|
2025-10-30 11:55:37 +08:00
|
|
|
|
// QWidget * pMyWidget = CallPlugin::getInstance()->getPluginWidget(MYUNITPLUGIN, NULL);
|
|
|
|
|
|
// if (pMyWidget != nullptr)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// //
|
|
|
|
|
|
// //直方图,获取当前工程下的slf
|
|
|
|
|
|
// QVector<QString> vecSlfList;
|
|
|
|
|
|
// QVector<QString> vecWellList;
|
|
|
|
|
|
// bool bRet = getAllSlf(g_prjname, vecSlfList, vecWellList);
|
|
|
|
|
|
// if(bRet)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// for(int i=0; i<vecWellList.size(); i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// qDebug() << "vecWellList:" << QString::number(i+1) << "=" << vecWellList[i];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// for(int i=0; i<vecSlfList.size(); i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// qDebug() << "vecSlfList:" << QString::number(i+1) << "=" << vecSlfList[i];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// //关联信号槽,数据传递vecSlfList, vecWellList
|
|
|
|
|
|
// //...
|
|
|
|
|
|
|
|
|
|
|
|
// //关联信号槽,数据查看
|
|
|
|
|
|
// connect(CallManage::getInstance(), SIGNAL(sig_testPlugin(QString)), pMyWidget, SLOT(s_testPlugin(QString)));
|
|
|
|
|
|
// //
|
|
|
|
|
|
// m_centerWidgets->addTab(pMyWidget, "插件视图");
|
|
|
|
|
|
// }
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
qDebug() << "工作区 id:" << m_stackedWidget_Center->winId() << ", name:" << m_stackedWidget_Center->windowTitle();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//停靠
|
|
|
|
|
|
void MainWindow::dockLayout()
|
|
|
|
|
|
{
|
|
|
|
|
|
//数据组织与管理树
|
|
|
|
|
|
QDockWidget *dock1=new QDockWidget(tr("数据组织与管理树"),this);
|
|
|
|
|
|
dock1->setFeatures(QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetFloatable);//QDockWidget::DockWidgetMovable
|
|
|
|
|
|
dock1->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea);
|
|
|
|
|
|
//
|
|
|
|
|
|
m_projectWidgets = new QtProjectWidgets(this);
|
|
|
|
|
|
dock1->setWidget(m_projectWidgets);
|
|
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea,dock1);
|
|
|
|
|
|
|
|
|
|
|
|
//属性编辑器
|
|
|
|
|
|
m_propertyWidget = PropertyService();
|
|
|
|
|
|
m_propertyWidget->setWindowTitle("属性编辑器");
|
|
|
|
|
|
m_propertyWidget->setParent(this);
|
|
|
|
|
|
addDockWidget( Qt::LeftDockWidgetArea, m_propertyWidget);
|
|
|
|
|
|
|
|
|
|
|
|
//日志输出窗口
|
|
|
|
|
|
m_consoleOutputWidget = ConsoleOutService();
|
|
|
|
|
|
m_consoleOutputWidget->setWindowTitle("输出");
|
|
|
|
|
|
m_consoleOutputWidget->setParent(this);
|
|
|
|
|
|
addDockWidget( Qt::LeftDockWidgetArea, m_consoleOutputWidget);
|
|
|
|
|
|
|
|
|
|
|
|
tabifyDockWidget(m_consoleOutputWidget, m_propertyWidget);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
m_propertyWidget->initWidgetProperty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_New()
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_NewProject();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_Open()
|
|
|
|
|
|
{
|
|
|
|
|
|
//打开
|
|
|
|
|
|
QString fileFull = "";
|
|
|
|
|
|
fileFull = QFileDialog::getOpenFileName(this,
|
|
|
|
|
|
tr("打开项目"),
|
|
|
|
|
|
GetProjectFolder(),
|
|
|
|
|
|
tr("项目文件(*.wwl)"));
|
|
|
|
|
|
if (!fileFull.isEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_OpenProject(fileFull);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-30 11:55:37 +08:00
|
|
|
|
//可视解释
|
|
|
|
|
|
void MainWindow::s_showView()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(g_prjname=="")
|
|
|
|
|
|
{
|
|
|
|
|
|
QMessageBox::information(nullptr, "提示", "请先打开项目!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Logdata
|
|
|
|
|
|
QString folderPath;
|
|
|
|
|
|
folderPath = GetLogdataPath();
|
|
|
|
|
|
folderPath = folderPath + g_prjname;
|
|
|
|
|
|
//folderPath = folderPath + "/multiwell.json";
|
|
|
|
|
|
|
|
|
|
|
|
//打开
|
|
|
|
|
|
QString fileFull = "";
|
|
|
|
|
|
fileFull = QFileDialog::getOpenFileName(this,
|
|
|
|
|
|
tr("选择模板"),
|
|
|
|
|
|
folderPath,
|
|
|
|
|
|
tr("多井图文件(*.json)"));
|
|
|
|
|
|
if (fileFull.isEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
//----
|
|
|
|
|
|
MainWindowCurve *mainWindowCurve = new MainWindowCurve();//中间工作区
|
|
|
|
|
|
m_centerWidgets->addTab(mainWindowCurve, "解释视图");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-31 17:56:50 +08:00
|
|
|
|
QFileInfo fileInfo(fileFull);
|
|
|
|
|
|
QString fileName = fileInfo.fileName(); // 获取文件名
|
|
|
|
|
|
|
2025-10-30 11:55:37 +08:00
|
|
|
|
//----
|
|
|
|
|
|
MainWindowCurve *mainWindowCurve = new MainWindowCurve();//中间工作区
|
2025-10-31 17:56:50 +08:00
|
|
|
|
m_centerWidgets->addTab(mainWindowCurve, fileName);
|
2025-11-04 14:44:14 +08:00
|
|
|
|
mainWindowCurve->Open(fileFull);
|
2025-10-31 17:56:50 +08:00
|
|
|
|
|
|
|
|
|
|
//QFuture<void> future = QtConcurrent::run(std::bind(&MainWindowCurve::s_Open, mainWindowCurve, fileFull));
|
|
|
|
|
|
//mainWindowCurve->Open(fileFull);
|
|
|
|
|
|
|
|
|
|
|
|
// 创建 FileSearchThread 实例
|
2025-11-04 14:44:14 +08:00
|
|
|
|
// FileOpenThread *searchThread = new FileOpenThread(fileFull);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_NewWell, mainWindowCurve, &MainWindowCurve::s_NewWell, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_NewTrackChangeWidth, mainWindowCurve, &MainWindowCurve::s_NewTrackChangeWidth, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_NewTrack_No_Line, mainWindowCurve, &MainWindowCurve::s_NewTrack_No_Line, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_AddLine_Property, mainWindowCurve, &MainWindowCurve::s_AddLine_Property, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// // 启动搜索线程
|
|
|
|
|
|
// searchThread->start();
|
|
|
|
|
|
|
|
|
|
|
|
// // 创建 FileSearchThread 实例
|
|
|
|
|
|
// FileOpenThread *searchThread = new FileOpenThread(fileFull);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_NewWell, mainWindowCurve, &MainWindowCurve::s_NewWell);//, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_NewTrackChangeWidth, mainWindowCurve, &MainWindowCurve::s_NewTrackChangeWidth);//, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_NewTrack_No_Line, mainWindowCurve, &MainWindowCurve::s_NewTrack_No_Line);//, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// connect(searchThread, &FileOpenThread::sig_AddLine_Property, mainWindowCurve, &MainWindowCurve::s_AddLine_Property);//, Qt::BlockingQueuedConnection);
|
|
|
|
|
|
// searchThread->Open(fileFull);
|
2025-10-30 11:55:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
void MainWindow::s_Risize()
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_Risize();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_AddOne()
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_AddOne();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_SaveImage()
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_SaveImg();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_DrawImg()
|
|
|
|
|
|
{
|
|
|
|
|
|
emit CallManage::getInstance()->sig_DrawImg();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_DrawLine()
|
|
|
|
|
|
{
|
|
|
|
|
|
//emit CallManage::getInstance()->sig_DrawLine();
|
|
|
|
|
|
|
|
|
|
|
|
//直方图,获取当前工程下的slf
|
|
|
|
|
|
QVector<QString> vecSlfList;
|
|
|
|
|
|
QVector<QString> vecWellList;
|
|
|
|
|
|
bool bRet = getAllSlf(g_prjname, vecSlfList, vecWellList);
|
|
|
|
|
|
if(bRet)
|
|
|
|
|
|
{
|
|
|
|
|
|
for(int i=0; i<vecWellList.size(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
qDebug() << "vecWellList:" << QString::number(i+1) << "=" << vecWellList[i];
|
|
|
|
|
|
}
|
|
|
|
|
|
for(int i=0; i<vecSlfList.size(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
qDebug() << "vecSlfList:" << QString::number(i+1) << "=" << vecSlfList[i];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::s_CloseProject()
|
|
|
|
|
|
{
|
|
|
|
|
|
// if(m_centerWidgets)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// int iCount = m_centerWidgets->count();
|
|
|
|
|
|
// for(int i=0; i<iCount; i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// m_centerWidgets->removeTab(0);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//曲线数据查看
|
|
|
|
|
|
void MainWindow::s_ShowCurve(QString strSlfName, QString strName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_centerWidgets)
|
|
|
|
|
|
{
|
|
|
|
|
|
WellLogTableDialogNew* pDialog = new WellLogTableDialogNew();
|
2025-11-10 16:35:40 +08:00
|
|
|
|
pDialog->setName(strSlfName, strName, CURVE_OBJECT);
|
2025-11-12 16:56:33 +08:00
|
|
|
|
QString wellname;
|
|
|
|
|
|
QString path;
|
2025-11-10 16:35:40 +08:00
|
|
|
|
GetWellNameAndPath(strSlfName, wellname, path);
|
|
|
|
|
|
m_centerWidgets->addTab(pDialog, wellname + ":" + strName);
|
|
|
|
|
|
int iCount = m_centerWidgets->count();
|
|
|
|
|
|
m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//表格数据查看
|
|
|
|
|
|
void MainWindow::s_ShowTable(QString strSlfName, QString strName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_centerWidgets)
|
|
|
|
|
|
{
|
|
|
|
|
|
WellLogTableDialogNew* pDialog = new WellLogTableDialogNew();
|
|
|
|
|
|
pDialog->setName(strSlfName, strName, TABLEE_OBJECT);
|
|
|
|
|
|
QString wellname;QString path;
|
|
|
|
|
|
GetWellNameAndPath(strSlfName, wellname, path);
|
|
|
|
|
|
m_centerWidgets->addTab(pDialog, wellname + ":" + strName);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
int iCount = m_centerWidgets->count();
|
|
|
|
|
|
m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-20 15:13:47 +08:00
|
|
|
|
|
|
|
|
|
|
//编辑测井信息
|
|
|
|
|
|
void MainWindow::s_WelllogInformation(QString strSlfName, QString strName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_centerWidgets)
|
|
|
|
|
|
{
|
|
|
|
|
|
// pai::gui::WellLogInformation* pWellLogInformation=new pai::gui::WellLogInformation;
|
|
|
|
|
|
// pWellLogInformation->exec();
|
|
|
|
|
|
// pWellLogInformation->SetWelllogRound(pWelllogRound);
|
|
|
|
|
|
CLogIO * pLogio=new CLogIO();
|
|
|
|
|
|
if(!pLogio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite))
|
|
|
|
|
|
{
|
|
|
|
|
|
QMessageBox::information(nullptr,QString::fromLocal8Bit("提示"),QString::fromLocal8Bit("存储失败!"));
|
|
|
|
|
|
delete pLogio;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
// pWellLogInformation->CreateTable(pLogio);
|
|
|
|
|
|
QString wellname;QString path;
|
|
|
|
|
|
GetWellNameAndPath(strSlfName, wellname, path);
|
|
|
|
|
|
// m_centerWidgets->addTab(pWellLogInformation, wellname + ":测井信息" );
|
|
|
|
|
|
// int iCount = m_centerWidgets->count();
|
|
|
|
|
|
// m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nTableFlag =pLogio->OpenTable("wellloginformation");
|
|
|
|
|
|
if(nTableFlag!=-1)
|
|
|
|
|
|
{
|
|
|
|
|
|
s_ShowTable(strSlfName, "wellloginformation");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString szColumnName;
|
|
|
|
|
|
|
|
|
|
|
|
szColumnName+=("缩写");szColumnName+=",";
|
|
|
|
|
|
szColumnName+=("值");szColumnName+=",";
|
|
|
|
|
|
|
|
|
|
|
|
szColumnName+=("单位");szColumnName+=",";
|
|
|
|
|
|
szColumnName+=("中文名");szColumnName+=",";
|
|
|
|
|
|
|
|
|
|
|
|
QString szDataType;
|
|
|
|
|
|
szDataType+="6,6,6,6";
|
|
|
|
|
|
|
|
|
|
|
|
QString szSize;
|
|
|
|
|
|
szSize+="64,128,64,128";
|
|
|
|
|
|
|
|
|
|
|
|
QString szRemark;
|
|
|
|
|
|
szRemark+="0,0,0,0";
|
|
|
|
|
|
|
|
|
|
|
|
nTableFlag =pLogio->Open_Set_Table("wellloginformation",
|
|
|
|
|
|
TABLEE_OBJECT,
|
|
|
|
|
|
4,
|
|
|
|
|
|
// szColumnName.toLocal8Bit().data(),
|
|
|
|
|
|
szColumnName.toStdString().c_str(),
|
|
|
|
|
|
szSize.toLocal8Bit().data(),
|
|
|
|
|
|
szDataType.toLocal8Bit().data(),
|
|
|
|
|
|
szRemark.toLocal8Bit().data());
|
|
|
|
|
|
|
|
|
|
|
|
int nTableColumn=pLogio->GetTableFieldCount(nTableFlag);
|
|
|
|
|
|
Slf_TABLE_FIELD *pFieldInfo=new Slf_TABLE_FIELD[nTableColumn+1];
|
|
|
|
|
|
pLogio->GetTableFieldInfo(nTableFlag,pFieldInfo);
|
|
|
|
|
|
|
|
|
|
|
|
char pArr[100];
|
|
|
|
|
|
|
|
|
|
|
|
strcpy(pArr, "WN");
|
|
|
|
|
|
pLogio->SetTableFieldData(nTableFlag,0,pArr,1);//缩写
|
|
|
|
|
|
strcpy(pArr, wellname.toStdString().c_str());
|
|
|
|
|
|
pLogio->SetTableFieldData(nTableFlag,1,pArr,1);//单位
|
|
|
|
|
|
strcpy(pArr, "NONE");
|
|
|
|
|
|
pLogio->SetTableFieldData(nTableFlag,2,pArr,1);//井名
|
|
|
|
|
|
strcpy(pArr, "井名");
|
|
|
|
|
|
pLogio->SetTableFieldData(nTableFlag,3,pArr,1);
|
|
|
|
|
|
s_ShowTable(strSlfName, "wellloginformation");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|