30 #ifndef ACTIVITYGRAPH_H
31 #define ACTIVITYGRAPH_H
34 #include <QtGui/QWindow>
35 #include <QtCore/QCoreApplication>
36 #include <QtGui/QPainter>
37 #include <QtGui/QGuiApplication>
38 #include <QtGui/QScreen>
39 #include <QBasicTimer>
40 #include <QMouseEvent>
43 #include <QtCore/qmath.h>
46 #include <QFontDatabase>
155 void paint(QPainter &painter);
179 void zoomIn(QDateTime start, QDateTime end);
203 void setMarkers(std::vector<GraphMarker> markers);
230 bool showmarkertexts;
232 bool marktomarkselection;
244 QDateTime startingtime;
249 QDateTime selectedtime;
272 double dataarray_activity[100];
273 double normarray_activity[100];
275 double dataarray_count[100];
276 double normarray_count[100];
284 bool pausepoint[100];
285 QDateTime pausetime[100];
293 std::string axistext[11];
325 std::vector<GraphMarker> marks;
332 QBrush background_brush;
333 QBrush areaselection_brush;
439 #endif // ACTIVITYGRAPH_H
void statisticsRequested(FrameTime start, FrameTime stop, int points)
Signal to be emitted when the graph wants data to be retrieved.
void sendAddNewMarkerNotify()
Sends a notify to parent of marker adding (when doubleclickin)
void changeFixed()
Sets parent's fixed time window -checkbox unchecked.
void resetGraph()
Resets the graph.
Definition: activitygraph.cpp:1297
Main class for Cavapa graphic curve display widget.
Definition: activitygraph.h:143
void mouseReleaseEvent(QMouseEvent *event)
Mouse release event of the graph.
Definition: activitygraph.cpp:954
void timerEvent(QTimerEvent *event)
Graph's own timer event to request data from parent.
Definition: activitygraph.cpp:1181
void setScrollBarSize(int size)
Sets scroll bar size.
QBrush selection
The graph selection color as QBrush, default = Qt::darkRed.
Definition: activitygraph.h:89
void setScrollRightActive(bool active)
Sets right slide button enabled or disabled.
void changeRTLabel(bool rt)
Changes the realtime label of parent.
QPen half_line
The default pen for horizontal half lines, etc.
Definition: activitygraph.h:124
void setTimeRelative(bool relative)
Changes time type between relative/absolute.
Definition: activitygraph.cpp:323
QPen def_pen
The default pen style for lines, etc.
Definition: activitygraph.h:110
QBrush background
The graph background color as QBrush, default = Qt::black.
Definition: activitygraph.h:84
void setFollowLatest(bool latest)
Sets the graph to follow only the latest data.
Definition: activitygraph.cpp:187
void showMarkerTexts(bool show)
Changes between showing/hiding marker texts without mouseover or selecting.
Definition: activitygraph.cpp:353
void showActivity(bool activity)
Changes between showing/hiding activity curve.
Definition: activitygraph.cpp:336
QDateTime getStartDateTime()
Gets the start time of the graph.
Definition: activitygraph.cpp:1274
void setPrinting()
Sets render function ready to print graph into image file.
Definition: activitygraph.cpp:1204
ActivityGraph(QWidget *parent=0)
Creates and initializes the graph.
Definition: activitygraph.cpp:38
void setStartTime(QDateTime time)
Gets the graph region starttime from the timeEdit of parent.
Definition: activitygraph.cpp:200
void normalizedata()
Normalizes input data arrays into normalized arrays.
Definition: activitygraph.cpp:1138
void setCurrentPosition(QDateTime point)
Sets the current selection to time point.
Definition: activitygraph.cpp:1322
void setNewSettings(GraphSettings settings)
Gets new settings for font, colors and line widths.
Definition: activitygraph.cpp:1212
FrameTime start
The start point of the region.
Definition: activitygraph.h:62
QPen text_selection
The default pen for text selection, etc.
Definition: activitygraph.h:117
void sendSelectedPoint(QDateTime point)
Sends QDateTime of selected position.
void changeAbsoluteEnabled(bool ae)
Sets absolute radio button enabled or disabled.
void removeSelectedMarker()
Removes the selected time marker (if an active marker is selected).
Definition: activitygraph.cpp:778
void setZoomOutActive(bool active)
Sets zoom out button enabled or disabled.
void showCount(bool count)
Changes between showing/hiding count curve.
Definition: activitygraph.cpp:344
Struct for one region of the graph.
Definition: activitygraph.h:58
void zoomOut()
Zooms graph out.
Definition: activitygraph.cpp:118
int linewidth
The line width for curves.
Definition: activitygraph.h:129
void setStartDateTime(QDateTime start)
Sets start datetime for the graph.
Definition: activitygraph.cpp:1306
void setMarkers(std::vector< GraphMarker > markers)
Sets the markers from parent.
Definition: activitygraph.cpp:1257
QDateTime FrameTimetoQDateTime(FrameTime ftime)
Changes FrameTime into QDateTime according the beginframe.
Definition: activitygraph.cpp:1243
std::uint64_t FrameTime
Used to store milliseconds interval in frame times.
Definition: common.h:138
Graph settings type for font/colors/line widths.
Definition: activitygraph.h:75
void paintEvent(QPaintEvent *event)
Qt paint event for drawing the graph.
Definition: activitygraph.cpp:361
QPen activity_curve
The activity curve style as QPen, default = QPen(Qt::magenta, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); Change only the first two parameters (color and width).
Definition: activitygraph.h:96
void scrollLeft()
Scrolls graph left.
Definition: activitygraph.cpp:283
void addMarker(std::string text)
Adds new marker to the selected position.
Definition: activitygraph.cpp:766
void mouseDoubleClickEvent(QMouseEvent *event)
Double-clicking the graph notifies the parent to add new marker.
Definition: activitygraph.cpp:1006
FrameTime end
The end point of the region.
Definition: activitygraph.h:67
void zoomIn(QDateTime start, QDateTime end)
Zooms graph in.
Definition: activitygraph.cpp:143
void setZoomInActive(bool active)
Sets zoom in button enabled or disabled.
GraphRegion sendGraphRegion()
Sends graph selection start and end positions.
Definition: activitygraph.cpp:1126
FrameTime getStartFrame()
Gets the first frame of the graph.
Definition: activitygraph.cpp:1290
void markerChanged()
Informs the parent of marker adding.
void setScrollLeftActive(bool active)
Sets left slide button enabled or disabled.
QPen count_curve
The count curve style as QPen, default = QPen(Qt::cyan, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); Change only the first two parameters (color and width).
Definition: activitygraph.h:103
void sendScrollPosition(int position)
Sends correct scroll bar position when zooming in/out.
QDateTime getSelectedTimePoint()
Gets the time point of currently selected frame.
Definition: activitygraph.cpp:1314
void sendTimeArea(QDateTime start, QDateTime end)
Sends Selection start and end time points.
void mousePressEvent(QMouseEvent *event)
Mouse Press event of the graph.
Definition: activitygraph.cpp:793
FrameTime QDateTimeToFrameTime(QDateTime time)
Changes QDateTime to FrameTime according the starting time of calculation.
Definition: activitygraph.cpp:1229
void scrollMouse(int position)
Scrolls zoomed graph area with scrollbar/mouse.
Definition: activitygraph.cpp:245
void scrollRight()
Scrolls graph right.
Definition: activitygraph.cpp:307
void mouseMoveEvent(QMouseEvent *event)
Mouse move event of the graph.
Definition: activitygraph.cpp:857
void setLatestLength(QTime length)
Sets the length of latest-data mode.
Definition: activitygraph.cpp:1171
void updateStatistics(const std::vector< FrameStats > &stats)
Updates the graph with new statistics.
Definition: activitygraph.cpp:1015
QFont font
The graph text font as QFont, default = "Arial".
Definition: activitygraph.h:79
void setEndTime(QDateTime time)
Gets graph region endtime from timeEdit of parent.
Definition: activitygraph.cpp:222
std::vector< GraphMarker > getMarkers()
Gets markers from the graph.
Definition: activitygraph.cpp:1265
void sendFrameTimePosition(FrameTime position)
Sends frametime of the selection position.
void paint(QPainter &painter)
Draws the graph.
Definition: activitygraph.cpp:376