![]() |
OGS
|
|
A List of data points and all the necessary meta-information to draw a graph.
Definition at line 17 of file DiagramList.h.
#include <DiagramList.h>
Public Member Functions | |
| DiagramList () | |
| Constructor containing an empty list. | |
| ~DiagramList () | |
| QColor | getColor () const |
| Returns the colour of the graph. | |
| float | height () const |
| Returns the height of the bounding box of all data points within the list. | |
| float | minXValue () const |
| Returns the minimum x-value. | |
| float | maxXValue () const |
| Returns the maximum x-value. | |
| float | minYValue () const |
| Returns the minimum y-value. | |
| float | maxYValue () const |
| Returns the maximum y-value. | |
| const QDateTime | getStartDate () const |
| Returns the start date of this list. | |
| QString | getName () const |
| Returns the name of the diagram. | |
| bool | getPath (QPainterPath &path, float scaleX, float scaleY) |
| bool | getPoint (QPointF &p, std::size_t i) |
| QString | getXLabel () const |
| Returns the label associated with the x-axis. | |
| QString | getYLabel () const |
| Returns the label associated with the y-axis. | |
| QString | getXUnit () const |
| Returns the unit associated with the x-axis. | |
| QString | getYUnit () const |
| Returns the unit associated with the y-axis. | |
| void | setColor (QColor c) |
| Sets the colour of the graph. | |
| void | setName (QString name) |
| Sets the name of the graph to be displayed in the caption. | |
| void | addNextPoint (float x, float y) |
| Adds a point at (x,y) to the list. | |
| void | truncateToRange (QDateTime const &start, QDateTime const &end) |
| cut list entries not within the given range | |
| void | setStartDate (QDateTime date) |
| Sets the start date (i.e. the min-value of the x-axis). | |
| void | setXLabel (QString label) |
| Specifies the meaning of the x Axis. | |
| void | setYLabel (QString label) |
| Specifies the meaning of the y Axis. | |
| void | setList (std::vector< std::pair< float, float > > const &coords) |
| void | setList (std::vector< std::pair< QDateTime, float > > const &coords) |
| void | setXUnit (QString unit) |
| Specifies the unit of the x Axis. | |
| void | setYUnit (QString unit) |
| Specifies the unit of the y Axis. | |
| std::size_t | size () const |
| Returns the number of data points. | |
| double | width () const |
| Returns the width of the bounding box of all data points within the list. | |
Static Public Member Functions | |
| static int | readList (const QString &path, std::vector< DiagramList * > &list) |
| static int | readList (const SensorData *data, std::vector< DiagramList * > &list) |
Private Member Functions | |
| float | calcMinXValue () |
| Returns the minimum x-value of all the data points. | |
| float | calcMaxXValue () |
| Returns the maximum x-value of all the data points. | |
| float | calcMinYValue () |
| Returns the minimum y-value of all the data points. | |
| float | calcMaxYValue () |
| Returns the maximum y-value of all the data points. | |
| int | readLine (std::ifstream inFile, QDateTime &cDate, float &cValue) |
| void | update () |
| Updates the bounds of the data points contained in the list. | |
Private Attributes | |
| float | _maxX {0} |
| float | _maxY {0} |
| float | _minX {0} |
| float | _minY {0} |
| std::vector< std::pair< float, float > > | _coords |
| QString | _name |
| QString | _xLabel |
| QString | _yLabel |
| QString | _xUnit |
| QString | _yUnit |
| QColor | _colour |
| QDateTime | _startDate |
| DiagramList::DiagramList | ( | ) |
Constructor containing an empty list.
Definition at line 16 of file DiagramList.cpp.
References _xLabel, _xUnit, _yLabel, and _yUnit.
Referenced by readList(), and readList().
|
default |
|
inline |
Adds a point at (x,y) to the list.
Definition at line 98 of file DiagramList.h.
References _coords.
|
private |
Returns the maximum x-value of all the data points.
Definition at line 32 of file DiagramList.cpp.
References _coords.
Referenced by update().
|
private |
Returns the maximum y-value of all the data points.
Definition at line 60 of file DiagramList.cpp.
References _coords.
Referenced by update().
|
private |
Returns the minimum x-value of all the data points.
Definition at line 20 of file DiagramList.cpp.
References _coords.
Referenced by update().
|
private |
Returns the minimum y-value of all the data points.
Definition at line 46 of file DiagramList.cpp.
References _coords.
Referenced by update().
|
inline |
Returns the colour of the graph.
Definition at line 25 of file DiagramList.h.
References _colour.
Referenced by DiagramScene::drawGraph().
|
inline |
Returns the name of the diagram.
Definition at line 46 of file DiagramList.h.
References _name.
Referenced by DiagramScene::drawGraph().
| bool DiagramList::getPath | ( | QPainterPath & | path, |
| float | scaleX, | ||
| float | scaleY ) |
Returns all the data points in form of a QPainterPath in scene coordinates. The order of the points is the same as in the vector of coordinates.
| path | The path containing all data points. |
| scaleX | Scaling factor in x-direction. |
| scaleY | Scaling factor in y-direction. |
Definition at line 74 of file DiagramList.cpp.
References _coords, and getPoint().
Referenced by DiagramScene::drawGraph().
| bool DiagramList::getPoint | ( | QPointF & | p, |
| std::size_t | i ) |
Returns the position of one point in the vector of coordinates.
| p | The point-object that will be returned. |
| i | Number of the point to be returned. |
Definition at line 94 of file DiagramList.cpp.
References _coords.
Referenced by getPath().
|
inline |
Returns the start date of this list.
Definition at line 43 of file DiagramList.h.
References _startDate.
Referenced by DiagramScene::setDiagramBoundaries().
|
inline |
Returns the label associated with the x-axis.
Definition at line 67 of file DiagramList.h.
References _xLabel.
Referenced by DiagramScene::addGraph().
|
inline |
Returns the unit associated with the x-axis.
Definition at line 73 of file DiagramList.h.
References _xUnit.
Referenced by DiagramScene::addGraph().
|
inline |
Returns the label associated with the y-axis.
Definition at line 70 of file DiagramList.h.
References _yLabel.
Referenced by DiagramScene::addGraph().
|
inline |
Returns the unit associated with the y-axis.
Definition at line 76 of file DiagramList.h.
References _yUnit.
Referenced by DiagramScene::addGraph().
|
inline |
Returns the height of the bounding box of all data points within the list.
Definition at line 28 of file DiagramList.h.
|
inline |
Returns the maximum x-value.
Definition at line 34 of file DiagramList.h.
References _maxX.
Referenced by DiagramScene::setDiagramBoundaries().
|
inline |
Returns the maximum y-value.
Definition at line 40 of file DiagramList.h.
References _maxY.
Referenced by DiagramScene::setDiagramBoundaries().
|
inline |
Returns the minimum x-value.
Definition at line 31 of file DiagramList.h.
References _minX.
Referenced by DiagramScene::setDiagramBoundaries().
|
inline |
Returns the minimum y-value.
Definition at line 37 of file DiagramList.h.
References _minY.
Referenced by DiagramScene::drawGraph(), and DiagramScene::setDiagramBoundaries().
|
private |
Reads an ASCII file containing the coordinates in the following format: date (tab) value where 'date' is given as 'dd.mm.yyyy'. (Changes to that format are easily implemented using QTimeDate)
|
static |
Reads information from a file. The reader assumes that values in the file are separated by tabstops. Also, the first row should contain identifiers for the values and the first column should contain timestamps. Currently accepted timestamps are of the following formats: "dd.mm.yyyy" "dd.mm.yyyy.hh.mm.ss" (this is the timestamp format used for the UFZ database) For each column after the timestamps a new diagram list is created.
Definition at line 146 of file DiagramList.cpp.
References DiagramList(), getDateTime(), BaseLib::replaceString(), and WARN().
Referenced by DetailWindow::DetailWindow(), DiagramPrefsDialog::DiagramPrefsDialog(), and DiagramPrefsDialog::loadFile().
|
static |
Definition at line 237 of file DiagramList.cpp.
References DiagramList(), SensorData::convertSensorDataType2String(), getDateTime(), SensorData::getEndTime(), SensorData::getStartTime(), SensorData::getStepSize(), SensorData::getTimeSeries(), SensorData::getTimeSeriesNames(), SensorData::getTimeSteps(), and BaseLib::int2date().
|
inline |
Sets the colour of the graph.
Definition at line 92 of file DiagramList.h.
References _colour.
Referenced by DetailWindow::addList().
| void DiagramList::setList | ( | std::vector< std::pair< float, float > > const & | coords | ) |
Sets the list of x/y-coordinates.
| coords | List of coordinates. |
Definition at line 365 of file DiagramList.cpp.
References _coords, _startDate, and update().
| void DiagramList::setList | ( | std::vector< std::pair< QDateTime, float > > const & | coords | ) |
Sets the list of x/y-coordinates. Note: This function converts QDateTime values to float values of the number of days from the first date (which is set as day 0)
| coords | List of coordinates. |
Definition at line 345 of file DiagramList.cpp.
References _coords, _startDate, and update().
|
inline |
Sets the name of the graph to be displayed in the caption.
Definition at line 95 of file DiagramList.h.
References _name.
Referenced by DiagramPrefsDialog::loadList().
|
inline |
Sets the start date (i.e. the min-value of the x-axis).
Definition at line 104 of file DiagramList.h.
References _startDate.
|
inline |
Specifies the meaning of the x Axis.
Definition at line 107 of file DiagramList.h.
References _xLabel.
|
inline |
Specifies the unit of the x Axis.
Definition at line 127 of file DiagramList.h.
References _xUnit.
|
inline |
Specifies the meaning of the y Axis.
Definition at line 110 of file DiagramList.h.
References _yLabel.
|
inline |
Specifies the unit of the y Axis.
Definition at line 130 of file DiagramList.h.
References _yUnit.
| std::size_t DiagramList::size | ( | ) | const |
Returns the number of data points.
Definition at line 377 of file DiagramList.cpp.
References _coords.
| void DiagramList::truncateToRange | ( | QDateTime const & | start, |
| QDateTime const & | end ) |
cut list entries not within the given range
Definition at line 314 of file DiagramList.cpp.
References _coords, _startDate, and update().
|
private |
Updates the bounds of the data points contained in the list.
Definition at line 382 of file DiagramList.cpp.
References _maxX, _maxY, _minX, _minY, calcMaxXValue(), calcMaxYValue(), calcMinXValue(), and calcMinYValue().
Referenced by setList(), setList(), and truncateToRange().
|
inline |
|
private |
Definition at line 173 of file DiagramList.h.
Referenced by getColor(), and setColor().
|
private |
Definition at line 167 of file DiagramList.h.
Referenced by addNextPoint(), calcMaxXValue(), calcMaxYValue(), calcMinXValue(), calcMinYValue(), getPath(), getPoint(), setList(), setList(), size(), and truncateToRange().
|
private |
Definition at line 163 of file DiagramList.h.
Referenced by maxXValue(), update(), and width().
|
private |
Definition at line 164 of file DiagramList.h.
Referenced by height(), maxYValue(), and update().
|
private |
Definition at line 165 of file DiagramList.h.
Referenced by minXValue(), update(), and width().
|
private |
Definition at line 166 of file DiagramList.h.
Referenced by height(), minYValue(), and update().
|
private |
Definition at line 168 of file DiagramList.h.
|
private |
Definition at line 174 of file DiagramList.h.
Referenced by getStartDate(), setList(), setList(), setStartDate(), and truncateToRange().
|
private |
Definition at line 169 of file DiagramList.h.
Referenced by DiagramList(), getXLabel(), and setXLabel().
|
private |
Definition at line 171 of file DiagramList.h.
Referenced by DiagramList(), getXUnit(), and setXUnit().
|
private |
Definition at line 170 of file DiagramList.h.
Referenced by DiagramList(), getYLabel(), and setYLabel().
|
private |
Definition at line 172 of file DiagramList.h.
Referenced by DiagramList(), getYUnit(), and setYUnit().