OSCAR-code/Graphs/gSessionTime.h

44 lines
1.3 KiB
C
Raw Normal View History

2011-07-12 07:10:34 +00:00
/*
gSessionTime Header
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
License: GPL
*/
#ifndef GSESSIONTIME_H
#define GSESSIONTIME_H
#include "gGraphView.h"
2011-07-12 07:10:34 +00:00
#include "gXAxis.h"
2011-07-12 07:29:02 +00:00
#include "gYAxis.h"
class gTimeYAxis:public gYAxis
{
public:
gTimeYAxis(QColor col=QColor("black"));
virtual ~gTimeYAxis();
2011-08-31 12:24:45 +00:00
virtual const QString Format(double v);
2011-07-12 07:29:02 +00:00
};
2011-07-12 07:10:34 +00:00
class gSessionTime:public Layer
2011-07-12 07:10:34 +00:00
{
public:
gSessionTime(ChannelID=EmptyChannel,QColor col=QColor("blue"),Qt::Orientation o=Qt::Horizontal);
2011-07-12 07:10:34 +00:00
virtual ~gSessionTime();
virtual void paint(gGraph & w,int left,int top, int width, int height);
2011-07-12 07:10:34 +00:00
protected:
Qt::Orientation m_orientation;
2011-07-27 09:21:53 +00:00
virtual const QString & FormatX(double v) { static QString t; QDateTime d; d=d.fromMSecsSinceEpoch(v*86400000.0); t=d.toString("MMM dd"); return t; }
2011-07-12 07:10:34 +00:00
//virtual const wxString & FormatX(double v) { static wxString t; wxDateTime d; d.Set(vi*86400000.0); t=d.Format(wxT("HH:mm")); return t; };
//virtual const wxString & FormatX(double v) { static wxString t; t=wxString::Format(wxT("%.1f"),v); return t; };
2011-07-27 09:21:53 +00:00
virtual const QString & FormatY(double v) { static QString t; t.sprintf("%.1f",v); return t; }
2011-07-12 07:10:34 +00:00
gXAxis *Xaxis;
QVector<QColor> color;
2011-07-12 07:10:34 +00:00
};
#endif // GSESSIONTIME_H