Main class for Cavapa graphic curve display widget. More...
#include <activitygraph.h>
Public Slots | |
void | zoomIn (QDateTime start, QDateTime end) |
Zooms graph in. | |
void | zoomOut () |
Zooms graph out. | |
void | scrollLeft () |
Scrolls graph left. | |
void | scrollRight () |
Scrolls graph right. | |
void | scrollMouse (int position) |
Scrolls zoomed graph area with scrollbar/mouse. More... | |
void | setStartTime (QDateTime time) |
Gets the graph region starttime from the timeEdit of parent. More... | |
void | setEndTime (QDateTime time) |
Gets graph region endtime from timeEdit of parent. More... | |
void | setTimeRelative (bool relative) |
Changes time type between relative/absolute. More... | |
void | showActivity (bool activity) |
Changes between showing/hiding activity curve. More... | |
void | showCount (bool count) |
Changes between showing/hiding count curve. More... | |
void | showMarkerTexts (bool show) |
Changes between showing/hiding marker texts without mouseover or selecting. More... | |
void | addMarker (std::string text) |
Adds new marker to the selected position. More... | |
void | removeSelectedMarker () |
Removes the selected time marker (if an active marker is selected). | |
void | setFollowLatest (bool latest) |
Sets the graph to follow only the latest data. More... | |
void | setLatestLength (QTime length) |
Sets the length of latest-data mode. More... | |
void | setNewSettings (GraphSettings settings) |
Gets new settings for font, colors and line widths. More... | |
void | setMarkers (std::vector< GraphMarker > markers) |
Sets the markers from parent. More... | |
void | setStartDateTime (QDateTime start) |
Sets start datetime for the graph. More... | |
void | setCurrentPosition (QDateTime point) |
Sets the current selection to time point. More... | |
Signals | |
void | statisticsRequested (FrameTime start, FrameTime stop, int points) |
Signal to be emitted when the graph wants data to be retrieved. More... | |
void | sendTimeArea (QDateTime start, QDateTime end) |
Sends Selection start and end time points. More... | |
void | sendFrameTimePosition (FrameTime position) |
Sends frametime of the selection position. More... | |
void | sendScrollPosition (int position) |
Sends correct scroll bar position when zooming in/out. More... | |
void | changeRTLabel (bool rt) |
Changes the realtime label of parent. More... | |
void | changeAbsoluteEnabled (bool ae) |
Sets absolute radio button enabled or disabled. More... | |
void | changeFixed () |
Sets parent's fixed time window -checkbox unchecked. | |
void | sendSelectedPoint (QDateTime point) |
Sends QDateTime of selected position. More... | |
void | sendAddNewMarkerNotify () |
Sends a notify to parent of marker adding (when doubleclickin) | |
void | setZoomInActive (bool active) |
Sets zoom in button enabled or disabled. More... | |
void | setZoomOutActive (bool active) |
Sets zoom out button enabled or disabled. More... | |
void | setScrollLeftActive (bool active) |
Sets left slide button enabled or disabled. More... | |
void | setScrollRightActive (bool active) |
Sets right slide button enabled or disabled. More... | |
void | setScrollBarSize (int size) |
Sets scroll bar size. More... | |
void | markerChanged () |
Informs the parent of marker adding. | |
Public Member Functions | |
ActivityGraph (QWidget *parent=0) | |
Creates and initializes the graph. More... | |
GraphRegion | sendGraphRegion () |
Sends graph selection start and end positions. More... | |
void | setPrinting () |
Sets render function ready to print graph into image file. | |
void | paint (QPainter &painter) |
Draws the graph. More... | |
void | updateStatistics (const std::vector< FrameStats > &stats) |
Updates the graph with new statistics. More... | |
void | resetGraph () |
Resets the graph. | |
FrameTime | QDateTimeToFrameTime (QDateTime time) |
Changes QDateTime to FrameTime according the starting time of calculation. More... | |
QDateTime | FrameTimetoQDateTime (FrameTime ftime) |
Changes FrameTime into QDateTime according the beginframe. More... | |
std::vector< GraphMarker > | getMarkers () |
Gets markers from the graph. More... | |
QDateTime | getStartDateTime () |
Gets the start time of the graph. More... | |
FrameTime | getStartFrame () |
Gets the first frame of the graph. More... | |
QDateTime | getSelectedTimePoint () |
Gets the time point of currently selected frame. More... | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) |
Qt paint event for drawing the graph. More... | |
void | mousePressEvent (QMouseEvent *event) |
Mouse Press event of the graph. More... | |
void | mouseReleaseEvent (QMouseEvent *event) |
Mouse release event of the graph. More... | |
void | mouseMoveEvent (QMouseEvent *event) |
Mouse move event of the graph. More... | |
void | mouseDoubleClickEvent (QMouseEvent *event) |
Double-clicking the graph notifies the parent to add new marker. More... | |
void | timerEvent (QTimerEvent *event) |
Graph's own timer event to request data from parent. More... | |
void | normalizedata () |
Normalizes input data arrays into normalized arrays. | |
Main class for Cavapa graphic curve display widget.
Qt widget that normalizes and presents the data, allows mouse actions for data interaction like selection zooming. It also presents markers for time events and timestamps for frame time position.
cavapa_gui::ActivityGraph::ActivityGraph | ( | QWidget * | parent = 0 | ) |
Creates and initializes the graph.
parent | The parent widget. |
|
slot |
Adds new marker to the selected position.
text | Text for new marker. |
|
signal |
Sets absolute radio button enabled or disabled.
ae | True/false for if enabled or not. |
|
signal |
Changes the realtime label of parent.
rt | True/false for if drawing "Realtime" or not. |
QDateTime cavapa_gui::ActivityGraph::FrameTimetoQDateTime | ( | FrameTime | ftime | ) |
Changes FrameTime into QDateTime according the beginframe.
ftime | FrameTime point. |
std::vector< GraphMarker > cavapa_gui::ActivityGraph::getMarkers | ( | ) |
Gets markers from the graph.
QDateTime cavapa_gui::ActivityGraph::getSelectedTimePoint | ( | ) |
Gets the time point of currently selected frame.
QDateTime cavapa_gui::ActivityGraph::getStartDateTime | ( | ) |
Gets the start time of the graph.
FrameTime cavapa_gui::ActivityGraph::getStartFrame | ( | ) |
Gets the first frame of the graph.
|
protected |
Double-clicking the graph notifies the parent to add new marker.
event | Qt default mouse event. |
|
protected |
Mouse move event of the graph.
Defines selected area.
event | Qt default mouse event. |
|
protected |
Mouse Press event of the graph.
Defines selected point.
event | Qt default mouse event. |
|
protected |
Mouse release event of the graph.
event | Qt default mouse event. |
void cavapa_gui::ActivityGraph::paint | ( | QPainter & | painter | ) |
Draws the graph.
painter | QPainter to do the drawing. |
|
protected |
Qt paint event for drawing the graph.
event | Qt default paint event. |
FrameTime cavapa_gui::ActivityGraph::QDateTimeToFrameTime | ( | QDateTime | time | ) |
Changes QDateTime to FrameTime according the starting time of calculation.
time | QDateTime point. |
|
slot |
Scrolls zoomed graph area with scrollbar/mouse.
position | The relative position of the view area, between 0 and 100. |
|
signal |
Sends frametime of the selection position.
position | Position in FrameTime. |
GraphRegion cavapa_gui::ActivityGraph::sendGraphRegion | ( | ) |
Sends graph selection start and end positions.
|
signal |
Sends correct scroll bar position when zooming in/out.
position | Position as an integer from 0 to 100. |
|
signal |
Sends QDateTime of selected position.
point | Position in QDateTime. |
|
signal |
Sends Selection start and end time points.
start | QDateTime of selection start. |
end | QDataTime of selection end. |
|
slot |
Sets the current selection to time point.
point | Time point as QDateTime. |
|
slot |
Gets graph region endtime from timeEdit of parent.
time | The end time. |
|
slot |
Sets the graph to follow only the latest data.
latest | True/false for if showing only latest time window. |
|
slot |
Sets the length of latest-data mode.
length | Length in QTime. |
|
slot |
Sets the markers from parent.
markers | Vector array of markers. |
|
slot |
Gets new settings for font, colors and line widths.
settings | The new settings as GraphSettings. |
|
signal |
Sets scroll bar size.
size | Size of bar as integer. |
|
signal |
Sets left slide button enabled or disabled.
active | True/false for if button active. |
|
signal |
Sets right slide button enabled or disabled.
active | True if the right slide button should be active, false otherwise. |
|
slot |
Sets start datetime for the graph.
start | Start time as QDateTime. |
|
slot |
Gets the graph region starttime from the timeEdit of parent.
time | The start time. |
|
slot |
Changes time type between relative/absolute.
relative | True/false for if time mode is relative. |
|
signal |
Sets zoom in button enabled or disabled.
active | True/false for if button active. |
|
signal |
Sets zoom out button enabled or disabled.
active | True/false for if button active. |
|
slot |
Changes between showing/hiding activity curve.
activity | True/false for if showing activity curve. |
|
slot |
Changes between showing/hiding count curve.
count | True/false for if showing count curve. |
|
slot |
Changes between showing/hiding marker texts without mouseover or selecting.
show | True/false for if showing text markers continously. |
|
signal |
Signal to be emitted when the graph wants data to be retrieved.
start | Period start time. If 0, the period will start from the first possible frame. |
stop | Period end time. If 0, the period will end at the last possible frame. |
points | Number of points desired to be returned. |
|
protected |
Graph's own timer event to request data from parent.
event | Qt default timer event. |
void cavapa_gui::ActivityGraph::updateStatistics | ( | const std::vector< FrameStats > & | stats | ) |
Updates the graph with new statistics.
Either the graph requested new statistics with requestData()-signal or the graph is being initialized with new statistical information.
stats | Statistical information from a certain period. |
stats | New statistics in a vector array. |