CAVAPA-GUI  30.5.2014
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
cavapa_gui::ActivityGraph Class Reference

Main class for Cavapa graphic curve display widget. More...

#include <activitygraph.h>

Inheritance diagram for cavapa_gui::ActivityGraph:

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< GraphMarkergetMarkers ()
 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.
 

Detailed Description

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.

Author
Joel Kivelä

Constructor & Destructor Documentation

cavapa_gui::ActivityGraph::ActivityGraph ( QWidget *  parent = 0)

Creates and initializes the graph.

Parameters
parentThe parent widget.

Member Function Documentation

void cavapa_gui::ActivityGraph::addMarker ( std::string  text)
slot

Adds new marker to the selected position.

Parameters
textText for new marker.
void cavapa_gui::ActivityGraph::changeAbsoluteEnabled ( bool  ae)
signal

Sets absolute radio button enabled or disabled.

Parameters
aeTrue/false for if enabled or not.
void cavapa_gui::ActivityGraph::changeRTLabel ( bool  rt)
signal

Changes the realtime label of parent.

Parameters
rtTrue/false for if drawing "Realtime" or not.
QDateTime cavapa_gui::ActivityGraph::FrameTimetoQDateTime ( FrameTime  ftime)

Changes FrameTime into QDateTime according the beginframe.

Parameters
ftimeFrameTime point.
Returns
QDateTime point.
std::vector< GraphMarker > cavapa_gui::ActivityGraph::getMarkers ( )

Gets markers from the graph.

Returns
Markers in vector array.
QDateTime cavapa_gui::ActivityGraph::getSelectedTimePoint ( )

Gets the time point of currently selected frame.

Returns
Time point as QDateTime.
QDateTime cavapa_gui::ActivityGraph::getStartDateTime ( )

Gets the start time of the graph.

Returns
The start time as QDateTime.
FrameTime cavapa_gui::ActivityGraph::getStartFrame ( )

Gets the first frame of the graph.

Returns
Frame Point in FrameTime.
void cavapa_gui::ActivityGraph::mouseDoubleClickEvent ( QMouseEvent *  event)
protected

Double-clicking the graph notifies the parent to add new marker.

Parameters
eventQt default mouse event.
void cavapa_gui::ActivityGraph::mouseMoveEvent ( QMouseEvent *  event)
protected

Mouse move event of the graph.

Defines selected area.

Parameters
eventQt default mouse event.
void cavapa_gui::ActivityGraph::mousePressEvent ( QMouseEvent *  event)
protected

Mouse Press event of the graph.

Defines selected point.

Parameters
eventQt default mouse event.
void cavapa_gui::ActivityGraph::mouseReleaseEvent ( QMouseEvent *  event)
protected

Mouse release event of the graph.

Parameters
eventQt default mouse event.
void cavapa_gui::ActivityGraph::paint ( QPainter &  painter)

Draws the graph.

Parameters
painterQPainter to do the drawing.
void cavapa_gui::ActivityGraph::paintEvent ( QPaintEvent *  event)
protected

Qt paint event for drawing the graph.

Parameters
eventQt default paint event.
FrameTime cavapa_gui::ActivityGraph::QDateTimeToFrameTime ( QDateTime  time)

Changes QDateTime to FrameTime according the starting time of calculation.

Parameters
timeQDateTime point.
Returns
FrameTime point.
void cavapa_gui::ActivityGraph::scrollMouse ( int  position)
slot

Scrolls zoomed graph area with scrollbar/mouse.

Parameters
positionThe relative position of the view area, between 0 and 100.
void cavapa_gui::ActivityGraph::sendFrameTimePosition ( FrameTime  position)
signal

Sends frametime of the selection position.

Parameters
positionPosition in FrameTime.
GraphRegion cavapa_gui::ActivityGraph::sendGraphRegion ( )

Sends graph selection start and end positions.

Returns
End and start points as a GraphRegion type.
void cavapa_gui::ActivityGraph::sendScrollPosition ( int  position)
signal

Sends correct scroll bar position when zooming in/out.

Parameters
positionPosition as an integer from 0 to 100.
void cavapa_gui::ActivityGraph::sendSelectedPoint ( QDateTime  point)
signal

Sends QDateTime of selected position.

Parameters
pointPosition in QDateTime.
void cavapa_gui::ActivityGraph::sendTimeArea ( QDateTime  start,
QDateTime  end 
)
signal

Sends Selection start and end time points.

Parameters
startQDateTime of selection start.
endQDataTime of selection end.
void cavapa_gui::ActivityGraph::setCurrentPosition ( QDateTime  point)
slot

Sets the current selection to time point.

Parameters
pointTime point as QDateTime.
void cavapa_gui::ActivityGraph::setEndTime ( QDateTime  time)
slot

Gets graph region endtime from timeEdit of parent.

Parameters
timeThe end time.
void cavapa_gui::ActivityGraph::setFollowLatest ( bool  latest)
slot

Sets the graph to follow only the latest data.

Parameters
latestTrue/false for if showing only latest time window.
void cavapa_gui::ActivityGraph::setLatestLength ( QTime  length)
slot

Sets the length of latest-data mode.

Parameters
lengthLength in QTime.
void cavapa_gui::ActivityGraph::setMarkers ( std::vector< GraphMarker markers)
slot

Sets the markers from parent.

Parameters
markersVector array of markers.
void cavapa_gui::ActivityGraph::setNewSettings ( GraphSettings  settings)
slot

Gets new settings for font, colors and line widths.

Parameters
settingsThe new settings as GraphSettings.
void cavapa_gui::ActivityGraph::setScrollBarSize ( int  size)
signal

Sets scroll bar size.

Parameters
sizeSize of bar as integer.
void cavapa_gui::ActivityGraph::setScrollLeftActive ( bool  active)
signal

Sets left slide button enabled or disabled.

Parameters
activeTrue/false for if button active.
void cavapa_gui::ActivityGraph::setScrollRightActive ( bool  active)
signal

Sets right slide button enabled or disabled.

Parameters
activeTrue if the right slide button should be active, false otherwise.
void cavapa_gui::ActivityGraph::setStartDateTime ( QDateTime  start)
slot

Sets start datetime for the graph.

Parameters
startStart time as QDateTime.
void cavapa_gui::ActivityGraph::setStartTime ( QDateTime  time)
slot

Gets the graph region starttime from the timeEdit of parent.

Parameters
timeThe start time.
void cavapa_gui::ActivityGraph::setTimeRelative ( bool  relative)
slot

Changes time type between relative/absolute.

Parameters
relativeTrue/false for if time mode is relative.
void cavapa_gui::ActivityGraph::setZoomInActive ( bool  active)
signal

Sets zoom in button enabled or disabled.

Parameters
activeTrue/false for if button active.
void cavapa_gui::ActivityGraph::setZoomOutActive ( bool  active)
signal

Sets zoom out button enabled or disabled.

Parameters
activeTrue/false for if button active.
void cavapa_gui::ActivityGraph::showActivity ( bool  activity)
slot

Changes between showing/hiding activity curve.

Parameters
activityTrue/false for if showing activity curve.
void cavapa_gui::ActivityGraph::showCount ( bool  count)
slot

Changes between showing/hiding count curve.

Parameters
countTrue/false for if showing count curve.
void cavapa_gui::ActivityGraph::showMarkerTexts ( bool  show)
slot

Changes between showing/hiding marker texts without mouseover or selecting.

Parameters
showTrue/false for if showing text markers continously.
void cavapa_gui::ActivityGraph::statisticsRequested ( FrameTime  start,
FrameTime  stop,
int  points 
)
signal

Signal to be emitted when the graph wants data to be retrieved.

Parameters
startPeriod start time. If 0, the period will start from the first possible frame.
stopPeriod end time. If 0, the period will end at the last possible frame.
pointsNumber of points desired to be returned.
void cavapa_gui::ActivityGraph::timerEvent ( QTimerEvent *  event)
protected

Graph's own timer event to request data from parent.

Parameters
eventQt 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.

Parameters
statsStatistical information from a certain period.
statsNew statistics in a vector array.

The documentation for this class was generated from the following files: