MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
progressiveLineGraph.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef progressiveLineGraph_H_
11 #define progressiveLineGraph_H_
12 
14 
15 #include <set>
16 #include <list>
17 #include <map>
18 #include <utility>
19 #include <QWidget>
20 
21 class QPainter;
22 class QPolygon;
23 class QLinearGradient;
24 class QMouseEvent;
25 class QEvent;
26 
27 namespace MAKLogger
28 {
29  class DtLgrGuiModel;
30  class DtLgrVerticalRangeSlider;
31 
35  {
36  Q_OBJECT
39  Q_PROPERTY(QColor UpdateColor READ updateColor WRITE setUpdateColor)
40  Q_PROPERTY(QColor InteraColor READ interaColor WRITE setInteraColor)
41  Q_PROPERTY(QColor CheckpColor READ checkpColor WRITE setCheckpColor)
42  Q_PROPERTY(QColor GridTextColor READ gridTextColor WRITE setGridTextColor)
43  Q_PROPERTY(QColor HoverColor READ hoverColor WRITE setHoverColor)
44 
45  public:
46 
48  DtProgressiveLineGraph(int rangeMin, int rangeMax,bool autoScale,
49  QWidget* parent);
50 
52  virtual ~DtProgressiveLineGraph();
53 
56  void setModel(DtLgrGuiModel* myModel);
57 
59  int verticalMargin() const;
60 
62  void setMargins(int horizontalMargin,int verticalMargin);
63 
65  void addSet(int set,QPen pen, int initial, bool valueCentered = false);
66 
68  QColor updateColor() const { return myUpdateColor; }
69  void setUpdateColor(const QColor& color);
70  QColor interaColor() const { return myInteraColor; }
71  void setInteraColor(const QColor& color);
72  QColor checkpColor() const { return myCheckpColor; }
73  void setCheckpColor(const QColor& color);
74  QColor gridTextColor() const { return myGridTextColor; }
75  void setGridTextColor(const QColor& color);
76 
79  QColor hoverColor() const { return myHoverColor; }
80  void setHoverColor(const QColor& color);
81 
83  void insertValue(int set,double percent,int value);
84 
86  virtual void resetAllValues(int value);
87 
89  virtual void resetValues(int set,int value);
90 
92  virtual void clearValues(int set);
93 
95  virtual void clearAllValues();
96 
99  virtual void offsetPercentages(double percentOffset);
100 
103  virtual void offsetPercentages(int set, double percentOffset);
104 
107  virtual void setRange(int min,int max);
108 
110  virtual int rangeMinimum() const;
111  virtual int rangeMaximum() const;
112 
115  virtual bool autoScale() const;
116 
119  virtual void setAutoScale(bool value);
120 
122  virtual void setNegativeReflection(bool positive);
123 
125  virtual void useBackgroundGradient(bool useIt);
126 
128  virtual bool usesBackgroundGradient() const;
129 
131  virtual void useAlphaBlending(bool useIt);
132 
134  virtual bool usesAlphaBlending() const;
135 
137  void useBasicGui(bool basic);
138 
141  virtual void drawAsVerticalLines(bool useVerticalLines);
142 
145  virtual bool usesVerticalLines() const;
146 
148  virtual void setOffsets(float left,float right);
149 
151  void forceUpdate(bool widgetUpdate);
152 
154  bool updateNeeded() const;
155 
156  typedef std::set<std::pair<double,int> > PercentValueMap;
157 
159  virtual void testForUpdate(DtLgrGuiModel& model);
160 
162  virtual void enableZoom();
163 
164  virtual void disableZoom();
165 
167  virtual void initializeZoomSlider();
168 
170  virtual void syncZoomSlider();
171 
173  virtual void setZoomed(bool zoom);
174 
176  virtual bool isZoomed();
177 
178  virtual bool isMoveValid(int slideAmount);
179 
180  signals:
181  void wheelMoved(int);
182 
185  void intervalSelected(double startSec, double stopSec);
186 
187  public slots:
188  void moveUp(int steps);
189 
190  void moveDown(int steps);
191 
192  void scrollBarMoved(int action);
193 
194  protected:
195 
196  class Set;
197  typedef std::map<int,Set*> SetMap;
198 
200  virtual double firstTime() const;
201 
203  virtual double lastTime() const;
204 
206  virtual double currentTime() const;
207 
209  virtual void resizeEvent( QResizeEvent* e);
210 
212  virtual void paintEvent( QPaintEvent* );
213 
215  virtual void draw(QPainter& painter,const QRect& rect);
216 
218  virtual void paintBackground(QPainter& painter);
219 
221  virtual int getSeparation() const;
222 
224  virtual void paintLines(QPainter&,Set& set);
225 
227  virtual int desiredRange() const;
228 
230  void paintVerticalLines( PercentValueMap &set, QRectF svp,
231  int rangeHeight, QPainter &painter, QPen pen, bool centered);
232 
234  void paintConnectedLines( PercentValueMap &set, QRectF svp,
235  int rangeHeight, QPainter &painter, QPen pen );
236 
238  int desiredMinimum() const;
239 
241  virtual void wheelEvent(QWheelEvent *event);
242 
244  virtual void mousePressEvent(QMouseEvent* event);
245 
247  virtual void mouseMoveEvent(QMouseEvent* event);
248 
250  virtual void leaveEvent(QEvent* event);
251 
253  void drawHoverLine(QPainter& painter);
254 
256  virtual void validateAndSetZoomedGraphRanges(int zoomedMax, int zoomedMin);
257 
259  virtual void slideZoomedRangeDown(int slideAmount);
260  virtual void slideZoomedRangeUp(int slideAmount);
261 
263  virtual void setScrollBarRange();
264 
266  virtual void calibrateScrollBarPosition(int jumpsToMax);
267 
270 
273 
277 
279 
281  bool myActive;
282 
284 
286  void setSetColor(int set, const QColor& color);
287 
292  QColor myHoverColor;
293 
296  QLinearGradient* myLinearGradient;
300  QPolygon* myPointCache;
301  QPixmap* myLineBuffer;
303 
307 
309  double myDrawnRange;
310 
312  int myHoverX;
313  };
314 
315 }
316 
317 #endif
std::set< std::pair< double, int > > PercentValueMap
Definition: progressiveLineGraph.h:156
int myInitialMinimumRange
Definition: progressiveLineGraph.h:268
int myVerticalMargin
Definition: progressiveLineGraph.h:278
int myInitialZoomedMinRange
Definition: progressiveLineGraph.h:275
int mySliderPosition
Definition: progressiveLineGraph.h:276
std::map< int, Set * > SetMap
Definition: progressiveLineGraph.h:196
bool myActive
Definition: progressiveLineGraph.h:281
QColor gridTextColor() const
Definition: progressiveLineGraph.h:74
DtLgrGuiModel * myModel
Definition: progressiveLineGraph.h:308
bool myZoomEnabled
Definition: progressiveLineGraph.h:306
A widget which can be zoomed.
Definition: lgrZoomableWidget.h:26
int myHoverX
Pixel x of the current hover position, or -1 when not hovering.
Definition: progressiveLineGraph.h:312
QColor myInteraColor
Definition: progressiveLineGraph.h:289
QColor myUpdateColor
Definition: progressiveLineGraph.h:288
The logger GUI&#39;s model.
Definition: lgrGuiModel.h:56
QColor myHoverColor
Definition: progressiveLineGraph.h:292
bool myUseVerticalLines
Definition: progressiveLineGraph.h:298
QColor hoverColor() const
Color of the hover time-indicator line, styleable via qproperty-HoverColor in the app&#39;s qss theme fil...
Definition: progressiveLineGraph.h:79
DtLgrVerticalRangeSlider * myRangeWidget
Definition: progressiveLineGraph.h:304
QPixmap * myLineBuffer
Definition: progressiveLineGraph.h:301
bool myUseGradient
Definition: progressiveLineGraph.h:294
bool myUseAlphaBlending
Definition: progressiveLineGraph.h:295
int myMaximumRange
Definition: progressiveLineGraph.h:272
QColor myCheckpColor
Definition: progressiveLineGraph.h:290
QColor interaColor() const
Definition: progressiveLineGraph.h:70
bool myIsZoomed
Definition: progressiveLineGraph.h:305
double myDrawnRange
Definition: progressiveLineGraph.h:309
QColor myGridTextColor
Definition: progressiveLineGraph.h:291
QLinearGradient * myLinearGradient
Definition: progressiveLineGraph.h:296
Contains MAKLogger::DtLgrZoomableWidget class.
int myMinimumRange
Definition: progressiveLineGraph.h:271
#define DT_DLL_LGRGUI
Definition: lgrGui.h:19
bool myGraphNeedsUpdating
Definition: progressiveLineGraph.h:297
Widget which draws a line graphic where the data is progressively added over time.
Definition: progressiveLineGraph.h:34
bool myUseCachedGraph
Definition: progressiveLineGraph.h:302
bool myAutoScale
Definition: progressiveLineGraph.h:280
QColor checkpColor() const
Definition: progressiveLineGraph.h:72
SetMap mySets
Definition: progressiveLineGraph.h:283
Definition: lgrVerticalRangeSlider.h:22
int myInitialMaximumRange
Definition: progressiveLineGraph.h:269
int myInitialZoomedMaxRange
Definition: progressiveLineGraph.h:274
QPolygon * myPointCache
Definition: progressiveLineGraph.h:300
bool myNegativeReflection
Definition: progressiveLineGraph.h:299

Document ID: Generated on Tue Nov 17 15:25:07 EST 2026 from SVN revision 298446
Copyright © 2026 MAK Technologies. All Rights Reserved (www.mak.com)