1.录井剖面新增5个属性 2.岩性描述新增3个属性 3.地质层位新增4个属性。

This commit is contained in:
jiayulong 2026-03-10 18:21:29 +08:00
parent 54cdf3c99f
commit 40aab5cde1
23 changed files with 668 additions and 249 deletions

View File

@ -211,6 +211,8 @@ signals:
//改变录井剖面属性
void sig_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan);
//是否显示
void sig_changeGeoLithShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow);
//
//void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath);

View File

@ -288,19 +288,54 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
//改变录井剖面属性,含油占比
emit CallManage::getInstance()->sig_changeGeoLithLine(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, dOilZhan);
}
else if("岩性配色显示" == m_propertyData[pProperty] ||
"仅绘含油地层" == m_propertyData[pProperty] ||
"单岩性显示" == m_propertyData[pProperty] ||
"显示含油性" == m_propertyData[pProperty] ||
"含油性居中" == m_propertyData[pProperty] ||
"显示颜色" == m_propertyData[pProperty] ||
"绘制颜色号" == m_propertyData[pProperty])
{
bool bShow = variant.value<bool>();
if(m_propertyData[pProperty] == "岩性配色显示")
{
m_formInfo->m_bLithColor = bShow;
}
else if(m_propertyData[pProperty] == "单岩性显示")
{
m_formInfo->m_bLithOne = bShow;
}
else if(m_propertyData[pProperty] == "显示含油性")
{
m_formInfo->m_bShowOil = bShow;
}
else if(m_propertyData[pProperty] == "显示颜色")
{
m_formInfo->m_bShowColor = bShow;
}
else if(m_propertyData[pProperty] == "绘制颜色号")
{
m_formInfo->m_bShowColorNum = bShow;
}
//改变录井剖面属性,是否显示
emit CallManage::getInstance()->sig_changeGeoLithShow(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_propertyData[pProperty], bShow);
}
}
else if (m_strCurrentProperty == Text_Property)//文字结论
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
}
else if (m_strCurrentProperty == Layer_Property)//文字结论
else if (m_strCurrentProperty == Layer_Property)//地质分层
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
}
else if (m_strCurrentProperty == TextItem_Property)
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
//文字结论item
if("顶深(m)" == m_propertyData[pProperty])
{
@ -338,10 +373,35 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
m_tdText->mPlot->SaveToSLF_Text();
}
}
else if("文字字体" == m_propertyData[pProperty])
{
//字体
QFont newFont = variant.value<QFont>();
m_tdText->wordfont = newFont;
m_tdText->mItemTitle->setFont(newFont);
m_tdText->mPlot->replot();
}
else if("字体颜色" == m_propertyData[pProperty])
{
QColor newColor = variant.value<QColor>();
m_tdText->fontColor = newColor;
m_tdText->mItemTitle->setColor(newColor);
m_tdText->mPlot->replot();
}
else if("背景色" == m_propertyData[pProperty])
{
QColor newColor = variant.value<QColor>();
m_tdText->backgroundColor = newColor;
m_tdText->setColor(newColor);
m_tdText->mPlot->replot();
}
}
else if (m_strCurrentProperty == LayerItem_Property)
{
//文字结论item
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
//地质分层item
if("顶深(m)" == m_propertyData[pProperty])
{
//qDebug() << "顶深(m)->改变";
@ -378,28 +438,44 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
m_tdLayer->mPlot->SaveToSLF_Layer();
}
}
else if("文字字体" == m_propertyData[pProperty])
{
//字体
QFont newFont = variant.value<QFont>();
m_tdLayer->wordfont = newFont;
m_tdLayer->mItemTitle->setFont(newFont);
m_tdLayer->mPlot->replot();
}
else if("字体颜色" == m_propertyData[pProperty])
{
QColor newColor = variant.value<QColor>();
m_tdLayer->fontColor = newColor;
m_tdLayer->mItemTitle->setColor(newColor);
m_tdLayer->mPlot->replot();
}
else if("背景色" == m_propertyData[pProperty])
{
QColor newColor = variant.value<QColor>();
m_tdLayer->backgroundColor = newColor;
m_tdLayer->setColor(newColor);
//m_tdLayer->mPlot->replot();
QCPRange currentRange = m_tdLayer->getRange();
m_tdLayer->setRange(currentRange.lower, currentRange.upper);
}
else if("岩性" == m_propertyData[pProperty])
{
QString newResult = variant.value<QString>();
m_tdLayer->setLith(newResult);
//
QCPRange currentRange = m_tdLayer->getRange();
m_tdLayer->setRange(currentRange.lower, currentRange.upper);
}
}
else if (m_strCurrentProperty == JieshiItem_Property)
{
if (m_tdJieshi)
{
if ("顶深(m)" == m_propertyData[pProperty])
{
double upper = variant.value<double>();
m_tdJieshi->setDragRect(2, -upper);
}
else if ("底深(m)" == m_propertyData[pProperty])
{
double lower = variant.value<double>();
m_tdJieshi->setDragRect(1, -lower);
}
else if ("油气结论" == m_propertyData[pProperty])
{
}
}
}
else if (m_strCurrentProperty == GujingItem_Property)
{
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
//固井结论item
if("顶深(m)" == m_propertyData[pProperty])
{
@ -440,6 +516,9 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
}
else if (m_strCurrentProperty == SwallCoreItem_Property)
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
//井壁取心item
if("深度" == m_propertyData[pProperty])
{
@ -529,6 +608,9 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
}
else if (m_strCurrentProperty == GeoLithItem_Property)
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
//录井剖面item
if("顶深(m)" == m_propertyData[pProperty])
{
@ -594,6 +676,48 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
m_tdGeoLith->mPlot->SaveToSLF_GeoLith();
}
}
else if("含油占比(1~8)" == m_propertyData[pProperty])
{
//qDebug() << "含油占比(1~8)->改变";
double dOilZhan = variant.value<double>();
m_formInfo->m_dOilZhan = dOilZhan;
//改变录井剖面属性,含油占比
emit CallManage::getInstance()->sig_changeGeoLithLine(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, dOilZhan);
}
else if("岩性配色显示" == m_propertyData[pProperty] ||
"仅绘含油地层" == m_propertyData[pProperty] ||
"单岩性显示" == m_propertyData[pProperty] ||
"显示含油性" == m_propertyData[pProperty] ||
"含油性居中" == m_propertyData[pProperty] ||
"显示颜色" == m_propertyData[pProperty] ||
"绘制颜色号" == m_propertyData[pProperty])
{
bool bShow = variant.value<bool>();
if(m_propertyData[pProperty] == "岩性配色显示")
{
m_formInfo->m_bLithColor = bShow;
}
else if(m_propertyData[pProperty] == "单岩性显示")
{
m_formInfo->m_bLithOne = bShow;
}
else if(m_propertyData[pProperty] == "显示含油性")
{
m_formInfo->m_bShowOil = bShow;
}
else if(m_propertyData[pProperty] == "显示颜色")
{
m_formInfo->m_bShowColor = bShow;
}
else if(m_propertyData[pProperty] == "绘制颜色号")
{
m_formInfo->m_bShowColorNum = bShow;
}
//改变录井剖面属性,是否显示
emit CallManage::getInstance()->sig_changeGeoLithShow(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_propertyData[pProperty], bShow);
}
}
if("深度比例尺" == m_propertyData[pProperty])
@ -1682,8 +1806,8 @@ void PropertyWidget::initTableProperty(FormInfo *formInfo)
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("名称", "显示名称", formInfo->m_strLineName, QVariant::String);
_CreateVariantPropertyItem("名称", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool);
_CreateVariantPropertyItem("名称", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
//_CreateVariantPropertyItem("名称", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool);
//_CreateVariantPropertyItem("名称", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
_CreateVariantPropertyItem("名称", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("名称", "颜色", formInfo->m_lineColor, QVariant::Color);
@ -1886,32 +2010,6 @@ void PropertyWidget::initWaveProperty(FormInfo *formInfo, int nType)
m_strCurrentProperty = Wave_Property;
}
void PropertyWidget::initJieshiItemProperty(TransparentGroupResult* tdJieshi, double lower, double upper, QString strResult)
{
//初始化,清空
InitCurrentViewInfo();
m_tdJieshi = tdJieshi;
//
_CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double);
_CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double);
_CreateVariantPropertyItem("当前项", "解释层号", tdJieshi->getTitle(), QVariant::String);
_CreateVariantPropertyItem("当前项", "油气结论", strResult, VariantManager::filePathTypeId());
_CreateVariantPropertyItem("当前项", "备注", "", QVariant::String);
for (int i = 1; i <= 10; i++)
{
_CreateVariantPropertyItem("当前项", QString("油气结论%1").arg(i), strResult, VariantManager::filePathTypeId());
}
for (int i = 1; i <= 10; i++)
{
_CreateVariantPropertyItem("当前项", QString("分段点%1深度").arg(i), strResult, VariantManager::filePathTypeId());
}
//当前属性类型
m_strCurrentProperty = JieshiItem_Property;
}
void PropertyWidget::initSwallCoreProperty(FormInfo *formInfo)
{
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
@ -1927,6 +2025,25 @@ void PropertyWidget::initSwallCoreItemProperty(TransparentDraggableSwallCore* td
{
//初始化,清空
InitCurrentViewInfo();
FormInfo* formInfo = tdSwallCore->mPlot->m_formTrack->getFormInfoByParameters(tdSwallCore->mPlot->m_strUuid, tdSwallCore->mPlot->m_strWellName,
tdSwallCore->mPlot->m_strTrackName, tdSwallCore->mPlot->m_strLineName);
if (formInfo != NULL)
{
m_formInfo = formInfo;
m_strUuid = formInfo->m_strUuid;
m_strTrackUuid = formInfo->m_strTrackUuid;
//
m_strSlfName = formInfo->m_strSlfName;
m_strWellName = formInfo->m_strWellName;
m_strTrackName = formInfo->m_strTrackName;
m_strLineName = formInfo->m_strLineName;
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
}
//当前属性类型
m_strCurrentProperty = SwallCoreItem_Property;
@ -1957,6 +2074,26 @@ void PropertyWidget::initTextItemProperty(TransparentDraggableRect* tdText, doub
//初始化,清空
InitCurrentViewInfo();
FormInfo* formInfo = tdText->mPlot->m_formTrack->getFormInfoByParameters(tdText->mPlot->m_strUuid, tdText->mPlot->m_strWellName,
tdText->mPlot->m_strTrackName, tdText->mPlot->m_strLineName);
if (formInfo != NULL)
{
m_formInfo = formInfo;
m_strUuid = formInfo->m_strUuid;
m_strTrackUuid = formInfo->m_strTrackUuid;
//
m_strSlfName = formInfo->m_strSlfName;
m_strWellName = formInfo->m_strWellName;
m_strTrackName = formInfo->m_strTrackName;
m_strLineName = formInfo->m_strLineName;
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
}
//当前属性类型
m_strCurrentProperty = TextItem_Property;
m_tdText = tdText;
@ -1965,6 +2102,14 @@ void PropertyWidget::initTextItemProperty(TransparentDraggableRect* tdText, doub
_CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double);
_CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double);
_CreateVariantPropertyItem("当前项", "文字结论", strResult, QVariant::String);
QFont myFont = tdText->wordfont; //("Arial", 12, QFont::Bold); // 名称字体
QColor myColor = tdText->fontColor; //Qt::black; //颜色
QColor backColor = tdText->backgroundColor; //QColor(255, 255, 255);//背景色
_CreateVariantPropertyItem("当前项", "字体颜色", myColor, QVariant::Color);
_CreateVariantPropertyItem("当前项", "文字字体", myFont, QVariant::Font);
_CreateVariantPropertyItem("当前项", "背景色", backColor, QVariant::Color);
}
void PropertyWidget::initLayerProperty(FormInfo *formInfo)
@ -1982,6 +2127,25 @@ void PropertyWidget::initLayerItemProperty(TransparentDraggableLayer* tdLayer, d
{
//初始化,清空
InitCurrentViewInfo();
FormInfo* formInfo = tdLayer->mPlot->m_formTrack->getFormInfoByParameters(tdLayer->mPlot->m_strUuid, tdLayer->mPlot->m_strWellName,
tdLayer->mPlot->m_strTrackName, tdLayer->mPlot->m_strLineName);
if (formInfo != NULL)
{
m_formInfo = formInfo;
m_strUuid = formInfo->m_strUuid;
m_strTrackUuid = formInfo->m_strTrackUuid;
//
m_strSlfName = formInfo->m_strSlfName;
m_strWellName = formInfo->m_strWellName;
m_strTrackName = formInfo->m_strTrackName;
m_strLineName = formInfo->m_strLineName;
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
}
//当前属性类型
m_strCurrentProperty = LayerItem_Property;
@ -1990,7 +2154,16 @@ void PropertyWidget::initLayerItemProperty(TransparentDraggableLayer* tdLayer, d
//
_CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double);
_CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double);
_CreateVariantPropertyItem("当前项", "文字结论", strResult, QVariant::String);
_CreateVariantPropertyItem("当前项", "文字结论", strResult, QVariant::String);
QFont myFont = tdLayer->wordfont; //("Arial", 12, QFont::Bold); // 名称字体
QColor myColor = tdLayer->fontColor; //Qt::black; //颜色
QColor backColor = tdLayer->backgroundColor; //QColor(255, 255, 255);//背景色
_CreateVariantPropertyItem("当前项", "字体颜色", myColor, QVariant::Color);
_CreateVariantPropertyItem("当前项", "文字字体", myFont, QVariant::Font);
_CreateVariantPropertyItem("当前项", "背景色", backColor, QVariant::Color);
_CreateVariantPropertyItem("当前项", "岩性", ::GetLithSymbolDir(), VariantManager::filePathTypeId());
}
void PropertyWidget::initGujingProperty(FormInfo *formInfo)
@ -2008,6 +2181,25 @@ void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing
{
//初始化,清空
InitCurrentViewInfo();
FormInfo* formInfo = tdGujing->mPlot->m_formTrack->getFormInfoByParameters(tdGujing->mPlot->m_strUuid, tdGujing->mPlot->m_strWellName,
tdGujing->mPlot->m_strTrackName, tdGujing->mPlot->m_strLineName);
if (formInfo != NULL)
{
m_formInfo = formInfo;
m_strUuid = formInfo->m_strUuid;
m_strTrackUuid = formInfo->m_strTrackUuid;
//
m_strSlfName = formInfo->m_strSlfName;
m_strWellName = formInfo->m_strWellName;
m_strTrackName = formInfo->m_strTrackName;
m_strLineName = formInfo->m_strLineName;
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
}
//当前属性类型
m_strCurrentProperty = GujingItem_Property;
@ -2027,6 +2219,12 @@ void PropertyWidget::initGeoLithProperty(FormInfo *formInfo)
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
//显示
_CreateVariantPropertyItem("显示", "岩性配色显示", formInfo->m_bLithColor, QVariant::Bool);
_CreateVariantPropertyItem("显示", "单岩性显示", formInfo->m_bLithOne, QVariant::Bool);
_CreateVariantPropertyItem("显示", "显示含油性", formInfo->m_bShowOil, QVariant::Bool);
_CreateVariantPropertyItem("显示", "显示颜色", formInfo->m_bShowColor, QVariant::Bool);
_CreateVariantPropertyItem("显示", "绘制颜色号", formInfo->m_bShowColorNum, QVariant::Bool);
_CreateVariantPropertyItem("显示", "含油占比(1~8)", formInfo->m_dOilZhan, QVariant::Double, 1, 8);
m_strCurrentProperty = GeoLith_Property;
@ -2037,6 +2235,33 @@ void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoL
//初始化,清空
InitCurrentViewInfo();
FormInfo* formInfo = tdGeoLith->mPlot->m_formTrack->getFormInfoByParameters(tdGeoLith->mPlot->m_strUuid, tdGeoLith->mPlot->m_strWellName,
tdGeoLith->mPlot->m_strTrackName, tdGeoLith->mPlot->m_strLineName);
if (formInfo != NULL)
{
m_formInfo = formInfo;
m_strUuid = formInfo->m_strUuid;
m_strTrackUuid = formInfo->m_strTrackUuid;
//
m_strSlfName = formInfo->m_strSlfName;
m_strWellName = formInfo->m_strWellName;
m_strTrackName = formInfo->m_strTrackName;
m_strLineName = formInfo->m_strLineName;
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
//显示
_CreateVariantPropertyItem("显示", "岩性配色显示", formInfo->m_bLithColor, QVariant::Bool);
_CreateVariantPropertyItem("显示", "单岩性显示", formInfo->m_bLithOne, QVariant::Bool);
_CreateVariantPropertyItem("显示", "显示含油性", formInfo->m_bShowOil, QVariant::Bool);
_CreateVariantPropertyItem("显示", "显示颜色", formInfo->m_bShowColor, QVariant::Bool);
_CreateVariantPropertyItem("显示", "绘制颜色号", formInfo->m_bShowColorNum, QVariant::Bool);
_CreateVariantPropertyItem("显示", "含油占比(1~8)", formInfo->m_dOilZhan, QVariant::Double, 1, 8);
}
//当前属性类型
m_strCurrentProperty = GeoLithItem_Property;
m_tdGeoLith = tdGeoLith;

View File

@ -123,13 +123,13 @@ void TransparentDraggableFac::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -89,6 +89,17 @@ void TransparentDraggableGeoLith::setLith(QString filePath, QString colorPath)
{
m_Lith = filePath;
m_Color = colorPath;
//-----------------------------
int Color=0;
QString name,path;
GetWellNameAndPath(m_Color,name,path);
//
int ind=mPlot->ColorOrder.value(name).toInt();
if(ind<0||ind>=mPlot->ColorInds.size()) Color=0;
else Color=mPlot->ColorInds.key(QString::number(ind)).toInt();
//
mstrTitle = QString::number(Color);
}
void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight, double lY1, double lY2)
@ -100,7 +111,29 @@ void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight,
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double y1 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
double y1 = 0;
if(mPlot->m_bShowOil)
{
if(mPlot->m_bShowColor || mPlot->m_bShowColorNum) // 绘制颜色号/显示颜色
{
y1 = mPlot->yAxis->coordToPixel(lY1+2*(lY2-lY1)/mPlot->m_dOilZhan);
}
else
{
y1 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
}
}
else
{
if(mPlot->m_bShowColor || mPlot->m_bShowColorNum) // 绘制颜色号/显示颜色
{
y1 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
}
else
{
y1 = mPlot->yAxis->coordToPixel(lY1);
}
}
double y2 = mPlot->yAxis->coordToPixel(lY2);
double newWidth = y2-y1;
double newHeight = x1-x2;
@ -119,22 +152,20 @@ void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight,
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect,Qt::white);
//
//painter.setBrush(QBrush(QPixmap(colorPath)));
//颜色
QString strLastColor = m_Color.right(4);
if(strLastColor.toLower()==".svg")
{
//拉伸
DrawSVGSteched(&painter,m_Color,fillRect,0);
}
//
if(mPlot->m_bLithColor)
{
//颜色
QString strLastColor = m_Color.right(4);
if(strLastColor.toLower()==".svg")
{
//拉伸
DrawSVGSteched(&painter,m_Color,fillRect,0);
}
}
//拉伸
DrawSVGSteched(&painter,filePath,fillRect,0);
//平铺
//DrawSVGTiled(&painter,filePath,fillRect,0);
//正常
//DrawSVGNormal(&painter,filePath,fillRect,0);
val=GetImagePath()+"TempNew";
QDir ss;
@ -159,15 +190,20 @@ void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight,
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect,Qt::white);
//颜色
QString strLastColor = m_Color.right(4);
if(strLastColor.toLower()==".svg")
if(mPlot->m_bLithColor)
{
//拉伸
DrawSVGSteched(&painter,m_Color,fillRect,0);
//颜色
QString strLastColor = m_Color.right(4);
if(strLastColor.toLower()==".svg")
{
//拉伸
DrawSVGSteched(&painter,m_Color,fillRect,0);
}
}
//
bool isOne=true;
bool isOne=mPlot->m_bLithOne; //单岩性显示
bool isStech=true;
bool isHorizon=false;
float cm = g_dPixelPerCm;//一厘米对应的像素个数
@ -200,15 +236,25 @@ void TransparentDraggableGeoLith::setOil(QString filePath)
void TransparentDraggableGeoLith::drawOil(double left_Low, double right_Hight, double lY1, double lY2)
{
if(m_Oil=="")
if(m_Oil=="" || !mPlot->m_bShowOil)
{
return;
}
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double y1 = mPlot->yAxis->coordToPixel(lY1);
double y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
double y1 = 0;
double y2 = 0;
if(mPlot->m_bShowColor || mPlot->m_bShowColorNum) // 绘制颜色号/显示颜色
{
y1 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
y2 = mPlot->yAxis->coordToPixel(lY1+2*(lY2-lY1)/mPlot->m_dOilZhan);
}
else
{
y1 = mPlot->yAxis->coordToPixel(lY1);
y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
}
bool bWidthBig = false;
double newWidth = y2-y1;
@ -327,7 +373,42 @@ void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight,
mRect->bottomRight->setCoords(right_Hight, lY2);
//位置与rect不一样否则图像反转
mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/mPlot->m_dOilZhan);
if(mPlot->m_bShowOil)
{
if(mPlot->m_bShowColor || mPlot->m_bShowColorNum) // 绘制颜色号/显示颜色
{
// 设置父锚点,定位点
mItemTitle->setText(mstrTitle);
float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15;
mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos),
lY1+(lY2-lY1)/mPlot->m_dOilZhan/2);
mPixmap_Color->topLeft->setCoords(right_Hight, lY1+2*(lY2-lY1)/mPlot->m_dOilZhan);
}
else
{
mItemTitle->setText("");
mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/mPlot->m_dOilZhan);
}
}
else
{
if(mPlot->m_bShowColor || mPlot->m_bShowColorNum) // 绘制颜色号/显示颜色
{
// 设置父锚点,定位点
mItemTitle->setText(mstrTitle);
float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15;
mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos),
lY1+(lY2-lY1)/mPlot->m_dOilZhan/2);
mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/mPlot->m_dOilZhan);
}
else
{
mItemTitle->setText("");
mPixmap_Color->topLeft->setCoords(right_Hight, lY1);
}
}
mPixmap_Color->bottomRight->setCoords(left_Low, lY2);
//
drawLith(left_Low, right_Hight, lY1, lY2);
@ -335,10 +416,6 @@ void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight,
//位置与rect不一样否则图像反转
drawOil(left_Low, right_Hight, lY1, lY2);
// 设置父锚点,定位点
mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2,
(mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置
updateHandles();
if(bRefresh)
@ -407,13 +484,13 @@ void TransparentDraggableGeoLith::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();
@ -440,7 +517,7 @@ void TransparentDraggableGeoLith::initRect()
mPixmap_Color->setLayer("overlay"); // 确保在最上层
mItemTitle = new QCPItemText(mPlot);
mItemTitle->setText(mstrTitle);
mItemTitle->setText("");
//mItemTitle->setBrush(QBrush(Qt::red));
mItemTitle->setFont(QFont("Arial", 12, QFont::Bold));
mItemTitle->setColor(Qt::black);

View File

@ -256,13 +256,13 @@ void TransparentDraggableGujing::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -155,13 +155,13 @@ void TransparentDraggableJiegutext::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -47,8 +47,9 @@ void TransparentDraggableLayer::setRange(double left_Low, double right_Hight)
mRect->bottomRight->setCoords(right_Hight, lY2);
//位置与rect不一样否则图像反转
mPixmap->topLeft->setCoords(right_Hight, lY1);
mPixmap->bottomRight->setCoords(left_Low, lY2);
drawLith(left_Low, right_Hight, lY1, lY2);
// mPixmap->topLeft->setCoords(right_Hight, lY1);
// mPixmap->bottomRight->setCoords(left_Low, lY2);
float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15;
mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos),
@ -70,11 +71,130 @@ QCPRange TransparentDraggableLayer::getRange()
// 设置矩形颜色
void TransparentDraggableLayer::setColor(const QColor &color)
{
backgroundColor = color;
//
mRect->setBrush(QBrush(color));
mRect->setPen(QPen(color.darker()));
//mPlot->replot();
}
//设置岩性
void TransparentDraggableLayer::setLith(QString filePath)
{
m_Lith = filePath;
}
void TransparentDraggableLayer::drawLith(double left_Low, double right_Hight, double lY1, double lY2)
{
if(m_Lith=="")
{
return;
}
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double y1 = mPlot->yAxis->coordToPixel(lY1);
double y2 = mPlot->yAxis->coordToPixel(lY2);
double newWidth = y2-y1;
double newHeight = x1-x2;
//
QString filePath = m_Lith;
QString strLast = filePath.right(4);
if(strLast.toLower()==".svg")
{
QString path,filename;
GetWellNameAndPath(filePath, filename, path);
QString basename = filename;
QString val=filePath;
QImage image(newWidth, newHeight, QImage::Format_RGB32);
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect, backgroundColor);
val=GetImagePath()+"TempNew";
QDir ss;
if(!ss.exists(val)) {
ss.mkdir(val);
}
val+=QDir::separator();
val+=basename+".png";
image.save(val);
//
mPixmap->setPixmap(QPixmap(val)); // 设置图片
}
else
{
// QImage imageRect(newWidth, newHeight, QImage::Format_RGB32);
// QPainter painter(&imageRect);
// //
// QColor oldBackColor(255, 255, 255); // 原始颜色
// //
// QImage image(m_Lith);
// for (int y = 0; y < image.height(); ++y) {
// for (int x = 0; x < image.width(); ++x) {
// QColor pixelColor = QColor(image.pixel(x, y));
// if (pixelColor == oldBackColor) {
// image.setPixelColor(x, y, backgroundColor); // 使用 setPixelColor 来设置新颜色
// }
// }
// }
// //
// painter.setBrush(QBrush(QPixmap::fromImage(image)));
// //
// QString path,filename;
// GetWellNameAndPath(filePath, filename, path);
// QString basename = filename;
// //
// QString val=GetImagePath()+"TempNew";
// QDir ss;
// if(!ss.exists(val)) {
// ss.mkdir(val);
// }
// val+=QDir::separator();
// val+=basename+".png";
// image.save(val);
// //
// mPixmap->setPixmap(QPixmap(val)); // 设置图片
QString path,filename;
GetWellNameAndPath(filePath, filename, path);
QString basename = filename;
QString val=filePath;
QImage image(newWidth, newHeight, QImage::Format_RGB32);
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect, backgroundColor);
//
bool isOne=false;//是否只画一个大图或者false平铺1堆小图
bool isStech=false;
bool isHorizon=false;
float cm = g_dPixelPerCm;//一厘米对应的像素个数
QColor bkColor = QColor(255,255,255,0);
float GeoResult = m_drawGeo.seleGeo("岩性符号库", basename, &painter, fillRect, isOne, isStech, isHorizon, cm, bkColor);
val=GetImagePath()+"TempNew";
QDir ss;
if(!ss.exists(val)) {
ss.mkdir(val);
}
val+=QDir::separator();
val+=basename+".png";
image.save(val);
//
mPixmap->setPixmap(QPixmap(val)); // 设置图片
}
mPixmap->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x2+1), mPlot->yAxis->pixelToCoord(y1+1));//right_Hight
mPixmap->bottomRight->setCoords(mPlot->xAxis->pixelToCoord(x1-1), mPlot->yAxis->pixelToCoord(y2-1));//left_Low
}
// 删除框图
void TransparentDraggableLayer::deleteRect()
{
@ -104,13 +224,13 @@ void TransparentDraggableLayer::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -5,6 +5,7 @@
#include "qmycustomplot.h"
#include <QString>
#include <QMenu>
#include "GeoIndicatorGenerator.h"
#pragma execution_character_set("utf-8") // 强制指定执行字符集为 UTF-8
@ -38,6 +39,10 @@ public:
//设置底深
void setLower(double lower);
//设置岩性
void setLith(QString filePath);
void drawLith(double left_Low, double right_Hight, double lY1, double lY2);
signals:
void rangeChanged(QCPRange newRange);
@ -65,10 +70,13 @@ public:
QString mstrTitle="";
QString m_strUuid = "";
QString m_Lith="";
GeoIndicatorGenerator m_drawGeo;
//以下字段为临时添加,后面需要数据组集成
QFont wordfont; //文字字体
QColor fontColor; //字体颜色
QColor backgroundColor; //背景颜色
QFont wordfont = QFont("Arial", 12, QFont::Bold); //文字字体
QColor fontColor = Qt::black; //字体颜色
QColor backgroundColor = Qt::white; //背景颜色
int leftAndRightAlign; //左右对齐方式
int upAndDownAlign; //上下对齐方式

View File

@ -123,13 +123,13 @@ void TransparentDraggableMFac::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -123,13 +123,13 @@ void TransparentDraggablePhase::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -70,6 +70,8 @@ QCPRange TransparentDraggableRect::getRange()
// 设置矩形颜色
void TransparentDraggableRect::setColor(const QColor &color)
{
backgroundColor = color;
//
mRect->setBrush(QBrush(color));
mRect->setPen(QPen(color.darker()));
//mPlot->replot();
@ -104,13 +106,13 @@ void TransparentDraggableRect::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));//red
mLeftHandle->setPen(QPen(Qt::black));//darkRed
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -66,9 +66,9 @@ public:
QString m_strUuid = "";
//以下字段为临时添加,后面需要数据组集成
QFont wordfont; //文字字体
QColor fontColor; //字体颜色
QColor backgroundColor; //背景颜色
QFont wordfont = QFont("Arial", 12, QFont::Bold); //文字字体
QColor fontColor = Qt::black; //字体颜色
QColor backgroundColor = Qt::white; //背景颜色
int leftAndRightAlign; //左右对齐方式
int upAndDownAlign; //上下对齐方式

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();
@ -107,8 +107,8 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
double y2 = mPlot->yAxis->coordToPixel(lY1)+m_fImageWidth+(m_fLeftSpace+m_fTriangleLen);
bool bWidthBig = false;
double newWidth = y2-y1;
double newHeight = x1-x2;
double newWidth = y2-y1;
double newHeight = x1-x2;
// if(newWidth>newHeight)
// {
// //取小,画正方形框
@ -129,29 +129,7 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
QImage image(newWidth, newHeight, QImage::Format_RGB32);
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect,Qt::white);
//
//painter.setBrush(QBrush(QPixmap(colorPath)));
// //颜色
// QString strLastColor = m_Color.right(4);
// if(strLastColor.toLower()==".svg")
// {
// //拉伸
// DrawSVGSteched(&painter,m_Color,fillRect,0);
// }
// bool isStrech=false;
// QSvgRenderer m_SvgRenderer;
// m_SvgRenderer.load(filePath);
// if(!isStrech){
// float oil_h = fillRect.width();
// oil_h = (oil_h / 2 >= fillRect.height() / 2) ? fillRect.height() : oil_h;
// float rect_y = fillRect.y() + fillRect.height() / 2 - oil_h / 2;
// fillRect.setY(rect_y);
// fillRect.setHeight(oil_h);
// }
// fillRect.setX(fillRect.x() + 1);
// m_SvgRenderer.render(&painter, fillRect);
painter.fillRect(fillRect,Qt::white);
//拉伸
DrawSVGSteched(&painter,filePath,fillRect,0);
@ -170,36 +148,10 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
image.save(val);
//
mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片
// QSvgRenderer* svgRender = new QSvgRenderer();
// svgRender->load(result);
// //
// QPixmap* pixmap = new QPixmap(10, 10);
// pixmap->fill(Qt::transparent);//设置背景透明
// QPainter p(pixmap);
// svgRender->render(&p);
// //
// mPixmap->setPixmap(*pixmap); // 设置图片
mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片
}
else
{
// QString val=filePath;
// QImage image(47,16,QImage::Format_RGB32);
// QPainter painter(&image);
// QRectF fillRect(0,0,47,16);
// painter.fillRect(fillRect, QColor(0, 0, 0, 0));
// //
// painter.setBrush(QBrush(QPixmap(colorPath)));
// QPixmap* pixmap = new QPixmap(filePath);
// pixmap->fill(Qt::transparent);//设置背景透明
// mPixmap_Lith->setPixmap(*pixmap); // 设置图片
//mPixmap_Lith->setPixmap(QPixmap(filePath)); // 设置图片
{
QString path,filename;
GetWellNameAndPath(filePath, filename, path);
QString basename = filename;
@ -208,18 +160,11 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
QImage image(newWidth, newHeight, QImage::Format_RGB32);
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect,Qt::white);
// //颜色
// QString strLastColor = m_Color.right(4);
// if(strLastColor.toLower()==".svg")
// {
// //拉伸
// DrawSVGSteched(&painter,m_Color,fillRect,0);
// }
//
bool isOne=true;
bool isStech=true;
bool isHorizon=false;
painter.fillRect(fillRect,Qt::white);
//
bool isOne=true;
bool isStech=true;
bool isHorizon=false;
float cm = g_dPixelPerCm;//一厘米对应的像素个数
QColor bkColor = QColor(255,255,255,0);
@ -237,13 +182,8 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
//
mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片
}
mPixmap_Lith->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x2+1), mPlot->yAxis->pixelToCoord(y1+1));//right_Hight
mPixmap_Lith->bottomRight->setCoords(mPlot->xAxis->pixelToCoord(x1-1), mPlot->yAxis->pixelToCoord(y2-1));//left_Low
// mPixmap_Lith->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4);
// mPixmap_Lith->bottomRight->setCoords(left_Low, lY2);
//mPlot->replot();
mPixmap_Lith->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x2), mPlot->yAxis->pixelToCoord(y1));//right_Hight+1
mPixmap_Lith->bottomRight->setCoords(mPlot->xAxis->pixelToCoord(x1), mPlot->yAxis->pixelToCoord(y2));//left_Low-1
}
//设置m_Oil
@ -437,13 +377,13 @@ void TransparentDraggableSwallCore::initRect()
// // 创建左右边界控制点
// mLeftHandle = new QCPItemRect(mPlot);
// mLeftHandle->setLayer("overlay");
// mLeftHandle->setBrush(QBrush(Qt::red));
// mLeftHandle->setPen(QPen(Qt::darkRed));
// mLeftHandle->setBrush(QBrush(Qt::black));
// mLeftHandle->setPen(QPen(Qt::black));
// mRightHandle = new QCPItemRect(mPlot);
// mRightHandle->setLayer("overlay");
// mRightHandle->setBrush(QBrush(Qt::red));
// mRightHandle->setPen(QPen(Qt::darkRed));
// mRightHandle->setBrush(QBrush(Qt::black));
// mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -855,7 +855,9 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri
curv->m_iY2 = m_iY2;
curv->initGeometry(m_strUuid, m_iScale, m_nTrackW);
curv->show();
//绑定m_formTrack方便关联formInfo
curv->m_formTrack = m_formTrack;
if (strLineName == "FRAC_HOLE.TABLE")
{
//蝌蚪图

View File

@ -432,37 +432,11 @@ void FormInfo::paintEvent(QPaintEvent* event)
//painter.drawText(rect.left() + 20, 80, QString::number(m_vmin)+" ~ "+QString::number(m_vmax));
QString strShowTxt = "";
if(m_strType=="curveObject")
{
//曲线
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3, Qt::AlignCenter, m_strUnit);
}
//---------------
if(m_strLineName=="WORDS_RELUST")
{
//文字结论,不绘制左右范围
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "文字结论");
}
else if(m_strLineName=="RESULT")
if(m_strLineName=="RESULT")
{
//解释结论,不绘制左右范围
strShowTxt = "解释结论";
}
else if(m_strLineName=="GEO_LITH")
{
//录井剖面,不绘制左右范围
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "录井剖面");
}
else if(m_strLineName=="SWALL_CORE")
{
//井壁取心,不绘制左右范围
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "井壁取心");
}
else if(m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT")
{
//固井结论,不绘制左右范围
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "固井结论");
}
}
else if(m_strLineName=="CORE_PHYSICS")
{
//岩心分析,不绘制左右范围

View File

@ -146,7 +146,12 @@ public:
float m_fLayerRotate = 0.0f; // 层号旋转
//录井剖面
double m_dOilZhan=8; //含油占比
bool m_bLithColor = true; // 岩性配色显示
bool m_bLithOne = true; // 单岩性显示
bool m_bShowOil = true; // 显示含油性
bool m_bShowColor = false; // 显示颜色
bool m_bShowColorNum = false; // 绘制颜色号
double m_dOilZhan = 8; //含油占比
public:
void setLineWidth(double dWidth);

View File

@ -215,7 +215,7 @@ void MainWindowCurve::initMainToolBar()
//add QAction to Widget.
ui->mainToolBar->addAction(m_fixwellsectionHeaderAc);
ui->mainToolBar->addAction(m_currtempliteAc);
//ui->mainToolBar->addAction(m_currtempliteAc);
ui->mainToolBar->addAction(m_saveastemplateAc);
ui->mainToolBar->addAction(m_executeDepthShiftAc);
ui->mainToolBar->addAction(m_joindepthAc);

View File

@ -126,6 +126,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString)));
//改变录井剖面属性
connect(CallManage::getInstance(), SIGNAL(sig_changeGeoLithLine(QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGeoLithLine(QString, QString, QString, QString, QString, double)));
//是否显示
connect(CallManage::getInstance(), SIGNAL(sig_changeGeoLithShow(QString, QString, QString, QString, QString, QString, bool)), this, SLOT(s_changeGeoLithShow(QString, QString, QString, QString, QString, QString, bool)));
}
void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW)
@ -5385,6 +5387,59 @@ void QMyCustomPlot::s_changeGeoLithLine(QString strUuid, QString strSlfName, QSt
//不清空属性窗口
}
//改变录井剖面属性,是否显示
void QMyCustomPlot::s_changeGeoLithShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow)
{
if(m_strUuid == strUuid &&
m_strSlfName == strSlfName &&
m_strWellName == strWellName &&
m_strTrackName == strTrackName &&
m_strLineName == strLineName)
{
}
else
{
return;
}
if(propertyData == "岩性配色显示")
{
m_bLithColor = bShow;
}
else if(propertyData == "单岩性显示")
{
m_bLithOne = bShow;
}
else if(propertyData == "显示含油性")
{
m_bShowOil = bShow;
}
else if(propertyData == "显示颜色")
{
m_bShowColor = bShow;
}
else if(propertyData == "绘制颜色号")
{
m_bShowColorNum = bShow;
}
//删除对象
TransparentDraggableGeoLith *pDraggableRect =NULL;
QMap<QString,QObject *>::Iterator it = m_mapDraggable_GeoLith.begin();
while( it != m_mapDraggable_GeoLith.end() )
{
pDraggableRect = (TransparentDraggableGeoLith*)it.value();
it++;
pDraggableRect->deleteRect();
}
//重新加载
LoadFromSLF_GeoLith(m_strSlfName, m_strLineName);
//不清空属性窗口
}
bool QMyCustomPlot::LoadFromSLF_Layer(QString strSlfName, QString strLineName)
{
LAYER_DATA m_Result;

View File

@ -3,9 +3,9 @@
#include "qcustomplot.h"
#include "LogIO.h"
//#include "TransparentDraggableRect.h"
#include "QCPSizeHandleManager.h"
#include "qtColorSchemeComboBox.h"
#include "formtrack.h"
#pragma execution_character_set("utf-8")
@ -13,7 +13,7 @@ const int iFracType=15;
//
#define SideWallCoreWidth 1.2
#define SideWallCoreHeight 0.4
#define SideWallCoreHeight 0.5
class TransparentGroupResult;
class QMyCustomPlot : public QCustomPlot
@ -60,6 +60,8 @@ public:
QString m_strTrackName;
QString m_strLineName;
FormTrack *m_formTrack = NULL;
//
float m_iX1, m_iX2;
float m_iY1, m_iY2;
@ -182,7 +184,12 @@ public:
QMap<QString,QString> ColorOrder;
QMap<QString,QString> ColorInds;
QStringList LithWidth;
double m_dOilZhan=8; //含油占比
bool m_bLithColor = true; // 岩性配色显示
bool m_bLithOne = true; // 单岩性显示
bool m_bShowOil = true; // 显示含油性
bool m_bShowColor = false; // 显示颜色
bool m_bShowColorNum = false; // 绘制颜色号
double m_dOilZhan = 8; //含油占比
QString GetIntLith(QString Lith);
QString GetIntOil(QString Oil);
QString GetIntColor(QString Color);
@ -377,6 +384,8 @@ public slots:
//改变录井剖面属性
void s_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan);
//是否显示
void s_changeGeoLithShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow);
public:
//蝌蚪图重绘网格线

View File

@ -262,13 +262,13 @@ void TransparentDraggableGuan::initRect()
// // 创建左右边界控制点
// mLeftHandle = new QCPItemRect(mPlot);
// mLeftHandle->setLayer("overlay");
// mLeftHandle->setBrush(QBrush(Qt::red));
// mLeftHandle->setPen(QPen(Qt::darkRed));
// mLeftHandle->setBrush(QBrush(Qt::black));
// mLeftHandle->setPen(QPen(Qt::black));
// mRightHandle = new QCPItemRect(mPlot);
// mRightHandle->setLayer("overlay");
// mRightHandle->setBrush(QBrush(Qt::red));
// mRightHandle->setPen(QPen(Qt::darkRed));
// mRightHandle->setBrush(QBrush(Qt::black));
// mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -185,13 +185,13 @@ void TransparentDraggableRightList::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -197,13 +197,13 @@ void TransparentDraggableSelectRect::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();

View File

@ -255,13 +255,13 @@ void TransparentDraggableImage::initRect()
// 创建左右边界控制点
mLeftHandle = new QCPItemRect(mPlot);
mLeftHandle->setLayer("overlay");
mLeftHandle->setBrush(QBrush(Qt::red));
mLeftHandle->setPen(QPen(Qt::darkRed));
mLeftHandle->setBrush(QBrush(Qt::black));
mLeftHandle->setPen(QPen(Qt::black));
mRightHandle = new QCPItemRect(mPlot);
mRightHandle->setLayer("overlay");
mRightHandle->setBrush(QBrush(Qt::red));
mRightHandle->setPen(QPen(Qt::darkRed));
mRightHandle->setBrush(QBrush(Qt::black));
mRightHandle->setPen(QPen(Qt::black));
// 设置初始位置
//double center = mPlot->xAxis->range().center();