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-2024 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 
25 namespace MAKLogger
26 {
27  class DtLgrGuiModel;
28  class DtLgrVerticalRangeSlider;
29 
33  {
34  Q_OBJECT
35 
36  public:
37 
39  DtProgressiveLineGraph(int rangeMin, int rangeMax,bool autoScale,
40  QWidget* parent);
41 
43  virtual ~DtProgressiveLineGraph();
44 
47  void setModel(DtLgrGuiModel* myModel);
48 
50  int verticalMargin() const;
51 
53  void setMargins(int horizontalMargin,int verticalMargin);
54 
56  void addSet(int set,QPen pen, int initial, bool valueCentered = false);
57 
59  void insertValue(int set,double percent,int value);
60 
62  virtual void resetAllValues(int value);
63 
65  virtual void resetValues(int set,int value);
66 
68  virtual void clearValues(int set);
69 
71  virtual void clearAllValues();
72 
75  virtual void offsetPercentages(double percentOffset);
76 
79  virtual void offsetPercentages(int set, double percentOffset);
80 
83  virtual void setRange(int min,int max);
84 
86  virtual int rangeMinimum() const;
87  virtual int rangeMaximum() const;
88 
91  virtual bool autoScale() const;
92 
95  virtual void setAutoScale(bool value);
96 
98  virtual void setNegativeReflection(bool positive);
99 
101  virtual void useBackgroundGradient(bool useIt);
102 
104  virtual bool usesBackgroundGradient() const;
105 
107  virtual void useAlphaBlending(bool useIt);
108 
110  virtual bool usesAlphaBlending() const;
111 
113  void useBasicGui(bool basic);
114 
117  virtual void drawAsVerticalLines(bool useVerticalLines);
118 
121  virtual bool usesVerticalLines() const;
122 
124  virtual void setOffsets(float left,float right);
125 
127  void forceUpdate(bool widgetUpdate);
128 
130  bool updateNeeded() const;
131 
132  typedef std::set<std::pair<double,int> > PercentValueMap;
133 
135  virtual void testForUpdate(DtLgrGuiModel& model);
136 
138  virtual void enableZoom();
139 
140  virtual void disableZoom();
141 
143  virtual void initializeZoomSlider();
144 
146  virtual void syncZoomSlider();
147 
149  virtual void setZoomed(bool zoom);
150 
152  virtual bool isZoomed();
153 
154  virtual bool isMoveValid(int slideAmount);
155 
156  signals:
157  void wheelMoved(int);
158 
159  public slots:
160  void moveUp(int steps);
161 
162  void moveDown(int steps);
163 
164  void scrollBarMoved(int action);
165 
166  protected:
167 
168  class Set;
169  typedef std::map<int,Set*> SetMap;
170 
172  virtual double firstTime() const;
173 
175  virtual double lastTime() const;
176 
178  virtual double currentTime() const;
179 
181  virtual void resizeEvent( QResizeEvent* e);
182 
184  virtual void paintEvent( QPaintEvent* );
185 
187  virtual void draw(QPainter& painter,const QRect& rect);
188 
190  virtual void paintBackground(QPainter& painter);
191 
193  virtual int getSeparation() const;
194 
196  virtual void paintLines(QPainter&,Set& set);
197 
199  virtual int desiredRange() const;
200 
202  void paintVerticalLines( PercentValueMap &set, QRectF svp,
203  int rangeHeight, QPainter &painter, QPen pen, bool centered);
204 
206  void paintConnectedLines( PercentValueMap &set, QRectF svp,
207  int rangeHeight, QPainter &painter, QPen pen );
208 
210  int desiredMinimum() const;
211 
213  virtual void wheelEvent(QWheelEvent *event);
214 
216  virtual void validateAndSetZoomedGraphRanges(int zoomedMax, int zoomedMin);
217 
219  virtual void slideZoomedRangeDown(int slideAmount);
220  virtual void slideZoomedRangeUp(int slideAmount);
221 
223  virtual void setScrollBarRange();
224 
226  virtual void calibrateScrollBarPosition(int jumpsToMax);
227 
230 
233 
237 
239 
241  bool myActive;
242 
244 
247  QLinearGradient* myLinearGradient;
251  QPolygon* myPointCache;
252  QPixmap* myLineBuffer;
254 
258 
260  double myDrawnRange;
261  };
262 
263 }
264 
265 #endif
std::set< std::pair< double, int > > PercentValueMap
Definition: progressiveLineGraph.h:132
int myInitialMinimumRange
Definition: progressiveLineGraph.h:228
int myVerticalMargin
Definition: progressiveLineGraph.h:238
int myInitialZoomedMinRange
Definition: progressiveLineGraph.h:235
int mySliderPosition
Definition: progressiveLineGraph.h:236
std::map< int, Set * > SetMap
Definition: progressiveLineGraph.h:168
bool myActive
Definition: progressiveLineGraph.h:241
DtLgrGuiModel * myModel
Definition: progressiveLineGraph.h:259
bool myZoomEnabled
Definition: progressiveLineGraph.h:257
A widget which can be zoomed.
Definition: lgrZoomableWidget.h:26
The logger GUI&#39;s model.
Definition: lgrGuiModel.h:56
bool myUseVerticalLines
Definition: progressiveLineGraph.h:249
DtLgrVerticalRangeSlider * myRangeWidget
Definition: progressiveLineGraph.h:255
QPixmap * myLineBuffer
Definition: progressiveLineGraph.h:252
bool myUseGradient
Definition: progressiveLineGraph.h:245
bool myUseAlphaBlending
Definition: progressiveLineGraph.h:246
int myMaximumRange
Definition: progressiveLineGraph.h:232
bool myIsZoomed
Definition: progressiveLineGraph.h:256
double myDrawnRange
Definition: progressiveLineGraph.h:260
QLinearGradient * myLinearGradient
Definition: progressiveLineGraph.h:247
Contains MAKLogger::DtLgrZoomableWidget class.
int myMinimumRange
Definition: progressiveLineGraph.h:231
#define DT_DLL_LGRGUI
Definition: lgrGui.h:19
bool myGraphNeedsUpdating
Definition: progressiveLineGraph.h:248
Widget which draws a line graphic where the data is progressively added over time.
Definition: progressiveLineGraph.h:32
bool myUseCachedGraph
Definition: progressiveLineGraph.h:253
bool myAutoScale
Definition: progressiveLineGraph.h:240
SetMap mySets
Definition: progressiveLineGraph.h:243
Definition: lgrVerticalRangeSlider.h:22
int myInitialMaximumRange
Definition: progressiveLineGraph.h:229
int myInitialZoomedMaxRange
Definition: progressiveLineGraph.h:234
QPolygon * myPointCache
Definition: progressiveLineGraph.h:251
bool myNegativeReflection
Definition: progressiveLineGraph.h:250

Document ID: Generated on Thu Oct 3 15:35:11 EDT 2024 from SVN revision 270037
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)