MAK RTIspy API Documentation for HLA 1.3
assistantPlot.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <rtiMsConfig.h>
13 
14 #include <vlutil/vlMachineTypes.h>
15 
16 #include <QtCore/QDateTime>
17 
18 #include <qwt_scale_engine.h>
19 #include <qwt_scale_draw.h>
20 #include <qwt_legend.h>
21 #include <qwt_plot.h>
22 
23 class QwtSymbol;
24 class QwtPlotCurve;
25 
27 
31 {
32  Q_OBJECT
33 
34 public:
35 
38  static DtAssistantPlot* create( const QString& unitLabel = QString() );
39 
43  static DtAssistantPlot* create( LegendPosition legendPos,
44  const QString& unitLabel = QString() );
45 
50  virtual void initialize( bool showLegend, const QString& unitLabel );
51 
53  virtual ~DtAssistantPlot();
54 
56  virtual void setShowTimeLabels( bool show );
57 
59  virtual void setLockUpdates( bool lock );
60 
65  virtual DtAssistantPlotSeries* createPlotSeries( const QColor& color,
66  unsigned seriesId, Qt::PenStyle style, const QString& dispName = QString() );
67 
70  virtual DtAssistantPlotSeries* findSeries( unsigned seriesId );
71 
72  virtual QwtLegend* createLegend();
73 
80  virtual void updateSeries( unsigned seriesId, double t, double val );
81 
86  virtual void updateAxisScaling();
87 
90  virtual void updateAxisScalingIfNeeded();
91 
92  virtual float getMaxVal();
93 
94  virtual float getMaxVal( unsigned seriesId );
95 
96  virtual float getMinVal();
97 
98  virtual float getMinVal( unsigned seriesId );
99 
100  virtual void setBaseTime( double baseTime );
101 
102  virtual void setSeriesEnabled( unsigned seriesId, bool enabled );
103 
104  virtual void setSeriesEnabled( QwtPlotItem* item, bool enabled );
105 
106  virtual void clear();
107 
108 protected:
109 
114  DtAssistantPlot( const QString& unitLabel = QString() );
115 
120  DtAssistantPlot( LegendPosition legendPos, const QString& unitLabel = QString() );
121 
122  virtual void connectToSignals();
123 
128  virtual QPen createPen( const QColor& color,
129  Qt::PenStyle style = Qt::SolidLine, qreal width = 0 );
130 
131 protected:
132 
136  {
137  public:
138 
141  TimeScaleDraw();
142 
148  virtual void setBaseTime( MAKRti::DtU64 baseTime );
149 
151  virtual QwtText label( double val ) const;
152 
153  private:
154 
155  //QDateTime baseTime;
156  MAKRti::DtU64 myBaseTime;
157 
158  };
159 
161  typedef std::map<unsigned,DtAssistantPlotSeries*> SeriesMap;
162 
164  typedef std::map<unsigned,float> SeriesMaxValMap;
166 
168 
170  float myMaxVal;
171 
173  float myMinVal;
174 
175  LegendPosition myLegendPosition;
176 
181 
182 
184 
185  static const float theScaleFactor;
186  static const float theIntervalFactor;
188 
189 };
190 

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)