波列-成像道-黑白图实现。

This commit is contained in:
DESKTOP-450PEFP\mainc 2026-05-22 14:51:36 +08:00
parent d0c4bbc89f
commit 06462cab21
5 changed files with 62 additions and 13 deletions

View File

@ -1492,7 +1492,15 @@ void FormInfo::paintEvent(QPaintEvent* event)
}
if (nUseTag >= 0)
{
QList<QRgb> rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(nUseTag, m_nSchemeIndex, m_nColorNum);
int nsidx = m_nSchemeIndex;
if (m_bBlack)
{
if (nUseTag == 0)
nsidx = 0;
if (nUseTag == 1)
nsidx = 2;
}
QList<QRgb> rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(nUseTag, nsidx, m_nColorNum);
int iColorNum = rgbList.size();
//头部绘制调色板

View File

@ -50,6 +50,8 @@ FormWave::FormWave(QWidget *parent, QString strSlfName, QString strWellName, QSt
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged(QString, double, double, double)), this, SLOT(vertScrollBarChanged(QString, double, double, double)));
connect(CallManage::getInstance(), SIGNAL(sig_vertScrollBarChanged_setGeometry(QString, double, double, double, int)), this, SLOT(vertScrollBarChanged_setGeometry(QString, double, double, double, int)));
connect(CallManage::getInstance(), SIGNAL(sig_ResizeDepth(QString, int, float)), this, SLOT(s_ResizeDepth(QString, int, float)));
//黑白图
connect(CallManage::getInstance(), SIGNAL(sig_changeBlack(QString, bool)), this, SLOT(s_changeBlack(QString, bool)));
}
FormWave::~FormWave()
@ -318,6 +320,19 @@ void FormWave::s_ResizeDepth(QString strUuid, int nHeight, float fDepthLowerY)
m_fAddY = m_fDepthLowerY - m_fTopY;
}
void FormWave::s_changeBlack(QString strUuid, bool bBlack)
{
if (m_strUuid != strUuid || m_bBlack == bBlack)
return;
m_bBlack = bBlack;
int nsidx = schemIndex;
if (m_bBlack)
nsidx = 0;
changeColor(nsidx, colornum);
update();
}
void FormWave::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
QString strGroup, QString strProperty, QVariant variant)
{

View File

@ -95,12 +95,15 @@ public:
int schemIndex = 1;
int colornum = 256;
// 黑白图
bool m_bBlack = false;
public:
//void DrawWave(QPainter* pdc, QRectF mrt1);
public slots:
void s_ResizeDepth(QString strUuid, int nHeight, float fDepthLowerY);
// 黑白图
void s_changeBlack(QString strUuid, bool bBlack);
//斜井三图一表
void s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
QString strGroup, QString strProperty, QVariant variant);

View File

@ -835,8 +835,10 @@ void QMyCustomPlot::updateImage(float fTopY, FormInfo* pInfo)
m_flBackVal = -9999;
m_nSchemeIndex = pInfo->m_nSchemeIndex;
}
//获取颜色数组
QList<QRgb> rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, m_nSchemeIndex, 256);
if (m_rgbList.size() <= 0)
{
m_rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, m_nSchemeIndex, 256);
}
QRgb rgbbg = QtColorTableData::getInstance()->getRgb_Bg(m_nSchemeIndex);
for (double dep1 = sdep; dep1 < edep; dep1 += ratio * m_Rlev)
@ -871,9 +873,9 @@ void QMyCustomPlot::updateImage(float fTopY, FormInfo* pInfo)
if (ii > 254) ii = 254;
if (ii < 0) ii = 0;
pData[m*nLnBytes + 3 * i] = qRed(rgbList.at(ii));
pData[m*nLnBytes + 3 * i + 1] = qGreen(rgbList.at(ii));
pData[m*nLnBytes + 3 * i + 2] = qBlue(rgbList.at(ii));
pData[m*nLnBytes + 3 * i] = qRed(m_rgbList.at(ii));
pData[m*nLnBytes + 3 * i + 1] = qGreen(m_rgbList.at(ii));
pData[m*nLnBytes + 3 * i + 2] = qBlue(m_rgbList.at(ii));
}
else
{
@ -979,7 +981,11 @@ void QMyCustomPlot::updateImage3D(float fTopY, FormInfo* pInfo)
m_RightVal = pInfo->m_ImgMaxVal;
m_nSchemeIndex = pInfo->m_nSchemeIndex;
}
QList<QRgb> rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, m_nSchemeIndex, 256);
//QList<QRgb> rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, m_nSchemeIndex, 256);
if (m_rgbList.size() <= 0)
{
m_rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, m_nSchemeIndex, 256);
}
float pi = 3.1415926;
float angle = pi / ((float)nPoint / 2.0);
int drawdep;
@ -1055,9 +1061,9 @@ void QMyCustomPlot::updateImage3D(float fTopY, FormInfo* pInfo)
if (ii > 254) ii = 254;
if (ii < 0) ii = 0;
pData[drawdep*nLnBytes + 3 * (i + dis)] = qRed(rgbList.at(ii));// GetBValue(pColorArr[ii]);
pData[drawdep*nLnBytes + 3 * (i + dis) + 1] = qGreen(rgbList.at(ii));// GetGValue(pColorArr[ii]);
pData[drawdep*nLnBytes + 3 * (i + dis) + 2] = qBlue(rgbList.at(ii));// GetRValue(pColorArr[ii]);
pData[drawdep*nLnBytes + 3 * (i + dis)] = qRed(m_rgbList.at(ii));// GetBValue(pColorArr[ii]);
pData[drawdep*nLnBytes + 3 * (i + dis) + 1] = qGreen(m_rgbList.at(ii));// GetGValue(pColorArr[ii]);
pData[drawdep*nLnBytes + 3 * (i + dis) + 2] = qBlue(m_rgbList.at(ii));// GetRValue(pColorArr[ii]);
}
}
}
@ -6374,6 +6380,11 @@ void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist)
|| "坐标类型" == strProperty
|| "配色方案" == strProperty)
{
if ("配色方案" == strProperty)
{
//获取颜色数组
m_rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, varVal.toInt(), 256);
}
this->updateImage(m_fTopY);
}
@ -14248,18 +14259,29 @@ void QMyCustomPlot::s_changeBlack(QString strUuid, bool bBlack)
pen.setColor(QColor(0,0,0));
graph->setPen(pen);
}
m_nSchemeIndex = 2;
}
else {
FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName);
if (pInfo == nullptr)
return;
m_nSchemeIndex = pInfo->m_nSchemeIndex;
QCPGraph* graph =this->graph(0);
if(graph)
{
FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName);
QPen pen = graph->pen();
pen.setColor(pInfo->m_lineColor);
graph->setPen(pen);
}
}
if ("DrawImageObject" == m_strType)
{
//获取颜色数组
m_rgbList = QtColorTableData::getInstance()->GetRgb_UseTag(1, m_bBlack ? 2 : m_nSchemeIndex, 256);
updateImage(m_fTopY);
return;
}
//固井结论
resetPosition_Gujing();
//井壁取心

View File

@ -243,6 +243,7 @@ public:
int m_nWaveJg = 1;
int m_nWaveHei = 1;
int m_nUseColor = 0; // 色板颜色标志
QList<QRgb> m_rgbList;
// 深度 第三个轴
QCPAxis *m_yAxis2 = nullptr;