00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef KDCHARTLEVEYJENNINGSDIAGRAM_H
00031 #define KDCHARTLEVEYJENNINGSDIAGRAM_H
00032
00033 #include "../KDChartLineDiagram.h"
00034 #include "KDChartLeveyJenningsCoordinatePlane.h"
00035
00036 class QPainter;
00037 class QPolygonF;
00038 class QSvgRenderer;
00039
00040 namespace KDChart {
00041
00042 class ThreeDLineAttributes;
00043
00049 class KDCHART_EXPORT LeveyJenningsDiagram : public LineDiagram
00050 {
00051 Q_OBJECT
00052
00053 Q_DISABLE_COPY( LeveyJenningsDiagram )
00054
00055
00056 KDCHART_DECLARE_DERIVED_DIAGRAM( LeveyJenningsDiagram, LeveyJenningsCoordinatePlane )
00057
00058
00059 public:
00060 explicit LeveyJenningsDiagram( QWidget* parent = 0, LeveyJenningsCoordinatePlane* plane = 0 );
00061 virtual ~LeveyJenningsDiagram();
00062
00063 virtual LineDiagram * clone() const;
00064
00065 enum Symbol
00066 {
00067 OkDataPoint,
00068 NotOkDataPoint,
00069 LotChanged,
00070 SensorChanged,
00071 FluidicsPackChanged
00072 };
00073
00077 bool compare( const LeveyJenningsDiagram* other ) const;
00078
00079 void setLotChangedSymbolPosition( Qt::Alignment pos );
00080 Qt::Alignment lotChangedSymbolPosition() const;
00081
00082 void setFluidicsPackChangedSymbolPosition( Qt::Alignment pos );
00083 Qt::Alignment fluidicsPackChangedSymbolPosition() const;
00084
00085 void setSensorChangedSymbolPosition( Qt::Alignment pos );
00086 Qt::Alignment sensorChangedSymbolPosition() const;
00087
00088 void setExpectedMeanValue( float meanValue );
00089 float expectedMeanValue() const;
00090
00091 void setExpectedStandardDeviation( float sd );
00092 float expectedStandardDeviation() const;
00093
00094 float calculatedMeanValue() const;
00095 float calculatedStandardDeviation() const;
00096
00097 void setFluidicsPackChanges( const QVector< QDateTime >& changes );
00098 QVector< QDateTime > fluidicsPackChanges() const;
00099
00100 void setSensorChanges( const QVector< QDateTime >& changes );
00101 QVector< QDateTime > sensorChanges() const;
00102
00103 void setScanLinePen( const QPen& pen );
00104 QPen scanLinePen() const;
00105
00106 void setSymbol( Symbol symbol, const QString& filename );
00107 QString symbol( Symbol symbol ) const;
00108
00109
00110 void setModel( QAbstractItemModel* model );
00111
00112 QPair< QDateTime, QDateTime > timeRange() const;
00113 void setTimeRange( const QPair< QDateTime, QDateTime >& timeRange );
00114
00115 protected:
00116 void paint( PaintContext* paintContext );
00117 void drawChanges( PaintContext* paintContext );
00118
00119 virtual void drawDataPointSymbol( PaintContext* paintContext, const QPointF& pos, bool ok );
00120 virtual void drawLotChangeSymbol( PaintContext* paintContext, const QPointF& pos );
00121 virtual void drawSensorChangedSymbol( PaintContext* paintContext, const QPointF& pos );
00122 virtual void drawFluidicsPackChangedSymbol( PaintContext* paintContext, const QPointF& pos );
00123
00124 virtual QRectF iconRect() const;
00125
00126 QSvgRenderer* iconRenderer( Symbol symbol );
00127
00129 const QPair<QPointF, QPointF> calculateDataBoundaries() const;
00130
00131 protected Q_SLOTS:
00132 void calculateMeanAndStandardDeviation() const;
00133 };
00134
00135 }
00136
00137 #endif // KDCHARTLINEDIAGRAM_H