KD Chart 2
[rev.2.5]
|
00001 /**************************************************************************** 00002 ** Copyright (C) 2001-2012 Klaralvdalens Datakonsult AB. All rights reserved. 00003 ** 00004 ** This file is part of the KD Chart library. 00005 ** 00006 ** Licensees holding valid commercial KD Chart licenses may use this file in 00007 ** accordance with the KD Chart Commercial License Agreement provided with 00008 ** the Software. 00009 ** 00010 ** 00011 ** This file may be distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 and version 3 as published by the 00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 ** Contact info@kdab.com if any conditions of this licensing are not 00019 ** clear to you. 00020 ** 00021 **********************************************************************/ 00022 00023 #ifndef KDCHARTLEVEYJENNINGSDIAGRAM_H 00024 #define KDCHARTLEVEYJENNINGSDIAGRAM_H 00025 00026 #include "KDChartLineDiagram.h" 00027 #include "KDChartLeveyJenningsCoordinatePlane.h" 00028 00029 QT_BEGIN_NAMESPACE 00030 class QPainter; 00031 class QPolygonF; 00032 class QSvgRenderer; 00033 QT_END_NAMESPACE 00034 00035 namespace KDChart { 00036 00037 class ThreeDLineAttributes; 00038 00044 class KDCHART_EXPORT LeveyJenningsDiagram : public LineDiagram 00045 { 00046 Q_OBJECT 00047 00048 Q_DISABLE_COPY( LeveyJenningsDiagram ) 00049 // KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * ) 00050 00051 KDCHART_DECLARE_DERIVED_DIAGRAM( LeveyJenningsDiagram, LeveyJenningsCoordinatePlane ) 00052 00053 00054 public: 00055 explicit LeveyJenningsDiagram( QWidget* parent = 0, LeveyJenningsCoordinatePlane* plane = 0 ); 00056 virtual ~LeveyJenningsDiagram(); 00057 00058 virtual LineDiagram * clone() const; 00059 00060 enum Symbol 00061 { 00062 OkDataPoint, 00063 NotOkDataPoint, 00064 LotChanged, 00065 SensorChanged, 00066 FluidicsPackChanged 00067 }; 00068 00072 bool compare( const LeveyJenningsDiagram* other ) const; 00073 00074 void setLotChangedSymbolPosition( Qt::Alignment pos ); 00075 Qt::Alignment lotChangedSymbolPosition() const; 00076 00077 void setFluidicsPackChangedSymbolPosition( Qt::Alignment pos ); 00078 Qt::Alignment fluidicsPackChangedSymbolPosition() const; 00079 00080 void setSensorChangedSymbolPosition( Qt::Alignment pos ); 00081 Qt::Alignment sensorChangedSymbolPosition() const; 00082 00083 void setExpectedMeanValue( float meanValue ); 00084 float expectedMeanValue() const; 00085 00086 void setExpectedStandardDeviation( float sd ); 00087 float expectedStandardDeviation() const; 00088 00089 float calculatedMeanValue() const; 00090 float calculatedStandardDeviation() const; 00091 00092 void setFluidicsPackChanges( const QVector< QDateTime >& changes ); 00093 QVector< QDateTime > fluidicsPackChanges() const; 00094 00095 void setSensorChanges( const QVector< QDateTime >& changes ); 00096 QVector< QDateTime > sensorChanges() const; 00097 00098 void setScanLinePen( const QPen& pen ); 00099 QPen scanLinePen() const; 00100 00101 void setSymbol( Symbol symbol, const QString& filename ); 00102 QString symbol( Symbol symbol ) const; 00103 00104 /* \reimpl */ 00105 void setModel( QAbstractItemModel* model ); 00106 00107 QPair< QDateTime, QDateTime > timeRange() const; 00108 void setTimeRange( const QPair< QDateTime, QDateTime >& timeRange ); 00109 00110 protected: 00111 void paint( PaintContext* paintContext ); 00112 void drawChanges( PaintContext* paintContext ); 00113 00114 virtual void drawDataPointSymbol( PaintContext* paintContext, const QPointF& pos, bool ok ); 00115 virtual void drawLotChangeSymbol( PaintContext* paintContext, const QPointF& pos ); 00116 virtual void drawSensorChangedSymbol( PaintContext* paintContext, const QPointF& pos ); 00117 virtual void drawFluidicsPackChangedSymbol( PaintContext* paintContext, const QPointF& pos ); 00118 00119 virtual QRectF iconRect() const; 00120 00121 QSvgRenderer* iconRenderer( Symbol symbol ); 00122 00124 const QPair<QPointF, QPointF> calculateDataBoundaries() const; 00125 00126 protected Q_SLOTS: 00127 void calculateMeanAndStandardDeviation() const; 00128 }; // End of class KDChartLineDiagram 00129 00130 } 00131 00132 #endif // KDCHARTLINEDIAGRAM_H