井壁取心图标,按照老版设置大小

This commit is contained in:
jiayulong 2026-04-15 17:11:45 +08:00
parent 1287c199a0
commit 1f1870862d
3 changed files with 27 additions and 16 deletions

View File

@ -1080,8 +1080,9 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
double x1 = m_tdSwallCore->mPlot->xAxis->coordToPixel(-lower);
//
double Depth2 = m_tdSwallCore->mPlot->xAxis->pixelToCoord(x1-h);
m_tdSwallCore->setRange(-lower, Depth2);
double Depth1 = m_tdSwallCore->mPlot->xAxis->pixelToCoord(x1+h/2.0);
double Depth2 = m_tdSwallCore->mPlot->xAxis->pixelToCoord(x1-h/2.0);
m_tdSwallCore->setRange(Depth1, Depth2);
//保存
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
}

View File

@ -11,8 +11,8 @@ TransparentDraggableSwallCore::TransparentDraggableSwallCore(QMyCustomPlot *pare
m_strUuid = strUuid;
//图片高度(需要根据高度宏定义,重新计算)
// double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
// m_fImageHeight = h/2.0;
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
m_fImageHeight = h/2.0;
//
initRect();
@ -506,7 +506,9 @@ void TransparentDraggableSwallCore::onMousePress(QMouseEvent *event)
//event->accept();
double low = mRect->topLeft->coords().x();
//double hight = mRect->bottomRight->coords().x();
double hight = mRect->bottomRight->coords().x();
double depth = (low+hight)/2.0;
QString ColorImage = "";
int ind=mPlot->colorinds_SWallCore.indexOf(mstrTitle);
if (ind>-1&&ind<mPlot->colors_SWallCore.size())
@ -517,7 +519,7 @@ void TransparentDraggableSwallCore::onMousePress(QMouseEvent *event)
ColorImage="";
}
PropertyService()->initSwallCoreItemProperty(this, low, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
PropertyService()->initSwallCoreItemProperty(this, depth, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
QMenu menu(nullptr);
menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &TransparentDraggableSwallCore::onDelRect);
@ -735,6 +737,9 @@ void TransparentDraggableSwallCore::onMouseRelease(QMouseEvent *event)
{
double low = mRect->topLeft->coords().x();
double hight = mRect->bottomRight->coords().x();
double depth = (low+hight)/2.0;
QString ColorImage = "";
int ind=mPlot->colorinds_SWallCore.indexOf(mstrTitle);
if (ind>-1&&ind<mPlot->colors_SWallCore.size())
@ -745,7 +750,7 @@ void TransparentDraggableSwallCore::onMouseRelease(QMouseEvent *event)
ColorImage="";
}
PropertyService()->initSwallCoreItemProperty(this, low, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
PropertyService()->initSwallCoreItemProperty(this, depth, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
if(m_bChange)
{

View File

@ -2459,10 +2459,12 @@ bool QMyCustomPlot::SaveToSLF_SwallCore()
//
QCPRange tmpRange = pDraggableRect->getRange();
float fSDepth = -tmpRange.lower;
float fEDepth = -tmpRange.upper;
float fDepth = (fSDepth+fEDepth)/2.0;
if(fSDepth == listSDepth[i])//按顺序写入
{
memset(&m_Result,0,sizeof(WALLCORE_DATA));
m_Result.Depth=fSDepth;
m_Result.Depth=fDepth;
m_Result.Order=i+1;
QString name,lithname,oilname,colorname;
@ -5455,11 +5457,12 @@ void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QSt
//左侧空白
dragRect->m_fLeftSpace = Sideleft*g_dPixelPerCm;
// 设置初始范围
double h = 32;//SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;//32;
double x1 = this->xAxis->coordToPixel(Depth);
//
double Depth2 = this->xAxis->pixelToCoord(x1-h);
dragRect->setRange(Depth, Depth2, bRefresh);
double Depth1 = this->xAxis->pixelToCoord(x1+h/2.0);
double Depth2 = this->xAxis->pixelToCoord(x1-h/2.0);
dragRect->setRange(Depth1, Depth2, bRefresh);
// 可选:设置颜色
dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色255, 100, 100, 80
//最小宽度
@ -10044,14 +10047,16 @@ void QMyCustomPlot::resetPosition_SwallCore()
//--------------------------
// 设置初始范围
double h = 32;
double Depth = tmpRange.lower;
double x1 = this->xAxis->coordToPixel(Depth);
double Depth2 = this->xAxis->pixelToCoord(x1-h);
//double h = 32;
double Depth1 = tmpRange.lower;
double Depth2 = tmpRange.upper;
// double x1 = this->xAxis->coordToPixel(Depth);
// double Depth2 = this->xAxis->pixelToCoord(x1-h);
//--------------------------
//
pDraggableRect->setRange(Depth, Depth2, false);
pDraggableRect->setRange(Depth1, Depth2, false);
}
}