This commit is contained in:
DESKTOP-450PEFP\mainc 2026-04-09 09:05:50 +08:00
commit 5eb1b2bfcc
8 changed files with 1113 additions and 701 deletions

View File

@ -182,8 +182,10 @@ signals:
//改变深度属性
void sig_changeDepthProperty(QVariantList vlist);
//改变频率统计图属性
// 改变频率统计图属性
void sig_changePlObjectProperty(QVariantMap variantMap);
// 改变玫瑰图属性
void sig_changeRoseProperty(QVariantMap variantMap);
//改变岩心分析
void sig_changeCorePhysicsProperty(QVariantMap variantMap);

View File

@ -165,7 +165,7 @@ void PropertyWidget::changedYxzpProperty(QtProperty *qtProperty, const QVariant
}
}
}
else if("例区高度" == m_propertyData[qtProperty])
else if("例区高度(cm)" == m_propertyData[qtProperty])
{
int temp = variant.toInt();
this->m_formInfo->m_headHeight = temp;
@ -292,7 +292,7 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV
m_formInfo->m_curveNameFont = newFont;
m_formInfo->update();
}
else if("例区高度" == m_propertyData[qtProperty])
else if("例区高度(cm)" == m_propertyData[qtProperty])
{
int temp = variant.toInt();
this->m_formInfo->m_headHeight = temp;
@ -3454,7 +3454,7 @@ void PropertyWidget::initImageProperty(FormInfo *formInfo)
{
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool);
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
_CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font);
@ -3488,7 +3488,7 @@ void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, d
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool);
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
_CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font);
@ -3547,7 +3547,7 @@ void PropertyWidget::initGeoLithProperty(FormInfo *formInfo)
void PropertyWidget::initCorePhysicsProperty(FormInfo *formInfo, bool isItem)
{
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
_CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
@ -3633,9 +3633,9 @@ void PropertyWidget::initCorePhysicsItemProperty(TransparentDraggableCorePhysics
this->initCorePhysicsProperty(formInfo, true);
_CreateVariantPropertyItem("当前项", "序号", tdImage->getCpOrder(), QVariant::Int);
_CreateVariantPropertyItem("当前项", "深度", tdImage->getCpDepth(), QVariant::Double);
_CreateVariantPropertyItem("当前项", "校正深度", tdImage->getCpCorrDepth(), QVariant::Double);
_CreateVariantPropertyItem("当前项", "序号", qAbs(tdImage->getCpOrder()), QVariant::Int);
_CreateVariantPropertyItem("当前项", "深度", qAbs(tdImage->getCpDepth()), QVariant::Double);
_CreateVariantPropertyItem("当前项", "校正深度", qAbs(tdImage->getCpCorrDepth()), QVariant::Double);
_CreateVariantPropertyItem("当前项", "数值", tdImage->getCpCoreValue(), QVariant::Double);
}
// 当前属性类型
@ -4181,7 +4181,7 @@ void PropertyWidget::initPlObjectProperty(FormInfo *formInfo)
_CreateVariantPropertyItem("数据", "方位曲线", formInfo->m_pl_azimuthCurve, QVariant::String);
_CreateVariantPropertyItem("数据", "倾角曲线", formInfo->m_pl_inclinationCurve, QVariant::String);
_CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int);
_CreateVariantPropertyItem("字体", "名称", formInfo->m_strAliasNameFont, QVariant::Font);
_CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font);
@ -4243,6 +4243,7 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
else if ("数据类型" == strProperty)
{
this->m_formInfo->m_pl_dataType = varVal.toInt();
flag = true;
}
else if ("显示单位" == strProperty)
{
@ -4252,10 +4253,12 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
else if ("方位曲线" == strProperty)
{
this->m_formInfo->m_pl_azimuthCurve = varVal.toString();
flag = true;
}
else if ("倾角曲线" == strProperty)
{
this->m_formInfo->m_pl_inclinationCurve = varVal.toString();
flag = true;
}
else if ("例区高度(cm)" == strProperty)
{
@ -4446,6 +4449,13 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
if(flag)
{
QVariantMap variantMap;
// 必须用来判断当前道
variantMap["m_strTrackName"] = this->m_formInfo->m_strTrackName;
// 数据
variantMap["m_pl_dataType"] = this->m_formInfo->m_pl_dataType;
variantMap["m_pl_azimuthCurve"] = this->m_formInfo->m_pl_azimuthCurve;
variantMap["m_pl_inclinationCurve"] = this->m_formInfo->m_pl_inclinationCurve;
variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
@ -4550,6 +4560,7 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
else if ("数据类型" == strProperty)
{
this->m_formInfo->m_pl_dataType = varVal.toInt();
flag = true;
}
else if ("显示单位" == strProperty)
{
@ -4559,10 +4570,12 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
else if ("方位曲线" == strProperty)
{
this->m_formInfo->m_pl_azimuthCurve = varVal.toString();
flag = true;
}
else if ("倾角曲线" == strProperty)
{
this->m_formInfo->m_pl_inclinationCurve = varVal.toString();
flag = true;
}
// 通常
else if ("例区高度(cm)" == strProperty)
@ -4684,11 +4697,89 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
{
this->m_formInfo->m_pl_custom2 = varVal.toBool();
}
// 表数据
else if ("深度字段" == strProperty)
{
this->m_formInfo->m_rose_depth_field = varVal.toString();
}
else if ("方位字段" == strProperty)
{
this->m_formInfo->m_rose_azimuth_field = varVal.toString();
}
else if ("倾角字段" == strProperty)
{
this->m_formInfo->m_rose_dip_field = varVal.toString();
}
else if ("属性字段" == strProperty)
{
this->m_formInfo->m_rose_attribute_field = varVal.toString();
}
// 玫瑰图
else if ("扇形" == strProperty)
{
this->m_formInfo->m_rose_sector_enabled = varVal.toInt();
}
else if ("圆半径(cm)" == strProperty)
{
this->m_formInfo->m_rose_circle_radius_cm = varVal.toInt();
}
else if ("辐射圈" == strProperty)
{
this->m_formInfo->m_rose_radiation_circle_enabled = varVal.toInt();
}
else if ("方位打印间隔" == strProperty)
{
this->m_formInfo->m_rose_azimuth_print_interval = varVal.toInt();
}
else if ("圆线颜色" == strProperty)
{
this->m_formInfo->m_rose_circle_line_color = varVal.value<QColor>();
}
else if ("圆线宽度" == strProperty)
{
this->m_formInfo->m_rose_circle_line_width = varVal.toInt();
}
else if ("应力线颜色" == strProperty)
{
this->m_formInfo->m_rose_stress_line_color = varVal.value<QColor>();
}
else if ("垮塌线颜色" == strProperty)
{
this->m_formInfo->m_rose_collapse_line_color = varVal.value<QColor>();
}
else if ("绘制辐射线?" == strProperty)
{
this->m_formInfo->m_rose_draw_radiation_line = varVal.toBool();
}
else if ("绘制井眼垮塌" == strProperty)
{
this->m_formInfo->m_rose_draw_wellbore_collapse = varVal.toBool();
}
else if ("是否填充" == strProperty)
{
this->m_formInfo->m_rose_fill_enabled = varVal.toBool();
}
else if ("是否绘制标注?" == strProperty)
{
this->m_formInfo->m_rose_draw_annotation = varVal.toBool();
}
if(flag)
{
QVariantMap variantMap;
// 必须用来判断当前道
variantMap["m_strTrackName"] = this->m_formInfo->m_strTrackName;
// 数据
variantMap["m_pl_dataType"] = this->m_formInfo->m_pl_dataType;
variantMap["m_pl_azimuthCurve"] = this->m_formInfo->m_pl_azimuthCurve;
variantMap["m_pl_inclinationCurve"] = this->m_formInfo->m_pl_inclinationCurve;
// 表数据
variantMap["m_rose_depth_field"] = this->m_formInfo->m_rose_depth_field;
variantMap["m_rose_azimuth_field"] = this->m_formInfo->m_rose_azimuth_field;
variantMap["m_rose_dip_field"] = this->m_formInfo->m_rose_dip_field;
variantMap["m_rose_attribute_field"] = this->m_formInfo->m_rose_attribute_field;
variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
@ -4713,7 +4804,6 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
variantMap["m_pl_maxInclination"] = this->m_formInfo->m_pl_maxInclination;
variantMap["m_strUuid"] = this->m_formInfo->m_strUuid;
variantMap["m_strTrackName"] = this->m_formInfo->m_strTrackName;
emit CallManage::getInstance()->sig_changePlObjectProperty(variantMap);
emit CallManage::getInstance()->sig_changeRoseProperty(variantMap);
}
}

View File

@ -312,28 +312,34 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
}
else if("plObject" == strType) // 频率统计图
{
initFgrq(curv);
// 读json后 重新设置样式
// 设置左侧显示属性 设置界面样式
if(pInfo->m_strUnit.isEmpty()){
pInfo->m_strUnit = "(°)";
pInfo->m_strUnitFont = QFont("微软雅黑", 8);
}
// 例区高度
pInfo->setFixedHeight(pInfo->m_headHeight);
this->initFgrq(curv);
// 数据
int dataType = pInfo->m_pl_dataType; // 数据类型
QString azimuthCurve = pInfo->m_pl_azimuthCurve; // 方位曲线
QString inclinationCurve = pInfo->m_pl_inclinationCurve; // 倾角曲线
// 通常
pInfo->setFixedHeight(pInfo->m_headHeight); // 例区高度
// 控制曲线
QString csCurveGrad = pInfo->m_pl_controlCurveName;
double LeftVal3 = pInfo->m_pl_controlMinValue;
double RightVal3 = pInfo->m_pl_controlMaxValue;
// 方位频率
int nArc = pInfo->m_pl_sectorCount;
double nR = pInfo->m_pl_circleRadius;
QColor crArc = pInfo->m_pl_circleColor;
int nArcLineWidth = pInfo->m_pl_circleLineWidth;
bool bFill = pInfo->m_pl_isFillEnabled;
QColor crFill = pInfo->m_pl_fillColor;
// 线数
int lineNumber = pInfo->m_pl_lineNumber;
// 倾角频率
int lineNumber = pInfo->m_pl_lineNumber; // 线数
// 统计线高度
double lineHeight = pInfo->m_pl_lineHeight;
// 线粗细
@ -351,7 +357,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
int statInterval = pInfo->m_pl_statInterval; // 统计间隔
double minInclination = pInfo->m_pl_minInclination; // 最小倾角
double maxInclination = pInfo->m_pl_maxInclination; // 最大倾角
curv->fgrqDraw(csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill,
curv->drawFgrq(dataType, azimuthCurve, inclinationCurve, csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill,
lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram,
baselineWidth, baselineColor, statInterval, minInclination, maxInclination);
}
@ -359,7 +365,20 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
{
pInfo->m_pl_azimuthCurve = "STRDIR"; // 方位曲线
pInfo->m_pl_inclinationCurve = "CALM"; // 倾角曲线
initRose(curv);
if(pInfo->m_strUnit.isEmpty()){
pInfo->m_strUnit = "(°)";
pInfo->m_strUnitFont = QFont("微软雅黑", 8);
}
this->initRose(curv);
// 数据
int dataType = pInfo->m_pl_dataType; // 数据类型
QString azimuthCurve = pInfo->m_pl_azimuthCurve; // 方位曲线
QString inclinationCurve = pInfo->m_pl_inclinationCurve; // 倾角曲线
// curv->drawRose(dataType, azimuthCurve, inclinationCurve);
}
else if("dcaObject" == strType)
@ -503,20 +522,16 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
//套管组件
DisplayTubing_One(lineObjInfo);
}
else if (strType == "depthObject")
{
// 深度
DisplayDepth_One(lineObjInfo);
}
else if (strType == "SantuyibiaoObject")
{
// 斜井三图一表属性
DisplayTvd_One(lineObjInfo);
}
else if (strType == "plObject")
// 深度 频率统计图 玫瑰图
else if (strType == "depthObject" || strType == "plObject" || strType == "roseObject")
{
// 频率统计图
displayPlObject(lineObjInfo);
DisplayType_One(lineObjInfo);
}
else
{
@ -528,37 +543,6 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
}
}
void FormDraw::displayPlObject(QJsonObject objInfo)
{
QString strType = objInfo.value("Type").toString();
QString strLineName = objInfo.value("LineName").toString();
QStringList dt;
dt << m_strUuid;
dt << m_strWellName;
dt << m_strSlfName;
dt << strLineName;
dt << strType;
dt << QString::number(m_nTrackW);
this->setDrawData(dt, objInfo);
}
// 深度
void FormDraw::DisplayDepth_One(QJsonObject objInfo)
{
QString strType = objInfo.value("Type").toString();
QString strLineName = objInfo.value("LineName").toString();
QStringList dt;
dt << m_strUuid;
dt << m_strWellName;
dt << m_strSlfName;
dt << strLineName;
dt << strType;
dt << QString::number(m_nTrackW);
this->setDrawData(dt, objInfo);
}
// 岩心分析
void FormDraw::displayCorePhysics(QJsonObject jsonObject)
{
@ -5988,16 +5972,32 @@ void FormDraw::initFgrq(QMyCustomPlot *widget)
widget->yAxis = xAxis;
}
void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_RightVal3)
void FormDraw::initRose(QMyCustomPlot *widget)
{
// widget->clearGraphs();
// widget->clearItems();
widget->m_iX1 = 0;
widget->m_iX2 = 1024;
widget->m_iY1 = m_iY1;
widget->m_iY2 = m_iY2;
//
widget->xAxis->setRange(widget->m_iX1, widget->m_iX2);
widget->yAxis->setRange(m_iY1, m_iY2);
//对调XY轴在最前面设置
QCPAxis *yAxis = widget->yAxis;
QCPAxis *xAxis = widget->xAxis;
widget->xAxis = yAxis;
widget->yAxis = xAxis;
// // if(m_Value == NULL)
// {
// m_bTableData = false; // 表格 曲线
// m_csCurveDDIR = "DDIR"; // 方位 曲线名
// m_csCurveDANG = "DANG";//倾角
// m_csCurveDDIR = "STRDIR"; // 方位 曲线名
// m_csCurveDANG = "CALM";//倾角
// m_csCurveGrad = "GRAD";
// m_qsTable="FRAC_HOLE.TABLE";
@ -6009,7 +6009,7 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
// Refurbish();
// }
// double nR = 50;
// double nR = 40;
// QPen wPen(Qt::black, 2);
// double centerX = widget->m_iX2/2;
@ -6018,6 +6018,8 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
// float x,y,x1,y1,x2,y2;
// float ifdir[360];
// int m_nArc = 36;
// float m_LeftVal3 = 0;
// float m_RightVal3 = 100.0;
// m_LeftVal = 0.0f;
// m_RightVal = 90.0f;
// float mind=min(m_RightVal , m_LeftVal);
@ -6026,7 +6028,7 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
// float deps;
// float ftmpSdep = m_SDep;
// float ftmpSdep = 2890;//m_SDep;
// float ftmpEdep = m_EDep;
// if (m_bTableData)
// {
@ -6046,6 +6048,15 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
// int tmp = ftmpSdep / nstep;
// float flDep = tmp * nstep;
// double pi = 3.1415926535;
// // 射线
// bool m_bGrid = true;
// // 井眼垮塌
// bool m_bJykt = true;
// // 标注
// bool m_bHint = true;
// int m_nAzimStep = 3;
// m_Curve.DepLevel = 0.5;
// while ( 1)
// {
@ -6054,6 +6065,8 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
// double tempf = flDep+(float)(nstep)/2.;
// double centerY = tempf * -1.0;
// wPen.setWidth(2);
// wPen.setColor(Qt::black);
// QCPItemEllipse* pEse = new QCPItemEllipse(widget);
// pEse->setPen(wPen);
// pEse->m_bCustom = true;
@ -6073,517 +6086,248 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
// pLine1->end->setCoords(centerY,centerX);
// }
// // 写标注
// if ( m_bHint )
// {
// int psize = 10;
// flVal = m_nAzimStep*360./m_nArc;
// for (int i=0 ;i<360; i+=(int)(flVal))
// {
// QCPItemText* mItemTitle = new QCPItemText(widget);
// mItemTitle->position->setCoords(centerY,centerX);
// mItemTitle->setText(QString::number(i));
// //mItemTitle->setBrush(QBrush(Qt::red));
// mItemTitle->setFont(QFont("Arial", 10));
// mItemTitle->setColor(Qt::black);
// dr = i*2* 3.1415926535/ 360.;
// mItemTitle->m_fx = (nR+psize*0.85)*sin(dr);
// mItemTitle->m_fy = (nR+psize*0.85)*cos(dr);
// mItemTitle->m_bCustom = true;
// }
// }
// if(m_bGrid)
// {
// wPen.setWidth(1);
// double st = 360/m_nArc;
// for(int i = 0; i < m_nArc; i++)
// {
// int ntmp = i % 9;
// if(ntmp != 0)
// {
// QCPItemLine* pLine = new QCPItemLine(widget);
// pLine->m_bCustom = true;
// pLine->m_dr = qDegreesToRadians(i * st);
// pLine->m_nRadius = 0;
// pLine->m_nTailLen=nR;
// pLine->setPen(wPen);
// pLine->start->setCoords(centerY,centerX);
// pLine->end->setCoords(centerY,centerX);
// }
// }
// }
// for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
// x1 = 360./m_nArc;
// int i = 0;
// if (m_bTableData)
// while ( 1 )
// {
// int m_nLine = 9;
// y1 = (maxd-mind)/m_nLine;//线数
// for (i=0; i<nPointNum; i++)
// deps = flDep + i * m_Curve.DepLevel;
// tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
// if (deps >= ftmpEdep||
// deps > m_Curve.EndDepth||
// deps >=( flDep + nstep))
// break;
// if(tempf<0)
// {
// const FRAC_TABLE& frac = m_FracTabList.at(i);
// if ( frac.DEP < 0 ) continue;
// bool bDraw = false;
// for (int j=0; j<n; j++)
// {
// const FRAC_DEF& fd = m_FracDefList.at(j);
// if ( (int)(frac.ID) == fd.iCode )
// {
// bDraw = m_bTypeDraw[j];//fd.bDraw;
// break;
// }
// }
// if ( !bDraw ) continue;
// deps =frac.DEP;
// if ( deps >= flDep &&deps < (flDep+ nstep) )
// {
// flVal = frac.DIR;//方位
// int j = flVal/x1;
// if ( j >= 0 && j< m_nArc+1 )
// ifdir[j] ++;
// flVal = frac.DIPorS;//倾角
// //按倾角范围统计
// if(flVal> maxd || flVal < mind)
// {
// //i++;
// continue;
// }
// // j = (flVal-mind)/y1;//j = flVal/y1+1;
// // if ( j >= 0 && j< m_nLine+1 )
// // ifdir[j] ++;
// }
// i++;
// continue;
// }
// }
// else
// {
// while ( 1 )
// {
// deps = flDep + i * m_Curve.DepLevel;
// tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
// if (deps >= ftmpEdep||
// deps > m_Curve.EndDepth||
// deps >=( flDep + nstep))
// break;
// if(tempf<0)
// if (m_Value3 !=NULL )// for 控制曲线
// {
// float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
// if(tempf3<0)
// {
// i++;
// continue;
// }
// if (m_Value3 !=NULL )// for 控制曲线
// {
// float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
// if(tempf3<0)
// {
// i++;
// continue;
// }
// double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
// if(grad<m_LeftVal3||grad>m_RightVal3){i++;continue;}
// }
// flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
// flVal=fmod(flVal,360.f);
// int j = flVal/x1;
// if ( j >= 0 && j< m_nArc+1 )
// ifdir[j] ++;
// double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
// if(grad<m_LeftVal3||grad>m_RightVal3){i++;continue;}
// }
// if (m_Value2 !=NULL ) // 倾角控制
// {
// tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5;
// if(tempf<0 )
// {
// i++;
// continue;
// }
// flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]);
// //按倾角范围统计
// if(flVal> maxd || flVal < mind)
// if(flVal > maxd || flVal < mind)
// {
// i++;
// continue;
// }
// i ++;
// }
// tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
// flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
// if(flVal<0)
// {
// i++;
// continue;
// }
// flVal=fmod(flVal,360.f);
// int j = flVal/x1;
// if ( j >= 0 && j< m_nArc+1 )
// ifdir[j] ++;
// i ++;
// }
// flVal = 3.1415926535 *2./ m_nArc ;
// dirmax=0; dipmax=0;
// dirmax=0;
// int iIndex = -1;
// for(i=0;i<=m_nArc;i++)
// if (dirmax<ifdir[i]) dirmax=ifdir[i];
// if (dirmax == 0 )
// dirmax=1;
// for(i=0;i<=m_nArc;i++)
// ifdir[i]=ifdir[i]*(nR)/dirmax;//-m_nArcLineWidth/2.whp add 2016.10.21 for线粗时扇叶超界
// // ifdir[i]=ifdir[i]*(nRadius-GetLineWidth(pDC,m_nArcLineWidth/2.))/dirmax;//-m_nArcLineWidth/2.whp add 2016.10.21 for线粗时扇叶超界
// {
// if (dirmax<ifdir[i])
// {
// iIndex = i;
// dirmax=ifdir[i];
// }
// }
// ifdir[m_nArc+1]=ifdir[1];
// //方位频率
// float x0,y0;
// //没有统计点,不绘制
// if (dirmax == 0 ) dirmax=1;
// x = centerY;
// y = centerX;
// for(int i=0;i<=m_nArc;i++)
// flVal = pi *2./ m_nArc ;
// QPolygonF myPolygon;
// float oldx, oldy;
// for (i=0 ;i<=m_nArc; i++)
// {
// if(ifdir[i] <= 0.0f)
// continue;
// dr=i*flVal;
// float x1 = ifdir[i]*nR*sin(dr)/dirmax;
// float y1 = ifdir[i]*nR*cos(dr)/dirmax;
// if(oldx != x1 || oldy != y1)
// {
// myPolygon << QPointF(x1, y1);
// oldx = x1;
// oldy = y1;
// }
// if ( i >=m_nArc )
// dr=0.;
// else
// dr=(i+1)*flVal;
// dr=(i+1)*flVal;
// float x2 = ifdir[i]*nR*sin(dr)/dirmax;
// float y2 = ifdir[i]*nR*cos(dr)/dirmax;
// if(oldx != x2 || oldy != y2)
// {
// myPolygon << QPointF(x2, y2);
// oldx = x2;
// oldy = y2;
// }
// }
// // pt[2*m_nArc+2] = pt[0];
// if (iIndex >=0/*&&m_bFill*/ )
// {
// x = centerY;
// y = centerX;
// QCPItemPolygon* pol = new QCPItemPolygon(widget);
// pol->topLeft->setCoords(x, y);
// pol->bottomRight->setCoords(x, y);
// // pol->setPloyVal(i,flVal, ifdir[i]);
// float dr=i*flVal;
// float x1 = ifdir[i]*sin(dr);
// float y1 = ifdir[i]*cos(dr);
// dr=(i+1)*flVal;
// float x2 = ifdir[i]*sin(dr);
// float y2 = ifdir[i]*cos(dr);
// QPolygonF myPolygon;
// myPolygon << QPointF(0, 0);
// myPolygon << QPointF(x1, y1);
// myPolygon << QPointF(x2, y2);
// myPolygon << QPointF(0, 0);
// pol->setPoints(myPolygon);
// pol->setBrushColor(QColor(255,170,0));
// }
// // QCPItemRect* prt = new QCPItemRect(widget);
// // prt->topLeft->setCoords(x, y);
// // prt->bottomRight->setCoords(x, y);
// myPolygon.clear();
// tempf = m_nArc/2.;
// for (i=0 ;i<=m_nArc; i++)
// {
// dr=i*flVal;
// dr = dr-tempf*flVal;
// float x1 = ifdir[i]*nR*sin(dr)/dirmax;
// float y1 = ifdir[i]*nR*cos(dr)/dirmax;
// if(oldx != x1 || oldy != y1)
// {
// myPolygon << QPointF(x1, y1);
// oldx = x1;
// oldy = y1;
// }
// if ( i >=m_nArc )
// dr=0.;
// else
// dr=(i+1)*flVal;
// dr = dr-tempf*flVal;
// float x2 = ifdir[i]*nR*sin(dr)/dirmax;
// float y2 = ifdir[i]*nR*cos(dr)/dirmax;
// if(oldx != x2 || oldy != y2)
// {
// myPolygon << QPointF(x2, y2);
// oldx = x2;
// oldy = y2;
// }
// }
// if (iIndex >=0/*&&m_bFill*/ )
// {
// x = centerY;
// y = centerX;
// QCPItemPolygon* pol = new QCPItemPolygon(widget);
// pol->topLeft->setCoords(x, y);
// pol->bottomRight->setCoords(x, y);
// pol->setPoints(myPolygon);
// pol->setBrushColor(QColor(255,170,0));
// }
// if ( m_bJykt && iIndex >=0 )
// {
// // 绘制垮塌方向
// dr=iIndex*flVal;
// dr = dr-pi/2;//9*flVal;
// x1 = ifdir[iIndex]*nR*sin(dr)/dirmax;
// y1 = ifdir[iIndex]*nR*cos(dr)/dirmax;
// dr=iIndex*flVal;
// dr = dr+pi/2;
// x2 = ifdir[iIndex]*nR*sin(dr)/dirmax;
// y2 = ifdir[iIndex]*nR*cos(dr)/dirmax;
// wPen.setWidth(2);
// wPen.setColor(QColor(0,85,255));
// this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen);
// dr=iIndex*flVal;
// float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
// float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
// this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
// this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
// dr=iIndex*flVal;
// dr = dr-pi;//18*flVal;//m1_nArc*flVal/2;
// x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
// y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
// this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
// this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
// // if(m_bFill)
// // {
// // QPainterPath myPath;
// // myPath.addPolygon(myPolygon);
// // pDC->fillPath(myPath,textBrushFill);
// // }
// // if(m_nArcLineWidth>=1)
// // {
// // pDC->setPen(pPenArc);
// // // pDC->drawPolygon(myPolygon);
// // }
// }
// flDep += nstep;
// }
}
void FormDraw::initRose(QMyCustomPlot *widget)
{
widget->m_iX1 = 0;
widget->m_iX2 = 1024;
widget->m_iY1 = m_iY1;
widget->m_iY2 = m_iY2;
//
widget->xAxis->setRange(widget->m_iX1, widget->m_iX2);
widget->yAxis->setRange(m_iY1, m_iY2);
//对调XY轴在最前面设置
QCPAxis *yAxis = widget->yAxis;
QCPAxis *xAxis = widget->xAxis;
widget->xAxis = yAxis;
widget->yAxis = xAxis;
// if(m_Value == NULL)
{
m_bTableData = false; // 表格 曲线
m_csCurveDDIR = "STRDIR"; // 方位 曲线名
m_csCurveDANG = "CALM";//倾角
m_csCurveGrad = "GRAD";
m_qsTable="FRAC_HOLE.TABLE";
m_qsDIR=("DDIR"); // 方位 曲线名
m_qsDIP=("DANG");//倾角
m_qsDepth="DEPT";
m_qsID = "ID";
Refurbish();
}
double nR = 40;
QPen wPen(Qt::black, 2);
double centerX = widget->m_iX2/2;
float flVal = 0.0f;
float x,y,x1,y1,x2,y2;
float ifdir[360];
int m_nArc = 36;
float m_LeftVal3 = 0;
float m_RightVal3 = 100.0;
m_LeftVal = 0.0f;
m_RightVal = 90.0f;
float mind=min(m_RightVal , m_LeftVal);
float maxd=max(m_RightVal , m_LeftVal);
float dirmax,dipmax,dr;
float deps;
float ftmpSdep = 2890;//m_SDep;
float ftmpEdep = m_EDep;
if (m_bTableData)
{
ReadFracDef();
for (int i = 0 ; i < iFracType ; i++)
{
m_bTypeDraw[i] = true;
}
ftmpSdep = -m_iY2;
ftmpEdep = -m_iY1;
}
int nPointNum = m_FracTabList.count();
int n = m_FracDefList.count();
int nstep = 5;
int tmp = ftmpSdep / nstep;
float flDep = tmp * nstep;
double pi = 3.1415926535;
// 射线
bool m_bGrid = true;
// 井眼垮塌
bool m_bJykt = true;
// 标注
bool m_bHint = true;
int m_nAzimStep = 3;
m_Curve.DepLevel = 0.5;
while ( 1)
{
if((flDep>=ftmpEdep+nstep)||flDep>=ftmpEdep)break;
double tempf = flDep+(float)(nstep)/2.;
double centerY = tempf * -1.0;
wPen.setWidth(2);
wPen.setColor(Qt::black);
QCPItemEllipse* pEse = new QCPItemEllipse(widget);
pEse->setPen(wPen);
pEse->m_bCustom = true;
pEse->m_nRadius = nR;
pEse->topLeft->setCoords(centerY, centerX);
pEse->bottomRight->setCoords(centerY, centerX);
for(int k = 0; k < 4; k++)
{
QCPItemLine* pLine1 = new QCPItemLine(widget);
pLine1->m_bCustom = true;
pLine1->m_dr = qDegreesToRadians(k*90.0);
pLine1->m_nRadius = 0;
pLine1->m_nTailLen=nR;
pLine1->setPen(wPen);
pLine1->start->setCoords(centerY,centerX);
pLine1->end->setCoords(centerY,centerX);
}
// 写标注
if ( m_bHint )
{
int psize = 10;
flVal = m_nAzimStep*360./m_nArc;
for (int i=0 ;i<360; i+=(int)(flVal))
{
QCPItemText* mItemTitle = new QCPItemText(widget);
mItemTitle->position->setCoords(centerY,centerX);
mItemTitle->setText(QString::number(i));
//mItemTitle->setBrush(QBrush(Qt::red));
mItemTitle->setFont(QFont("Arial", 10));
mItemTitle->setColor(Qt::black);
dr = i*2* 3.1415926535/ 360.;
mItemTitle->m_fx = (nR+psize*0.85)*sin(dr);
mItemTitle->m_fy = (nR+psize*0.85)*cos(dr);
mItemTitle->m_bCustom = true;
}
}
if(m_bGrid)
{
wPen.setWidth(1);
double st = 360/m_nArc;
for(int i = 0; i < m_nArc; i++)
{
int ntmp = i % 9;
if(ntmp != 0)
{
QCPItemLine* pLine = new QCPItemLine(widget);
pLine->m_bCustom = true;
pLine->m_dr = qDegreesToRadians(i * st);
pLine->m_nRadius = 0;
pLine->m_nTailLen=nR;
pLine->setPen(wPen);
pLine->start->setCoords(centerY,centerX);
pLine->end->setCoords(centerY,centerX);
}
}
}
for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
x1 = 360./m_nArc;
int i = 0;
while ( 1 )
{
deps = flDep + i * m_Curve.DepLevel;
tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
if (deps >= ftmpEdep||
deps > m_Curve.EndDepth||
deps >=( flDep + nstep))
break;
if(tempf<0)
{
i++;
continue;
}
if (m_Value3 !=NULL )// for 控制曲线
{
float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
if(tempf3<0)
{
i++;
continue;
}
double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
if(grad<m_LeftVal3||grad>m_RightVal3){i++;continue;}
}
if (m_Value2 !=NULL ) // 倾角控制
{
tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5;
flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]);
//按倾角范围统计
if(flVal > maxd || flVal < mind)
{
i++;
continue;
}
}
tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
if(flVal<0)
{
i++;
continue;
}
flVal=fmod(flVal,360.f);
int j = flVal/x1;
if ( j >= 0 && j< m_nArc+1 )
ifdir[j] ++;
i ++;
}
dirmax=0;
int iIndex = -1;
for(i=0;i<=m_nArc;i++)
{
if (dirmax<ifdir[i])
{
iIndex = i;
dirmax=ifdir[i];
}
}
ifdir[m_nArc+1]=ifdir[1];
//没有统计点,不绘制
if (dirmax == 0 ) dirmax=1;
flVal = pi *2./ m_nArc ;
QPolygonF myPolygon;
float oldx, oldy;
for (i=0 ;i<=m_nArc; i++)
{
dr=i*flVal;
float x1 = ifdir[i]*nR*sin(dr)/dirmax;
float y1 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x1 || oldy != y1)
{
myPolygon << QPointF(x1, y1);
oldx = x1;
oldy = y1;
}
if ( i >=m_nArc )
dr=0.;
else
dr=(i+1)*flVal;
dr=(i+1)*flVal;
float x2 = ifdir[i]*nR*sin(dr)/dirmax;
float y2 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x2 || oldy != y2)
{
myPolygon << QPointF(x2, y2);
oldx = x2;
oldy = y2;
}
}
// pt[2*m_nArc+2] = pt[0];
if (iIndex >=0/*&&m_bFill*/ )
{
x = centerY;
y = centerX;
QCPItemPolygon* pol = new QCPItemPolygon(widget);
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
}
myPolygon.clear();
tempf = m_nArc/2.;
for (i=0 ;i<=m_nArc; i++)
{
dr=i*flVal;
dr = dr-tempf*flVal;
float x1 = ifdir[i]*nR*sin(dr)/dirmax;
float y1 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x1 || oldy != y1)
{
myPolygon << QPointF(x1, y1);
oldx = x1;
oldy = y1;
}
if ( i >=m_nArc )
dr=0.;
else
dr=(i+1)*flVal;
dr = dr-tempf*flVal;
float x2 = ifdir[i]*nR*sin(dr)/dirmax;
float y2 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x2 || oldy != y2)
{
myPolygon << QPointF(x2, y2);
oldx = x2;
oldy = y2;
}
}
if (iIndex >=0/*&&m_bFill*/ )
{
x = centerY;
y = centerX;
QCPItemPolygon* pol = new QCPItemPolygon(widget);
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
}
if ( m_bJykt && iIndex >=0 )
{
// 绘制垮塌方向
dr=iIndex*flVal;
dr = dr-pi/2;//9*flVal;
x1 = ifdir[iIndex]*nR*sin(dr)/dirmax;
y1 = ifdir[iIndex]*nR*cos(dr)/dirmax;
dr=iIndex*flVal;
dr = dr+pi/2;
x2 = ifdir[iIndex]*nR*sin(dr)/dirmax;
y2 = ifdir[iIndex]*nR*cos(dr)/dirmax;
wPen.setWidth(2);
wPen.setColor(QColor(0,85,255));
this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen);
dr=iIndex*flVal;
float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
dr=iIndex*flVal;
dr = dr-pi;//18*flVal;//m1_nArc*flVal/2;
x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
}
flDep += nstep;
}
}
void FormDraw::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen)
{
QPolygonF myPolygon;

View File

@ -60,14 +60,11 @@ public:
void DisplayLine_One(QJsonObject lineObjInfo);
//波列
void DisplayType_One(QJsonObject objInfo);
// 深度
void DisplayDepth_One(QJsonObject lineObjInfo);
// 岩心分析
void displayCorePhysics(QJsonObject lineObjInfo);
// 岩心照片
void displayImageData(QJsonObject lineObjInfo);
// 频率统计图
void displayPlObject(QJsonObject lineObjInfo);
//表格:固井结论等
void DisplayTable_One(QJsonObject lineObjInfo);
@ -235,12 +232,11 @@ public:
//深度
void initDepth(QMyCustomPlot *widget);
//频率统计图
void initFgrq(QMyCustomPlot *widget);
void fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_RightVal3);
//玫瑰图
void initRose(QMyCustomPlot *widget);
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
// DCA检测

View File

@ -165,45 +165,6 @@ void FormInfo::initProperty(QJsonObject obj)
}
else if ("plObject" == strType)
{
// 数据名称
this->m_pl_dataType = obj["m_pl_dataType"].toInt(); // 数据类型
// 显示单位
// 井文件名称
this->m_pl_azimuthCurve = obj["m_pl_azimuthCurve"].toString(); // 方位曲线
this->m_pl_inclinationCurve = obj["m_pl_inclinationCurve"].toString(); // 倾角曲线
this->m_headHeight = obj["m_headHeight"].toInt(); // 例区高度
// 名称
{
QStringList fontParts = obj["m_strAliasNameFont"].toString().split(","); // 按逗号拆分
if (fontParts.size() >= 2) {
this->m_strAliasNameFont.setFamily(fontParts[0]); // 设置字体名称
this->m_strAliasNameFont.setPointSize(fontParts[1].toInt()); // 设置字号
}
}
// 单位
{
QStringList fontParts = obj["m_strUnitFont"].toString().split(","); // 按逗号拆分
if (fontParts.size() >= 2) {
this->m_strUnitFont.setFamily(fontParts[0]); // 设置字体名称
this->m_strUnitFont.setPointSize(fontParts[1].toInt()); // 设置字号
}
}
// 刻度
{
QStringList fontParts = obj["m_pl_fontScale"].toString().split(","); // 按逗号拆分
if (fontParts.size() >= 2) {
this->m_pl_fontScale.setFamily(fontParts[0]); // 设置字体名称
this->m_pl_fontScale.setPointSize(fontParts[1].toInt()); // 设置字号
}
}
// this->m_strAliasNameFont = obj["m_strAliasNameFont"]; // 曲线名称
this->m_pl_controlCurveName = obj["m_pl_controlCurveName"].toString(); // 曲线名
this->m_pl_controlMinValue = obj["m_pl_controlMinValue"].toDouble(); // 最小值
this->m_pl_controlMaxValue = obj["m_pl_controlMaxValue"].toDouble(); // 最大值
this->m_pl_sectorCount = obj["m_pl_sectorCount"].toInt(); // 扇形
this->m_pl_circleRadius = obj["m_pl_circleRadius"].toDouble(); // 圆半径
this->m_pl_circleColor = QColor(obj["m_pl_circleColor"].toString()); // 圆线颜色
@ -220,11 +181,63 @@ void FormInfo::initProperty(QJsonObject obj)
this->m_pl_baselineWidth = obj["m_pl_baselineWidth"].toInt(); // 宽度
this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色
}
else if ("roseObject" == strType)
{
// this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色
}
if ("plObject" == strType || ("roseObject" == strType))
{
// 数据
// 数据名称
this->m_pl_dataType = obj["m_pl_dataType"].toInt(); // 数据类型
// 显示单位
// 井文件名称
this->m_pl_azimuthCurve = obj["m_pl_azimuthCurve"].toString(); // 方位曲线
this->m_pl_inclinationCurve = obj["m_pl_inclinationCurve"].toString(); // 倾角曲线
// 通常
this->m_headHeight = obj["m_headHeight"].toInt(); // 例区高度
// 字体
{
// 名称
QStringList fontParts = obj["m_strAliasNameFont"].toString().split(","); // 按逗号拆分
if (fontParts.size() >= 2) {
this->m_strAliasNameFont.setFamily(fontParts[0]); // 设置字体名称
this->m_strAliasNameFont.setPointSize(fontParts[1].toInt()); // 设置字号
}
}
{
// 单位
QStringList fontParts = obj["m_strUnitFont"].toString().split(","); // 按逗号拆分
if (fontParts.size() >= 2) {
this->m_strUnitFont.setFamily(fontParts[0]); // 设置字体名称
this->m_strUnitFont.setPointSize(fontParts[1].toInt()); // 设置字号
}
}
{
// 刻度
QStringList fontParts = obj["m_pl_fontScale"].toString().split(","); // 按逗号拆分
if (fontParts.size() >= 2) {
this->m_pl_fontScale.setFamily(fontParts[0]); // 设置字体名称
this->m_pl_fontScale.setPointSize(fontParts[1].toInt()); // 设置字号
}
}
// this->m_strAliasNameFont = obj["m_strAliasNameFont"]; // 曲线名称
// 控制曲线
this->m_pl_controlCurveName = obj["m_pl_controlCurveName"].toString(); // 曲线名
this->m_pl_controlMinValue = obj["m_pl_controlMinValue"].toDouble(); // 最小值
this->m_pl_controlMaxValue = obj["m_pl_controlMaxValue"].toDouble(); // 最大值
// 统计参数
this->m_pl_statInterval = obj["m_pl_statInterval"].toInt(); // 统计间隔
this->m_pl_minInclination = obj["m_pl_minInclination"].toDouble(); // 最小倾角
this->m_pl_maxInclination = obj["m_pl_maxInclination"].toDouble(); // 最大倾角
// 分类
this->m_pl_highGap = obj["m_pl_highGap"].toBool(); // 高导缝
this->m_pl_highReservoir = obj["m_pl_highReservoir"].toBool(); // 高阻缝
this->m_pl_reticularFracture = obj["m_pl_reticularFracture"].toBool(); // 网状缝
@ -864,7 +877,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
//蝌蚪图,不绘制左右范围
strShowTxt = "蝌蚪图";
}
if(this->m_strType == "plObject")
if(this->m_strType == "plObject" || this->m_strType == "roseObject")
{
strShowTxt = " ";
}
@ -1024,7 +1037,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
}
// 频率统计图
if(this->m_strType == "plObject")
if(this->m_strType == "roseObject")
{
painter.setRenderHint(QPainter::Antialiasing);
@ -1068,6 +1081,52 @@ void FormInfo::paintEvent(QPaintEvent* event)
painter.setFont(oldFont);
currentY += UNIT_HEIGHT + SPACING;
painter.setFont(oldFont);
}
if(this->m_strType == "plObject")
{
QRect rect = this->rect();
int width = rect.width();
int height = rect.height();
// ========== 固定距离配置 ==========
const int NAME_HEIGHT = 30; // 名称区域高度
const int UNIT_HEIGHT = 25; // 单位区域高度
const int COMPASS_SIZE = 50; // 指南针区域高度
const int SPACING = 15; // 元素之间的间距
// 计算总占用高度
int totalContentHeight = NAME_HEIGHT + SPACING + UNIT_HEIGHT + SPACING + COMPASS_SIZE;
// 垂直居中起始位置
int startY = (height - totalContentHeight) / 2;
if (startY < 0) startY = 0;
int currentY = startY;
int centerX = width / 2;
// ========== 1. 绘制名称(最上面)==========
QFont oldFont = painter.font();
painter.setFont(this->m_strAliasNameFont);
QRect nameRect(0, currentY, width, NAME_HEIGHT);
painter.drawText(nameRect, Qt::AlignCenter, this->m_strAliasName);
painter.setFont(oldFont);
currentY += NAME_HEIGHT + SPACING;
// ========== 2. 绘制单位(中间)==========
oldFont = painter.font();
painter.setFont(this->m_strUnitFont);
QRect unitRect(0, currentY, width, UNIT_HEIGHT);
painter.drawText(unitRect, Qt::AlignCenter, this->m_strUnit);
painter.setFont(oldFont);
currentY += UNIT_HEIGHT + SPACING;
// ========== 3. 绘制指南针(最下面)==========
oldFont = painter.font();
painter.setFont(this->m_pl_fontScale);

View File

@ -298,24 +298,23 @@ public:
// 玫瑰图
// 表数据字段
QString m_rose_depth_field; // 深度字段
QString m_rose_azimuth_field; // 方位字段
QString m_rose_dip_field; // 倾角字段
QString m_rose_attribute_field; // 属性字段
// 玫瑰图核心配置
int m_rose_sector_enabled; // 扇形(启用开关)
int m_rose_circle_radius_cm; // 圆半径(cm)
int m_rose_radiation_circle_enabled; // 辐射圈(启用开关)
int m_rose_azimuth_print_interval; // 方位打印间隔
QColor m_rose_circle_line_color; // 圆线颜色
int m_rose_circle_line_width; // 圆线宽度
QColor m_rose_stress_line_color; // 应力线颜色
QColor m_rose_collapse_line_color; // 垮塌线颜色
bool m_rose_draw_radiation_line; // 绘制辐射线?
bool m_rose_draw_wellbore_collapse; // 绘制井眼垮塌
bool m_rose_fill_enabled; // 是否填充
bool m_rose_draw_annotation; // 是否绘制标注?
QString m_rose_depth_field = "DEP"; // 深度字段
QString m_rose_azimuth_field = "DIR"; // 方位字段
QString m_rose_dip_field = "DIPorS"; // 倾角字段
QString m_rose_attribute_field = "ID"; // 属性字段
// 玫瑰图
int m_rose_sector_enabled = 36; // 扇形(启用开关)
int m_rose_circle_radius_cm = 1; // 圆半径(cm)
int m_rose_radiation_circle_enabled = 9; // 辐射圈(启用开关)
int m_rose_azimuth_print_interval = 3; // 方位打印间隔
QColor m_rose_circle_line_color = Qt::black; // 圆线颜色
int m_rose_circle_line_width = 2; // 圆线宽度
QColor m_rose_stress_line_color = Qt::black; // 应力线颜色
QColor m_rose_collapse_line_color = Qt::black; // 垮塌线颜色
bool m_rose_draw_radiation_line = true; // 绘制辐射线?
bool m_rose_draw_wellbore_collapse = true; // 绘制井眼垮塌
bool m_rose_fill_enabled = true; // 是否填充
bool m_rose_draw_annotation = true; // 是否绘制标注?
int cpLineWidth() const;
void setCpLineWidth(int cpLineWidth);

View File

@ -150,8 +150,12 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
// 深度属性修改
connect(CallManage::getInstance(), SIGNAL(sig_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList)));
// 深度属性修改
// 频率统计图属性修改
connect(CallManage::getInstance(), SIGNAL(sig_changePlObjectProperty(QVariantMap)), this, SLOT(s_changePlObjectProperty(QVariantMap)));
// 玫瑰图属性修改
connect(CallManage::getInstance(), SIGNAL(sig_changeRoseProperty(QVariantMap)), this, SLOT(s_changeRoseProperty(QVariantMap)));
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
// 岩心分析
@ -9982,6 +9986,16 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
{
return;
}
// 数据
int dataType = variantMap["m_pl_dataType"].toInt();
bool bTableData = false;
if(dataType == 1)
{
bTableData = true;
}
QString azimuthCurve = variantMap["m_pl_azimuthCurve"].toString();
QString inclinationCurve = variantMap["m_pl_inclinationCurve"].toString();
// 控制曲线
QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString();
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
@ -10013,13 +10027,14 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
double maxInclination = variantMap["m_pl_maxInclination"].toDouble();
this->fgrqDraw(csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill,
this->drawFgrq(dataType, azimuthCurve, inclinationCurve, csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill,
lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram, baselineWidth,
baselineColor, statInterval, minInclination, maxInclination);
}
void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightVal3, int nArc,
void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString csCurveGrad, double LeftVal3, double RightVal3, int nArc,
double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill,
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram,
int baselineWidth, QColor baselineColor, int nstep, double LeftVal, double RightVal)
@ -10027,11 +10042,12 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
this->clearGraphs();
this->clearItems();
bool flag = true;
// if(m_Value == NULL)
{
m_bTableData = false; // 表格 曲线
m_csCurveDDIR = "DDIR"; // 方位 曲线名
m_csCurveDANG = "DANG";//倾角
m_bTableData = bTableData; // 表格 曲线
this->m_csCurveDDIR = csCurveDDIR; // 方位 曲线名
this->m_csCurveDANG = csCurveDANG;//倾角
this->m_csCurveGrad = csCurveGrad;
m_qsTable="FRAC_HOLE.TABLE";
@ -10040,7 +10056,11 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
m_qsDepth="DEPT";
m_qsID = "ID";
Refurbish();
flag = Refurbish();
if(!flag)
{
return;
}
}
// double nR = 50;
@ -10180,7 +10200,6 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
if(grad<LeftVal3||grad>RightVal3){i++;continue;}
}
flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
flVal=fmod(flVal,360.f);
int j = flVal/x1;
@ -10265,7 +10284,7 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
if(drawAnnotation)
{
this->drawDipAngle(centerX, centerY, ifdir, iIndex, dirmax, lineNumber, lineHeight, lineThickness, lineColor,
this->drawDipAngle(centerX, centerY, ifdir, dirmax, lineNumber, lineHeight, lineThickness, lineColor,
drawHistogram, baselineWidth, baselineColor, LeftVal, RightVal);
}
@ -10276,7 +10295,7 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
this->replot();
}
void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360], int iIndex, float dirmax,
void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360], float dirmax,
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawHistogram,
int baselineWidth, QColor baselineColor, double minInclination, double maxInclination)
{
@ -10318,35 +10337,39 @@ void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360
scaleLine->start->setCoords(startY, currY);
scaleLine->end->setCoords(startY + dynamicLen, currY); // 每个刻度长度不同
}
// QRect rect = this->axisRect()->rect();
// qDebug() << centerY << "--==--=-=-=" << centerX << "-----------" << rect;
}
void QMyCustomPlot::Refurbish()
bool QMyCustomPlot::Refurbish()
{
bool flag = true;
if (m_bTableData)
{
// ReadData(m_strSlfName, "");
ReadData(m_strSlfName, "");
}
else
{
this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve);
this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2);
this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3);
flag = this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve);
if(!flag)
{
return flag;
}
flag = this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2);
flag = this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3);
}
return flag;
}
//曲线
//read curve
void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve)
//曲线 //read curve
bool QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve)
{
bool flag = true;
//
if(strSlfName.isEmpty())
{
return;
flag = false;
return flag;
}
// 读曲线数值
@ -10375,7 +10398,11 @@ void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve
if (iIndex >= 0)
{
mrw.GetCurveInfo(iIndex,curve);
if(curve->DepLevel==0) return;
if(curve->DepLevel==0)
{
flag = false;
return flag;
}
m_PointNum = (float)(fabs((curve->EndDepth - curve->StartDepth)/curve->DepLevel+0.5));
m_SDep=curve->StartDepth;
m_EDep=curve->EndDepth;
@ -10408,7 +10435,493 @@ void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve
}
mrw.CloseCurve(iIndex);
}
else
{
flag = false;
}
mrw.Close(); //关闭井文件
}
return flag;
}
//表格 //for table dip ,read FRAC_HOLE.TABLE
bool QMyCustomPlot::ReadData(QString strSlfName, QString strLineName)
{
bool flag = true;
QString cs;
int nField,len;
FRAC_TABLE frac;
CMemRdWt mrw;
m_PointNum = 0 ;
char strFracTable[256];
int i,j,iIndex,nCount,iType=1;
char wellname2[512];
char *buffer;
Slf_TABLE_FIELD *Table_Field;
char bufField[1024];
float val;
//
m_FracTabList.clear();
if(m_qsTable=="AC"|| m_qsTable=="")
{
m_qsTable="FRAC_HOLE.TABLE";
}
//
if(strSlfName.isEmpty())
{
flag = false;
return flag;
}
//CString wellname(strSlfName);
if ( mrw.Open(strSlfName.toStdString().c_str()) ) // 打开井文件
{
//CString strFracTable(m_qsTable);
iIndex = mrw.OpenTable(m_qsTable.toStdString().c_str());
if (iIndex >= 0)
{
nField = mrw.GetTableFieldCount(iIndex);
Table_Field = new Slf_TABLE_FIELD[nField+1];
// 读取字段信息
mrw.GetTableFieldInfo(iIndex, Table_Field);
// 读取数据记录
nCount = mrw.GetTableRecordCount(iIndex);
i = mrw.GetTableRecordLength(iIndex);
buffer = new char[i+2];
m_PointNum = nCount;
for(i=0; i<nCount; i++)
{
memset(&frac, 0x00, sizeof(FRAC_TABLE));
mrw.ReadTable(iIndex, i+1, buffer);
frac.DEP = -9999;
len = 0;
for(j=0; j<nField; j++)
{
val = GetData(Table_Field[j].RepCode, &buffer[len]);
cs = Table_Field[j].Name;
if ( m_qsDepth.compare(cs)==0)
frac.DEP = val;
if ( m_qsDIP.compare(cs)==0)
frac.DIPorS = val;
if ( m_qsDIR.compare(cs)==0)
frac.DIR = val;
if ( m_qsID.compare(cs)==0)
{
// frac.ID = (int)(val);
if(Table_Field[j].RepCode == 6)
{
char buf[513];
memset(buf,0,513);
strncpy(buf,&buffer[len],Table_Field[j].Length);
buf[Table_Field[j].Length]='\0';
frac.ID = atoi(buf);
}
}
len += Table_Field[j].Length;
}
m_FracTabList.append(frac);
}
delete [] Table_Field;
delete [] buffer;
mrw.CloseTable(iIndex);
}
else
{
flag = false;
}
mrw.Close(); //关闭井文件
}
return flag;
}
void QMyCustomPlot::s_changeRoseProperty(QVariantMap variantMap)
{
QString strTrackName = variantMap["m_strTrackName"].toString();
if(this->m_strTrackName != strTrackName)
{
return;
}
// 数据
int dataType = variantMap["m_pl_dataType"].toInt();
bool bTableData = false;
if(dataType == 1)
{
dataType = true;
}
QString azimuthCurve = variantMap["m_pl_azimuthCurve"].toString();
QString inclinationCurve = variantMap["m_pl_inclinationCurve"].toString();
// 表数据
QString m_rose_depth_field = variantMap["m_rose_depth_field"].toString();
QString m_rose_azimuth_field = variantMap["m_rose_azimuth_field"].toString();
QString m_rose_dip_field = variantMap["m_rose_dip_field"].toString();
QString m_rose_attribute_field = variantMap["m_rose_attribute_field"].toString();
this->drawRose(bTableData, azimuthCurve, inclinationCurve,
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field);
}
void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID)
{
bool flag = true;
this->clearGraphs();
this->clearItems();
double m_LeftVal = 0.0f;
double m_RightVal = 90.0f;
// if(m_Value == NULL)
{
m_bTableData = bTableData; // 表格 曲线
m_csCurveDDIR = csCurveDDIR; // 方位曲线
m_csCurveDANG = csCurveDANG; //倾角曲线
m_csCurveGrad = "GRAD";
m_qsDepth="DEPT"; // 深度字段
m_qsDIR="DDIR"; // 方位字段
m_qsDIP="DANG";// 倾角字段
m_qsID = "ID";
m_qsTable="FRAC_HOLE.TABLE";
flag = Refurbish();
if(!flag)
{
return;
}
}
double nR = 40;
QPen wPen(Qt::black, 2);
double centerX = this->m_iX2/2;
float flVal = 0.0f;
float x,y,x1,y1,x2,y2;
float ifdir[360];
int m_nArc = 36;
float m_LeftVal3 = 0;
float m_RightVal3 = 100.0;
m_LeftVal = 0.0f;
m_RightVal = 90.0f;
float mind=min(m_RightVal , m_LeftVal);
float maxd=max(m_RightVal , m_LeftVal);
float dirmax,dipmax,dr;
float deps;
float ftmpSdep = 2890;//m_SDep;
float ftmpEdep = m_EDep;
if (m_bTableData)
{
ReadFracDef();
for (int i = 0 ; i < iFracType ; i++)
{
m_bTypeDraw[i] = true;
}
ftmpSdep = -m_iY2;
ftmpEdep = -m_iY1;
}
int nPointNum = m_FracTabList.count();
int n = m_FracDefList.count();
int nstep = 5;
int tmp = ftmpSdep / nstep;
float flDep = tmp * nstep;
double pi = 3.1415926535;
// 射线
bool m_bGrid = true;
// 井眼垮塌
bool m_bJykt = true;
// 标注
bool m_bHint = true;
int m_nAzimStep = 3;
m_Curve.DepLevel = 0.5;
while ( 1)
{
if((flDep>=ftmpEdep+nstep)||flDep>=ftmpEdep)break;
double tempf = flDep+(float)(nstep)/2.;
double centerY = tempf * -1.0;
wPen.setWidth(2);
wPen.setColor(Qt::black);
QCPItemEllipse* pEse = new QCPItemEllipse(this);
pEse->setPen(wPen);
pEse->m_bCustom = true;
pEse->m_nRadius = nR;
pEse->topLeft->setCoords(centerY, centerX);
pEse->bottomRight->setCoords(centerY, centerX);
for(int k = 0; k < 4; k++)
{
QCPItemLine* pLine1 = new QCPItemLine(this);
pLine1->m_bCustom = true;
pLine1->m_dr = qDegreesToRadians(k*90.0);
pLine1->m_nRadius = 0;
pLine1->m_nTailLen=nR;
pLine1->setPen(wPen);
pLine1->start->setCoords(centerY,centerX);
pLine1->end->setCoords(centerY,centerX);
}
// 写标注
if ( m_bHint )
{
int psize = 10;
flVal = m_nAzimStep*360./m_nArc;
for (int i=0 ;i<360; i+=(int)(flVal))
{
QCPItemText* mItemTitle = new QCPItemText(this);
mItemTitle->position->setCoords(centerY,centerX);
mItemTitle->setText(QString::number(i));
//mItemTitle->setBrush(QBrush(Qt::red));
mItemTitle->setFont(QFont("Arial", 10));
mItemTitle->setColor(Qt::black);
dr = i*2* 3.1415926535/ 360.;
mItemTitle->m_fx = (nR+psize*0.85)*sin(dr);
mItemTitle->m_fy = (nR+psize*0.85)*cos(dr);
mItemTitle->m_bCustom = true;
}
}
if(m_bGrid)
{
wPen.setWidth(1);
double st = 360/m_nArc;
for(int i = 0; i < m_nArc; i++)
{
int ntmp = i % 9;
if(ntmp != 0)
{
QCPItemLine* pLine = new QCPItemLine(this);
pLine->m_bCustom = true;
pLine->m_dr = qDegreesToRadians(i * st);
pLine->m_nRadius = 0;
pLine->m_nTailLen=nR;
pLine->setPen(wPen);
pLine->start->setCoords(centerY,centerX);
pLine->end->setCoords(centerY,centerX);
}
}
}
for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
x1 = 360./m_nArc;
int i = 0;
while ( 1 )
{
deps = flDep + i * m_Curve.DepLevel;
tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
if (deps >= ftmpEdep||
deps > m_Curve.EndDepth||
deps >=( flDep + nstep))
break;
if(tempf<0)
{
i++;
continue;
}
if (m_Value3 !=NULL )// for 控制曲线
{
float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
if(tempf3<0)
{
i++;
continue;
}
double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
if(grad<m_LeftVal3||grad>m_RightVal3){i++;continue;}
}
if (m_Value2 !=NULL ) // 倾角控制
{
tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5;
flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]);
//按倾角范围统计
if(flVal > maxd || flVal < mind)
{
i++;
continue;
}
}
tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
if(flVal<0)
{
i++;
continue;
}
flVal=fmod(flVal,360.f);
int j = flVal/x1;
if ( j >= 0 && j< m_nArc+1 )
ifdir[j] ++;
i ++;
}
dirmax=0;
int iIndex = -1;
for(i=0;i<=m_nArc;i++)
{
if (dirmax<ifdir[i])
{
iIndex = i;
dirmax=ifdir[i];
}
}
ifdir[m_nArc+1]=ifdir[1];
//没有统计点,不绘制
if (dirmax == 0 ) dirmax=1;
flVal = pi *2./ m_nArc ;
QPolygonF myPolygon;
float oldx, oldy;
for (i=0 ;i<=m_nArc; i++)
{
dr=i*flVal;
float x1 = ifdir[i]*nR*sin(dr)/dirmax;
float y1 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x1 || oldy != y1)
{
myPolygon << QPointF(x1, y1);
oldx = x1;
oldy = y1;
}
if ( i >=m_nArc )
dr=0.;
else
dr=(i+1)*flVal;
dr=(i+1)*flVal;
float x2 = ifdir[i]*nR*sin(dr)/dirmax;
float y2 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x2 || oldy != y2)
{
myPolygon << QPointF(x2, y2);
oldx = x2;
oldy = y2;
}
}
// pt[2*m_nArc+2] = pt[0];
if (iIndex >=0/*&&m_bFill*/ )
{
x = centerY;
y = centerX;
QCPItemPolygon* pol = new QCPItemPolygon(this);
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
}
myPolygon.clear();
tempf = m_nArc/2.;
for (i=0 ;i<=m_nArc; i++)
{
dr=i*flVal;
dr = dr-tempf*flVal;
float x1 = ifdir[i]*nR*sin(dr)/dirmax;
float y1 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x1 || oldy != y1)
{
myPolygon << QPointF(x1, y1);
oldx = x1;
oldy = y1;
}
if ( i >=m_nArc )
dr=0.;
else
dr=(i+1)*flVal;
dr = dr-tempf*flVal;
float x2 = ifdir[i]*nR*sin(dr)/dirmax;
float y2 = ifdir[i]*nR*cos(dr)/dirmax;
if(oldx != x2 || oldy != y2)
{
myPolygon << QPointF(x2, y2);
oldx = x2;
oldy = y2;
}
}
if (iIndex >=0/*&&m_bFill*/ )
{
x = centerY;
y = centerX;
QCPItemPolygon* pol = new QCPItemPolygon(this);
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
}
if ( m_bJykt && iIndex >=0 )
{
// 绘制垮塌方向
dr=iIndex*flVal;
dr = dr-pi/2;//9*flVal;
x1 = ifdir[iIndex]*nR*sin(dr)/dirmax;
y1 = ifdir[iIndex]*nR*cos(dr)/dirmax;
dr=iIndex*flVal;
dr = dr+pi/2;
x2 = ifdir[iIndex]*nR*sin(dr)/dirmax;
y2 = ifdir[iIndex]*nR*cos(dr)/dirmax;
wPen.setWidth(2);
wPen.setColor(QColor(0,85,255));
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen);
dr=iIndex*flVal;
float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
dr=iIndex*flVal;
dr = dr-pi;//18*flVal;//m1_nArc*flVal/2;
x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
}
flDep += nstep;
}
}
void QMyCustomPlot::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen)
{
QPolygonF myPolygon;
myPolygon << p1;
myPolygon << p2;
QCPItemLine* pLine = new QCPItemLine(widget);
pLine->setPen(wPen);
pLine->start->setCoords(cx,cy);
pLine->end->setCoords(cx,cy);
pLine->setPoints(myPolygon);
}

View File

@ -58,27 +58,27 @@ public:
{
}
void initGeometry(QString strUuid, int nscale, int nW);
void initGeometry(QString strUuid, int nscale, int nW);
void changePropertyWaveUpdate();
// 绘图类型-变密度(成像)
void initWave(QString strSlfName, QString strWaveName);
// 绘图类型-波形
void initWave2(QString strSlfName, QString strWaveName);
void initColorTable();
void setSchemeIndex(int nidx, int colorNum);
QCPColorMap * updateWave();
void changePropertyWaveUpdate();
// 绘图类型-变密度(成像)
void initWave(QString strSlfName, QString strWaveName);
// 绘图类型-波形
void initWave2(QString strSlfName, QString strWaveName);
float getScaleV();
void initColorTable();
void setSchemeIndex(int nidx, int colorNum);
QCPColorMap * updateWave();
void groupBeginResult(float fEndDepth, float fStartDepth);
void groupEndResult();
float getScaleV();
// 设置解释结论属性
void setShowProperty(QVariant val, int ntag);
void setConclusionProportion(int nCopro);
void setShowPos(int nSPos);
void groupBeginResult(float fEndDepth, float fStartDepth);
void groupEndResult();
// 设置解释结论属性
void setShowProperty(QVariant val, int ntag);
void setConclusionProportion(int nCopro);
void setShowPos(int nSPos);
//道宽改变后,避免井壁取心等组件变形,需要重新刷新
void resetPosition();
@ -95,7 +95,7 @@ protected:
//virtual void mouseMoveEvent(QMouseEvent *event);
public:
// 井UUID
// 井UUID
QString m_strUuid;
QString m_strSlfName;
QString m_strWellName;
@ -107,8 +107,8 @@ public:
//
float m_iX1, m_iX2;
float m_iY1, m_iY2;
qint8 m_nLeftCross = 0; // 左跨道个数
qint8 m_nRightCross = 0; // 右跨道个数
qint8 m_nLeftCross = 0; // 左跨道个数
qint8 m_nRightCross = 0; // 右跨道个数
//填充曲线
QCPGraph *graph_Fill=nullptr;
@ -149,38 +149,38 @@ public:
bool singleDragMove = false;
float singleOldPosition = 0;
QCPColorMap *m_colorMap = NULL;
QCPColorScale * m_colorScale = NULL;
QVector< QVector <double>> m_vecWaveData;
int m_nRow = 0;
int m_nCol = 0;
int m_nDrawType = 2; // 绘图类型
// 0.全周 1.正半周 2.负半周
int m_nMode = 1;
float m_fScaleV = 0.0f;
float m_fmin;
float m_fmax;
int m_nColorNum = 256;
int m_nSchemeIndex = 1;
bool m_bDrawDepth = false; // 绘制波深度
bool m_bDrawBase = false; // 绘制波基线
bool m_bOddEven = false; // 奇偶配色
float m_Base = 0.0f; // 波列基值
float m_MaxRange = 1023.0f;
int m_nWaveJg = 1;
int m_nWaveHei = 1;
QCPColorMap *m_colorMap = NULL;
QCPColorScale * m_colorScale = NULL;
QVector< QVector <double>> m_vecWaveData;
int m_nRow = 0;
int m_nCol = 0;
int m_nDrawType = 2; // 绘图类型
// 0.全周 1.正半周 2.负半周
int m_nMode = 1;
float m_fScaleV = 0.0f;
float m_fmin;
float m_fmax;
int m_nColorNum = 256;
int m_nSchemeIndex = 1;
bool m_bDrawDepth = false; // 绘制波深度
bool m_bDrawBase = false; // 绘制波基线
bool m_bOddEven = false; // 奇偶配色
float m_Base = 0.0f; // 波列基值
float m_MaxRange = 1023.0f;
int m_nWaveJg = 1;
int m_nWaveHei = 1;
// 深度 第三个轴
QCPAxis *m_yAxis2 = nullptr;
QCPAxis *m_yAxis3 = nullptr; // 保存指针
public:
bool m_bEditor = false; // 编辑状态
QCPItemStraightLine* m_pAddLine1 = NULL;
QCPItemStraightLine* m_pAddLine2 = NULL;
bool m_bEditor = false; // 编辑状态
QCPItemStraightLine* m_pAddLine1 = NULL;
QCPItemStraightLine* m_pAddLine2 = NULL;
QString m_strGroupUid = "";
// 解释结论终止深度
float m_fResultEndDepth = 0.0f;
QString m_strGroupUid = "";
// 解释结论终止深度
float m_fResultEndDepth = 0.0f;
QVector<double> m_x;
QVector<double> m_y;
int m_iCurNum=0;
@ -191,8 +191,8 @@ public:
bool m_bFirstTimeConnect=true; //初次绑定编辑曲线信号槽。
bool m_bPriviewRightList=false; //当前是否正在预览曲线。
// 组
QMap<QString, QObject*> m_mapDragGroup;
// 组
QMap<QString, QObject*> m_mapDragGroup;
QMap<QString, QObject*> m_mapDraggable_Rect; //文字结论
QMap<QString, QObject*> m_mapDraggable_Layer; //地质分层
@ -307,7 +307,7 @@ public:
QMap<QString,QString> zoneOrder_Tubing;
QString cclimgpath_Tubing="";
QList<Slf_JIEGUPOS> m_pResultList_Tubing;
QString m_strAddTubing="";
QString m_strAddTubing="";
QCPItemRect *mRect_Tubing=nullptr; //套管左侧图像
QCPItemRect *mRect2_Tubing=nullptr; //套管右侧图像
QCPItemPixmap *mPixmap_Tubing=nullptr; //管柱图像
@ -347,7 +347,7 @@ public:
void addLayerToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80));
//解释结论
TransparentGroupResult* addResultGroup(double left_Low, double right_Hight, QString &strUuid, QString strText = "");
TransparentGroupResult* addResultGroup(double left_Low, double right_Hight, QString &strUuid, QString strText = "");
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText="");
//录井剖面
@ -380,7 +380,7 @@ public:
void addRightListToPlot( QList<double> new_DepthList, QList<double> new_ValueList);
public slots:
void slotSelectionRectAccepted(const QRect &rect, QMouseEvent *event);
void slotSelectionRectAccepted(const QRect &rect, QMouseEvent *event);
void s_LineClicked(int index);
void onResetZoom();
@ -449,7 +449,7 @@ public slots:
void ClearSelectItems(); //取消选中
//右键--编辑固井
void onEditGujing();
void onEditGujing();
void addItems_Gujing(); //从剪切板文本数据粘贴
void DeleteItems_Gujing(); //全部清空
void RefreshItems_Gujing(); //刷新数据
@ -501,7 +501,7 @@ public slots:
void addItems_Jiegutext(); //从剪切板文本数据粘贴
void DeleteItems_Jiegutext(); //全部清空
void RefreshItems_Jiegutext(); //刷新数据
//右键--沉积相
void addItem_Fac(); //添加沉积相
void RefreshItems_Fac(bool bAdd=true); //刷新数据
@ -512,23 +512,23 @@ public slots:
void DeleteItems_Tubing();//全部清空
void RefreshItems_Tubing(); //刷新数据
//右键--解释结论
void onOpenEditResult();
void onCloseEditResult();
void DeleteItemGroup();
void updateGroupZone(); //更新层号
//右键--解释结论
void onOpenEditResult();
void onCloseEditResult();
void DeleteItemGroup();
void updateGroupZone(); //更新层号
bool SaveToSLF_Result();
bool SaveToSLF_Result();
TransparentGroupResult* getCurGroupResult(double x_val);
// 筛选出选中的Group 并且排序
QMap<double, TransparentGroupResult*> getSelectGroupResult();
void segmentationInnerLayer(); // 分割为层内层
void segmentationIndependentLayer(); // 分割为独立层
void splitIndependentLayer(); // 拆分复合层成独立层
void megResultLayer();// 合并
TransparentGroupResult* getCurGroupResult(double x_val);
// 筛选出选中的Group 并且排序
QMap<double, TransparentGroupResult*> getSelectGroupResult();
void segmentationInnerLayer(); // 分割为层内层
void segmentationIndependentLayer(); // 分割为独立层
void splitIndependentLayer(); // 拆分复合层成独立层
void megResultLayer();// 合并
bool getIsEditor();
bool getIsEditor();
//
void addItems_Core();
@ -547,13 +547,16 @@ public slots:
//Plot重新加载数据
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
void s_changeDrawProperty(QVariantList vlist);
void s_changeDrawProperty(QVariantList vlist);
// 深度
void s_changeDepthProperty(QVariantList vlist);
// 频率统计图
void s_changePlObjectProperty(QVariantMap variantMap);
// 玫瑰图
void s_changeRoseProperty(QVariantMap variantMap);
// 岩心分析
void s_changeCorePhysicsProperty(QVariantMap variantMap);
@ -589,10 +592,10 @@ public:
bool mKedou = false;
//
bool mMousePress = false;
double m_dPressX = 0;
double m_dPressX = 0;
QPoint mLastPos;
QCPSizeHandleManager *mSizeHandleManager;
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
@ -635,21 +638,27 @@ public:
QString m_qsWellName,m_qsTable;
QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线
float m_SDep,m_EDep,m_Rlev;
int m_nSamples = 0;
// csCurveGrad曲线名 LeftVal3最小值 RightVal3最大值 nArc扇形 nR圆半径 crArc圆颜色 nArcLineWidth圆线宽度 bFill是否填充
void fgrqDraw(QString csCurveGrad, double LeftVal3, double RightVal3, int nArc, double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill,
int m_nSamples = 0;
// 频率统计图 csCurveGrad曲线名 LeftVal3最小值 RightVal3最大值 nArc扇形 nR圆半径 crArc圆颜色 nArcLineWidth圆线宽度 bFill是否填充
void drawFgrq(bool bTableData, QString csCurveDDIR, QString csCurveDANG, QString csCurveGrad, double LeftVal3, double RightVal3, int nArc, double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill,
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram,
int baselineWidth, QColor baselineColor, int nstep, double minInclination, double maxInclination);
// 绘制倾角
void drawDipAngle(double centerX, double centerY, float ifdir[360], int iIndex, float dirmax,
void drawDipAngle(double centerX, double centerY, float ifdir[360], float dirmax,
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawHistogram,
int baselineWidth, QColor baselineColor, double minInclination, double maxInclination);
void Refurbish();
bool Refurbish();
int m_PointNum;
char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL;
void ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve);
bool ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve);
bool ReadData(QString strSlfName, QString strLineName);
void drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID);
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
private:
};