diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 3663296..ddccbdd 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -4054,19 +4054,22 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do void PropertyWidget::initPlObjectProperty(FormInfo *formInfo) { - _CreateVariantPropertyItem("数据", "名称", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("数据", "数据类型", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("数据", "显示单位", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("数据", "井文件名称", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("数据", "方位曲线", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("数据", "倾角曲线", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("数据", "数据名称", formInfo->m_strAliasName, QVariant::String); + QStringList listType; + listType.append("曲线型数据"); + listType.append("表格型数据"); + _CreateEnumPropertyItem("数据", "数据类型", formInfo->m_pl_dataType, listType); + _CreateVariantPropertyItem("数据", "显示单位", formInfo->m_strUnit, QVariant::String); + _CreateVariantPropertyItem("数据", "井文件名称", formInfo->m_strSlfName, QVariant::String); + _CreateVariantPropertyItem("数据", "方位曲线", formInfo->m_pl_azimuthCurve, QVariant::String); + _CreateVariantPropertyItem("数据", "倾角曲线", formInfo->m_pl_inclinationCurve, QVariant::String); - _CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int); - _CreateVariantPropertyItem("字体", "名称", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("字体", "单位", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("字体", "刻度", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("字体", "名称", formInfo->m_strAliasNameFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "刻度", formInfo->m_strAliasName, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_strAliasName, QVariant::Font); _CreateVariantPropertyItem("控制曲线", "曲线名", formInfo->m_strAliasName, QVariant::String); _CreateVariantPropertyItem("控制曲线", "最小值", formInfo->m_strAliasName, QVariant::String); @@ -4108,27 +4111,46 @@ void PropertyWidget::initPlObjectProperty(FormInfo *formInfo) _CreateVariantPropertyItem("分类", "垂直缝", formInfo->m_strAliasName, QVariant::String); _CreateVariantPropertyItem("分类", "自定义1", formInfo->m_strAliasName, QVariant::String); _CreateVariantPropertyItem("分类", "自定义2", formInfo->m_strAliasName, QVariant::String); + + m_strCurrentProperty = PL_OBJECT_PROPERTY; } void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVal) { - if ("名称" == strProperty) + if ("数据名称" == strProperty) { - QFont newFont = varVal.value(); - m_formInfo->m_curveNameFont = newFont; + m_formInfo->m_strAliasName = varVal.toString(); this->m_formInfo->repaint(); } + if ("显示单位" == strProperty) + { + this->m_formInfo->m_strUnit = varVal.toString(); + this->m_formInfo->repaint(); + } + else if ("例区高度" == strProperty) + { + int temp = varVal.toInt(); + this->m_formInfo->m_headHeight = temp; + this->m_formInfo->setFixedHeight(temp); + } + else if ("名称" == strProperty) + { + QFont newFont = varVal.value(); + this->m_formInfo->m_strAliasNameFont = newFont; + this->m_formInfo->repaint(); + } + else if ("单位" == strProperty) + { + QFont temp = varVal.value(); + this->m_formInfo->m_strUnitFont = temp; + this->m_formInfo->repaint(); + } + } void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal) { - if ("名称" == strProperty) - { - QFont newFont = varVal.value(); - m_formInfo->m_curveNameFont = newFont; - this->m_formInfo->repaint(); - } - else if ("显示单位" == strProperty) + if ("显示单位" == strProperty) { this->m_formInfo->m_strUnit = varVal.toString(); this->m_formInfo->repaint(); diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index d18ee43..ed4d4be 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -174,8 +174,6 @@ public: void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col); void initTableProperty(FormInfo *formInfo); - // 深度 - void initDepthProperty(FormInfo *formInfo); void initProperty(FormInfo *formInfo); // 玫瑰图属性 @@ -190,14 +188,6 @@ public: void initGujingProperty(FormInfo *formInfo); void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult); - // 岩心照片属性 - void initImageProperty(FormInfo *formInfo); - void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth); - - // 岩心分析属性 isItem用来判断是不是item 默认false - void initCorePhysicsProperty(FormInfo *formInfo, bool isItem = false); - void initCorePhysicsItemProperty(TransparentDraggableCorePhysics* tdImage); - // 井壁取心属性 void initSwallCoreProperty(FormInfo *formInfo); void initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor); @@ -229,25 +219,31 @@ public: void initTubingProperty(FormInfo *formInfo); void initTubingItemProperty(TransparentDraggableGuan* tdGuan, double lower, double upper, QString strResult); - // 频率统计图 - void initPlObjectProperty(FormInfo *formInfo); - void changedPlObjectProperty(QString strProName, QVariant val); - void ChangFillProperty();//填充属性改变 void ChangHeadItemProperty();//图头项改变 //处理通用属性 void CommonPropertyChanged(QtProperty *pProperty, const QVariant &variant); - // 岩心照片 + // 频率统计图 + void initPlObjectProperty(FormInfo *formInfo); + void changedPlObjectProperty(QString strProName, QVariant val); + + // 岩心照片 属性 + void initImageProperty(FormInfo *formInfo); + void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth); void changedYxzpProperty(QtProperty *pProperty, const QVariant &variant); void changedYxzpItemProperty(QtProperty *pProperty, const QVariant &variant); // 深度 + void initDepthProperty(FormInfo *formInfo); void changedDepthProperty(QString strProName, QVariant val); - // 岩心分析 + // 岩心分析 属性 isItem用来判断是不是item 默认false + void initCorePhysicsProperty(FormInfo *formInfo, bool isItem = false); + void initCorePhysicsItemProperty(TransparentDraggableCorePhysics* tdImage); void changedCorePhysicsProperty(QtProperty *pProperty, const QVariant &variant, bool isItem = false); + public slots: void SlotPropertyChanged(QtProperty *property, const QVariant &variant); void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index d55b760..61aed8c 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -192,7 +192,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) // 设置左侧显示属性 设置界面样式 if(pInfo->m_strUnit.isEmpty()){ pInfo->m_strUnit = "(米)"; - pInfo->m_strUnitFont = QFont("微软雅黑", 10); + pInfo->m_strUnitFont = QFont("微软雅黑", 8); } initDepth(curv); // 读json后 重新设置样式 @@ -312,6 +312,11 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) } else if("plObject" == strType) { + if(pInfo->m_strUnit.isEmpty()){ + pInfo->m_strUnit = "(°)"; + pInfo->m_strUnitFont = QFont("微软雅黑", 8); + } + initFgrq(curv); } else if("roseObject" == strType) diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index df4b35e..04b1314 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -747,7 +747,10 @@ void FormInfo::paintEvent(QPaintEvent* event) } else { + QFont oldFont = painter.font(); + painter.setFont(this->m_strAliasNameFont); painter.drawText(rt, Qt::AlignCenter, text); + painter.setFont(oldFont); } } @@ -793,18 +796,19 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.drawText(rect.left(), rect.top()+rect.height()*2/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, QString::number(m_vmin)+" ~ "+QString::number(m_vmax)); } - if(m_strLineName == "深度") + if(m_strLineName == "深度" || m_strType == "plObject") { + QFont oldFont = painter.font(); painter.setFont(m_strUnitFont); painter.drawText(rect.left(), rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, this->m_strUnit); + painter.setFont(oldFont); } + // 岩心分析 if(m_strType == "tableObject" && m_strLineName == "CORE_PHYSICS") { painter.setPen(Qt::black); - // 字体->曲线单位 QFont oldFont = painter.font(); painter.setFont(m_strUnitFont); - // 显示单位 painter.drawText(rect.left()+10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, m_strUnit); painter.setFont(oldFont); @@ -854,6 +858,11 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.setFont(oldFont); } + if(this->m_strType == "plObject") + { + + } + QWidget::paintEvent(event); } diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 09dd583..4c78082 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -85,9 +85,10 @@ public: QString m_strWellName; QString m_strTrackName; QString m_strLineName; - QString m_strAliasName;//显示名称 + QString m_strAliasName; //显示名称 + QFont m_strAliasNameFont = QFont("微软雅黑", 10); //显示名称字体 QString m_strUnit = "(米)";//单位 - QFont m_strUnitFont = QFont("微软雅黑", 10);//单位字体 + QFont m_strUnitFont = QFont("微软雅黑", 8);//单位字体 // 头部高度 int m_headHeight = 100; @@ -240,6 +241,61 @@ public: QColor m_cp_symbolFillColor; // 填充颜色 int m_cp_fieldName = 0; // 字段名称 + // 频率统计图 + // 数据 + int m_pl_dataType; // 数据类型 + QString m_pl_azimuthCurve = "DDIR"; // 方位曲线 + QString m_pl_inclinationCurve = "DANG"; // 倾角曲线 + // 通用界面配置 + QString m_pl_sectionHeight; // 例区高度(cm) + // 字体相关配置 + QString m_pl_fontName; // 字体名称 + QString m_pl_fontUnit; // 单位字体 + int m_pl_fontScale; // 刻度字体大小 + QString m_pl_curveName; // 曲线名称 + // 控制曲线参数 + QString m_pl_controlCurveName; // 控制曲线名 + double m_pl_controlMinValue; // 控制最小值 + double m_pl_controlMaxValue; // 控制最大值 + // 方位频率绘图参数 + int m_pl_azimuthFrequency; // 方位频率 + int m_pl_sectorCount; // 扇形数量 + double m_pl_circleRadius; // 圆半径(cm) + QColor m_pl_circleColor; // 圆线颜色 + int m_pl_circleLineWidth; // 圆线宽度 + bool m_pl_isFillEnabled; // 是否启用填充 + QColor m_pl_fillColor; // 填充颜色 + int m_pl_fillFrequency; // 填充频率 + // 倾角频率绘图参数 + int m_pl_dipFrequency; // 倾角频率 + int m_pl_lineType; // 线型 + int m_pl_lineThickness; // 线粗细 + QColor m_pl_lineColor; // 线颜色 + bool m_pl_drawAnnotation; // 是否绘制标注 + bool m_pl_drawHistogram; // 是否绘制直方图 + // 基线参数 + int m_pl_baselineWidth; // 基线宽度 + QColor m_pl_baselineColor; // 基线颜色 + // 统计参数 + int m_pl_statInterval; // 统计间隔 + double m_pl_minInclination; // 最小倾角 + double m_pl_maxInclination; // 最大倾角 + // 地质要素分类开关 + bool m_pl_highGap; // 高导缝 + bool m_pl_highReservoir; // 高阻缝 + bool m_pl_reticularFracture; // 网状缝 + bool m_pl_inducedFracture; // 诱导缝 + bool m_pl_bedLayer; // 层理 + bool m_pl_erosionSurface; // 侵蚀面 + bool m_pl_pore; // 孔洞 + bool m_pl_vesicle; // 气孔 + bool m_pl_gravel; // 砾石 + bool m_pl_nodule; // 结核 + bool m_pl_lumps; // 团块 + bool m_pl_fault; // 断层 + bool m_pl_verticalFracture; // 垂直缝 + QString m_pl_custom1; // 自定义1 + int cpLineWidth() const; void setCpLineWidth(int cpLineWidth);