MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
federateTree.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #ifndef federateTree_H_
10 #define federateTree_H_
11 
12 #include "rtiMsConfig.h"
13 #include "federationInfo.h"
14 #include <QtGui/QTreeWidget>
15 #include <vector>
16 #include <map>
17 #include <set>
18 #include <vlutil/vlTime.h>
19 #include <vlutil/vlString.h>
20 
22 
24 {
25  Q_OBJECT
26 
27 public:
28 
29  DtFederateTree( QWidget* parent );
30  virtual ~DtFederateTree();
31 
32 private:
33 
36 
38  DtFederateTree& operator=( DtFederateTree const& );
39 
40 public:
41 
43  virtual QSize sizeHint() const;
44 
46  virtual void hideEvent( QHideEvent* event );
47 
50  virtual bool updateFederation( const DtAssistantFederationInfo* federation,
51  const DtAssistantForwarderInfo* forwarderInfo );
52 
55  virtual bool removeFederation( const QString& name );
56 
58  virtual void removeAllFederations();
59 
61  virtual void updateFederationColor( const MAKRti::DtString& federationName, const QColor& color );
62 
65  virtual bool updateFederate( const DtAssistantFederateInfo& federate,
66  const DtAssistantForwarderInfo* forwarderInfo,
67  const QString& fedexName);
68 
73  virtual bool removeFederate( int federateHandle, const QString& fedexName,
74  bool clearedDefunct = false );
75 
77  virtual void displayLoadingIndication();
78 
80  virtual void removeLoadingIndication();
81 
83  bool isFederateValid( int federateHandle, const QString& fedexName ) const;
84 
86  void processInvalidList();
87 
90  QMenu* columnViewMenu() { return myColViewMenu; };
91 
94  QMenu* federateMenu() { return myFederateMenu; };
95 
97 
98  QAction* statisticsAction() { return myStatisticsAction; }
99  QAction* latencyTestAction() { return myLatencyTestAction; }
100  QAction* federateRidParamAction() { return myFederateRidParametersAction; }
101  QAction* federateFomAction() { return myFederateFomAction; }
102  QAction* federateLogAction() { return myFederateLogAction; }
103  QAction* changeFederateIconAction() { return myChangeFederateIconAction; }
104  QAction* resignFederateAction() { return myResignFederateAction; }
106 
109  QMenu* federationMenu() { return myFederationMenu; };
110 
112 
113  QAction* federationFomAction() { return myFederationFomAction; }
114  QAction* syncPointsAction() { return myDisplaySyncPointsAction; }
115  QAction* destroyFederationAction() { return myDestroyFederationAction; }
117 
120  void setFederateRemovalTime(float newTime);
121 
123  float getFederateRemovalTime() const;
124 
126  void enableDeletion( bool enable );
127 
129  QString getTreeFederationName( const MAKRti::DtString& federationName );
130 
132  void forceFederateSelection(int federateHandle, const MAKRti::DtString& federation);
133 
135  void forceFederationSelection(const MAKRti::DtString& federation);
136 
138  void forceClearSelection();
139 
141  void saveGuiConfiguration(const MAKRti::DtFilename& configFile);
142 
144  void loadGuiConfiguration(const MAKRti::DtFilename& configFile);
145 
146  void initializeQtToolTips();
147 
148 protected:
149 
151  virtual void updateFederateItems( const DtFederateInfoByHandleMap& federates,
152  const DtAssistantForwarderInfo * forwarderInfo,
153  QTreeWidgetItem* fedexItem );
154 
156  virtual void updateFederateItem( const DtAssistantFederateInfo& federate,
157  const DtAssistantForwarderInfo * forwarderInfo,
158  const QString& fedexName, QTreeWidgetItem* fedItem );
159 
161  virtual void updateFederateItemFromForwarderInformation(
162  const DtAssistantFederateInfo& federate,
163  const DtAssistantForwarderInfo * forwarderInfo,
164  const QString& fedexName, QTreeWidgetItem* fedItem );
165 
166 
168  virtual void removeAllFederateItems( QTreeWidgetItem* fedexItem );
169 
173  virtual void removeFederateItem( QTreeWidgetItem* fedItem,
174  QTreeWidgetItem* fedexItem, bool clearedDefunct = false );
175 
177  bool isFederateValid( QTreeWidgetItem* item ) const;
178 
180  bool isFederateLocal( QTreeWidgetItem* item ) const;
181 
184  bool isFederateLightweight( QTreeWidgetItem* item ) const;
185 
188  bool isFederationLightweight( QTreeWidgetItem* item ) const;
189 
190 public:
191 
193  {
194  FederationNameIndex = 0,
195  FederateTypeAndHandleIndex = 0, // Shares column with federation name
211  NumFederateTreeCols
212  };
213 
215  static const QString theLoadingText;
216 
218 
230 
232 
233 
234 public slots:
235 
237  void showColumns();
238 
240  void setAllColumns( const std::map<QString, std::pair<int, bool> >& columns );
241 
243  void allColumns( std::map<QString, std::pair<int, bool> >& columns );
244 
246  void showColCustomizeDlg();
247 
249  void deleteSelectedFed();
250 
253  void destroySelectedFederations();
254 
256  void updateEnableNetworkTestingForSelectedFederations();
257 
259  void showLatencyTest();
260 
262  void clearAllDefunctFederates();
263 
265  bool hasValidFederates() const;
266 
268  void clearCurrDefunctFederates();
269 
271  void refreshMenus();
272 
274  void signalSelectionChange();
275 
277  void showContextMenu( const QPoint& );
278 
279 signals:
280  void fedDeleteRequest( int, const QString& );
281  void federationDeleteRequest( const QString& fedexName );
282  void enableNetworkTestingRequest( const QString& );
283  void disableNetworkTestingRequest( const QString& );
284  void showFedLatencyTest( const QString&, int );
285 
287  void federateSelected(const MAKRti::DtString& federation, int federateHandle);
288 
290  void federationSelected(const MAKRti::DtString& name);
291 
293  void nothingSelected();
294 
296  void multipleItemsSelected();
297 
299  void defunctFederateRemoved(const MAKRti::DtString& federation,
300  int federateHandle);
301 
302 protected:
303 
304  static const int FederateNameRole;
305  static const int FederateHandleRole;
306  static const int TestEnableRole;
307  static const int IsLocalRole;
308  static const int IsLightweightRole;
309 
312  {
313  public:
314 
316  : shortName()
317  , longName()
318  , description()
319  , defaultSize(50) {}
320  DtFederateTreeColDescr(const QString& s, const QString& l,
321  const QString& d, unsigned sz)
322  : shortName(s)
323  , longName(l)
324  , description(d)
325  , defaultSize(sz) {}
327 
328  QString shortName;
329  QString longName;
330  QString description;
331  unsigned defaultSize;
332  };
333 
335  std::vector<DtFederateTreeColDescr> myColumnDescrs;
336 
339 
341  std::vector< QAction* > myColDispActions;
343 
345  QMenu* myContextMenu;
348 
350 
360 
362 
369 
371 
372  QIcon myCheckIcon;
379  QIcon myTestIcon;
383 
385  std::map<QString, QString> myFederationNamesToItemNames;
386 
388  std::map<QString, QString> myItemNamesToFederationNames;
389 
395  std::map<QTreeWidgetItem*, std::pair<MAKRti::DtTime, std::pair<QString, int> > > myDefunctFederateTreeWidgets;
396 
398  std::map<QTreeWidgetItem*, std::pair<QString, int> > myReconnectingFederates;
399 
401  std::map<QTreeWidgetItem*, std::pair<QString, int> > myReconnectedFederates;
402 
404  std::set< std::pair<QString, int > > myClearedDefunctFederates;
405 
407  std::set<QTreeWidgetItem* > myTestDisabledFederations;
408 
410  std::map< MAKRti::DtString, QColor > myFederationColors;
411 
414 
417 
420 
421  MAKRti::DtClock myTimer;
422 
425 
428  static const int theLastColDefaultedOn;
429 
430 };
431 
432 #endif

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)