MAK RTIspy API Documentation for HLA Evolved
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 <qtreewidget.h>
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 protected:
147 
149  virtual void updateFederateItems( const DtFederateInfoByHandleMap& federates,
150  const DtAssistantForwarderInfo * forwarderInfo,
151  QTreeWidgetItem* fedexItem );
152 
154  virtual void updateFederateItem( const DtAssistantFederateInfo& federate,
155  const DtAssistantForwarderInfo * forwarderInfo,
156  const QString& fedexName, QTreeWidgetItem* fedItem );
157 
159  virtual void updateFederateItemFromForwarderInformation(
160  const DtAssistantFederateInfo& federate,
161  const DtAssistantForwarderInfo * forwarderInfo,
162  const QString& fedexName, QTreeWidgetItem* fedItem );
163 
164 
166  virtual void removeAllFederateItems( QTreeWidgetItem* fedexItem );
167 
171  virtual void removeFederateItem( QTreeWidgetItem* fedItem,
172  QTreeWidgetItem* fedexItem, bool clearedDefunct = false );
173 
175  bool isFederateValid( QTreeWidgetItem* item ) const;
176 
178  bool isFederateLocal( QTreeWidgetItem* item ) const;
179 
182  bool isFederateLightweight( QTreeWidgetItem* item ) const;
183 
186  bool isFederationLightweight( QTreeWidgetItem* item ) const;
187 
188 public:
189 
191  {
192  FederationNameIndex = 0,
193  FederateTypeAndHandleIndex = 0, // Shares column with federation name
209  NumFederateTreeCols
210  };
211 
213  static const QString theLoadingText;
214 
216 
217  static const QString theRegulatingEnabledToolTip;
218  static const QString theRegulatingDisabledToolTip;
219  static const QString theConstrainedEnabledToolTip;
220  static const QString theConstrainedDisabledToolTip;
221  static const QString theTestCapableEnabledToolTip;
222  static const QString theTestCapableDisabledToolTip;
223  static const QString theNoTestToolTip;
224  static const QString theContinuousTestToolTip;
225  static const QString theSingleTestToolTip;
226  static const QString theFederateLogEnabledText;
227  static const QString theFederateLogDisabledText;
228 
230 
231 
232 public slots:
233 
235  void showColumns();
236 
238  void setAllColumns( const std::map<QString, std::pair<int, bool> >& columns );
239 
241  void allColumns( std::map<QString, std::pair<int, bool> >& columns );
242 
244  void showColCustomizeDlg();
245 
247  void deleteSelectedFed();
248 
251  void destroySelectedFederations();
252 
254  void updateEnableNetworkTestingForSelectedFederations();
255 
257  void openFedWebSpy();
258 
260  void showLatencyTest();
261 
263  void clearAllDefunctFederates();
264 
266  bool hasValidFederates() const;
267 
269  void clearCurrDefunctFederates();
270 
272  void refreshMenus();
273 
275  void signalSelectionChange();
276 
278  void showContextMenu( const QPoint& );
279 
280 signals:
281  void fedDeleteRequest( int, const QString& );
282  void federationDeleteRequest( const QString& fedexName );
283  void openFedWebSpyRequest( const QString&, int );
284  void enableNetworkTestingRequest( const QString& );
285  void disableNetworkTestingRequest( const QString& );
286  void showFedLatencyTest( const QString&, int );
287 
289  void federateSelected(const MAKRti::DtString& federation, int federateHandle);
290 
292  void federationSelected(const MAKRti::DtString& name);
293 
295  void nothingSelected();
296 
298  void multipleItemsSelected();
299 
301  void defunctFederateRemoved(const MAKRti::DtString& federation,
302  int federateHandle);
303 
304 protected:
305 
306  static const int FederateNameRole;
307  static const int FederateHandleRole;
308  static const int TestEnableRole;
309  static const int IsLocalRole;
310  static const int IsLightweightRole;
311 
314  {
315  public:
316 
318  : shortName()
319  , longName()
320  , description()
321  , defaultSize(50) {}
322  DtFederateTreeColDescr(const QString& s, const QString& l,
323  const QString& d, unsigned sz)
324  : shortName(s)
325  , longName(l)
326  , description(d)
327  , defaultSize(sz) {}
329 
330  QString shortName;
331  QString longName;
332  QString description;
333  unsigned defaultSize;
334  };
335 
337  std::vector<DtFederateTreeColDescr> myColumnDescrs;
338 
341 
343  std::vector< QAction* > myColDispActions;
345 
347  QMenu* myContextMenu;
350 
352 
362 
364 
371 
373 
374  QIcon myCheckIcon;
381  QIcon myTestIcon;
385 
387  std::map<QString, QString> myFederationNamesToItemNames;
388 
390  std::map<QString, QString> myItemNamesToFederationNames;
391 
397  std::map<QTreeWidgetItem*, std::pair<MAKRti::DtTime, std::pair<QString, int> > > myDefunctFederateTreeWidgets;
398 
400  std::map<QTreeWidgetItem*, std::pair<QString, int> > myReconnectingFederates;
401 
403  std::map<QTreeWidgetItem*, std::pair<QString, int> > myReconnectedFederates;
404 
406  std::set< std::pair<QString, int > > myClearedDefunctFederates;
407 
409  std::set<QTreeWidgetItem* > myTestDisabledFederations;
410 
412  std::map< MAKRti::DtString, QColor > myFederationColors;
413 
416 
417 // //! Federate items for which web spy page can be loaded
418 // std::set<QTreeWidgetItem*> myListOfWebSpyEnabledFederates;
419 
422 
425 
426  MAKRti::DtClock myTimer;
427 
430 
433  static const int theLastColDefaultedOn;
434 
435 };
436 
437 #endif

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)