玫瑰图属性
This commit is contained in:
parent
2c403c1cc7
commit
a46d3e9ba6
|
|
@ -182,8 +182,10 @@ signals:
|
||||||
//改变深度属性
|
//改变深度属性
|
||||||
void sig_changeDepthProperty(QVariantList vlist);
|
void sig_changeDepthProperty(QVariantList vlist);
|
||||||
|
|
||||||
//改变频率统计图属性
|
// 改变频率统计图属性
|
||||||
void sig_changePlObjectProperty(QVariantMap variantMap);
|
void sig_changePlObjectProperty(QVariantMap variantMap);
|
||||||
|
// 改变玫瑰图属性
|
||||||
|
void sig_changeRoseProperty(QVariantMap variantMap);
|
||||||
|
|
||||||
//改变岩心分析
|
//改变岩心分析
|
||||||
void sig_changeCorePhysicsProperty(QVariantMap variantMap);
|
void sig_changeCorePhysicsProperty(QVariantMap variantMap);
|
||||||
|
|
|
||||||
|
|
@ -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();
|
int temp = variant.toInt();
|
||||||
this->m_formInfo->m_headHeight = temp;
|
this->m_formInfo->m_headHeight = temp;
|
||||||
|
|
@ -292,7 +292,7 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV
|
||||||
m_formInfo->m_curveNameFont = newFont;
|
m_formInfo->m_curveNameFont = newFont;
|
||||||
m_formInfo->update();
|
m_formInfo->update();
|
||||||
}
|
}
|
||||||
else if("例区高度" == m_propertyData[qtProperty])
|
else if("例区高度(cm)" == m_propertyData[qtProperty])
|
||||||
{
|
{
|
||||||
int temp = variant.toInt();
|
int temp = variant.toInt();
|
||||||
this->m_formInfo->m_headHeight = temp;
|
this->m_formInfo->m_headHeight = temp;
|
||||||
|
|
@ -3454,7 +3454,7 @@ void PropertyWidget::initImageProperty(FormInfo *formInfo)
|
||||||
{
|
{
|
||||||
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
||||||
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, 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_bVerticaDrawing, QVariant::Bool);
|
||||||
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
|
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
|
||||||
_CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font);
|
_CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font);
|
||||||
|
|
@ -3488,7 +3488,7 @@ void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, d
|
||||||
|
|
||||||
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
||||||
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, 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_bVerticaDrawing, QVariant::Bool);
|
||||||
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
|
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
|
||||||
_CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font);
|
_CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font);
|
||||||
|
|
@ -3547,7 +3547,7 @@ void PropertyWidget::initGeoLithProperty(FormInfo *formInfo)
|
||||||
void PropertyWidget::initCorePhysicsProperty(FormInfo *formInfo, bool isItem)
|
void PropertyWidget::initCorePhysicsProperty(FormInfo *formInfo, bool isItem)
|
||||||
{
|
{
|
||||||
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
_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_nRotationAngle, QVariant::Int);
|
||||||
|
|
||||||
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
|
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
|
||||||
|
|
@ -3633,9 +3633,9 @@ void PropertyWidget::initCorePhysicsItemProperty(TransparentDraggableCorePhysics
|
||||||
|
|
||||||
this->initCorePhysicsProperty(formInfo, true);
|
this->initCorePhysicsProperty(formInfo, true);
|
||||||
|
|
||||||
_CreateVariantPropertyItem("当前项", "序号", tdImage->getCpOrder(), QVariant::Int);
|
_CreateVariantPropertyItem("当前项", "序号", qAbs(tdImage->getCpOrder()), QVariant::Int);
|
||||||
_CreateVariantPropertyItem("当前项", "深度", tdImage->getCpDepth(), QVariant::Double);
|
_CreateVariantPropertyItem("当前项", "深度", qAbs(tdImage->getCpDepth()), QVariant::Double);
|
||||||
_CreateVariantPropertyItem("当前项", "校正深度", tdImage->getCpCorrDepth(), QVariant::Double);
|
_CreateVariantPropertyItem("当前项", "校正深度", qAbs(tdImage->getCpCorrDepth()), QVariant::Double);
|
||||||
_CreateVariantPropertyItem("当前项", "数值", tdImage->getCpCoreValue(), 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_azimuthCurve, QVariant::String);
|
||||||
_CreateVariantPropertyItem("数据", "倾角曲线", formInfo->m_pl_inclinationCurve, 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_strAliasNameFont, QVariant::Font);
|
||||||
_CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font);
|
_CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font);
|
||||||
|
|
@ -4243,6 +4243,7 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
|
||||||
else if ("数据类型" == strProperty)
|
else if ("数据类型" == strProperty)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_dataType = varVal.toInt();
|
this->m_formInfo->m_pl_dataType = varVal.toInt();
|
||||||
|
flag = true;
|
||||||
}
|
}
|
||||||
else if ("显示单位" == strProperty)
|
else if ("显示单位" == strProperty)
|
||||||
{
|
{
|
||||||
|
|
@ -4252,10 +4253,12 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
|
||||||
else if ("方位曲线" == strProperty)
|
else if ("方位曲线" == strProperty)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_azimuthCurve = varVal.toString();
|
this->m_formInfo->m_pl_azimuthCurve = varVal.toString();
|
||||||
|
flag = true;
|
||||||
}
|
}
|
||||||
else if ("倾角曲线" == strProperty)
|
else if ("倾角曲线" == strProperty)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_inclinationCurve = varVal.toString();
|
this->m_formInfo->m_pl_inclinationCurve = varVal.toString();
|
||||||
|
flag = true;
|
||||||
}
|
}
|
||||||
else if ("例区高度(cm)" == strProperty)
|
else if ("例区高度(cm)" == strProperty)
|
||||||
{
|
{
|
||||||
|
|
@ -4446,6 +4449,13 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
|
||||||
if(flag)
|
if(flag)
|
||||||
{
|
{
|
||||||
QVariantMap variantMap;
|
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_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
|
||||||
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
|
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
|
||||||
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
|
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
|
||||||
|
|
@ -4550,6 +4560,7 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
|
||||||
else if ("数据类型" == strProperty)
|
else if ("数据类型" == strProperty)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_dataType = varVal.toInt();
|
this->m_formInfo->m_pl_dataType = varVal.toInt();
|
||||||
|
flag = true;
|
||||||
}
|
}
|
||||||
else if ("显示单位" == strProperty)
|
else if ("显示单位" == strProperty)
|
||||||
{
|
{
|
||||||
|
|
@ -4559,10 +4570,12 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
|
||||||
else if ("方位曲线" == strProperty)
|
else if ("方位曲线" == strProperty)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_azimuthCurve = varVal.toString();
|
this->m_formInfo->m_pl_azimuthCurve = varVal.toString();
|
||||||
|
flag = true;
|
||||||
}
|
}
|
||||||
else if ("倾角曲线" == strProperty)
|
else if ("倾角曲线" == strProperty)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_inclinationCurve = varVal.toString();
|
this->m_formInfo->m_pl_inclinationCurve = varVal.toString();
|
||||||
|
flag = true;
|
||||||
}
|
}
|
||||||
// 通常
|
// 通常
|
||||||
else if ("例区高度(cm)" == strProperty)
|
else if ("例区高度(cm)" == strProperty)
|
||||||
|
|
@ -4684,11 +4697,89 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
|
||||||
{
|
{
|
||||||
this->m_formInfo->m_pl_custom2 = varVal.toBool();
|
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)
|
if(flag)
|
||||||
{
|
{
|
||||||
QVariantMap variantMap;
|
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_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
|
||||||
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
|
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
|
||||||
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
|
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_pl_maxInclination"] = this->m_formInfo->m_pl_maxInclination;
|
||||||
|
|
||||||
variantMap["m_strUuid"] = this->m_formInfo->m_strUuid;
|
variantMap["m_strUuid"] = this->m_formInfo->m_strUuid;
|
||||||
variantMap["m_strTrackName"] = this->m_formInfo->m_strTrackName;
|
emit CallManage::getInstance()->sig_changeRoseProperty(variantMap);
|
||||||
emit CallManage::getInstance()->sig_changePlObjectProperty(variantMap);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,28 +311,34 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
|
||||||
}
|
}
|
||||||
else if("plObject" == strType) // 频率统计图
|
else if("plObject" == strType) // 频率统计图
|
||||||
{
|
{
|
||||||
initFgrq(curv);
|
|
||||||
|
|
||||||
// 读json后 重新设置样式
|
// 读json后 重新设置样式
|
||||||
// 设置左侧显示属性 设置界面样式
|
// 设置左侧显示属性 设置界面样式
|
||||||
if(pInfo->m_strUnit.isEmpty()){
|
if(pInfo->m_strUnit.isEmpty()){
|
||||||
pInfo->m_strUnit = "(°)";
|
pInfo->m_strUnit = "(°)";
|
||||||
pInfo->m_strUnitFont = QFont("微软雅黑", 8);
|
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;
|
QString csCurveGrad = pInfo->m_pl_controlCurveName;
|
||||||
double LeftVal3 = pInfo->m_pl_controlMinValue;
|
double LeftVal3 = pInfo->m_pl_controlMinValue;
|
||||||
double RightVal3 = pInfo->m_pl_controlMaxValue;
|
double RightVal3 = pInfo->m_pl_controlMaxValue;
|
||||||
|
// 方位频率
|
||||||
int nArc = pInfo->m_pl_sectorCount;
|
int nArc = pInfo->m_pl_sectorCount;
|
||||||
double nR = pInfo->m_pl_circleRadius;
|
double nR = pInfo->m_pl_circleRadius;
|
||||||
QColor crArc = pInfo->m_pl_circleColor;
|
QColor crArc = pInfo->m_pl_circleColor;
|
||||||
int nArcLineWidth = pInfo->m_pl_circleLineWidth;
|
int nArcLineWidth = pInfo->m_pl_circleLineWidth;
|
||||||
bool bFill = pInfo->m_pl_isFillEnabled;
|
bool bFill = pInfo->m_pl_isFillEnabled;
|
||||||
QColor crFill = pInfo->m_pl_fillColor;
|
QColor crFill = pInfo->m_pl_fillColor;
|
||||||
// 线数
|
// 倾角频率
|
||||||
int lineNumber = pInfo->m_pl_lineNumber;
|
int lineNumber = pInfo->m_pl_lineNumber; // 线数
|
||||||
// 统计线高度
|
// 统计线高度
|
||||||
double lineHeight = pInfo->m_pl_lineHeight;
|
double lineHeight = pInfo->m_pl_lineHeight;
|
||||||
// 线粗细
|
// 线粗细
|
||||||
|
|
@ -350,7 +356,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
|
||||||
int statInterval = pInfo->m_pl_statInterval; // 统计间隔
|
int statInterval = pInfo->m_pl_statInterval; // 统计间隔
|
||||||
double minInclination = pInfo->m_pl_minInclination; // 最小倾角
|
double minInclination = pInfo->m_pl_minInclination; // 最小倾角
|
||||||
double maxInclination = pInfo->m_pl_maxInclination; // 最大倾角
|
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,
|
lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram,
|
||||||
baselineWidth, baselineColor, statInterval, minInclination, maxInclination);
|
baselineWidth, baselineColor, statInterval, minInclination, maxInclination);
|
||||||
}
|
}
|
||||||
|
|
@ -358,7 +364,20 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
|
||||||
{
|
{
|
||||||
pInfo->m_pl_azimuthCurve = "STRDIR"; // 方位曲线
|
pInfo->m_pl_azimuthCurve = "STRDIR"; // 方位曲线
|
||||||
pInfo->m_pl_inclinationCurve = "CALM"; // 倾角曲线
|
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)
|
else if("dcaObject" == strType)
|
||||||
|
|
@ -502,20 +521,16 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
|
||||||
//套管组件
|
//套管组件
|
||||||
DisplayTubing_One(lineObjInfo);
|
DisplayTubing_One(lineObjInfo);
|
||||||
}
|
}
|
||||||
else if (strType == "depthObject")
|
|
||||||
{
|
|
||||||
// 深度
|
|
||||||
DisplayDepth_One(lineObjInfo);
|
|
||||||
}
|
|
||||||
else if (strType == "SantuyibiaoObject")
|
else if (strType == "SantuyibiaoObject")
|
||||||
{
|
{
|
||||||
// 斜井三图一表属性
|
// 斜井三图一表属性
|
||||||
DisplayTvd_One(lineObjInfo);
|
DisplayTvd_One(lineObjInfo);
|
||||||
}
|
}
|
||||||
else if (strType == "plObject")
|
// 深度 频率统计图 玫瑰图
|
||||||
|
else if (strType == "depthObject" || strType == "plObject" || strType == "roseObject")
|
||||||
{
|
{
|
||||||
// 频率统计图
|
// 频率统计图
|
||||||
displayPlObject(lineObjInfo);
|
DisplayType_One(lineObjInfo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -527,37 +542,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)
|
void FormDraw::displayCorePhysics(QJsonObject jsonObject)
|
||||||
{
|
{
|
||||||
|
|
@ -5983,16 +5967,32 @@ void FormDraw::initFgrq(QMyCustomPlot *widget)
|
||||||
widget->yAxis = xAxis;
|
widget->yAxis = xAxis;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_RightVal3)
|
|
||||||
|
void FormDraw::initRose(QMyCustomPlot *widget)
|
||||||
{
|
{
|
||||||
// widget->clearGraphs();
|
widget->m_iX1 = 0;
|
||||||
// widget->clearItems();
|
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)
|
// // if(m_Value == NULL)
|
||||||
// {
|
// {
|
||||||
// m_bTableData = false; // 表格 曲线
|
// m_bTableData = false; // 表格 曲线
|
||||||
// m_csCurveDDIR = "DDIR"; // 方位 曲线名
|
// m_csCurveDDIR = "STRDIR"; // 方位 曲线名
|
||||||
// m_csCurveDANG = "DANG";//倾角
|
// m_csCurveDANG = "CALM";//倾角
|
||||||
// m_csCurveGrad = "GRAD";
|
// m_csCurveGrad = "GRAD";
|
||||||
|
|
||||||
// m_qsTable="FRAC_HOLE.TABLE";
|
// m_qsTable="FRAC_HOLE.TABLE";
|
||||||
|
|
@ -6004,7 +6004,7 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
|
||||||
// Refurbish();
|
// Refurbish();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// double nR = 50;
|
// double nR = 40;
|
||||||
|
|
||||||
// QPen wPen(Qt::black, 2);
|
// QPen wPen(Qt::black, 2);
|
||||||
// double centerX = widget->m_iX2/2;
|
// double centerX = widget->m_iX2/2;
|
||||||
|
|
@ -6013,6 +6013,8 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
|
||||||
// float x,y,x1,y1,x2,y2;
|
// float x,y,x1,y1,x2,y2;
|
||||||
// float ifdir[360];
|
// float ifdir[360];
|
||||||
// int m_nArc = 36;
|
// int m_nArc = 36;
|
||||||
|
// float m_LeftVal3 = 0;
|
||||||
|
// float m_RightVal3 = 100.0;
|
||||||
// m_LeftVal = 0.0f;
|
// m_LeftVal = 0.0f;
|
||||||
// m_RightVal = 90.0f;
|
// m_RightVal = 90.0f;
|
||||||
// float mind=min(m_RightVal , m_LeftVal);
|
// float mind=min(m_RightVal , m_LeftVal);
|
||||||
|
|
@ -6021,7 +6023,7 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
|
||||||
|
|
||||||
// float deps;
|
// float deps;
|
||||||
|
|
||||||
// float ftmpSdep = m_SDep;
|
// float ftmpSdep = 2890;//m_SDep;
|
||||||
// float ftmpEdep = m_EDep;
|
// float ftmpEdep = m_EDep;
|
||||||
// if (m_bTableData)
|
// if (m_bTableData)
|
||||||
// {
|
// {
|
||||||
|
|
@ -6041,6 +6043,15 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
|
||||||
// int tmp = ftmpSdep / nstep;
|
// int tmp = ftmpSdep / nstep;
|
||||||
// float flDep = tmp * 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;
|
// m_Curve.DepLevel = 0.5;
|
||||||
// while ( 1)
|
// while ( 1)
|
||||||
// {
|
// {
|
||||||
|
|
@ -6049,6 +6060,8 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
|
||||||
// double tempf = flDep+(float)(nstep)/2.;
|
// double tempf = flDep+(float)(nstep)/2.;
|
||||||
// double centerY = tempf * -1.0;
|
// double centerY = tempf * -1.0;
|
||||||
|
|
||||||
|
// wPen.setWidth(2);
|
||||||
|
// wPen.setColor(Qt::black);
|
||||||
// QCPItemEllipse* pEse = new QCPItemEllipse(widget);
|
// QCPItemEllipse* pEse = new QCPItemEllipse(widget);
|
||||||
// pEse->setPen(wPen);
|
// pEse->setPen(wPen);
|
||||||
// pEse->m_bCustom = true;
|
// pEse->m_bCustom = true;
|
||||||
|
|
@ -6068,517 +6081,248 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right
|
||||||
// pLine1->end->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.;
|
// for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
|
||||||
// x1 = 360./m_nArc;
|
// x1 = 360./m_nArc;
|
||||||
|
|
||||||
// int i = 0;
|
// int i = 0;
|
||||||
// if (m_bTableData)
|
// while ( 1 )
|
||||||
// {
|
// {
|
||||||
// int m_nLine = 9;
|
// deps = flDep + i * m_Curve.DepLevel;
|
||||||
// y1 = (maxd-mind)/m_nLine;//线数
|
|
||||||
// for (i=0; i<nPointNum; i++)
|
// 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);
|
// i++;
|
||||||
// if ( frac.DEP < 0 ) continue;
|
// 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] ++;
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// while ( 1 )
|
|
||||||
// {
|
|
||||||
// deps = flDep + i * m_Curve.DepLevel;
|
|
||||||
|
|
||||||
// tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5;
|
// if (m_Value3 !=NULL )// for 控制曲线
|
||||||
// if (deps >= ftmpEdep||
|
// {
|
||||||
// deps > m_Curve.EndDepth||
|
// float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
|
||||||
// deps >=( flDep + nstep))
|
// if(tempf3<0)
|
||||||
// break;
|
|
||||||
// if(tempf<0)
|
|
||||||
// {
|
// {
|
||||||
// i++;
|
// i++;
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
|
// double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
|
||||||
// if (m_Value3 !=NULL )// for 控制曲线
|
// if(grad<m_LeftVal3||grad>m_RightVal3){i++;continue;}
|
||||||
// {
|
// }
|
||||||
// float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5;
|
// if (m_Value2 !=NULL ) // 倾角控制
|
||||||
// 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] ++;
|
|
||||||
|
|
||||||
// tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5;
|
// tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5;
|
||||||
// if(tempf<0 )
|
// flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]);
|
||||||
// {
|
|
||||||
// i++;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //按倾角范围统计
|
// //按倾角范围统计
|
||||||
// if(flVal> maxd || flVal < mind)
|
// if(flVal > maxd || flVal < mind)
|
||||||
// {
|
// {
|
||||||
// i++;
|
// i++;
|
||||||
// continue;
|
// 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;
|
||||||
// dirmax=0; dipmax=0;
|
// int iIndex = -1;
|
||||||
// for(i=0;i<=m_nArc;i++)
|
// for(i=0;i<=m_nArc;i++)
|
||||||
// if (dirmax<ifdir[i]) dirmax=ifdir[i];
|
// {
|
||||||
|
// if (dirmax<ifdir[i])
|
||||||
// if (dirmax == 0 )
|
// {
|
||||||
// dirmax=1;
|
// iIndex = i;
|
||||||
// for(i=0;i<=m_nArc;i++)
|
// dirmax=ifdir[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线粗时扇叶超界
|
// }
|
||||||
// ifdir[m_nArc+1]=ifdir[1];
|
// ifdir[m_nArc+1]=ifdir[1];
|
||||||
|
|
||||||
// //方位频率
|
// //没有统计点,不绘制
|
||||||
// float x0,y0;
|
// if (dirmax == 0 ) dirmax=1;
|
||||||
|
|
||||||
// x = centerY;
|
// flVal = pi *2./ m_nArc ;
|
||||||
// y = centerX;
|
|
||||||
// for(int i=0;i<=m_nArc;i++)
|
// QPolygonF myPolygon;
|
||||||
|
// float oldx, oldy;
|
||||||
|
// for (i=0 ;i<=m_nArc; i++)
|
||||||
// {
|
// {
|
||||||
// if(ifdir[i] <= 0.0f)
|
// dr=i*flVal;
|
||||||
// continue;
|
// 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);
|
// QCPItemPolygon* pol = new QCPItemPolygon(widget);
|
||||||
// pol->topLeft->setCoords(x, y);
|
// pol->topLeft->setCoords(x, y);
|
||||||
// pol->bottomRight->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->setPoints(myPolygon);
|
||||||
|
// pol->setBrushColor(QColor(255,170,0));
|
||||||
|
// }
|
||||||
|
|
||||||
// // QCPItemRect* prt = new QCPItemRect(widget);
|
// myPolygon.clear();
|
||||||
// // prt->topLeft->setCoords(x, y);
|
// tempf = m_nArc/2.;
|
||||||
// // prt->bottomRight->setCoords(x, y);
|
// 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;
|
// 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)
|
void FormDraw::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen)
|
||||||
{
|
{
|
||||||
QPolygonF myPolygon;
|
QPolygonF myPolygon;
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,11 @@ public:
|
||||||
void DisplayLine_One(QJsonObject lineObjInfo);
|
void DisplayLine_One(QJsonObject lineObjInfo);
|
||||||
//波列
|
//波列
|
||||||
void DisplayType_One(QJsonObject objInfo);
|
void DisplayType_One(QJsonObject objInfo);
|
||||||
// 深度
|
|
||||||
void DisplayDepth_One(QJsonObject lineObjInfo);
|
|
||||||
// 岩心分析
|
// 岩心分析
|
||||||
void displayCorePhysics(QJsonObject lineObjInfo);
|
void displayCorePhysics(QJsonObject lineObjInfo);
|
||||||
// 岩心照片
|
// 岩心照片
|
||||||
void displayImageData(QJsonObject lineObjInfo);
|
void displayImageData(QJsonObject lineObjInfo);
|
||||||
// 频率统计图
|
|
||||||
void displayPlObject(QJsonObject lineObjInfo);
|
|
||||||
|
|
||||||
//表格:固井结论等
|
//表格:固井结论等
|
||||||
void DisplayTable_One(QJsonObject lineObjInfo);
|
void DisplayTable_One(QJsonObject lineObjInfo);
|
||||||
|
|
@ -235,12 +232,11 @@ public:
|
||||||
|
|
||||||
//深度
|
//深度
|
||||||
void initDepth(QMyCustomPlot *widget);
|
void initDepth(QMyCustomPlot *widget);
|
||||||
|
|
||||||
//频率统计图
|
//频率统计图
|
||||||
void initFgrq(QMyCustomPlot *widget);
|
void initFgrq(QMyCustomPlot *widget);
|
||||||
void fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_RightVal3);
|
|
||||||
//玫瑰图
|
//玫瑰图
|
||||||
void initRose(QMyCustomPlot *widget);
|
void initRose(QMyCustomPlot *widget);
|
||||||
|
|
||||||
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
|
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
|
||||||
|
|
||||||
// DCA检测
|
// DCA检测
|
||||||
|
|
|
||||||
|
|
@ -165,45 +165,6 @@ void FormInfo::initProperty(QJsonObject obj)
|
||||||
}
|
}
|
||||||
else if ("plObject" == strType)
|
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_sectorCount = obj["m_pl_sectorCount"].toInt(); // 扇形
|
||||||
this->m_pl_circleRadius = obj["m_pl_circleRadius"].toDouble(); // 圆半径
|
this->m_pl_circleRadius = obj["m_pl_circleRadius"].toDouble(); // 圆半径
|
||||||
this->m_pl_circleColor = QColor(obj["m_pl_circleColor"].toString()); // 圆线颜色
|
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_baselineWidth = obj["m_pl_baselineWidth"].toInt(); // 宽度
|
||||||
this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色
|
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_statInterval = obj["m_pl_statInterval"].toInt(); // 统计间隔
|
||||||
this->m_pl_minInclination = obj["m_pl_minInclination"].toDouble(); // 最小倾角
|
this->m_pl_minInclination = obj["m_pl_minInclination"].toDouble(); // 最小倾角
|
||||||
this->m_pl_maxInclination = obj["m_pl_maxInclination"].toDouble(); // 最大倾角
|
this->m_pl_maxInclination = obj["m_pl_maxInclination"].toDouble(); // 最大倾角
|
||||||
|
|
||||||
|
// 分类
|
||||||
this->m_pl_highGap = obj["m_pl_highGap"].toBool(); // 高导缝
|
this->m_pl_highGap = obj["m_pl_highGap"].toBool(); // 高导缝
|
||||||
this->m_pl_highReservoir = obj["m_pl_highReservoir"].toBool(); // 高阻缝
|
this->m_pl_highReservoir = obj["m_pl_highReservoir"].toBool(); // 高阻缝
|
||||||
this->m_pl_reticularFracture = obj["m_pl_reticularFracture"].toBool(); // 网状缝
|
this->m_pl_reticularFracture = obj["m_pl_reticularFracture"].toBool(); // 网状缝
|
||||||
|
|
@ -864,7 +877,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
//蝌蚪图,不绘制左右范围
|
//蝌蚪图,不绘制左右范围
|
||||||
strShowTxt = "蝌蚪图";
|
strShowTxt = "蝌蚪图";
|
||||||
}
|
}
|
||||||
if(this->m_strType == "plObject")
|
if(this->m_strType == "plObject" || this->m_strType == "roseObject")
|
||||||
{
|
{
|
||||||
strShowTxt = " ";
|
strShowTxt = " ";
|
||||||
}
|
}
|
||||||
|
|
@ -1024,7 +1037,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 频率统计图
|
// 频率统计图
|
||||||
if(this->m_strType == "plObject")
|
if(this->m_strType == "roseObject")
|
||||||
{
|
{
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
painter.setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
|
|
@ -1068,6 +1081,52 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
painter.setFont(oldFont);
|
painter.setFont(oldFont);
|
||||||
currentY += UNIT_HEIGHT + SPACING;
|
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. 绘制指南针(最下面)==========
|
// ========== 3. 绘制指南针(最下面)==========
|
||||||
oldFont = painter.font();
|
oldFont = painter.font();
|
||||||
painter.setFont(this->m_pl_fontScale);
|
painter.setFont(this->m_pl_fontScale);
|
||||||
|
|
|
||||||
|
|
@ -298,24 +298,23 @@ public:
|
||||||
|
|
||||||
// 玫瑰图
|
// 玫瑰图
|
||||||
// 表数据字段
|
// 表数据字段
|
||||||
QString m_rose_depth_field; // 深度字段
|
QString m_rose_depth_field = "DEP"; // 深度字段
|
||||||
QString m_rose_azimuth_field; // 方位字段
|
QString m_rose_azimuth_field = "DIR"; // 方位字段
|
||||||
QString m_rose_dip_field; // 倾角字段
|
QString m_rose_dip_field = "DIPorS"; // 倾角字段
|
||||||
QString m_rose_attribute_field; // 属性字段
|
QString m_rose_attribute_field = "ID"; // 属性字段
|
||||||
|
// 玫瑰图
|
||||||
// 玫瑰图核心配置
|
int m_rose_sector_enabled = 36; // 扇形(启用开关)
|
||||||
int m_rose_sector_enabled; // 扇形(启用开关)
|
int m_rose_circle_radius_cm = 1; // 圆半径(cm)
|
||||||
int m_rose_circle_radius_cm; // 圆半径(cm)
|
int m_rose_radiation_circle_enabled = 9; // 辐射圈(启用开关)
|
||||||
int m_rose_radiation_circle_enabled; // 辐射圈(启用开关)
|
int m_rose_azimuth_print_interval = 3; // 方位打印间隔
|
||||||
int m_rose_azimuth_print_interval; // 方位打印间隔
|
QColor m_rose_circle_line_color = Qt::black; // 圆线颜色
|
||||||
QColor m_rose_circle_line_color; // 圆线颜色
|
int m_rose_circle_line_width = 2; // 圆线宽度
|
||||||
int m_rose_circle_line_width; // 圆线宽度
|
QColor m_rose_stress_line_color = Qt::black; // 应力线颜色
|
||||||
QColor m_rose_stress_line_color; // 应力线颜色
|
QColor m_rose_collapse_line_color = Qt::black; // 垮塌线颜色
|
||||||
QColor m_rose_collapse_line_color; // 垮塌线颜色
|
bool m_rose_draw_radiation_line = true; // 绘制辐射线?
|
||||||
bool m_rose_draw_radiation_line; // 绘制辐射线?
|
bool m_rose_draw_wellbore_collapse = true; // 绘制井眼垮塌
|
||||||
bool m_rose_draw_wellbore_collapse; // 绘制井眼垮塌
|
bool m_rose_fill_enabled = true; // 是否填充
|
||||||
bool m_rose_fill_enabled; // 是否填充
|
bool m_rose_draw_annotation = true; // 是否绘制标注?
|
||||||
bool m_rose_draw_annotation; // 是否绘制标注?
|
|
||||||
|
|
||||||
int cpLineWidth() const;
|
int cpLineWidth() const;
|
||||||
void setCpLineWidth(int cpLineWidth);
|
void setCpLineWidth(int cpLineWidth);
|
||||||
|
|
|
||||||
|
|
@ -142,9 +142,13 @@ 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_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList)));
|
||||||
|
|
||||||
// 深度属性修改
|
// 频率统计图属性修改
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_changePlObjectProperty(QVariantMap)), this, SLOT(s_changePlObjectProperty(QVariantMap)));
|
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)));
|
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
|
||||||
// 岩心分析
|
// 岩心分析
|
||||||
connect(CallManage::getInstance(), SIGNAL(sig_changeCorePhysicsProperty(QVariantMap)), this, SLOT(s_changeCorePhysicsProperty(QVariantMap)));
|
connect(CallManage::getInstance(), SIGNAL(sig_changeCorePhysicsProperty(QVariantMap)), this, SLOT(s_changeCorePhysicsProperty(QVariantMap)));
|
||||||
|
|
@ -10040,6 +10044,16 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
|
||||||
{
|
{
|
||||||
return;
|
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();
|
QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString();
|
||||||
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
|
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
|
||||||
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
|
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
|
||||||
|
|
@ -10071,13 +10085,14 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
|
||||||
double maxInclination = variantMap["m_pl_maxInclination"].toDouble();
|
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,
|
lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram, baselineWidth,
|
||||||
baselineColor, statInterval, minInclination, maxInclination);
|
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,
|
double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill,
|
||||||
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram,
|
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram,
|
||||||
int baselineWidth, QColor baselineColor, int nstep, double LeftVal, double RightVal)
|
int baselineWidth, QColor baselineColor, int nstep, double LeftVal, double RightVal)
|
||||||
|
|
@ -10085,11 +10100,12 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
|
||||||
this->clearGraphs();
|
this->clearGraphs();
|
||||||
this->clearItems();
|
this->clearItems();
|
||||||
|
|
||||||
|
bool flag = true;
|
||||||
// if(m_Value == NULL)
|
// if(m_Value == NULL)
|
||||||
{
|
{
|
||||||
m_bTableData = false; // 表格 曲线
|
m_bTableData = bTableData; // 表格 曲线
|
||||||
m_csCurveDDIR = "DDIR"; // 方位 曲线名
|
this->m_csCurveDDIR = csCurveDDIR; // 方位 曲线名
|
||||||
m_csCurveDANG = "DANG";//倾角
|
this->m_csCurveDANG = csCurveDANG;//倾角
|
||||||
this->m_csCurveGrad = csCurveGrad;
|
this->m_csCurveGrad = csCurveGrad;
|
||||||
|
|
||||||
m_qsTable="FRAC_HOLE.TABLE";
|
m_qsTable="FRAC_HOLE.TABLE";
|
||||||
|
|
@ -10098,7 +10114,11 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
|
||||||
m_qsDepth="DEPT";
|
m_qsDepth="DEPT";
|
||||||
m_qsID = "ID";
|
m_qsID = "ID";
|
||||||
|
|
||||||
Refurbish();
|
flag = Refurbish();
|
||||||
|
if(!flag)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// double nR = 50;
|
// double nR = 50;
|
||||||
|
|
@ -10238,7 +10258,6 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
|
||||||
double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
|
double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]);
|
||||||
if(grad<LeftVal3||grad>RightVal3){i++;continue;}
|
if(grad<LeftVal3||grad>RightVal3){i++;continue;}
|
||||||
}
|
}
|
||||||
|
|
||||||
flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
|
flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]);
|
||||||
flVal=fmod(flVal,360.f);
|
flVal=fmod(flVal,360.f);
|
||||||
int j = flVal/x1;
|
int j = flVal/x1;
|
||||||
|
|
@ -10323,7 +10342,7 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
|
||||||
|
|
||||||
if(drawAnnotation)
|
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);
|
drawHistogram, baselineWidth, baselineColor, LeftVal, RightVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -10334,7 +10353,7 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV
|
||||||
this->replot();
|
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 lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawHistogram,
|
||||||
int baselineWidth, QColor baselineColor, double minInclination, double maxInclination)
|
int baselineWidth, QColor baselineColor, double minInclination, double maxInclination)
|
||||||
{
|
{
|
||||||
|
|
@ -10376,35 +10395,39 @@ void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360
|
||||||
scaleLine->start->setCoords(startY, currY);
|
scaleLine->start->setCoords(startY, currY);
|
||||||
scaleLine->end->setCoords(startY + dynamicLen, currY); // 每个刻度长度不同
|
scaleLine->end->setCoords(startY + dynamicLen, currY); // 每个刻度长度不同
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// QRect rect = this->axisRect()->rect();
|
// QRect rect = this->axisRect()->rect();
|
||||||
// qDebug() << centerY << "--==--=-=-=" << centerX << "-----------" << rect;
|
// qDebug() << centerY << "--==--=-=-=" << centerX << "-----------" << rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMyCustomPlot::Refurbish()
|
bool QMyCustomPlot::Refurbish()
|
||||||
{
|
{
|
||||||
|
bool flag = true;
|
||||||
if (m_bTableData)
|
if (m_bTableData)
|
||||||
{
|
{
|
||||||
// ReadData(m_strSlfName, "");
|
ReadData(m_strSlfName, "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve);
|
flag = this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve);
|
||||||
this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2);
|
if(!flag)
|
||||||
this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3);
|
{
|
||||||
|
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
|
||||||
//read curve
|
bool QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve)
|
||||||
void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve)
|
|
||||||
{
|
{
|
||||||
|
bool flag = true;
|
||||||
//
|
//
|
||||||
if(strSlfName.isEmpty())
|
if(strSlfName.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
flag = false;
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读曲线数值
|
// 读曲线数值
|
||||||
|
|
@ -10433,7 +10456,11 @@ void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve
|
||||||
if (iIndex >= 0)
|
if (iIndex >= 0)
|
||||||
{
|
{
|
||||||
mrw.GetCurveInfo(iIndex,curve);
|
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_PointNum = (float)(fabs((curve->EndDepth - curve->StartDepth)/curve->DepLevel+0.5));
|
||||||
m_SDep=curve->StartDepth;
|
m_SDep=curve->StartDepth;
|
||||||
m_EDep=curve->EndDepth;
|
m_EDep=curve->EndDepth;
|
||||||
|
|
@ -10466,7 +10493,493 @@ void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve
|
||||||
}
|
}
|
||||||
mrw.CloseCurve(iIndex);
|
mrw.CloseCurve(iIndex);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
mrw.Close(); //关闭井文件
|
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);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -555,6 +555,9 @@ public slots:
|
||||||
// 频率统计图
|
// 频率统计图
|
||||||
void s_changePlObjectProperty(QVariantMap variantMap);
|
void s_changePlObjectProperty(QVariantMap variantMap);
|
||||||
|
|
||||||
|
// 玫瑰图
|
||||||
|
void s_changeRoseProperty(QVariantMap variantMap);
|
||||||
|
|
||||||
// 岩心分析
|
// 岩心分析
|
||||||
void s_changeCorePhysicsProperty(QVariantMap variantMap);
|
void s_changeCorePhysicsProperty(QVariantMap variantMap);
|
||||||
|
|
||||||
|
|
@ -636,20 +639,25 @@ public:
|
||||||
QString m_qsWellName,m_qsTable;
|
QString m_qsWellName,m_qsTable;
|
||||||
QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线
|
QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线
|
||||||
float m_SDep,m_EDep,m_Rlev;
|
float m_SDep,m_EDep,m_Rlev;
|
||||||
// csCurveGrad曲线名 LeftVal3最小值 RightVal3最大值 nArc扇形 nR圆半径 crArc圆颜色 nArcLineWidth圆线宽度 bFill是否填充
|
// 频率统计图 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,
|
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 lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram,
|
||||||
int baselineWidth, QColor baselineColor, int nstep, double minInclination, double maxInclination);
|
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 lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawHistogram,
|
||||||
int baselineWidth, QColor baselineColor, double minInclination, double maxInclination);
|
int baselineWidth, QColor baselineColor, double minInclination, double maxInclination);
|
||||||
|
|
||||||
void Refurbish();
|
bool Refurbish();
|
||||||
|
|
||||||
int m_PointNum;
|
int m_PointNum;
|
||||||
char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL;
|
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:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user