VR-Exchange 2.2 API Documentation
pStatisticsViewComponent.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <namespace.h>
13 
15 
16 #include <QtCore/QObject>
17 #include <QtGui/QWidget>
18 
19 class QMenu;
20 class QPushButton;
21 
22 namespace MAKVrExchange
23 {
24 
25  class DtFrameratePlot;
26  class DtPortalConnection;
27  class DtSeriesColorRecord;
28  class DtPlotColorSettings;
29  class DtPlotterLegendDialog;
30  class DtPortalAppInitializer;
31 
34  class DT_DLL_LIBPORTALAPP DtStatisticsViewComponent : public QWidget
35  { Q_OBJECT;
36  public:
37 
40 
42  virtual ~DtStatisticsViewComponent();
43 
46  virtual void setInitializer( DtPortalAppInitializer* originalInit );
47 
49  virtual void toggleShowStatistics( bool show );
50 
53  virtual void toggleLegend( bool show );
54 
55  signals:
56 
57  // Indicates that the legend was shown or hidden
58  void legendVisibilityChanged( bool show );
59 
60  protected:
61 
64  void initView();
65 
68  void connectToSignals();
69 
72  void initializeColors();
73 
76  static void portalMessageCb( const DtPortalMessage& msg, void* usr );
77 
79  virtual void receivePortalMessage( const DtPortalMessage& msg );
80 
83  virtual void initPortalMessageFields();
84 
87  virtual void plotPortalMessageCounts();
88 
91  static void abnormalRemovalCb( const DtAbnormalBrokerExitMessage& msg, void* usr );
92 
95  static void removeBrokerCb( const DtBrokerExitingMessage& msg, void* usr );
96 
98  virtual void processBrokerRemoval( const DtString& broker );
99 
102  static void statisticsReportCb( const DtStatisticsReportMessage& msg, void* usr );
103 
105  virtual void receiveStatisticsReport( const DtStatisticsReportMessage& message );
106 
108  virtual DtU32 getSeriesId( DtU32 brokerId, const DtString& fieldName );
109 
111  virtual bool lookupSeriesBrokerField( unsigned int seriesId,
112  DtString& brokerName, DtString& fieldName );
113 
116  virtual void saveSeriesRecord( const DtSeriesColorRecord& rec );
117 
119  virtual void getSeriesRecord( const DtString& brokername,
120  const DtString& fieldname, DtSeriesColorRecord& rec );
121 
122  protected slots:
123 
125  virtual void tick();
126 
129  virtual void toggleLegend();
130 
132  virtual void onContextMenuRequested( const QPoint& where );
133 
135  virtual void onSeriesToggled( const DtString& brokerName,
136  const DtString& fieldName, bool enabled );
137 
139  virtual void onSeriesStyleChanged( const DtString& brokerName,
140  const DtString& fieldName, unsigned int style );
141 
143  virtual void onSeriesColorChanged( const DtString& brokerName,
144  const DtString& fieldName, int r, int g, int b );
145 
148  virtual void onLegendDialogClosed();
149 
150  private:
151 
154 
157 
158  protected:
159 
163  {
167  };
168 
173  typedef std::map<DtString,unsigned int> FieldIdMap;
174 
177  typedef std::map<DtU32,FieldIdMap> BrokerFieldIdMap;
179 
182  typedef std::map<unsigned int,DtU32> FieldBrokerMap;
184 
187  typedef std::map<DtU32,BrokerInfoStruct> BrokerInfoMap;
189 
193 
194  float myNextHue;
198 
199  unsigned int myPortalObjectCount;
204 
207 
210  QPushButton* myLegendButton;
212  QTimer* myTimer;
213 
214  };
215 
216 }

Document ID: Generated on Mon Apr 15 17:15:50 EDT 2013 from SVN revision 126154
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)