217 lines
7.8 KiB
C++
217 lines
7.8 KiB
C++
/**
|
||
* @file PropertyWidget.h
|
||
* @brief 统一属性服务,采用了singleton模式
|
||
* @date 2025-10-10
|
||
* @author:
|
||
*/
|
||
#pragma once
|
||
#include <QDockWidget>
|
||
#include <QTableWidget>
|
||
|
||
#include "qtpropertybrowser.h"
|
||
#include "qtvariantproperty.h"
|
||
#include "qttreepropertybrowser.h"
|
||
//file
|
||
#include "variantmanager.h"
|
||
#include "variantfactory.h"
|
||
#include "ColorSchemeComboBox.h"
|
||
//
|
||
#include "forminfo.h"
|
||
#include "formhead.h"
|
||
#include "qmytablewidget.h"
|
||
#include "formtracktop.h"
|
||
#include "TransparentDraggableGujing.h"
|
||
#include "transparentdraggableimage.h"
|
||
#include "TransparentDraggableSwallCore.h"
|
||
#include "TransparentDraggableGeoLith.h"
|
||
#include "TransparentDraggableRect.h"
|
||
#include "TransparentDraggableLayer.h"
|
||
#include "TransparentDraggableJiegutext.h"
|
||
|
||
#include "TransparentGroupResult.h"
|
||
|
||
//当前曲线类型
|
||
#define Widget_Property "Widget_Property"
|
||
#define Well_Property "Well_Property" //井
|
||
#define Track_Property "Track_Property" //道
|
||
#define Curve_Property "Curve_Property" //曲线
|
||
#define Wave_Property "Wave_Property" //波列
|
||
#define Table_Property "Table_Property" //解释结论
|
||
#define JieshiItem_Property "JieshiItem_Property" //解释结论Item
|
||
|
||
#define Head_Property "Head_Property" //图头,单元格
|
||
|
||
#define Gujing_Property "Gujing_Property" //固井结论
|
||
#define GujingItem_Property "GujingItem_Property" //固井item
|
||
|
||
#define Image_Property "Image_Property" // 岩心图片
|
||
#define ImageItem_Property "ImageItem_Property" // 岩心图片item
|
||
|
||
#define SwallCore_Property "SwallCore_Property" //井壁取心
|
||
#define SwallCoreItem_Property "SwallCoreItem_Property" //井壁取心item
|
||
|
||
#define GeoLith_Property "GeoLith_Property" //录井剖面
|
||
#define GeoLithItem_Property "GeoLithItem_Property" //录井剖面item
|
||
|
||
#define Text_Property "Text_Property" //文字结论
|
||
#define TextItem_Property "TextItem_Property" //文字结论item
|
||
|
||
#define Layer_Property "Layer_Property" //地质分层
|
||
#define LayerItem_Property "LayerItem_Property" //地质分层item
|
||
|
||
#define Jiegutext_Property "Jiegutext_Property" //气测/FMT/射孔/文本
|
||
#define JiegutextItem_Property "JiegutextItem_Property" //气测/FMT/射孔/文本item
|
||
|
||
#pragma execution_character_set("utf-8")
|
||
|
||
/**
|
||
* @class PropertyWidget
|
||
* @brief 统一属性服务
|
||
* @date 2025-10-10
|
||
* @author:
|
||
*/
|
||
class PropertyWidget:public QDockWidget
|
||
{
|
||
Q_OBJECT
|
||
public:
|
||
PropertyWidget(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||
~PropertyWidget();
|
||
|
||
private:
|
||
QtTreePropertyBrowser *m_pPropertyBrowser;
|
||
QtVariantPropertyManager *m_pVariantManager;
|
||
QtColorSchemeComboBoxPropertyManager * m_pColorSchemeManager;
|
||
|
||
public:
|
||
QString m_strUuid;
|
||
QString m_strTrackUuid;
|
||
QString m_strSlfName;
|
||
QString m_strWellName;
|
||
QString m_strTrackName;
|
||
QString m_strLineName;
|
||
int m_iScale=200;
|
||
double m_iY1=0;
|
||
double m_iY2=0;
|
||
|
||
QString m_strCurrentProperty;
|
||
QMap<QtProperty*, QString> m_propertyData; //属性页值
|
||
//静态属性
|
||
QMap<QString, QtProperty*> m_mapGroupItem;
|
||
|
||
//其他曲线
|
||
QStringList m_strListOtherLine;
|
||
QList<float> m_listMin;
|
||
QList<float> m_listMax;
|
||
QStringList m_strListOtherScaleType;
|
||
|
||
FormTrackTop* m_fromTop = NULL;
|
||
FormInfo * m_formInfo = NULL;
|
||
|
||
//图头
|
||
FormHead *m_formHead;
|
||
QTableWidget *m_tableWidget;
|
||
QTableWidgetItem* m_item;
|
||
int m_iRow;
|
||
int m_iCol;
|
||
//图头, 图例宽高
|
||
double m_colWidth_Img = 1;
|
||
double m_rowHeight_Img = 1;
|
||
//图头, 行高、列宽
|
||
double m_colWidth = 1;
|
||
double m_rowHeight = 1;
|
||
|
||
//道
|
||
QMyTableWidget *m_myTableWidget;
|
||
int m_iCurrentCol;
|
||
|
||
bool m_bSelfChange=false;
|
||
|
||
TransparentGroupResult* m_tdJieshi;
|
||
//
|
||
TransparentDraggableGujing* m_tdGujing;
|
||
TransparentDraggableImage* m_tdImage;
|
||
TransparentDraggableSwallCore* m_tdSwallCore;
|
||
TransparentDraggableGeoLith* m_tdGeoLith;
|
||
TransparentDraggableRect* m_tdText;
|
||
TransparentDraggableLayer* m_tdLayer;
|
||
TransparentDraggableJiegutext* m_tdJiegutext;
|
||
|
||
public:
|
||
QWidget* GetPropertyWidget();
|
||
|
||
QtVariantProperty* _CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType);
|
||
void _CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType, double dMin, double dMax);
|
||
void _CreateEnumPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, QStringList listValue);
|
||
|
||
void _CreateColorSchemePropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue);
|
||
|
||
void InitCurrentViewInfo(bool bAll = true); //初始化属性,清空
|
||
void initWidgetProperty(QString strUuid, int iScale); //可视解释整体属性
|
||
//井
|
||
void initWellProperty(QString strUuid, QString strSlfName, QString strWellName, double iY1, double iY2);
|
||
//道
|
||
void initTrackProperty(FormTrackTop *fromTop, int iWidth, QMyTableWidget *myTableWidget, int iCurrentCol);
|
||
//曲线
|
||
void initCurveProperty(FormInfo *formInfo, QStringList strListOtherLine, QList<float> listMin, QList<float> listMax, QStringList strListOtherScaleType);
|
||
//图头
|
||
void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col);
|
||
|
||
void initTableProperty(FormInfo *formInfo);
|
||
|
||
void initDepthProperty(FormInfo *formInfo);
|
||
|
||
void initProperty(FormInfo *formInfo);
|
||
// 玫瑰图属性
|
||
void initRoseProperty(FormInfo *formInfo);
|
||
// 波列属性
|
||
void initWaveProperty(FormInfo *formInfo, int nType = 3);
|
||
|
||
// 解释结论Item属性
|
||
void initJieshiItemProperty(TransparentGroupResult* tdJieshi, double lower, double upper, QString strResult);
|
||
|
||
// 固井结论属性
|
||
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);
|
||
|
||
// 井壁取心属性
|
||
void initSwallCoreProperty(FormInfo *formInfo);
|
||
void initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor);
|
||
|
||
// 录井剖面属性
|
||
void initGeoLithProperty(FormInfo *formInfo);
|
||
void initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor);
|
||
|
||
// 文字结论属性
|
||
void initTextProperty(FormInfo *formInfo);
|
||
void initTextItemProperty(TransparentDraggableRect* tdText, double lower, double upper, QString strResult);
|
||
|
||
// 地质分层属性
|
||
void initLayerProperty(FormInfo *formInfo);
|
||
void initLayerItemProperty(TransparentDraggableLayer* tdLayer, double lower, double upper, QString strResult);
|
||
|
||
//气测/FMT/射孔/文本
|
||
void initJiegutextProperty(FormInfo *formInfo);
|
||
void initJiegutextItemProperty(TransparentDraggableJiegutext* tdJiegutext, double lower, double upper);
|
||
|
||
|
||
void ChangFillProperty();//填充属性改变
|
||
void ChangHeadItemProperty();//图头项改变
|
||
|
||
//处理通用属性
|
||
void CommonPropertyChanged(QtProperty *pProperty, const QVariant &variant);
|
||
|
||
void changedYxzpProperty(QtProperty *pProperty, const QVariant &variant);
|
||
void changedYxzpItemProperty(QtProperty *pProperty, const QVariant &variant);
|
||
|
||
public slots:
|
||
void SlotPropertyChanged(QtProperty *property, const QVariant &variant);
|
||
void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle);
|
||
};
|
||
|
||
extern PropertyWidget* PropertyService();
|
||
|