511 lines
19 KiB
C++
511 lines
19 KiB
C++
#ifndef QMYCUSTOMPLOT_H
|
||
#define QMYCUSTOMPLOT_H
|
||
|
||
#include "qcustomplot.h"
|
||
#include "LogIO.h"
|
||
#include "QCPSizeHandleManager.h"
|
||
#include "qtColorSchemeComboBox.h"
|
||
#include "formtrack.h"
|
||
|
||
#pragma execution_character_set("utf-8")
|
||
|
||
const int iFracType=15;
|
||
|
||
//
|
||
#define SideWallCoreWidth 1.2
|
||
#define SideWallCoreHeight 0.5
|
||
|
||
struct Slf_TxtPOS {
|
||
int Order;
|
||
float Depth;
|
||
float CorrDepth;
|
||
};
|
||
|
||
struct Slf_JIEGUPOS {
|
||
int Order;
|
||
float Depth;
|
||
float Number;
|
||
char Dest[64];
|
||
};
|
||
|
||
typedef struct
|
||
{
|
||
int iCode; //代码
|
||
QString Fac; //相
|
||
QString Phase; //亚相
|
||
QString mFac; //微相
|
||
}FAC_DEF;
|
||
|
||
typedef struct
|
||
{
|
||
int no;
|
||
float sdep;
|
||
float edep;
|
||
char Fac[32];
|
||
char Phase[32];
|
||
char mFac[32];
|
||
char Dest[32];
|
||
}FAC_TABLE;
|
||
|
||
class TransparentGroupResult;
|
||
class QMyCustomPlot : public QCustomPlot
|
||
{
|
||
Q_OBJECT
|
||
public:
|
||
QMyCustomPlot(QWidget *parent = nullptr, QString strSlfName="", QString strWellName="", QString strTrackName="", QString strLineName="");
|
||
|
||
virtual ~QMyCustomPlot()
|
||
{
|
||
}
|
||
|
||
void initGeometry(QString strUuid, int nscale, int nW);
|
||
|
||
void changePropertyWaveUpdate();
|
||
// 绘图类型-变密度(成像)
|
||
void initWave(QString strSlfName, QString strWaveName);
|
||
// 绘图类型-波形
|
||
void initWave2(QString strSlfName, QString strWaveName);
|
||
|
||
|
||
void initColorTable();
|
||
void setSchemeIndex(int nidx, int colorNum);
|
||
double** getWavedata(int nrow, int ncol);
|
||
QCPColorMap * updateWave();
|
||
|
||
float getScaleV();
|
||
|
||
void groupBeginResult(float fEndDepth, float fStartDepth);
|
||
void groupEndResult();
|
||
|
||
// 设置解释结论属性
|
||
void setShowProperty(QVariant val, int ntag);
|
||
void setConclusionProportion(int nCopro);
|
||
void setShowPos(int nSPos);
|
||
protected:
|
||
//virtual void mouseMoveEvent(QMouseEvent *event);
|
||
|
||
public:
|
||
// 井UUID
|
||
QString m_strUuid;
|
||
QString m_strSlfName;
|
||
QString m_strWellName;
|
||
QString m_strTrackName;
|
||
QString m_strLineName;
|
||
|
||
FormTrack *m_formTrack = NULL;
|
||
|
||
//
|
||
float m_iX1, m_iX2;
|
||
float m_iY1, m_iY2;
|
||
qint8 m_nLeftCross = 0; // 左跨道个数
|
||
qint8 m_nRightCross = 0; // 右跨道个数
|
||
|
||
//填充曲线
|
||
QCPGraph *graph_Fill=nullptr;
|
||
//对称曲线
|
||
QCPGraph *graph_Symmetry=nullptr;
|
||
|
||
//其他曲线
|
||
QString m_newFillType;
|
||
QString m_newTargetLine;
|
||
QColor m_newColor;
|
||
QString m_newLithosImage;
|
||
QString m_newHeadFill;
|
||
float m_vMin;
|
||
float m_vMax;
|
||
QString m_strOtherScaleType;
|
||
QString m_strScaleType="线性";//刻度类型(线性,对数)
|
||
|
||
//绘制方式
|
||
bool m_bDrawLine = true; // 曲线
|
||
bool m_bDrawGan = false; // 杆状
|
||
bool m_bDrawPoint = false; // 点状
|
||
bool m_bDrawSymmetry = false; // 绘制对称曲线
|
||
|
||
QColor m_frontColor;//岩性前景色
|
||
QColor m_backColor;//岩性背景色
|
||
QString m_newFillMode;
|
||
bool m_bFillNow = true;
|
||
|
||
QContextMenuEvent *m_event;
|
||
|
||
bool m_bDrawRect = true;
|
||
bool m_bX2Y = true;
|
||
|
||
//
|
||
bool m_bDrawCore_PHYSICS = false; //岩心分析
|
||
int dataIndex = -1;
|
||
bool singleDragMove = false;
|
||
float singleOldPosition = 0;
|
||
|
||
QCPColorMap *m_colorMap = NULL;
|
||
QCPColorScale * m_colorScale = NULL;
|
||
double** m_wavedata = NULL;
|
||
int m_nRow = 0;
|
||
int m_nCol = 0;
|
||
int m_nDrawType = 3; // 绘图类型
|
||
// 0.全周 1.正半周 2.负半周
|
||
int m_nMode = 1;
|
||
float m_fScaleV = 0.0f;
|
||
float m_fmin;
|
||
float m_fmax;
|
||
int m_nColorNum = 256;
|
||
int m_nSchemeIndex = 1;
|
||
bool m_bDrawDepth = false; // 绘制波深度
|
||
bool m_bDrawBase = false; // 绘制波基线
|
||
bool m_bOddEven = false; // 奇偶配色
|
||
float m_Base = 0.0f; // 波列基值
|
||
float m_MaxRange = 1023.0f;
|
||
int m_nWaveJg = 100;
|
||
int m_nWaveHei = 1;
|
||
public:
|
||
bool m_bEditor = false; // 编辑状态
|
||
QCPItemStraightLine* m_pAddLine1 = NULL;
|
||
QCPItemStraightLine* m_pAddLine2 = NULL;
|
||
|
||
QString m_strGroupUid = "";
|
||
// 解释结论终止深度
|
||
float m_fResultEndDepth = 0.0f;
|
||
QVector<double> m_x;
|
||
QVector<double> m_y;
|
||
int m_iCurNum=0;
|
||
//分段刷新
|
||
int m_iSplitNum=2000; //2000000; //2000;
|
||
bool m_addRandomGraph=false;//当前是否绘制曲线 true:是。
|
||
bool m_bEditRect=false; //当前是否正在编辑曲线。
|
||
bool m_bFirstTimeConnect=true; //初次绑定编辑曲线信号槽。
|
||
bool m_bPriviewRightList=false; //当前是否正在预览曲线。
|
||
|
||
// 组
|
||
QMap<QString, QObject*> m_mapDragGroup;
|
||
|
||
QMap<QString, QObject*> m_mapDraggable_Rect; //文字结论
|
||
QMap<QString, QObject*> m_mapDraggable_Layer; //地质分层
|
||
QMap<QString, QObject*> m_mapDraggable_Result; //解释结论
|
||
QMap<QString, QObject*> m_mapDraggable_GeoLith; //录井剖面
|
||
QMap<QString, QObject*> m_mapDraggable_SwallCore; //井壁取心
|
||
QMap<QString, QObject*> m_mapDraggable_Gujing; //固井
|
||
QMap<QString, QObject*> m_mapDraggable_Image;
|
||
QMap<QString, QObject*> m_mapDraggable_MFac;
|
||
QMap<QString, QObject*> m_mapDraggable_Phase;
|
||
QMap<QString, QObject*> m_mapDraggable_Fac;
|
||
QMap<QString, QObject*> m_mapDraggable_Guan;
|
||
QMap<QString, QObject*> m_mapDraggable_Jiegutext;
|
||
QMap<QString, QObject*> m_mapDraggable_Line;
|
||
QMap<QString, QObject*> m_mapDraggable_SelectRect;
|
||
QMap<QString, QObject*> m_mapDraggable_RightList;
|
||
|
||
QObject* m_SelectShiftLine=nullptr;//当前选中的分段线
|
||
QObject* m_SelectRect=nullptr;//当前选中的曲线编辑框
|
||
|
||
//固井
|
||
QMap<QString,QString> zoneOrder_Gujing;
|
||
bool SaveToSLF_Gujing();
|
||
QString GetIntResult_Gujing(QString result);
|
||
void AddTableToWellRound(); //将表,添加到左侧树图
|
||
bool CopyToSLFFile(QString targetSLFFileName, bool deleteFromSrc, char*newCurveName);
|
||
bool LoadFromSLF_Gujing(QString strSlfName, QString strLineName);
|
||
|
||
// 岩心图片
|
||
QMap<QString,QString> zoneOrderImage;
|
||
bool SaveToSLFImage();
|
||
|
||
//井壁取心
|
||
QStringList liths_SWallCore;
|
||
QStringList oils_SWallCore;
|
||
QStringList colors_SWallCore;
|
||
QStringList colorinds_SWallCore;
|
||
bool SaveToSLF_SwallCore();
|
||
bool LoadFromSLF_SwallCore(QString strSlfName, QString strLineName);
|
||
|
||
//录井剖面
|
||
QMap<QString,QString> OilOrder;
|
||
QMap<QString,QString> LithOrder;
|
||
QMap<QString,QString> ColorOrder;
|
||
QMap<QString,QString> ColorInds;
|
||
QStringList LithWidth;
|
||
bool m_bLithColor = true; // 岩性配色显示
|
||
bool m_bLithOne = true; // 单岩性显示
|
||
bool m_bShowOil = true; // 显示含油性
|
||
bool m_bCenterOil = false; // 含油性居中
|
||
bool m_bShowColor = false; // 显示颜色
|
||
bool m_bShowColorNum = false; // 绘制颜色号
|
||
double m_dOilZhan = 8; //含油占比
|
||
QString GetIntLith(QString Lith);
|
||
QString GetIntOil(QString Oil);
|
||
QString GetIntColor(QString Color);
|
||
bool SaveToSLF_GeoLith();
|
||
bool LoadFromSLF_GeoLith(QString strSlfName, QString strLineName);
|
||
|
||
//文字结论
|
||
bool SaveToSLF_Text();
|
||
bool LoadFromSLF_Text(QString strSlfName, QString strLineName);
|
||
|
||
//地质层位
|
||
bool SaveToSLF_Layer();
|
||
bool LoadFromSLF_Layer(QString strSlfName, QString strLineName);
|
||
|
||
//气测/FMT/射孔/文本
|
||
QStringList m_FieldNameList;
|
||
QStringList m_FieldHZNameList;
|
||
QStringList m_FieldUnitList;
|
||
QStringList m_FieldHZUnitList;
|
||
QList<int> ValueTypes;
|
||
QStringList CoreValues;
|
||
bool LoadFromSLF_Jiegutext(QString strSlfName, QString csCurve, QString strAliasName);
|
||
bool SaveToSLF_Jiegutext();
|
||
|
||
//沉积相
|
||
QList <FAC_DEF> m_FracDef;
|
||
QList <FAC_TABLE> m_ObjList_Fac;
|
||
void ReadFracDef();
|
||
void ReadData_Fac(QString strSlfName, QString csCurve);
|
||
void DrawFac(int iType);
|
||
bool LoadFromSLF_Fac(QString strSlfName, QString csCurve);
|
||
|
||
public slots:
|
||
void slot_time();
|
||
|
||
public:
|
||
void init(QString strName, QVector<double> x, QVector<double> y);
|
||
|
||
//岩心照片
|
||
void addImageToPlot(double left_Low, double right_Hight, const QString imagePath);
|
||
|
||
//曲线
|
||
void addRandomGraph(QVector<double> x, QVector<double> y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit,
|
||
double newLeftScale, double newRightScale, QString strScaleType, QColor &newlineColor, double width, Qt::PenStyle lineStyle);
|
||
|
||
//文字结论
|
||
void addTextToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||
|
||
//地质分层
|
||
void addLayerToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||
|
||
//解释结论
|
||
TransparentGroupResult* addResultGroup(double left_Low, double right_Hight, QString &strUuid, QString strText = "");
|
||
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText="");
|
||
|
||
//录井剖面
|
||
void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor, bool bRefresh=true);
|
||
|
||
//井壁取心
|
||
void addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor);
|
||
|
||
//固井结论
|
||
void addGujingToPlot(double left_Low, double right_Hight, const QString strResult);
|
||
|
||
//气测/FMT/射孔/文本
|
||
void addJiegutextToPlot(double left_Low, double right_Hight, const QStringList strText, const QStringList strList_coredat, QColor crColor=QColor(255, 255, 255, 80));
|
||
|
||
//沉积相
|
||
void addMFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||
void addPhaseToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||
void addFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||
|
||
//套管组件
|
||
void addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in);
|
||
|
||
void addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
||
|
||
//框选并编辑曲线
|
||
void addSelectRectToPlot(double left_Low, double right_Hight, int left_Low_Number, int right_Hight_Number);
|
||
|
||
//预览
|
||
void addRightListToPlot( QList<double> new_DepthList, QList<double> new_ValueList);
|
||
|
||
public slots:
|
||
void slotSelectionRectAccepted(const QRect &rect, QMouseEvent *event);
|
||
|
||
void s_LineClicked(int index);
|
||
void onResetZoom();
|
||
void removeSelectedGraph();
|
||
void removeSelectedGraphByTitle();
|
||
|
||
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType);
|
||
|
||
//属性
|
||
//左刻度
|
||
void s_ChangeLeftScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newLeftScale);
|
||
//右刻度
|
||
void s_ChangeRightScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newRightScale);
|
||
//刻度类型
|
||
void s_ChangeScaleType(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strScaleType);
|
||
|
||
//线颜色
|
||
void s_ChangeLineColor(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor);
|
||
//线宽
|
||
void s_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width);
|
||
//线型
|
||
void s_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle);
|
||
|
||
//绘制方式
|
||
void ChangeDrawMethod(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
//曲线
|
||
void s_ChangeDrawLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawLine);
|
||
//杆状
|
||
void s_ChangeDrawGan(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawGan);
|
||
//点状
|
||
void s_ChangeDrawPoint(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawPoint);
|
||
//绘制对称曲线
|
||
void s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry);
|
||
|
||
//岩性填充-不填充
|
||
void s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
//岩性填充-填充
|
||
void s_ChangeFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
||
QString newFillType, QString newTargetLine, QColor newColor, QString newLithosImage, QString newHeadFill,
|
||
float vMin, float vMax, QString strOtherScaleType, QColor frontColor, QColor backColor, QString newFillMode, bool bFillNow);
|
||
|
||
|
||
//右键--添加分段线
|
||
void onAddShiftLine();
|
||
//校深线段
|
||
void s_AddShifLineToPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double left_Low, double right_Hight);
|
||
|
||
//右键--清除当前分段线
|
||
void onDelSelectShiftLine();
|
||
//清除当前分段线
|
||
void s_DelSelectShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
|
||
//右键--清除全部分段线
|
||
void onDelAllShiftLine();
|
||
//清除全部分段线
|
||
void s_DelAllShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
|
||
//右键--编辑曲线
|
||
void onEditLine();
|
||
|
||
//通用
|
||
void ClearSelectItems(); //取消选中
|
||
|
||
//右键--编辑固井
|
||
void onEditGujing();
|
||
void addItems_Gujing(); //从剪切板文本数据粘贴
|
||
void DeleteItems_Gujing(); //全部清空
|
||
void RefreshItems_Gujing(); //刷新数据
|
||
void MegResult_Gujing(); //合并结论
|
||
|
||
//右键--编辑岩心照片
|
||
void onEditImage();
|
||
void addItemsImage(); //从剪切板文本数据粘贴
|
||
void deleteItemsImage(); //全部清空
|
||
void refreshItemsImage(); //刷新数据
|
||
void megResultImage(); //合并结论
|
||
|
||
//右键--编辑井壁取心
|
||
void addItem_SWallCore(); //增加井壁取心
|
||
void moveItems_SWallCore(); //平移水平位置
|
||
void addItems_SWallCore(); //从剪切板文本数据粘贴
|
||
void DeleteItems_SWallCore(); //全部清空
|
||
void RefreshItems_SWallCore(); //刷新数据
|
||
void AddItem_SWallCore(QStringList lists);
|
||
|
||
//右键--编辑录井剖面
|
||
void onEditGeoLith();
|
||
void addItems_GeoLith(); //从剪切板文本数据粘贴
|
||
void DeleteItems_GeoLith(); //全部清空
|
||
void RefreshItems_GeoLith(); //刷新数据
|
||
void AddItem_GeoLith(QStringList lists);
|
||
|
||
//右键--编辑文字结论
|
||
void onEditText();
|
||
void addItems_Text(); //从剪切板文本数据粘贴
|
||
void DeleteItems_Text(); //全部清空
|
||
void RefreshItems_Text(); //刷新数据
|
||
void AddItem_Text(QStringList lists);
|
||
|
||
//右键--编辑地质分层
|
||
void onEditLayer();
|
||
void addItems_Layer(); //从剪切板文本数据粘贴
|
||
void DeleteItems_Layer(); //全部清空
|
||
void RefreshItems_Layer(); //刷新数据
|
||
void AddItem_Layer(QStringList lists);
|
||
|
||
//右键--气测-管柱-文本-FMT-射孔
|
||
void addItems_Jiegutext(); //从剪切板文本数据粘贴
|
||
void DeleteItems_Jiegutext(); //全部清空
|
||
void RefreshItems_Jiegutext(); //刷新数据
|
||
|
||
//右键--沉积相
|
||
void addItem_Fac(); //添加沉积相
|
||
|
||
//右键--解释结论
|
||
void onOpenEditResult();
|
||
void onCloseEditResult();
|
||
void DeleteItemGroup();
|
||
void updateGroupZone(); //更新层号
|
||
|
||
bool SaveToSLF_Result();
|
||
|
||
TransparentGroupResult* getCurGroupResult(double x_val);
|
||
// 筛选出选中的Group, 并且排序
|
||
QMap<double, TransparentGroupResult*> getSelectGroupResult();
|
||
void segmentationInnerLayer(); // 分割为层内层
|
||
void segmentationIndependentLayer(); // 分割为独立层
|
||
void splitIndependentLayer(); // 拆分复合层成独立层
|
||
void megResultLayer();// 合并
|
||
|
||
bool getIsEditor();
|
||
//
|
||
void addItems_Core();
|
||
|
||
//执行校正
|
||
void s_RuncorFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
|
||
//执行拼接
|
||
void s_MergeFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
|
||
//执行预览
|
||
void s_PreMergeFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
void s_PreMerge_FromRightList(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QList<double> new_DepthList, QList<double> new_ValueList);
|
||
//关闭预览框
|
||
void s_PreMerge_Close(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
||
|
||
//Plot重新加载数据
|
||
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
|
||
|
||
void s_changeDrawProperty(QVariantList vlist);
|
||
|
||
void onAddRect();
|
||
|
||
//蝌蚪图重绘网格线
|
||
void drawCustomElements();
|
||
|
||
//改变固井曲线名
|
||
void s_changeGujingLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName);
|
||
|
||
//改变曲线名 //气测/FMT/射孔/文本
|
||
void s_changeJiegutextLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName);
|
||
void s_changeJiegutextTitle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName);
|
||
|
||
|
||
//改变录井剖面属性
|
||
void s_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan);
|
||
//是否显示
|
||
void s_changeGeoLithShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow);
|
||
|
||
public:
|
||
//蝌蚪图重绘网格线
|
||
bool mKedou = false;
|
||
//
|
||
bool mMousePress = false;
|
||
double m_dPressX = 0;
|
||
QPoint mLastPos;
|
||
QCPSizeHandleManager *mSizeHandleManager;
|
||
virtual void mouseDoubleClickEvent(QMouseEvent *event);
|
||
virtual void mousePressEvent(QMouseEvent *event);
|
||
virtual void mouseMoveEvent(QMouseEvent *event);
|
||
virtual void mouseReleaseEvent(QMouseEvent *event);
|
||
|
||
//单点移动功能
|
||
void executeSingle(QMouseEvent *event);
|
||
|
||
virtual void contextMenuEvent(QContextMenuEvent *event);
|
||
|
||
private:
|
||
|
||
};
|
||
|
||
#endif // QMYCUSTOMPLOT_H
|