波列,最大振幅,波列基值,波形高度属性可修改

This commit is contained in:
DESKTOP-450PEFP\mainc 2026-03-31 09:56:51 +08:00
parent 82c261e8c3
commit 0c1988c1b7
3 changed files with 100 additions and 9 deletions

View File

@ -2996,6 +2996,15 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
QTimer::singleShot(100, this, [=]() {
if (m_iY2 == 0.0)
{
// ####测试
QTimer::singleShot(200, this, [=]() {
m_iY2 = -2869;
m_iY1 = -2910;
emit CallManage::getInstance()->sig_changeDepth(m_strUuid, m_strSlfName, m_strWellName, m_iY1, m_iY2);
});
}
emit CallManage::getInstance()->sig_ReplotFinished(m_strUuid);
});
//

View File

@ -141,6 +141,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString)));
// 深度属性修改
connect(CallManage::getInstance(), SIGNAL(sig_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList)));
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
// 岩心分析
connect(CallManage::getInstance(), SIGNAL(sig_changeCorePhysicsProperty(QVariantList)), this, SLOT(s_changeCorePhysicsProperty(QVariantList)));
@ -250,12 +252,50 @@ void QMyCustomPlot::initWave(QString strSlfName, QString strWaveName)
float vmax = -9999;//(float)_nSamples;
float vmin = -9999;
//
double** wavedata = widget->getWavedata(_nSamples, m_Record);
//wavedata = new double*[_nSamples];
//for(int kk = 0;kk<_nSamples;kk++){
// wavedata[kk] = new double[m_Record];
//}
#define W_NEW
#ifdef W_NEW
float detp = _SDep;
float edepc = _EDep;
if (m_nWaveJg < 10)
m_nWaveJg = 10;
float m_r = _Rlev * m_nWaveJg;
float m_MoveDep = 0.0f;
QVector< QVector <double>> vecWave;
for (float dep1 = detp - 10 * m_r; dep1 < edepc + m_MoveDep + 10 * m_r; dep1 += m_r)
{
int iIndex = Slf_Int(dep1 + m_MoveDep, _SDep, _Rlev);
if (iIndex < 0) {
continue;
}
if (iIndex >= m_Record)
break;
QVector <double> ve(_nSamples);
for (int kk = 0; kk < _nSamples; kk++)
{
double val = GetData(_wave.RepCode, (char *)&value[iIndex * _nSamples*_wave.CodeLen + kk * _wave.CodeLen]);
ve[kk] = val;
if (val == -9999)
{
continue;
}
if (bFistValue == false)
{
//最大值,最小值默认采用第一个有效值
bFistValue = true;
vmax = vmin = val;
}
//
if (vmax < val)vmax = val;
if (vmin > val)vmin = val;
}
vecWave << ve;
}
#else
double** wavedata = widget->getWavedata(_nSamples, m_Record);
for (int i = 0; i < m_Record; i++)
{
for (int kk = 0; kk < _nSamples; kk++)
@ -277,8 +317,10 @@ void QMyCustomPlot::initWave(QString strSlfName, QString strWaveName)
if (vmin > val)vmin = val;
}
}
#endif
delete[] value;
float f = 264 / 269.0f;
// m_iY1 = 0.0 -_EDep;
// m_iY2 = 0.0 -_SDep;
//------------------------
@ -304,7 +346,7 @@ void QMyCustomPlot::initWave(QString strSlfName, QString strWaveName)
widget->yAxis = xAxis;
widget->m_fmin = vmin;
widget->m_fmax = vmax;
widget->m_fmax = vmax * f;
//-------------------
// set up the QCPColorMap:
@ -315,11 +357,51 @@ void QMyCustomPlot::initWave(QString strSlfName, QString strWaveName)
int nx = m_Record;
int ny = _nSamples;
#ifdef W_NEW
nx = vecWave.size();
#endif
colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点
//colorMap->data()->setRange(QCPRange(m_iY1, m_iY2), QCPRange(vmin, vmax)); // 并在键x和值y维上跨越坐标范围-4..4
colorMap->data()->setRange(QCPRange(0 - _EDep, 0 - _SDep), QCPRange(vmin, vmax));
colorMap->data()->setRange(QCPRange(0 - _EDep, 0 - _SDep), QCPRange(vmin, widget->m_fmax));
#ifdef W_NEW
double x, y, z;
for (int xIndex = 0; xIndex < nx; ++xIndex)
{
for (int yIndex = 0; yIndex < ny; ++yIndex)
{
double dz = vecWave[xIndex][yIndex];
if (m_nMode == 0)
{
if (dz == -9999)
{
dz = m_fmax;
}
}
else if (m_nMode == 1)
{
if (dz == -9999)
{
dz = m_fmin;
}
}
else if (m_nMode == 2)
{
if (dz == -9999)
{
dz = m_fmax;
}
else
{
dz = m_fmin;
}
}
m_colorMap->data()->setCell(nx - xIndex - 1, yIndex, dz);
}
}
#else
// 现在我们通过访问颜色贴图的QCPColorMapData实例来分配一些数据
this->updateWave();
#endif // W_NEW
// 添加色标:
QCPColorScale *colorScale = new QCPColorScale(widget);

View File

@ -155,7 +155,7 @@ public:
double** m_wavedata = NULL;
int m_nRow = 0;
int m_nCol = 0;
int m_nDrawType = 3; // 绘图类型
int m_nDrawType = 2; // 绘图类型
// 0.全周 1.正半周 2.负半周
int m_nMode = 1;
float m_fScaleV = 0.0f;
@ -168,7 +168,7 @@ public:
bool m_bOddEven = false; // 奇偶配色
float m_Base = 0.0f; // 波列基值
float m_MaxRange = 1023.0f;
int m_nWaveJg = 100;
int m_nWaveJg = 1;
int m_nWaveHei = 1;
// 深度 第三个轴