logplus/logPlus/formdraw.h

230 lines
9.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef FORMDRAW_H
#define FORMDRAW_H
#include <QWidget>
#include <QPainter>
#include <QPaintEvent>
#include "qmycustomplot.h"
#include "formtitle.h"
#include "formtrack.h"
#include "LogIO.h"
#include "MemRdWt.h"
#pragma execution_character_set("utf-8")
//const int iFracType=15;
//蝌蚪图
typedef struct FRACDEF
{
int iCode; //代码
QString csName; // 名称
int iType; //形状代码(1:正弦曲线 2:连线 3:封闭区域)
QColor crColor; //颜色(红 绿 蓝)
int nLineWidth; //线宽度
int bDraw; // 是否显示
}FRAC_DEF;
typedef struct FRACTABLE
{
float DEP; //深度
float AorX;
float XETAorH;
float W;
float DIPorS; //倾角
float DIR; //方位
float ID; //裂缝代码/可信度
float NUM;
float X[16],Y[16];//X0,Y0,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6,X7,Y7,X8,Y8,X9,Y9;
}FRAC_TABLE;
namespace Ui {
class FormDraw;
}
class FormDraw : public QWidget
{
Q_OBJECT
public:
explicit FormDraw(QWidget *parent = nullptr, QString m_strWellName="", QString strTrackName="");
~FormDraw();
void setDrawData(QStringList slist);
private:
Ui::FormDraw *ui;
protected:
void paintEvent(QPaintEvent *event);
public slots:
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
void dropEvent(QDropEvent* event);
//
void s_mouseWheel(QWheelEvent *event);
void setRowHeight(double dHight, QProgressBar *progressBar, int iSplit);
public:
QString m_strUuid;
QString m_strWellName;
QString m_strTrackName;
FormTrack *m_formTrack;
QStringList m_listLineName;
QStringList m_listWaveName;
QStringList m_listTableName;
//X坐标
float m_vmax;
float m_vmin;
public:
void initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine);
void addRandomGraph(QMyCustomPlot *widget, QVector<double> x, QVector<double> y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit,
double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine);
void setupLineStyleDemo(QMyCustomPlot *customPlot);
void setupSelectionDemo(QMyCustomPlot *customPlot);
//波列
void initWave(QMyCustomPlot *widget, QString strSlfName, QString strWaveName, int &_nSamples);
void initWave_3D(QMyCustomPlot *widget, QString strSlfName, QString strWaveName, int &_nSamples);
void initWave2(QMyCustomPlot *widget, QString strSlfName, QString strWaveName);
//图像-3d成图
int getColorConfig(QVector <QString> &qFiles);
void DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, QString &strWaveName, int &_nSamples);
//表格曲线
void initTableLine(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
void ReadFracDef();
void ReadData(QString strSlfName, QString strLineName);//表格
void ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve);//曲线
void DrawDip(QMyCustomPlot *widget);
void DrawStck(QMyCustomPlot *widget);
void DrawTabDip(QMyCustomPlot *widget);
void CalcDipWidth(int nColumn,float *flWidth,float factor,int x1,int x2,float flHoriRatio);
void Refurbish();
void DrawJykt(QMyCustomPlot *widget, QString strSlfName);
void DrawDenv(QMyCustomPlot *widget, QString strSlfName);
int m_PointNum;
//
int FracNum;
float *m_pflTab_Frac;
bool m_bFracIsOK;
//CString m_csUnit;
//
Slf_CURVE m_Curve,m_Curve2,m_Curve3;
char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL;
// 以下变量需保存在模板里
// 绘制时,方位/倾角/可信度曲线的深度、采样间隔应该一致
//CString m_csCurveDDIR,m_csCurveDANG,m_csCurveGrad; // 方位/倾角/可信度 曲线名
float m_LeftVal2,m_RightVal2;
float m_flGrad1,m_flGrad2; // 可信度
int m_bTableData = 0;//表格或曲线
QRectF m_Rect;
float m_nRadius,m_nCircleWidth; // 半径,圆线宽度
float m_nTailWidth,m_nTailLen; // 尾宽度、尾长
float m_nSltk; // 杆状图长度
QColor m_crPointFill,m_crTail,m_crCircle;
QColor m_crGridSmall;
QString m_strSlfName;
//TabDip
QString m_qsWellName,m_qsTable; //
QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线
QList<FRAC_DEF> m_FracDefList;
QList<FRAC_TABLE> m_FracTabList;
bool m_bTypeDraw[iFracType];
bool m_bDrawValue;
int m_iPrecision;//小数位数
float m_SDep,m_EDep,m_Rlev;
QString m_csCurveDDIR,m_csCurveDANG,m_csCurveGrad;
float m_LeftVal; //左刻度
float m_RightVal; //右刻度
//井眼垮塌矢量图
QString m_csCurveCAL;
float m_flStep;// 增加深度间隔
float m_nCircleLineWidth;//增加圆线宽
QColor m_crLine,m_crTailLine; // 圆线颜色,尾线颜色
float m_nOffset; // 角度偏移=0,主应力方向,=90长轴方向
//井斜方位图
QString m_csCurveAZIM, m_csCurveDEVI; // 方位/倾角/可信度 曲线名
QColor m_TailColor,m_crCirCleColor;// add m_crCirCleColor圆线颜色
QColor m_crPointFillDenv;
//文字结论
void initWords(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
bool LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//解释结论
void initResult(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
bool LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//录井剖面
void initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
bool LoadFromSLF_GeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//井壁取心
void initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
bool LoadFromSLF_SwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//固井结论
void initGujing(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
bool LoadFromSLF_Gujing(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//岩心实验数据
void initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//岩心图片数据
void initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
bool LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//深度
void initDepth(QMyCustomPlot *widget);
//频率统计图
void initFgrq(QMyCustomPlot *widget);
//玫瑰图
void initRose(QMyCustomPlot *widget);
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
signals:
//void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
public slots:
void s_addLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
void s_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性
void s_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName);
void s_MouseMove(QString strUuid, QString strWellName, QString strTrackName, float dep);
void s_handleRectRangeChange(QCPRange newRange);
void s_selectionRectAccepted(const QRect &rect, QMouseEvent *event);
void s_addGanZuangTu(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);//杆状图
//井眼垮塌矢量图
void s_addJykt(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
//井斜方位图
void s_addDenv(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
//图像 成像
void s_addDrawImage(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
//裂缝
void s_addCrack(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
//地质层位道
void s_addGeoSection(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
//
void s_addWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName);
void s_delWave(QString strUuid, QString strWellName, QString strTrackName, QString strLineName);
//
void s_addTableLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName);
void s_delTableLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName);
};
#endif // FORMDRAW_H