MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Slots | Signals | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MAKLogger::DtProgressiveLineGraph Class Reference

Widget which draws a line graphic where the data is progressively added over time. More...

+ Inheritance diagram for MAKLogger::DtProgressiveLineGraph:
+ Collaboration diagram for MAKLogger::DtProgressiveLineGraph:

Public Types

typedef std::set< std::pair
< double, int > > 
PercentValueMap
 

Public Slots

void moveUp (int steps)
 
void moveDown (int steps)
 
void scrollBarMoved (int action)
 
- Public Slots inherited from MAKLogger::DtLgrZoomableWidget

Signals

void wheelMoved (int)
 
- Signals inherited from MAKLogger::DtLgrZoomableWidget
void offsetsChanged (float left, float right)
 

Public Member Functions

 DtProgressiveLineGraph (int rangeMin, int rangeMax, bool autoScale, QWidget *parent)
 CTOR for creating the graph. More...
 
virtual ~DtProgressiveLineGraph ()
 DTOR for graph. More...
 
void setModel (DtLgrGuiModel *myModel)
 Set the model, this is required for a number of features such as drawing a cursor. More...
 
int verticalMargin () const
 Get the vertical margin. More...
 
void setMargins (int horizontalMargin, int verticalMargin)
 set the Graph margins. More...
 
void addSet (int set, QPen pen, int initial, bool valueCentered=false)
 Add a set with a color and initial value. More...
 
void insertValue (int set, double percent, int value)
 Insert a value into the middle of the graph. More...
 
virtual void resetAllValues (int value)
 Clear all sets and insert the initial value. More...
 
virtual void resetValues (int set, int value)
 Clear the values and insert the initial value. More...
 
virtual void clearValues (int set)
 Clear the values. More...
 
virtual void clearAllValues ()
 Clear all sets. More...
 
virtual void offsetPercentages (double percentOffset)
 Offset the percentages of all the values. More...
 
virtual void offsetPercentages (int set, double percentOffset)
 Offset the percentages of a set of values. More...
 
virtual void setRange (int min, int max)
 Sets the minimum and maximum range of the points. More...
 
virtual int rangeMinimum () const
 Get the Range minimum and maximum. More...
 
virtual int rangeMaximum () const
 
virtual bool autoScale () const
 Get whether auto scaling is used. More...
 
virtual void setAutoScale (bool value)
 Set whether auto scaling is used. More...
 
virtual void setNegativeReflection (bool positive)
 Set whether the scale is a reflect negative scale. More...
 
virtual void useBackgroundGradient (bool useIt)
 Set if the background gradient is used. More...
 
virtual bool usesBackgroundGradient () const
 Get if the background gradient is used. More...
 
virtual void useAlphaBlending (bool useIt)
 Set whether to use alpha blending. More...
 
virtual bool usesAlphaBlending () const
 Get whether alpha blending is used. More...
 
void useBasicGui (bool basic)
 Set whether to use basic render settings. More...
 
virtual void drawAsVerticalLines (bool useVerticalLines)
 Set whether vertical line samples are used instead of connected samples. More...
 
virtual bool usesVerticalLines () const
 Get whether vertical line samples are used instead of connected samples. More...
 
virtual void setOffsets (float left, float right)
 Override base implementation. More...
 
void forceUpdate (bool widgetUpdate)
 Force a redraw and optionally a widget update. More...
 
bool updateNeeded () const
 Check to see if an update has been forced. More...
 
virtual void testForUpdate (DtLgrGuiModel &model)
 Override test for update. More...
 
virtual void enableZoom ()
 Enable/disable Zoom functionality for this graph. More...
 
virtual void disableZoom ()
 
virtual void initializeZoomSlider ()
 Initializes Zoom slider and sets geometry. More...
 
virtual void syncZoomSlider ()
 Resizes Zoom slider on resize events. Hides slider when disabled. More...
 
virtual void setZoomed (bool zoom)
 Set when in a zoomed state. More...
 
virtual bool isZoomed ()
 Returns true is graph is in a zoomed state. More...
 
virtual bool isMoveValid (int slideAmount)
 
- Public Member Functions inherited from MAKLogger::DtLgrZoomableWidget
 DtLgrZoomableWidget (QWidget *parent)
 CTOR. More...
 
virtual ~DtLgrZoomableWidget ()
 DTOR. More...
 
QRectF scaledViewport (QRect orignalViewport, QPoint margins) const
 Scale a viewport using the scaled settings and the provided margins. More...
 
void drawCursor (QPainter &painter, double firstVisibleTime, double lastVisibleTime, double cursorTime, int xOffset, bool active)
 Draw A cursor. More...
 
QRect cursorBounds (double firstVisibleTime, double lastVisibleTime, double cursorTime, int xOffset)
 Get the cursor bounds. More...
 
double firstVisibleTime (double firstTime, double lastTime) const
 Get the first visible time, based upon the scale. More...
 
double firstVisibleTime (DtLgrGuiModel &model) const
 Get the first visible time via the models display time. More...
 
double lastVisibleTime (double firstTime, double lastTime) const
 Get the last visible time, based upon the scale. More...
 
double lastVisibleTime (DtLgrGuiModel &model) const
 Get the last visible time via the models display time. More...
 
float leftOffset () const
 Get the left offset (percent 0-100.0), inline for performance reasons. More...
 
float rightOffset () const
 Get the right offset (percent 0-100.0), inline for performance reasons. More...
 
float horizontalMargin () const
 get the horizontal margin. More...
 
void setHorizontalMargin (float margin)
 set the horizontal margin. More...
 
void setDrawTimes (DtLgrGuiModel &model)
 

Protected Types

typedef std::map< int, Set * > SetMap
 

Protected Member Functions

virtual double firstTime () const
 Get the current time. More...
 
virtual double lastTime () const
 Get the current time. More...
 
virtual double currentTime () const
 Get the current time. More...
 
virtual void resizeEvent (QResizeEvent *e)
 Resize event needed to resize back buffer. More...
 
virtual void paintEvent (QPaintEvent *)
 Draw the widget. More...
 
virtual void draw (QPainter &painter, const QRect &rect)
 Draw the control. More...
 
virtual void paintBackground (QPainter &painter)
 Paint background. More...
 
virtual int getSeparation () const
 Get the line separation count. More...
 
virtual void paintLines (QPainter &, Set &set)
 Function to draw the lines in the foreground color. More...
 
virtual int desiredRange () const
 Get the desired Range. More...
 
void paintVerticalLines (PercentValueMap &set, QRectF svp, int rangeHeight, QPainter &painter, QPen pen, bool centered)
 Draw the graph as vertical lines. More...
 
void paintConnectedLines (PercentValueMap &set, QRectF svp, int rangeHeight, QPainter &painter, QPen pen)
 Draw the graph as a connected line. More...
 
int desiredMinimum () const
 Get the desired minimum. More...
 
virtual void wheelEvent (QWheelEvent *event)
 Catch mouse wheel movements. More...
 
virtual void validateAndSetZoomedGraphRanges (int zoomedMax, int zoomedMin)
 Set new graph ranges based on mouse wheel movements. More...
 
virtual void slideZoomedRangeDown (int slideAmount)
 Move graph ranges up/down based on slider movement. More...
 
virtual void slideZoomedRangeUp (int slideAmount)
 
virtual void setScrollBarRange ()
 Set scroll bar range to reflect zoomed range. More...
 
virtual void calibrateScrollBarPosition (int jumpsToMax)
 Calibrate the slider position after mouse wheel movement. More...
 

Protected Attributes

int myInitialMinimumRange
 
int myInitialMaximumRange
 
int myMinimumRange
 
int myMaximumRange
 
int myInitialZoomedMaxRange
 
int myInitialZoomedMinRange
 
int mySliderPosition
 
int myVerticalMargin
 
bool myAutoScale
 
bool myActive
 
SetMap mySets
 
bool myUseGradient
 
bool myUseAlphaBlending
 
QLinearGradient * myLinearGradient
 
bool myGraphNeedsUpdating
 
bool myUseVerticalLines
 
bool myNegativeReflection
 
QPolygon * myPointCache
 
QPixmap * myLineBuffer
 
bool myUseCachedGraph
 
DtLgrVerticalRangeSlidermyRangeWidget
 
bool myIsZoomed
 
bool myZoomEnabled
 
DtLgrGuiModelmyModel
 
double myDrawnRange
 
- Protected Attributes inherited from MAKLogger::DtLgrZoomableWidget
float myLeftOffset
 
float myRightOffset
 
float myHorizontalMargin
 
double myDrawnFirstVisibleTime
 
double myDrawnLastVisibleTime
 
double myDrawnCurrentVisibleTime
 

Detailed Description

Widget which draws a line graphic where the data is progressively added over time.

Member Typedef Documentation

typedef std::set<std::pair<double,int> > MAKLogger::DtProgressiveLineGraph::PercentValueMap
typedef std::map<int,Set*> MAKLogger::DtProgressiveLineGraph::SetMap
protected

Constructor & Destructor Documentation

MAKLogger::DtProgressiveLineGraph::DtProgressiveLineGraph ( int  rangeMin,
int  rangeMax,
bool  autoScale,
QWidget parent 
)

CTOR for creating the graph.

virtual MAKLogger::DtProgressiveLineGraph::~DtProgressiveLineGraph ( )
virtual

DTOR for graph.

Member Function Documentation

void MAKLogger::DtProgressiveLineGraph::addSet ( int  set,
QPen  pen,
int  initial,
bool  valueCentered = false 
)

Add a set with a color and initial value.

virtual bool MAKLogger::DtProgressiveLineGraph::autoScale ( ) const
virtual

Get whether auto scaling is used.

Auto scale will change the range dynamically as points are added.

virtual void MAKLogger::DtProgressiveLineGraph::calibrateScrollBarPosition ( int  jumpsToMax)
protectedvirtual

Calibrate the slider position after mouse wheel movement.

virtual void MAKLogger::DtProgressiveLineGraph::clearAllValues ( )
virtual

Clear all sets.

virtual void MAKLogger::DtProgressiveLineGraph::clearValues ( int  set)
virtual

Clear the values.

virtual double MAKLogger::DtProgressiveLineGraph::currentTime ( ) const
protectedvirtual

Get the current time.

int MAKLogger::DtProgressiveLineGraph::desiredMinimum ( ) const
protected

Get the desired minimum.

virtual int MAKLogger::DtProgressiveLineGraph::desiredRange ( ) const
protectedvirtual

Get the desired Range.

virtual void MAKLogger::DtProgressiveLineGraph::disableZoom ( )
virtual
virtual void MAKLogger::DtProgressiveLineGraph::draw ( QPainter &  painter,
const QRect &  rect 
)
protectedvirtual

Draw the control.

virtual void MAKLogger::DtProgressiveLineGraph::drawAsVerticalLines ( bool  useVerticalLines)
virtual

Set whether vertical line samples are used instead of connected samples.

virtual void MAKLogger::DtProgressiveLineGraph::enableZoom ( )
virtual

Enable/disable Zoom functionality for this graph.

virtual double MAKLogger::DtProgressiveLineGraph::firstTime ( ) const
protectedvirtual

Get the current time.

void MAKLogger::DtProgressiveLineGraph::forceUpdate ( bool  widgetUpdate)

Force a redraw and optionally a widget update.

virtual int MAKLogger::DtProgressiveLineGraph::getSeparation ( ) const
protectedvirtual

Get the line separation count.

virtual void MAKLogger::DtProgressiveLineGraph::initializeZoomSlider ( )
virtual

Initializes Zoom slider and sets geometry.

void MAKLogger::DtProgressiveLineGraph::insertValue ( int  set,
double  percent,
int  value 
)

Insert a value into the middle of the graph.

virtual bool MAKLogger::DtProgressiveLineGraph::isMoveValid ( int  slideAmount)
virtual
virtual bool MAKLogger::DtProgressiveLineGraph::isZoomed ( )
virtual

Returns true is graph is in a zoomed state.

virtual double MAKLogger::DtProgressiveLineGraph::lastTime ( ) const
protectedvirtual

Get the current time.

void MAKLogger::DtProgressiveLineGraph::moveDown ( int  steps)
slot
void MAKLogger::DtProgressiveLineGraph::moveUp ( int  steps)
slot
virtual void MAKLogger::DtProgressiveLineGraph::offsetPercentages ( double  percentOffset)
virtual

Offset the percentages of all the values.

Any value with a negative percentage or a percentage > 100 will be dropped.

virtual void MAKLogger::DtProgressiveLineGraph::offsetPercentages ( int  set,
double  percentOffset 
)
virtual

Offset the percentages of a set of values.

Any value with a negative percentage or a percentage > 100 will be dropped.

virtual void MAKLogger::DtProgressiveLineGraph::paintBackground ( QPainter &  painter)
protectedvirtual

Paint background.

void MAKLogger::DtProgressiveLineGraph::paintConnectedLines ( PercentValueMap set,
QRectF  svp,
int  rangeHeight,
QPainter &  painter,
QPen  pen 
)
protected

Draw the graph as a connected line.

virtual void MAKLogger::DtProgressiveLineGraph::paintEvent ( QPaintEvent *  )
protectedvirtual

Draw the widget.

virtual void MAKLogger::DtProgressiveLineGraph::paintLines ( QPainter &  ,
Set &  set 
)
protectedvirtual

Function to draw the lines in the foreground color.

void MAKLogger::DtProgressiveLineGraph::paintVerticalLines ( PercentValueMap set,
QRectF  svp,
int  rangeHeight,
QPainter &  painter,
QPen  pen,
bool  centered 
)
protected

Draw the graph as vertical lines.

virtual int MAKLogger::DtProgressiveLineGraph::rangeMaximum ( ) const
virtual
virtual int MAKLogger::DtProgressiveLineGraph::rangeMinimum ( ) const
virtual

Get the Range minimum and maximum.

virtual void MAKLogger::DtProgressiveLineGraph::resetAllValues ( int  value)
virtual

Clear all sets and insert the initial value.

virtual void MAKLogger::DtProgressiveLineGraph::resetValues ( int  set,
int  value 
)
virtual

Clear the values and insert the initial value.

virtual void MAKLogger::DtProgressiveLineGraph::resizeEvent ( QResizeEvent *  e)
protectedvirtual

Resize event needed to resize back buffer.

void MAKLogger::DtProgressiveLineGraph::scrollBarMoved ( int  action)
slot
virtual void MAKLogger::DtProgressiveLineGraph::setAutoScale ( bool  value)
virtual

Set whether auto scaling is used.

Auto scale will change the range dynamically as points are added.

void MAKLogger::DtProgressiveLineGraph::setMargins ( int  horizontalMargin,
int  verticalMargin 
)

set the Graph margins.

void MAKLogger::DtProgressiveLineGraph::setModel ( DtLgrGuiModel myModel)

Set the model, this is required for a number of features such as drawing a cursor.

virtual void MAKLogger::DtProgressiveLineGraph::setNegativeReflection ( bool  positive)
virtual

Set whether the scale is a reflect negative scale.

virtual void MAKLogger::DtProgressiveLineGraph::setOffsets ( float  left,
float  right 
)
virtual

Override base implementation.

Reimplemented from MAKLogger::DtLgrZoomableWidget.

virtual void MAKLogger::DtProgressiveLineGraph::setRange ( int  min,
int  max 
)
virtual

Sets the minimum and maximum range of the points.

As points are scaled clipped to the min and max. when drawn.

virtual void MAKLogger::DtProgressiveLineGraph::setScrollBarRange ( )
protectedvirtual

Set scroll bar range to reflect zoomed range.

virtual void MAKLogger::DtProgressiveLineGraph::setZoomed ( bool  zoom)
virtual

Set when in a zoomed state.

virtual void MAKLogger::DtProgressiveLineGraph::slideZoomedRangeDown ( int  slideAmount)
protectedvirtual

Move graph ranges up/down based on slider movement.

virtual void MAKLogger::DtProgressiveLineGraph::slideZoomedRangeUp ( int  slideAmount)
protectedvirtual
virtual void MAKLogger::DtProgressiveLineGraph::syncZoomSlider ( )
virtual

Resizes Zoom slider on resize events. Hides slider when disabled.

virtual void MAKLogger::DtProgressiveLineGraph::testForUpdate ( DtLgrGuiModel model)
virtual

Override test for update.

Reimplemented from MAKLogger::DtLgrZoomableWidget.

bool MAKLogger::DtProgressiveLineGraph::updateNeeded ( ) const

Check to see if an update has been forced.

virtual void MAKLogger::DtProgressiveLineGraph::useAlphaBlending ( bool  useIt)
virtual

Set whether to use alpha blending.

virtual void MAKLogger::DtProgressiveLineGraph::useBackgroundGradient ( bool  useIt)
virtual

Set if the background gradient is used.

void MAKLogger::DtProgressiveLineGraph::useBasicGui ( bool  basic)

Set whether to use basic render settings.

virtual bool MAKLogger::DtProgressiveLineGraph::usesAlphaBlending ( ) const
virtual

Get whether alpha blending is used.

virtual bool MAKLogger::DtProgressiveLineGraph::usesBackgroundGradient ( ) const
virtual

Get if the background gradient is used.

virtual bool MAKLogger::DtProgressiveLineGraph::usesVerticalLines ( ) const
virtual

Get whether vertical line samples are used instead of connected samples.

virtual void MAKLogger::DtProgressiveLineGraph::validateAndSetZoomedGraphRanges ( int  zoomedMax,
int  zoomedMin 
)
protectedvirtual

Set new graph ranges based on mouse wheel movements.

int MAKLogger::DtProgressiveLineGraph::verticalMargin ( ) const

Get the vertical margin.

virtual void MAKLogger::DtProgressiveLineGraph::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Catch mouse wheel movements.

void MAKLogger::DtProgressiveLineGraph::wheelMoved ( int  )
signal

Member Data Documentation

bool MAKLogger::DtProgressiveLineGraph::myActive
protected
bool MAKLogger::DtProgressiveLineGraph::myAutoScale
protected
double MAKLogger::DtProgressiveLineGraph::myDrawnRange
protected
bool MAKLogger::DtProgressiveLineGraph::myGraphNeedsUpdating
protected
int MAKLogger::DtProgressiveLineGraph::myInitialMaximumRange
protected
int MAKLogger::DtProgressiveLineGraph::myInitialMinimumRange
protected
int MAKLogger::DtProgressiveLineGraph::myInitialZoomedMaxRange
protected
int MAKLogger::DtProgressiveLineGraph::myInitialZoomedMinRange
protected
bool MAKLogger::DtProgressiveLineGraph::myIsZoomed
protected
QLinearGradient* MAKLogger::DtProgressiveLineGraph::myLinearGradient
protected
QPixmap* MAKLogger::DtProgressiveLineGraph::myLineBuffer
protected
int MAKLogger::DtProgressiveLineGraph::myMaximumRange
protected
int MAKLogger::DtProgressiveLineGraph::myMinimumRange
protected
DtLgrGuiModel* MAKLogger::DtProgressiveLineGraph::myModel
protected
bool MAKLogger::DtProgressiveLineGraph::myNegativeReflection
protected
QPolygon* MAKLogger::DtProgressiveLineGraph::myPointCache
protected
DtLgrVerticalRangeSlider* MAKLogger::DtProgressiveLineGraph::myRangeWidget
protected
SetMap MAKLogger::DtProgressiveLineGraph::mySets
protected
int MAKLogger::DtProgressiveLineGraph::mySliderPosition
protected
bool MAKLogger::DtProgressiveLineGraph::myUseAlphaBlending
protected
bool MAKLogger::DtProgressiveLineGraph::myUseCachedGraph
protected
bool MAKLogger::DtProgressiveLineGraph::myUseGradient
protected
bool MAKLogger::DtProgressiveLineGraph::myUseVerticalLines
protected
int MAKLogger::DtProgressiveLineGraph::myVerticalMargin
protected
bool MAKLogger::DtProgressiveLineGraph::myZoomEnabled
protected

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

Document ID: Generated on Mon Mar 22 15:30:17 EDT 2021 from SVN revision 226440
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)