logplus/logPlus/formdraw.h

74 lines
2.4 KiB
C++

#ifndef FORMDRAW_H
#define FORMDRAW_H
#include <QWidget>
#include <QPainter>
#include <QPaintEvent>
#include "qmycustomplot.h"
#include "formtitle.h"
#include "formtrack.h"
#include "LogIO.h"
#pragma execution_character_set("utf-8")
namespace Ui {
class FormDraw;
}
class FormDraw : public QWidget
{
Q_OBJECT
public:
explicit FormDraw(QWidget *parent = nullptr, QString m_strWellName="", QString strTrackName="");
~FormDraw();
private:
Ui::FormDraw *ui;
protected:
void paintEvent(QPaintEvent *event);
public slots:
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent* event);
void dropEvent(QDropEvent* event);
public:
QString m_strUuid;
QString m_strWellName;
QString m_strTrackName;
FormTrack *m_formTrack;
QStringList m_listLineName;
//X坐标
float m_vmax;
float m_vmin;
public:
void initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
double newLeftScale=-9999, double newRightScale=-9999, 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,
double newLeftScale=-9999, double newRightScale=-9999, QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine);
void setupLineStyleDemo(QMyCustomPlot *customPlot);
void setupSelectionDemo(QMyCustomPlot *customPlot);
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, 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);
};
#endif // FORMDRAW_H