Compare commits
No commits in common. "69fbee204e66191da5dc3619e27ec00ac9a97876" and "f37c73a1c38e0b5904d79a333169e4a3fb7cc29e" have entirely different histories.
69fbee204e
...
f37c73a1c3
|
|
@ -1080,9 +1080,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
|
||||
double x1 = m_tdSwallCore->mPlot->xAxis->coordToPixel(-lower);
|
||||
//
|
||||
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);
|
||||
double Depth2 = m_tdSwallCore->mPlot->xAxis->pixelToCoord(x1-h);
|
||||
m_tdSwallCore->setRange(-lower, Depth2);
|
||||
//保存
|
||||
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,9 +506,7 @@ void TransparentDraggableSwallCore::onMousePress(QMouseEvent *event)
|
|||
//event->accept();
|
||||
|
||||
double low = mRect->topLeft->coords().x();
|
||||
double hight = mRect->bottomRight->coords().x();
|
||||
double depth = (low+hight)/2.0;
|
||||
|
||||
//double hight = mRect->bottomRight->coords().x();
|
||||
QString ColorImage = "";
|
||||
int ind=mPlot->colorinds_SWallCore.indexOf(mstrTitle);
|
||||
if (ind>-1&&ind<mPlot->colors_SWallCore.size())
|
||||
|
|
@ -519,7 +517,7 @@ void TransparentDraggableSwallCore::onMousePress(QMouseEvent *event)
|
|||
ColorImage="";
|
||||
}
|
||||
|
||||
PropertyService()->initSwallCoreItemProperty(this, depth, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
|
||||
PropertyService()->initSwallCoreItemProperty(this, low, 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);
|
||||
|
|
@ -737,9 +735,6 @@ 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())
|
||||
|
|
@ -750,7 +745,7 @@ void TransparentDraggableSwallCore::onMouseRelease(QMouseEvent *event)
|
|||
ColorImage="";
|
||||
}
|
||||
|
||||
PropertyService()->initSwallCoreItemProperty(this, depth, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
|
||||
PropertyService()->initSwallCoreItemProperty(this, low, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
|
||||
|
||||
if(m_bChange)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2461,12 +2461,10 @@ 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=fDepth;
|
||||
m_Result.Depth=fSDepth;
|
||||
m_Result.Order=i+1;
|
||||
|
||||
QString name,lithname,oilname,colorname;
|
||||
|
|
@ -5459,12 +5457,11 @@ void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QSt
|
|||
//左侧空白
|
||||
dragRect->m_fLeftSpace = Sideleft*g_dPixelPerCm;
|
||||
// 设置初始范围
|
||||
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;//32;
|
||||
double h = 32;//SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
|
||||
double x1 = this->xAxis->coordToPixel(Depth);
|
||||
//
|
||||
double Depth1 = this->xAxis->pixelToCoord(x1+h/2.0);
|
||||
double Depth2 = this->xAxis->pixelToCoord(x1-h/2.0);
|
||||
dragRect->setRange(Depth1, Depth2, bRefresh);
|
||||
double Depth2 = this->xAxis->pixelToCoord(x1-h);
|
||||
dragRect->setRange(Depth, Depth2, bRefresh);
|
||||
// 可选:设置颜色
|
||||
dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色255, 100, 100, 80
|
||||
//最小宽度
|
||||
|
|
@ -10049,16 +10046,14 @@ void QMyCustomPlot::resetPosition_SwallCore()
|
|||
|
||||
//--------------------------
|
||||
// 设置初始范围
|
||||
//double h = 32;
|
||||
double Depth1 = tmpRange.lower;
|
||||
double Depth2 = tmpRange.upper;
|
||||
|
||||
// double x1 = this->xAxis->coordToPixel(Depth);
|
||||
// double Depth2 = this->xAxis->pixelToCoord(x1-h);
|
||||
double h = 32;
|
||||
double Depth = tmpRange.lower;
|
||||
double x1 = this->xAxis->coordToPixel(Depth);
|
||||
double Depth2 = this->xAxis->pixelToCoord(x1-h);
|
||||
//--------------------------
|
||||
|
||||
//
|
||||
pDraggableRect->setRange(Depth1, Depth2, false);
|
||||
pDraggableRect->setRange(Depth, Depth2, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user