添加曲线深度重采

This commit is contained in:
zhaolei 2026-05-19 10:17:36 +08:00
parent d9054d26e6
commit 6e6372f266
2 changed files with 202 additions and 5 deletions

View File

@ -266,7 +266,6 @@ void QtProjectWidgets::s_loadTreeWidget(QString fileFull)
itemIndex->setExpanded(true); itemIndex->setExpanded(true);
} }
void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname) void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname)
{ {
//Logdata //Logdata
@ -298,10 +297,6 @@ void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFul
} }
else else
{ {
qDebug() << " folderPath " << folderPath;
//井目录 //井目录
//取当前当前目录内容 //取当前当前目录内容
QDir dir(folderPath); QDir dir(folderPath);
@ -865,6 +860,11 @@ void QtProjectWidgets::initCurveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWid
connect(m_action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool))); connect(m_action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool)));
menu->addAction(m_action_DepthShift); menu->addAction(m_action_DepthShift);
m_action_DepthResample = new QAction("深度重采样", treeWidget);
m_action_DepthResample->setIcon(QIcon(GetImagePath() + "icon/AddToTrack.png")); // 设置图标
connect(m_action_DepthResample, SIGNAL(triggered(bool)), this, SLOT(onDepthResample(bool)));
menu->addAction(m_action_DepthResample);
QAction* action_WaveCompose = new QAction("合成阵列曲线", treeWidget); QAction* action_WaveCompose = new QAction("合成阵列曲线", treeWidget);
action_WaveCompose->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); action_WaveCompose->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png"));
connect(action_WaveCompose, SIGNAL(triggered()), this, SLOT(onWaveCompose())); connect(action_WaveCompose, SIGNAL(triggered()), this, SLOT(onWaveCompose()));
@ -1246,6 +1246,201 @@ void QtProjectWidgets::onDepthShift(bool checked)
} }
} }
//深度重采样
void QtProjectWidgets::onDepthResample(bool checked)
{
double rlev=0.125;
bool ok=0;
QString ss=QInputDialog::getText(NULL,"深度重采样","请输入新的采样间隔",QLineEdit::Normal,QString::number(rlev),&ok);
if(!ok) return;
rlev=ss.toDouble();
if(rlev==0) return;
int ret=QMessageBox::information(NULL,"提示","不保留原始数据?",QMessageBox::Yes|QMessageBox::No);
QList<QTreeWidgetItem*> selectedItemList = ui->treeWidget->selectedItems();
foreach (QTreeWidgetItem * pItem, selectedItemList)
{
QString strTreeTag = pItem->data(0, Qt::UserRole).toString();
if (strTreeTag == "wellname") //井名
{
QList<QString> listqWellFiles = m_qmapWellFiles[pItem->text(0)];
int count = listqWellFiles.count();
for(int i=0;i<count;i++)
{
CObjWelllogRound* pround = new CObjWelllogRound;
pround->SetSlfFileName(listqWellFiles.at(i));
if(pround){
QString SlfFileName=pround->GetSlfFileName();
if(SlfFileName.isEmpty()) continue;
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
return ;
};
char name[64];
int count1=logio->GetObjectCount();
QStringList namess;
for(int i=0;i<count1;i++) {
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue;
logio->GetObjectName(i,name);
if(strstr(name,".OLD")) continue;
short Attribute,SubAttribute;
Attribute=logio->GetObjectType(i);
if(Attribute!=CURVE_OBJECT&&Attribute!=WAVE_OBJECT)continue;
namess.append(name);
int index=logio->OpenChannel(name);
if(index>-1) {
logio->ChannelResamples(index,rlev);
}
/*
CObjWellLog *pLog=dynamic_cast<CObjWellLog *>(pround->GetObjectByName(name));
if(pLog) {
if(pLog->IsLoaded())
{
pLog->isLoad=false;
pLog->LoadFromSLF();
}
else pLog->SetRlev(rlev);
}
*/
}
delete logio;
// foreach(QString name1,namess)
// {
// GetObjectEvent().OnDeAttchData(m_SlfFileName,name1);
// GetObjectEvent().OnRefreshData(m_SlfFileName,name1);
// }
if(ret==QMessageBox::Yes) {
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
return ;
};
char name[64];
int count=logio->GetObjectCount();
DepthProgress dp;
dp.CreatProgress(0,count,"开始清除对象原始数据...");
for(int i=0;i<count;i++) {
logio->GetObjectName(i,name);
if(strstr(name,".OLD")) logio->DiscardObject(name);
dp.SetDepth(i);
}
delete logio;
dp.DelProgress();
}
CDataImport::ChangetoSlf(SlfFileName);
}
}
}
else if (strTreeTag == "wellItem") //井次
{
CObjWelllogRound* pround = new CObjWelllogRound;
pround->SetSlfFileName(pItem->data(0, Qt::UserRole+1).toString());
if(pround){
QString SlfFileName=pround->GetSlfFileName();
if(SlfFileName.isEmpty()) continue;
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
return ;
};
char name[64];
int count=logio->GetObjectCount();
QStringList namess;
for(int i=0;i<count;i++) {
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue;
logio->GetObjectName(i,name);
if(strstr(name,".OLD")) continue;
short Attribute,SubAttribute;
Attribute=logio->GetObjectType(i);
if(Attribute!=CURVE_OBJECT&&Attribute!=WAVE_OBJECT)continue;
int index=logio->OpenChannel(name);
if(index>-1) {
logio->ChannelResamples(index,rlev);
namess.append(name);
}
/*
CObjWellLog *pLog=dynamic_cast<CObjWellLog *>(pround->GetObjectByName(name));
if(pLog) {
if(pLog->IsLoaded())
{
pLog->isLoad=false;
pLog->LoadFromSLF();
}
else pLog->SetRlev(rlev);
}
*/
}
delete logio;
// foreach(QString name1,namess)
// {
// GetObjectEvent().OnDeAttchData(m_SlfFileName,name1);
// GetObjectEvent().OnRefreshData(m_SlfFileName,name1);
// }
if(ret==QMessageBox::Yes) {
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
return ;
};
char name[64];
int count=logio->GetObjectCount();
DepthProgress dp;
dp.CreatProgress(0,count,"开始清除对象原始数据...");
for(int i=0;i<count;i++) {
logio->GetObjectName(i,name);
if(strstr(name,".OLD")) logio->DiscardObject(name);
dp.SetDepth(i);
}
delete logio;
dp.DelProgress();
}
CDataImport::ChangetoSlf(SlfFileName);
}
}
else {
CObjWellLog* pLog= new CObjWellLog();
pLog->SetSlfFileName(pItem->data(0, Qt::UserRole+1).toString());
pLog->SetName(pItem->text(0));
if(pLog) {
pLog->ReSample(rlev);
// GetObjectEvent().OnDeAttchData(pLog->GetSlfFileName(),pLog->GetName());
// GetObjectEvent().OnRefreshData(pLog->GetSlfFileName(),pLog->GetName());
}
if(ret==QMessageBox::Yes) {
CMemRdWt * logio=new CMemRdWt();
if(!logio->Open(pLog->GetSlfFileName().toStdString().c_str(),CSlfIO::modeReadWrite))
{
delete logio;
return ;
};
char name[64];
int count=logio->GetObjectCount();
DepthProgress dp;
dp.CreatProgress(0,count,"开始清除对象原始数据...");
for(int i=0;i<count;i++) {
logio->GetObjectName(i,name);
if(strstr(name,".OLD")) logio->DiscardObject(name);
dp.SetDepth(i);
}
delete logio;
dp.DelProgress();
}
}
}
// foreach(QDialog *pDia,m_pDialogs)
// {
// CBaseDialog *pBD=dynamic_cast<CBaseDialog *>(pDia);
// if(pBD)
// {
// pBD->ReFreshWindow(0);
// }
// }
}
//合成阵列曲线 //合成阵列曲线
void QtProjectWidgets::onWaveCompose(bool checked) void QtProjectWidgets::onWaveCompose(bool checked)
{ {

View File

@ -52,6 +52,7 @@ public slots:
void onShowCurve(bool checked = false); //数据查看 void onShowCurve(bool checked = false); //数据查看
void ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset); void ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset);
void onDepthShift(bool checked = false); //深度移动 void onDepthShift(bool checked = false); //深度移动
void onDepthResample(bool checked = false); //深度重采样
void onWaveCompose(bool checked = false); //合成阵列曲线 void onWaveCompose(bool checked = false); //合成阵列曲线
void onInfoEdit(bool checked = false); //属性 void onInfoEdit(bool checked = false); //属性
@ -120,6 +121,7 @@ public:
//曲线对象(AC、BS...)-右键菜单 //曲线对象(AC、BS...)-右键菜单
QAction* m_action_ShowCurve; QAction* m_action_ShowCurve;
QAction* m_action_DepthShift; QAction* m_action_DepthShift;
QAction* m_action_DepthResample;
QString m_strWellname; QString m_strWellname;
QString m_strSlfName; QString m_strSlfName;