diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 7fbeea7..e7174de 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -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); }); // diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index e7f1d70..2c98981 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -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 > 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 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); diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index f7ba52c..9a15de6 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -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; // 深度 第三个轴