KChart

KChartLeveyJenningsDiagram.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KCHARTLEVEYJENNINGSDIAGRAM_H
10#define KCHARTLEVEYJENNINGSDIAGRAM_H
11
12#include "KChartLineDiagram.h"
13#include "KChartLeveyJenningsCoordinatePlane.h"
14
15QT_BEGIN_NAMESPACE
16class QPainter;
17class QPolygonF;
18class QSvgRenderer;
19QT_END_NAMESPACE
20
21namespace KChart {
22
24
25/**
26 * @brief LeveyDiagram defines a Levey Jennings chart.
27 *
28 * It provides different subtypes which are set using \a setType.
29 */
30class KCHART_EXPORT LeveyJenningsDiagram : public LineDiagram
31{
33
34 Q_DISABLE_COPY( LeveyJenningsDiagram )
35// KCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * )
36
37 KCHART_DECLARE_DERIVED_DIAGRAM( LeveyJenningsDiagram, LeveyJenningsCoordinatePlane )
38
39
40public:
41 explicit LeveyJenningsDiagram( QWidget* parent = nullptr, LeveyJenningsCoordinatePlane* plane = nullptr );
42 ~LeveyJenningsDiagram() override;
43
44
45 /**
46 * Creates an exact copy of this diagram.
47 */
48 LineDiagram * clone() const override;
49
50 enum Symbol
51 {
52 OkDataPoint,
53 NotOkDataPoint,
54 LotChanged,
55 SensorChanged,
56 FluidicsPackChanged
57 };
58
59 /**
60 * Returns true if both diagrams have the same settings.
61 */
62 bool compare( const LeveyJenningsDiagram* other ) const;
63
64
65 /**
66 * Sets the position of the lot change symbol to \a pos.
67 * Valid values are: Qt::AlignTop (default), Qt::AlignBottom.
68 */
70
71 /**
72 * Returns the position of the lot change symbol.
73 */
75
76
77 /**
78 * Sets the position of the fluidics pack changed symbol to \a pos.
79 * Valid values are: Qt::AlignBottom (default), Qt::AlignTop.
80 */
82
83 /**
84 * Returns the position of the fluidics pack changed symbol.
85 */
87
88
89 /**
90 * Sets the position of the sensor changed symbol to \a pos.
91 * Valid values are: Qt::AlignBottom (default), Qt::AlignTop.
92 */
94
95 /**
96 * Returns the position of the sensor changed symbol.
97 */
99
100
101 /**
102 * Sets the expected mean value over all QC values to \a meanValue.
103 */
104 void setExpectedMeanValue( float meanValue );
105
106 /**
107 * Returns the expected mean values over all QC values.
108 */
109 float expectedMeanValue() const;
110
111
112 /**
113 * Sets the expected standard deviaction over all QC values to \a sd.
114 */
115 void setExpectedStandardDeviation( float sd );
116
117 /**
118 * Returns the expected standard deviation over all QC values.
119 */
120 float expectedStandardDeviation() const;
121
122
123 /**
124 * Returns the calculated mean values over all QC values.
125 */
126 float calculatedMeanValue() const;
127
128 /**
129 * Returns the calculated standard deviation over all QC values.
130 */
131 float calculatedStandardDeviation() const;
132
133
134 /**
135 * Sets the date/time of all fluidics pack changes to \a changes.
136 */
137 void setFluidicsPackChanges( const QVector< QDateTime >& changes );
138
139 /**
140 * Returns the list of all fluidics pack changes.
141 */
143
144
145 /**
146 * Sets the date/time of all sensor changes to \a changes.
147 */
148 void setSensorChanges( const QVector< QDateTime >& changes );
149
150 /**
151 * Returns the list of all sensor changes.
152 */
154
155
156 /**
157 * Sets the pen used for drawing the scan line to \a pen
158 */
159 void setScanLinePen( const QPen& pen );
160
161 /**
162 * Returns the pen being used for drawing the scan line.
163 */
164 QPen scanLinePen() const;
165
166
167 /**
168 * Sets the symbol being used for \a symbol to a SVG file \a filename.
169 */
170 void setSymbol( Symbol symbol, const QString& filename );
171
172 /**
173 * Returns the SVG file name usef for \a symbol
174 */
175 QString symbol( Symbol symbol ) const;
176
177 /* \reimpl */
178 void setModel( QAbstractItemModel* model ) override;
179
180
181 /**
182 * Returns the timerange of the diagram's data.
183 */
184 QPair< QDateTime, QDateTime > timeRange() const;
185
186 /**
187 * Sets the \a timeRange visible on the x axis. Set it to QPair< QDateTime, QDateTime >()
188 * to use the default auto calculation.
189 */
190 void setTimeRange( const QPair< QDateTime, QDateTime >& timeRange );
191
192protected:
193
194 /** \reimpl */
195 void paint( PaintContext* paintContext ) override;
196
197 /**
198 * Draws the fluidics pack and sensor changed symbols.
199 */
200 void drawChanges( PaintContext* paintContext );
201
202
203 /**
204 * Draws a data point symbol for the data point at \a pos.
205 * @param ok True, when the data point is ok, false otherwise (different symbol)
206 * @param ctx The PaintContext being used
207 * @param pos Position
208 * @param ok Draw as Ok or notOK data point
209 */
210 virtual void drawDataPointSymbol( PaintContext* paintContext, const QPointF& pos, bool ok );
211
212 /**
213 * Draws a lot changed symbol for the data point at \a pos.
214 * @param ctx The PaintContext being used
215 * @param pos Position
216 * \sa lotChangedSymbolPosition
217 */
218 virtual void drawLotChangeSymbol( PaintContext* paintContext, const QPointF& pos );
219
220 /**
221 * Draws a sensor changed symbol for the data point at \a pos.
222 * @param ctx The PaintContext being used
223 * @param pos Position
224 * \sa sensorChangedSymbolPosition
225 */
226 virtual void drawSensorChangedSymbol( PaintContext* paintContext, const QPointF& pos );
227
228 /**
229 * Draws a fluidics pack changed symbol for the data point at \a pos.
230 * @param ctx The PaintContext being used
231 * @param pos Position
232 * \sa fluidicsPackChangedSymbolPosition
233 */
234 virtual void drawFluidicsPackChangedSymbol( PaintContext* paintContext, const QPointF& pos );
235
236
237 /**
238 * Returns the rectangle being used for drawing the icons
239 */
240 virtual QRectF iconRect() const;
241
242
243 /**
244 * Returns the SVG icon renderer for \a symbol
245 */
247
248 /* \reimpl */
249
250 /** \reimpl */
251 const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
252
253protected Q_SLOTS:
254 void calculateMeanAndStandardDeviation() const;
255}; // End of class KChartLineDiagram
256
257}
258
259#endif // KCHARTLINEDIAGRAM_H
QPen pen() const
Retrieve the pen to be used for painting datapoints globally.
Levey Jennings coordinate plane This is actually nothing real more than a plain cartesian coordinate ...
QPen scanLinePen() const
Returns the pen being used for drawing the scan line.
void setScanLinePen(const QPen &pen)
Sets the pen used for drawing the scan line to pen.
void setExpectedMeanValue(float meanValue)
Sets the expected mean value over all QC values to meanValue.
void setLotChangedSymbolPosition(Qt::Alignment pos)
Sets the position of the lot change symbol to pos.
void setFluidicsPackChanges(const QVector< QDateTime > &changes)
Sets the date/time of all fluidics pack changes to changes.
void drawChanges(PaintContext *paintContext)
Draws the fluidics pack and sensor changed symbols.
void setFluidicsPackChangedSymbolPosition(Qt::Alignment pos)
Sets the position of the fluidics pack changed symbol to pos.
void setExpectedStandardDeviation(float sd)
Sets the expected standard deviaction over all QC values to sd.
QVector< QDateTime > fluidicsPackChanges() const
Returns the list of all fluidics pack changes.
float expectedStandardDeviation() const
Returns the expected standard deviation over all QC values.
float calculatedStandardDeviation() const
Returns the calculated standard deviation over all QC values.
QVector< QDateTime > sensorChanges() const
Returns the list of all sensor changes.
float expectedMeanValue() const
Returns the expected mean values over all QC values.
QString symbol(Symbol symbol) const
Returns the SVG file name usef for symbol.
Qt::Alignment sensorChangedSymbolPosition() const
Returns the position of the sensor changed symbol.
Qt::Alignment fluidicsPackChangedSymbolPosition() const
Returns the position of the fluidics pack changed symbol.
float calculatedMeanValue() const
Returns the calculated mean values over all QC values.
void paint(PaintContext *paintContext) override
\reimpl
virtual void drawDataPointSymbol(PaintContext *paintContext, const QPointF &pos, bool ok)
Draws a data point symbol for the data point at pos.
virtual void drawFluidicsPackChangedSymbol(PaintContext *paintContext, const QPointF &pos)
Draws a fluidics pack changed symbol for the data point at pos.
LineDiagram * clone() const override
Creates an exact copy of this diagram.
void setSymbol(Symbol symbol, const QString &filename)
Sets the symbol being used for symbol to a SVG file filename.
void setSensorChangedSymbolPosition(Qt::Alignment pos)
Sets the position of the sensor changed symbol to pos.
QPair< QDateTime, QDateTime > timeRange() const
Returns the timerange of the diagram's data.
virtual QRectF iconRect() const
Returns the rectangle being used for drawing the icons.
QSvgRenderer * iconRenderer(Symbol symbol)
Returns the SVG icon renderer for symbol.
void setTimeRange(const QPair< QDateTime, QDateTime > &timeRange)
Sets the timeRange visible on the x axis.
bool compare(const LeveyJenningsDiagram *other) const
Returns true if both diagrams have the same settings.
Qt::Alignment lotChangedSymbolPosition() const
Returns the position of the lot change symbol.
const QPair< QPointF, QPointF > calculateDataBoundaries() const override
\reimpl
void setSensorChanges(const QVector< QDateTime > &changes)
Sets the date/time of all sensor changes to changes.
virtual void drawSensorChangedSymbol(PaintContext *paintContext, const QPointF &pos)
Draws a sensor changed symbol for the data point at pos.
virtual void drawLotChangeSymbol(PaintContext *paintContext, const QPointF &pos)
Draws a lot changed symbol for the data point at pos.
Stores information about painting diagrams.
QAbstractItemModel * model() const const
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
typedef Alignment
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:56:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.