数据对象拷贝功能添加

This commit is contained in:
zhaolei 2026-03-05 08:10:44 +08:00
parent ea6d0346a2
commit c6dc2868d2
9 changed files with 131 additions and 29 deletions

View File

@ -10,7 +10,7 @@
DEFAULTTABLE *DefauleTable=NULL;
int DefTabNum=0;
bool DataHelper::m_IsGc=true;//false;
QMap<QString, QList<QString> > DataHelper::m_qmapWellFiles;
DataHelper::DataHelper()
{
}
@ -317,7 +317,7 @@ bool DataHelper::IsNullLine(QByteArray line)
QStringList DataHelper::GetAllWellName()
{
QStringList WellNameList;
// WellNameList.clear();
WellNameList.clear();
// PaiObject *pPrj=GetProject();
// if(!pPrj) return WellNameList;
// PaiObject *pObj=pPrj->GetObjectByType(GetClassID_WellsFolder());
@ -329,6 +329,11 @@ QStringList DataHelper::GetAllWellName()
// CObjWell *pWell=dynamic_cast<CObjWell*>(pChild);
// if(pWell) WellNameList.append(pWell->GetName());
// }
int wellnum=m_qmapWellFiles.count();
for(auto it=m_qmapWellFiles.begin();it!=m_qmapWellFiles.end();++it)
{
WellNameList.append(it.key());
}
return WellNameList;
}
QStringList DataHelper::GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList)
@ -336,6 +341,17 @@ QStringList DataHelper::GetAllWellRoundName(QString WellName,QStringList& WellRo
QStringList WellRoundNameList;
WellRoundNameList.clear();
WellRoundFileNameList.clear();
if(m_qmapWellFiles.contains(WellName))
{
QList<QString> WellFiles = m_qmapWellFiles[WellName];
foreach(QString strFile,WellFiles)
{
QFileInfo fileInfo(strFile);
WellRoundNameList.append(fileInfo.baseName());
WellRoundFileNameList.append(strFile);
}
}
// CObjWell * pWell = CDataImport::GetWellByName(WellName);
// QList<PaiObject*> wellroundchildren;
// int count=pWell->GetAllWellRound(wellroundchildren);

View File

@ -50,6 +50,7 @@ public:
static bool m_IsGc;
static QStringList GetAllWellName();
static QStringList GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList);
static QMap<QString, QList<QString> > m_qmapWellFiles;
};
class Function
{

View File

@ -21,7 +21,7 @@
#include "StatisticsDlg.h"
#include "Statistics2Dlg.h"
#include "CurveComputePage.h"
// #include "CopyObjectDlg.h"
#include "CopyObjectDlg.h"
// #include "WaveComposeDlg.h"//2020.4.14 合成阵列曲线
#include "ShowWave.h"//波列曲线预览
#include "ShowCurve.h"//2020.5.12常规曲线预览
@ -56,6 +56,11 @@ int CDataManagger::GetDefTabNum()
{
return DefTabNum;
}
void CDataManagger::SetWellFiles(QMap<QString, QList<QString> > &mapWellFiles)
{
DataHelper::m_qmapWellFiles=mapWellFiles;
}
//交互导入数据表
//whp change 2020.3.9 for 统一离散数据入口
void CDataManagger::execInDefTable(int curitemType,
@ -100,16 +105,16 @@ void CDataManagger::execInDefTable(int curitemType,
return;
pDlg->exec();
}
// //数据对象拷贝
// void CDataManagger::CopyObject(int curitemType,const QString& WellName,const QString& WellRoundName)
// {
// CCopyObjectDlg *pDlg=new CCopyObjectDlg();
// pDlg->curitemType=curitemType;
// pDlg->WellName=WellName;
// pDlg->WellRoundFileName=WellRoundName;
// pDlg->Init();
// pDlg->exec();
// }
//数据对象拷贝
void CDataManagger::CopyObject(int curitemType,const QString& WellName,const QString& WellRoundName)
{
CCopyObjectDlg *pDlg=new CCopyObjectDlg();
pDlg->curitemType=curitemType;
pDlg->WellName=WellName;
pDlg->WellRoundFileName=WellRoundName;
pDlg->Init();
pDlg->exec();
}
//数据表自动导入
//whp change 2020.3.9 for 统一离散数据入口
//void CDataManagger::dataInTable(const QStringList& lst)

View File

@ -17,6 +17,7 @@ public:
~CDataManagger();
int GetDefTabNum();
DEFAULTTABLE *GetDefauleTable();
void SetWellFiles(QMap<QString, QList<QString> > &mapWellFiles);
//whp change 2020.3.9 for 统一离散数据入口
//交互导入数据表
//void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName);
@ -25,7 +26,7 @@ public:
//void dataInTable(const QStringList& lst );
//QStringList dataInTable(int curitemType,const QString& showWellName,const QString& wellFileName);//返回不能识别的非定式的数据文件列表
void dataInTable(int curitemType,QString& showWellName,QString& wellFileName);
// void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName);
void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName);
//
//曲线属性编辑
void CurvePropertyEdit(int Type,const QString& FileName,const QString& CurveName);

View File

@ -18,6 +18,7 @@ TEMPLATE = lib
DEFINES += QT_DEPRECATED_WARNINGS
#DEFINES += _WINDOWS
DEFINES += DATAMGR_LIB
DEFINES += HAVE_STRUCT_TIMESPEC
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
@ -49,6 +50,7 @@ FORMS += \
CreateNewTableDlg.ui \
CurveComputePage.ui \
UI/AngleAdjTool.ui \
UI/CopyObject.ui \
UI/CurveComputer.ui \
UI/CurvePropertyEdit.ui \
UI/InDefTable.ui \
@ -71,6 +73,7 @@ HEADERS += \
AdaptionComboBox.h \
AngleAdjTool.h \
CheckHeadView.h \
CopyObjectDlg.h \
CreateNewTableDlg.h \
CurveComputePage.h \
CurveComputerDlg.h \
@ -99,6 +102,7 @@ SOURCES += \
AngleAdjTool.cpp \
CStringType.cpp \
CheckHeadView.cpp \
CopyObjectDlg.cpp \
CreateNewTableDlg.cpp \
CurveComputePage.cpp \
CurveComputerDlg.cpp \
@ -131,6 +135,12 @@ INCLUDEPATH += ../../ConvertorManager/include
INCLUDEPATH += ../../OSGFramework/include
INCLUDEPATH += ../../OSGDataModel/include
INCLUDEPATH += ../../common
INCLUDEPATH += ../../Workflow/include
INCLUDEPATH += ../../Workflow/WFEngine/IOService/include
INCLUDEPATH += ../../Workflow/WFEngine/Module/include
INCLUDEPATH += ../../Workflow/WFCrystal/SysUtility/utils/include
INCLUDEPATH += ../../Workflow/WFEngine/ObjectModel/ObjectModel/include
INCLUDEPATH += ../../Workflow/WFEngine/ObjectModel/ObjectModelBase/include
CONFIG(debug, debug|release){
LIBS += -L../../Bin -lBaseFund

View File

@ -1797,10 +1797,14 @@ void CInDefTableDlg::resizeEvent(QResizeEvent *pEvent)
{
QDialog::resizeEvent(pEvent);
//m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents);
if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
//m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
int visual = m_pUI->tableWidget->horizontalHeader()->visualIndex(1);
if (visual!=-1)
{
m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents);
if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
}
if(MaxCol<10)m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::Stretch);
else m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
@ -1813,10 +1817,14 @@ void CInDefTableDlg::showEvent(QShowEvent * pEvent)
// if(m_bFirstShow)
{
// m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents);
if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
// m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
int visual = m_pUI->tableWidget->horizontalHeader()->visualIndex(1);
if (visual!=-1)
{
m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents);
if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch);
else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
}
if(MaxCol<10)m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::Stretch);
else m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);

View File

@ -7,6 +7,7 @@
#include <QPushButton>
#include <QVBoxLayout>
#include <QMenu>
#include <QPainterPath>
#include "geometryutils.h"
#include "qtColorSchemeComboBox.h"

View File

@ -198,6 +198,7 @@ void QtProjectWidgets::s_loadTreeWidget(QString fileFull)
itemIndex->setIcon(0, icon_wellfolder);
parent->addChild(itemIndex);//添加一级子节点
//数据导入
m_qmapWellFiles.clear();
loadIndexSysTree(itemIndex, fileFull, g_prjname);
//数据分析
@ -425,11 +426,12 @@ void QtProjectWidgets::loadWellTree(QTreeWidgetItem *parent, QString fileFull, Q
return;
}
QString wellname=QString::fromLocal8Bit(mssage.WellName);
if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1)
m_qmapWellFiles[wellname].append(fileFull);
// if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1)
{
QFileInfo fileinfo;
fileinfo = QFileInfo(fileFull);
wellname = fileinfo.completeBaseName();
wellname = fileinfo.completeBaseName();//井次
}
// if(wellname != parentWellname)
// {
@ -684,9 +686,14 @@ void QtProjectWidgets::initWellsTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
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()));
// 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()));
menu->addAction(action_New);
// action_New = new QAction("输出数据", treeWidget);
@ -1099,7 +1106,7 @@ void QtProjectWidgets::onImportSingleWellLogData()
}
}
if (pMainWindow)
// if (pMainWindow)
{
// InterfaceWidget *pInterfaceWidget = new InterfaceWidget();//中间工作区
// pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据");
@ -1182,6 +1189,58 @@ void QtProjectWidgets::onOutWellLogRound()
moutPut=NULL;
}
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;
}
//点击树图节点
void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index)
{

View File

@ -52,6 +52,7 @@ public slots:
void onImportSingleWellLogData();
void onImportSlfTable();
void onOutWellLogRound();
void onCopyObject(); //数据对象拷贝
//井次
void onWelllogInformation(); //编辑测井信息
void onDepthShift_Well(bool checked = false); //深度移动
@ -117,5 +118,5 @@ public:
void initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget);
private:
QMap<QString, QList<QString> > m_qmapWellFiles;
};