You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iPlot/iPlotBase/ZxSubAxisDt.h

91 lines
2.4 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "ZxSubAxisBase.h"
// 该类用于了zxLogMonitor
class I_PLOTBASE_EXPORT ZxSubAxisDt
: public ZxSubAxisBase
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
enum TimeTextFormat //刻度文本显示样式
{
TTF_Relative_TIU = 0, //相对时间,多少分或多少秒等等
TTF_Relative_Normal, //相对时间1'35.24'',时分秒模式
// 成都不考虑如下三种
#ifdef QT_DEBUG
TTF_Absolute_Time //绝对时间,格式由format来定
#endif
};
public:
ZxSubAxisDt();
ZxSubAxisDt(const QString& name);
ZxSubAxisDt(const ZxSubAxisDt & c);
virtual ~ZxSubAxisDt();
public:
virtual double getValueForPos(double fPos) const;
virtual double getPosForValue(double fVal) const;
void setStartDt(QDateTime& dt);
QDateTime getStartDt();
protected:
void init();
void onInstallPolicies();
virtual void onLayout();
virtual void paintBack(QPainter* painter, const ZxPaintParam& param);
virtual void fillPtyPano(IxPtyPano* pano);
virtual void fillPtyPano_TtfFormat(IxPtyPano* pano, IxPtyItem* prop);
virtual void fillPtyPano_TtfUnit(IxPtyPano* pano, IxPtyItem* prop);
virtual void fillPtyPano_Style(IxPtyPano* pano, IxPtyItem* prop);
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
protected:
virtual void calculateMajorGrid();
virtual void calculateMinorGrid();
virtual void calculateThirdGrid();
virtual void drawMajorGrid(QPainter* painter, const ZxPaintParam& param);
virtual void drawMinorGrid(QPainter* painter, const ZxPaintParam& param);
virtual void drawThirdGrid(QPainter* painter, const ZxPaintParam& param);
virtual void drawDepthText(QPainter* painter, const ZxPaintParam& param);
public slots:
virtual void onColnDepthRatioChanged(double dRatio);
public:
QString getLabelStr(double d);
void setTtf(TimeTextFormat o);
TimeTextFormat getTtf();
void setTtfFormat(QString s);
QString getTtfFormat();
void setTtfUnit(QString s);
QString getTtfUnit();
QString getTimeBaseUnit();
virtual QString getTipOfDepth(double dDepth);
private:
// 起始时间对应数据深度0
QDateTime m_dtStart;
TimeTextFormat m_oTtf;
QString m_sTtfUnit; //对于相对时间,是单位
QString m_sTtfFormat; //对于绝对时间是format
};