Merge branch 'main' of http://git.hivekion.com:3000/jiayulong/logplus
This commit is contained in:
commit
6cc5be18c3
|
|
@ -2692,7 +2692,7 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
|
|||
//固井结论
|
||||
this->initGujingProperty(formInfo);
|
||||
}
|
||||
if (m_strLineName == "IMAGE_DATA")
|
||||
else if (m_strLineName == "IMAGE_DATA")
|
||||
{
|
||||
// 岩心图片
|
||||
this->initImageProperty(formInfo);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "PickFrac.h"
|
||||
#include "DrawNrad.h"
|
||||
#include "formline.h"
|
||||
#include "PropertyWidget.h"
|
||||
|
||||
//以下参数从配置文件读取
|
||||
extern int g_iIndex;
|
||||
|
|
@ -2056,6 +2057,15 @@ void FormDraw::DisplayLine_One(QJsonObject lineObjInfo)
|
|||
bDrawSymmetry = value.toBool();
|
||||
}
|
||||
}
|
||||
//
|
||||
QCPScatterStyle::ScatterShape pointStyle=QCPScatterStyle::ssCircle;//数据点,符号类型,圆,三角等
|
||||
if (lineObjInfo.contains("pointStyle"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("pointStyle");
|
||||
if (value.isDouble()) {
|
||||
pointStyle = (QCPScatterStyle::ScatterShape)value.toInt();
|
||||
}
|
||||
}
|
||||
|
||||
QString folderPath = GetLogdataPath();
|
||||
folderPath = folderPath + g_prjname;
|
||||
|
|
@ -2099,6 +2109,8 @@ void FormDraw::DisplayLine_One(QJsonObject lineObjInfo)
|
|||
else{
|
||||
listOtherProperty.append("0");
|
||||
}
|
||||
//
|
||||
listOtherProperty.append(QString::number(pointStyle));
|
||||
|
||||
//新建曲线
|
||||
s_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName,
|
||||
|
|
@ -2794,6 +2806,12 @@ void FormDraw::s_delLine(QString strUuid, QString strWellName, QString strTrackN
|
|||
{
|
||||
childWidget->deleteLater(); // 安排控件的删除,稍后执行
|
||||
m_listLineName.removeOne(strLineName);
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2840,6 +2858,12 @@ void FormDraw::s_delWave(QString strUuid, QString strWellName, QString strTrackN
|
|||
{
|
||||
childWidget->deleteLater(); // 安排控件的删除,稍后执行
|
||||
m_listWaveName.removeOne(strLineName);
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2885,6 +2909,12 @@ void FormDraw::s_delTableLine(QString strUuid, QString strWellName, QString strT
|
|||
{
|
||||
childWidget->deleteLater(); // 安排控件的删除,稍后执行
|
||||
m_listTableName.removeOne(strLineName);
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
|
@ -4184,7 +4214,9 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi
|
|||
bool bDrawGan = false; // 杆状
|
||||
bool bDrawPoint = false; // 点状
|
||||
bool bDrawSymmetry = false; // 绘制对称曲线
|
||||
if(listOtherProperty.size()>=7)
|
||||
QCPScatterStyle::ScatterShape pointStyle=QCPScatterStyle::ssCircle;//数据点,符号类型,圆,三角等
|
||||
|
||||
if(listOtherProperty.size()>=8)
|
||||
{
|
||||
if(listOtherProperty[3]=="DrawLine")
|
||||
{
|
||||
|
|
@ -4221,6 +4253,8 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi
|
|||
{
|
||||
bDrawSymmetry = false;
|
||||
}
|
||||
//
|
||||
pointStyle = (QCPScatterStyle::ScatterShape)listOtherProperty[7].toInt();
|
||||
}
|
||||
|
||||
//最大值,最小值
|
||||
|
|
@ -4321,6 +4355,7 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi
|
|||
widget->m_bDrawGan = bDrawGan;
|
||||
widget->m_bDrawPoint = bDrawPoint;
|
||||
widget->m_bDrawSymmetry = bDrawSymmetry;
|
||||
widget->m_pointStyle = pointStyle;
|
||||
|
||||
addRandomGraph(widget, x, y, strSlfName, strLineName, strAliasName, strUnit,
|
||||
newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty);
|
||||
|
|
@ -7780,6 +7815,12 @@ void FormDraw::s_changeGujingLine(QString strUuid, QString strSlfName, QString s
|
|||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
m_listLineName.removeOne(strLineName);
|
||||
|
||||
//属性清空
|
||||
//PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
//qDebug() << "FormDraw strLineName already exist! " << strLineName;
|
||||
//return;
|
||||
}
|
||||
|
|
@ -7800,6 +7841,12 @@ void FormDraw::s_changeJiegutextLine(QString strUuid, QString strSlfName, QStrin
|
|||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
m_listLineName.removeOne(strLineName);
|
||||
|
||||
//属性清空
|
||||
//PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
//qDebug() << "FormDraw strLineName already exist! " << strLineName;
|
||||
//return;
|
||||
}
|
||||
|
|
@ -7820,6 +7867,12 @@ void FormDraw::s_changeLineName(QString strUuid, QString strSlfName, QString str
|
|||
if(m_listLineName.contains(strLineName))
|
||||
{
|
||||
m_listLineName.removeOne(strLineName);
|
||||
|
||||
//属性清空
|
||||
//PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
//qDebug() << "FormDraw strLineName already exist! " << strLineName;
|
||||
//return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ QJsonObject FormInfo::makeJson()
|
|||
rootObj["DrawGan"] = m_bDrawGan; // 杆状
|
||||
rootObj["DrawPoint"] = m_bDrawPoint; // 点状
|
||||
rootObj["DrawSymmetry"] = m_bDrawSymmetry; // 绘制对称曲线
|
||||
rootObj["pointStyle"] = m_pointStyle;
|
||||
|
||||
//岩性填充
|
||||
rootObj["newFillMode"] = m_newFillMode;
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ void FormTrack::s_addLine(QString strSlfName, QString strWellName, QString strTr
|
|||
curveNameFont.fromString(listOtherProperty[2]);
|
||||
formInfo->m_curveNameFont = curveNameFont;
|
||||
}
|
||||
if(listOtherProperty.size()>=7)
|
||||
if(listOtherProperty.size()>=8)
|
||||
{
|
||||
if(listOtherProperty[3]=="DrawLine")
|
||||
{
|
||||
|
|
@ -407,6 +407,11 @@ void FormTrack::s_addLine(QString strSlfName, QString strWellName, QString strTr
|
|||
{
|
||||
formInfo->m_bDrawSymmetry = false;
|
||||
}
|
||||
|
||||
//
|
||||
QCPScatterStyle::ScatterShape pointStyle=QCPScatterStyle::ssCircle;//数据点,符号类型,圆,三角等
|
||||
pointStyle = (QCPScatterStyle::ScatterShape)listOtherProperty[7].toInt();
|
||||
formInfo->m_pointStyle = pointStyle;
|
||||
}
|
||||
|
||||
//设置高度
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "qtColorSchemeComboBox.h"
|
||||
#include "geometryutils.h"
|
||||
#include "mainwindowcurve.h"
|
||||
#include "PropertyWidget.h"
|
||||
|
||||
extern int g_iOneWidth; //道宽
|
||||
//extern int m_iY1;
|
||||
|
|
@ -77,6 +78,28 @@ int FormWell::insertColumn(int nw)
|
|||
return ncolCount;
|
||||
}
|
||||
|
||||
//获取当前井的所有道名称
|
||||
QStringList FormWell::getTrackNameList()
|
||||
{
|
||||
QStringList listTrackName;
|
||||
|
||||
int columnCount = ui->tableWidget->columnCount();//总列数
|
||||
for(int i=0; i<columnCount; i++)
|
||||
{
|
||||
if( ui->tableWidget->cellWidget(0, i) != nullptr )
|
||||
{
|
||||
auto myWidget = ui->tableWidget->cellWidget(0, i);
|
||||
FormTrackTop* fromTop = qobject_cast<FormTrackTop*>(myWidget);
|
||||
if(fromTop)
|
||||
{
|
||||
listTrackName.append(fromTop->m_strTrackName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return listTrackName;
|
||||
}
|
||||
|
||||
QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
||||
{
|
||||
QVector<QWidget *> vec;
|
||||
|
|
@ -101,8 +124,9 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
|||
|
||||
if(strTrackName.length() <= 0)
|
||||
{
|
||||
//道名
|
||||
strTrackName = "道" + QString::number(columnCount+1);
|
||||
//获取当前井的所有道名称
|
||||
QStringList listTrackName = getTrackNameList();
|
||||
//
|
||||
if(strType == "depthObject")
|
||||
strTrackName = "深度";
|
||||
else if(strType == "roseObject")
|
||||
|
|
@ -111,6 +135,42 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
|||
strTrackName = "DCA检测";
|
||||
else if(strType == "tdtObject")
|
||||
strTrackName = "TDT";
|
||||
else{
|
||||
strTrackName = "道" + QString::number(columnCount+1);
|
||||
}
|
||||
//
|
||||
if(listTrackName.size()>0)
|
||||
{
|
||||
if(listTrackName.contains(strTrackName))//道名已经存在,避免道重名
|
||||
{
|
||||
//道名
|
||||
for(int i=2; i<100; i++)
|
||||
{
|
||||
//
|
||||
if(strType == "depthObject")
|
||||
strTrackName = "深度" + QString::number(columnCount+i);
|
||||
else if(strType == "roseObject")
|
||||
strTrackName = "玫瑰图" + QString::number(columnCount+i);
|
||||
else if(strType == "dcaObject")
|
||||
strTrackName = "DCA检测" + QString::number(columnCount+i);
|
||||
else if(strType == "tdtObject")
|
||||
strTrackName = "TDT" + QString::number(columnCount+i);
|
||||
else{
|
||||
strTrackName = "道" + QString::number(columnCount+i);
|
||||
}
|
||||
|
||||
//
|
||||
if(listTrackName.contains(strTrackName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormTrack *formTrack = nullptr;
|
||||
|
|
@ -640,7 +700,14 @@ void FormWell::slotDeleteSelectTrack()
|
|||
if(iCurrentRow == 0)
|
||||
{
|
||||
ui->tableWidget->removeColumn(iCurrentCol);
|
||||
|
||||
resizeWindow();
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,9 @@ public:
|
|||
//设置道宽
|
||||
int setColWidth(int iCurrentCol, int iNewWidth);
|
||||
|
||||
//获取当前井的所有道名称
|
||||
QStringList getTrackNameList();
|
||||
|
||||
public slots:
|
||||
//void onTableColumnsInserted(const QModelIndex &parent, int first, int last);
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ void MainWindowCurve::initMainToolBar()
|
|||
QIcon executeDepthShiftIcon(::GetImagePath()+"icon/ExecuteDepthShift.png");
|
||||
QIcon joindepthIcon(::GetImagePath()+"icon/joindepth.png");
|
||||
QIcon ModuleOpenIcon(::GetImagePath()+"icon/ModuleOne.png");
|
||||
QIcon openFileIcon(":/image/open.png");
|
||||
QIcon SaveAsPictureIcon(::GetImagePath()+"icon/SaveAsPicture.png");
|
||||
QIcon runIcon(":/image/capacity.png");
|
||||
QIcon debugIcon(":/image/anaysis.png");
|
||||
QIcon loadIcon(":/image/export.png");
|
||||
|
|
@ -210,7 +210,7 @@ void MainWindowCurve::initMainToolBar()
|
|||
QAction* m_executeDepthShiftAc = nullptr; //校深
|
||||
QAction* m_joindepthAc = nullptr; //拼接
|
||||
QAction* m_ModuleOpenAc = nullptr; //处理方法
|
||||
//QAction* m_openAc = nullptr; //打开
|
||||
QAction* m_SaveAsPictureAc = nullptr; //导出长图
|
||||
// QAction* m_runAc = nullptr;//
|
||||
// QAction* m_debugAc = nullptr; //
|
||||
// QAction* m_loadAc = nullptr; //加载
|
||||
|
|
@ -222,7 +222,7 @@ void MainWindowCurve::initMainToolBar()
|
|||
m_executeDepthShiftAc = new QAction(executeDepthShiftIcon, "校深", this);
|
||||
m_joindepthAc = new QAction(joindepthIcon, "拼接", this);
|
||||
m_ModuleOpenAc = new QAction(ModuleOpenIcon, "处理方法", this);
|
||||
// m_runAc = new QAction(runIcon, "设置井", this);
|
||||
m_SaveAsPictureAc = new QAction(SaveAsPictureIcon, "导出长图", this);
|
||||
// m_debugAc = new QAction(debugIcon, "撤销", this);
|
||||
// m_loadAc = new QAction(loadIcon, "重做", this);
|
||||
//m_openAc = new QAction(openFileIcon, "打开", this);
|
||||
|
|
@ -238,7 +238,8 @@ void MainWindowCurve::initMainToolBar()
|
|||
ui->mainToolBar->addAction(m_joindepthAc);
|
||||
ui->mainToolBar->addAction(m_ModuleOpenAc);
|
||||
|
||||
// ui->mainToolBar->addAction(m_runAc);
|
||||
//ui->mainToolBar->addAction(m_SaveAsPictureAc);//导出长图
|
||||
|
||||
// ui->mainToolBar->addAction(m_debugAc);
|
||||
// ui->mainToolBar->addAction(m_loadAc);
|
||||
//ui->mainToolBar->addAction(m_openAc);
|
||||
|
|
@ -251,10 +252,10 @@ void MainWindowCurve::initMainToolBar()
|
|||
connect(m_joindepthAc, &QAction::triggered, this, &MainWindowCurve::s_ExecuteMerge);
|
||||
|
||||
connect(m_ModuleOpenAc, &QAction::triggered, this, &MainWindowCurve::s_ModuleOpen);
|
||||
connect(m_SaveAsPictureAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsPicture);
|
||||
|
||||
// connect(m_grepAc, &QAction::triggered, this, &MainWindow::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);
|
||||
//connect(m_openAc, &QAction::triggered, this, &MainWindowCurve::s_Open);
|
||||
|
|
@ -2320,6 +2321,14 @@ void MainWindowCurve::s_ModuleOpen()
|
|||
m_pParentWin->setModuleOpenOrClose();
|
||||
}
|
||||
|
||||
//导出长图
|
||||
void MainWindowCurve::s_SaveAsPicture()
|
||||
{
|
||||
//指标体系图
|
||||
QPixmap pPixmap = ui->tableWidget_2->grab(QRect(0, 0, ui->tableWidget_2->width()*2, ui->tableWidget_2->height()*2));
|
||||
pPixmap.save("d:\\3.png", "png");
|
||||
}
|
||||
|
||||
//void MainWindowCurve::s_Open(QString fileFull)
|
||||
//{
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ public slots:
|
|||
void s_ExecuteDepthShift(); //校深
|
||||
void s_ExecuteMerge(); //拼接
|
||||
void s_ModuleOpen(); //处理算法
|
||||
//void s_Open(QString fileFull);//打开
|
||||
void s_SaveAsPicture(); //导出长图
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -625,6 +625,10 @@ void QtProjectWidgets::loadWellTree(QTreeWidgetItem *parent, QString fileFull, Q
|
|||
//初始化树形控件中的右键菜单
|
||||
void QtProjectWidgets::initMenu()
|
||||
{
|
||||
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()));
|
||||
|
||||
//根节点(项目名称)-右键菜单
|
||||
_menuRoot = new QMenu(ui->treeWidget);
|
||||
initRootTreeMenu(_menuRoot, ui->treeWidget);
|
||||
|
|
@ -657,6 +661,14 @@ void QtProjectWidgets::initMenu()
|
|||
_menuTableFolder = new QMenu(ui->treeWidget);
|
||||
initTableFolderTreeMenu(_menuTableFolder, ui->treeWidget);
|
||||
|
||||
_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);
|
||||
// //评估方案-右键菜单
|
||||
// _menuEvaluate = new QMenu(ui->treeWidget);
|
||||
// initEvaluateTreeMenu(_menuEvaluate, ui->treeWidget);
|
||||
|
|
@ -708,6 +720,16 @@ void QtProjectWidgets::initParameterCardTreeMenu(QMenu *menu, QTreeWidget *treeW
|
|||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//初始化曲线对象(AC、BS...)-右键菜单
|
||||
|
|
@ -722,6 +744,16 @@ void QtProjectWidgets::initCurveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWid
|
|||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//初始化波列对象-右键菜单
|
||||
|
|
@ -736,6 +768,16 @@ void QtProjectWidgets::initWaveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWidg
|
|||
action_DepthShift->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); // 设置图标
|
||||
connect(action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool)));
|
||||
menu->addAction(action_DepthShift);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//初始化表格对象-右键菜单
|
||||
|
|
@ -750,6 +792,16 @@ void QtProjectWidgets::initTableObjectTreeMenu(QMenu *menu, QTreeWidget *treeWid
|
|||
action_DepthShift->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); // 设置图标
|
||||
connect(action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool)));
|
||||
menu->addAction(action_DepthShift);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//初始化根节点(井名称)-右键菜单
|
||||
|
|
@ -793,6 +845,7 @@ void QtProjectWidgets::initSlfNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
|||
action_New->setIcon(QIcon(GetImagePath() + "icon/Edit.png")); // 设置图标
|
||||
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onWelllogInformation()));
|
||||
menu->addAction(action_New);
|
||||
menu->addAction(m_action_Paste);
|
||||
|
||||
//
|
||||
QAction* action_DepthShift = new QAction("深度移动", treeWidget);
|
||||
|
|
@ -808,8 +861,24 @@ void QtProjectWidgets::initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWid
|
|||
action_New->setIcon(QIcon(GetImagePath() + "icon/CreateTable.png")); // 设置图标
|
||||
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCreateNewTable()));
|
||||
menu->addAction(action_New);
|
||||
}
|
||||
|
||||
menu->addAction(m_action_Paste);
|
||||
}
|
||||
//初始化根节点(曲线表目录)-右键菜单
|
||||
void QtProjectWidgets::initCurveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
||||
{
|
||||
menu->addAction(m_action_Paste);
|
||||
}
|
||||
//初始化根节点(参数卡目录)-右键菜单
|
||||
void QtProjectWidgets::initParCardFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
||||
{
|
||||
menu->addAction(m_action_Paste);
|
||||
}
|
||||
//初始化根节点(波列目录)-右键菜单
|
||||
void QtProjectWidgets::initWaveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
|
||||
{
|
||||
menu->addAction(m_action_Paste);
|
||||
}
|
||||
//新建项目
|
||||
void QtProjectWidgets::onNewProject(bool checked)
|
||||
{
|
||||
|
|
@ -1069,6 +1138,92 @@ void QtProjectWidgets::onCreateNewTable()
|
|||
}
|
||||
}
|
||||
|
||||
//删除(曲线、表格、波列、参数卡)
|
||||
void QtProjectWidgets::onDeleteObject()
|
||||
{
|
||||
CLogIO *logio=new CLogIO;
|
||||
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
||||
delete logio;
|
||||
return;
|
||||
}
|
||||
logio->DeleteObject(m_strCurveObjectName.toLocal8Bit().data());
|
||||
logio->Close();
|
||||
|
||||
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
||||
{
|
||||
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
|
||||
RefreshWellRoundTree(parentItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void QtProjectWidgets::onCopySelObject() // 复制
|
||||
{
|
||||
m_strCopySlfName = m_strSlfName; // 当前复制的对象Slf文件
|
||||
m_strCopyCurveObjectName = m_strCurveObjectName; // 当前复制的对象名
|
||||
}
|
||||
|
||||
void QtProjectWidgets::onPasteSelObject() // 粘贴
|
||||
{
|
||||
if (m_strCopySlfName == m_strSlfName)
|
||||
{
|
||||
CLogIO *logio=new CLogIO;
|
||||
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
|
||||
delete logio;
|
||||
return;
|
||||
}
|
||||
char buf[1000];
|
||||
int i=1;
|
||||
while(1) {
|
||||
sprintf(buf,"%s_%d",m_strCopyCurveObjectName.toStdString().c_str(),i++);
|
||||
if (0>logio->FindObjectName(buf))
|
||||
break;
|
||||
}
|
||||
logio->CopyObject(m_strCopyCurveObjectName.toStdString().c_str(), buf);
|
||||
logio->Close();
|
||||
delete logio;
|
||||
|
||||
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;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//刷新井次树
|
||||
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);
|
||||
childItem->setExpanded(true);
|
||||
int childCount = childItem->childCount();
|
||||
for (int j = 0; j < childCount; ++j)
|
||||
{
|
||||
childItem->child(j)->setExpanded(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QtProjectWidgets::onEditWelllogRound()
|
||||
{
|
||||
QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin();
|
||||
|
|
@ -1298,7 +1453,29 @@ void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index)
|
|||
popMenu = _menuTableFolder;
|
||||
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf
|
||||
}
|
||||
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")
|
||||
{
|
||||
//曲线数据-右键菜单
|
||||
popMenu = _menuTableFolder;
|
||||
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点(井次)获取slf
|
||||
}
|
||||
|
||||
if (m_strCopySlfName != m_strSlfName)
|
||||
m_action_Paste->setVisible(false);
|
||||
else
|
||||
m_action_Paste->setVisible(true);
|
||||
//
|
||||
if (qApp->mouseButtons() == Qt::RightButton) // 只针对鼠标右键,弹出菜单
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,7 +58,11 @@ public slots:
|
|||
void onDepthShift_Well(bool checked = false); //深度移动
|
||||
//表格数据 根节点
|
||||
void onCreateNewTable(); //创建新表
|
||||
|
||||
//删除(曲线、表格、波列、参数卡)
|
||||
void onDeleteObject(); // 删除
|
||||
void onCopySelObject(); // 复制
|
||||
void onPasteSelObject(); // 粘贴
|
||||
void RefreshWellRoundTree(QTreeWidgetItem *parentItem); // 刷新井次树
|
||||
//向左侧树图,追加固井结论表格
|
||||
void s_AddGujingToTree(QString strSlfName, QString strWellName, QString strLineName);
|
||||
|
||||
|
|
@ -77,7 +81,11 @@ public:
|
|||
QMenu *_menuWellName; //井名
|
||||
QMenu *_menuSlfName; //井次
|
||||
QMenu *_menuTableFolder; //表目录
|
||||
QMenu *_menuCurveFolder; //曲线目录
|
||||
QMenu *_menuParCardFolder; //参数卡目录
|
||||
QMenu *_menuWaveFolder; //波列目录
|
||||
|
||||
QAction* m_action_Paste; //黏贴
|
||||
//根节点(项目名称)-右键菜单
|
||||
QAction* m_action_New;
|
||||
QAction* m_action_Open;
|
||||
|
|
@ -91,6 +99,9 @@ public:
|
|||
QString m_strSlfName;
|
||||
QString m_strCurveObjectName;
|
||||
|
||||
QString m_strCopySlfName; // 当前复制的对象Slf文件
|
||||
QString m_strCopyCurveObjectName; // 当前复制的对象名
|
||||
|
||||
public:
|
||||
void loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname);
|
||||
void loadWellTree(QTreeWidgetItem *parent, QString fileFull, QString parentWellname);
|
||||
|
|
@ -116,6 +127,13 @@ public:
|
|||
void initSlfNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget);
|
||||
//初始化根节点(表目录)-右键菜单
|
||||
void initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget);
|
||||
//初始化根节点(曲线表目录)-右键菜单
|
||||
void initCurveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget);
|
||||
//初始化根节点(参数卡目录)-右键菜单
|
||||
void initParCardFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget);
|
||||
//初始化根节点(波列目录)-右键菜单
|
||||
void initWaveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget);
|
||||
|
||||
|
||||
private:
|
||||
QMap<QString, QList<QString> > m_qmapWellFiles;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user