MAK RTIspy API Documentation for HLA 1.3
federationsViewDialog.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 
9 
10 #ifndef federationsViewDialog_H_
11 #define federationsViewDialog_H_
12 
13 #include "rtiMsConfig.h"
14 #include "ui_federationsViewDialogUI.h"
16 #include "federationInfo.h"
17 #include "forwarderInfo.h"
18 #include "assistantEnums.h"
19 #include <QtGui/QTreeWidget>
20 #include <map>
21 #include <vector>
22 #include <list>
23 
24 #include <vlutil/vlUtil.h>
25 #include <vlutil/vlTime.h>
26 
27 #include <QtCore/QDir>
28 #include <QtGui/QComboBox>
29 
30 class DtWidgetDialog;
31 class QSignalMapper;
32 class QProcess;
34 class QTextEdit;
35 class QSplitter;
36 class DtNetworkMapWidget;
37 class QTime;
40 class DtFederateTree;
42 class QLabel;
43 
45 {
46  Q_OBJECT
47 
48 public:
50  {
51  DtFederationsViewProcess = 0,
59  DtFederationsViewCommandLine
60  };
61 
64  const MAKRti::DtFilename& configDir,
65  QWidget* parent = 0,
66  Qt::WindowFlags flags = 0 );
67 
69  virtual ~DtFederationsViewDialog();
70 
72  virtual QSize sizeHint() const;
73 
75  virtual void tick();
76 
79  virtual void setConnectionIsLocal( const MAKRti::DtString& name, bool isLocal );
80 
82  virtual void checkAndAddMainForwarder(const MAKRti::DtString& hostname);
83 
85  virtual void checkAndAddLightweight(const MAKRti::DtString& hostname);
86 
88  virtual void addNetworkMapForwarderNode(const MAKRti::DtString& forwarderName);
89 
91  virtual void removeNetworkMapForwarderNode(const MAKRti::DtString& forwarderName);
92 
94  virtual void addNetworkMapRtiexecNode();
95 
97  virtual void removeNetworkMapRtiexecNode();
98 
100  virtual void addNetworkMapFederateNode( int fedHandle,
101  const MAKRti::DtString& federationName,
102  const MAKRti::DtString& processName, const MAKRti::DtString& fedType,
103  const MAKRti::DtString& fedName, bool notJoined = false,
104  bool isDropped = false);
105 
107  virtual void removeNetworkMapFederateNode(int fedHandle,
108  const MAKRti::DtString& federationName );
109 
111  void updateNetworkMapFederateNode( int fedHandle,
112  const MAKRti::DtString& federationName, int queueStatus,
113  bool disconnected, bool reconnecting, bool inErrorState = false );
114 
116  void refreshNetworkMap();
117 
119  virtual void clearData();
120 
122  virtual void setViewedConnectionDescription(const DtRtiConnectionInfo& conn);
123 
125  virtual void clearNetworkMap();
126 
128  virtual void enableCommands( bool enable );
129 
131  virtual void enableRtiExecShutdownCommand( bool enable );
132 
134  virtual void enableRtiForwarderShutdownCommand( bool enable );
135 
136  //virtual void refreshCommandsEnabled();
137 
139  virtual void displayLoadingIndication();
140 
142  virtual void removeLoadingIndication();
143 
145  void saveGuiConfiguration();
146 
147  Ui::FederationsViewDialog getUiImpl() const;
148 
149  // Ported from federationsViewDialog
154  virtual int addConnection( const MAKRti::DtString& name,
155  const DtRtiConnectionInfo& conn, bool isLocal );
156 
158  virtual void removeConnection( const MAKRti::DtString& name );
159 
162  virtual void updateFederations( const DtFederationStateByNameMap* federations,
163  const DtAssistantForwarderInfo* forwarderInfo );
164 
167  virtual void updateFederation( const DtAssistantFederationInfo* federation,
168  const DtAssistantForwarderInfo* forwarderInfo );
169 
171  virtual void removeFederation( const MAKRti::DtString& federationName );
172 
174  virtual void removeAllFederations();
175 
178  virtual void updateFederate( const DtAssistantFederateInfo& federate,
179  const DtAssistantForwarderInfo * forwarderInfo,
180  const MAKRti::DtString& federationName );
181 
184  virtual void removeFederate( int federateHandle, const MAKRti::DtString& federationName);
185 
188  void setupFederateTree();
189 
191  virtual void setFederateIdentifierType( DtFederateIdentifierType fedIdType );
192 
194  void selectFederate(const MAKRti::DtString& federation, int federateHandle,
195  const DtAssistantFederateInfo* fedInfo,
196  const DtAssistantNetworkCompInfo* netCompInfo);
197 
199  void selectDeadFederate(const MAKRti::DtString& federation,
200  const MAKRti::DtString& federateName, const DtAssistantNetworkCompInfo& newInfo);
201 
203  void selectRtiexec(const DtAssistantNetworkCompInfo* netCompInfo);
204 
206  void selectForwarder(const MAKRti::DtString& name);
207 
209  void selectPeerForwarder(const DtAssistantNetworkCompInfo* netCompInfo);
210 
212  void selectFederation(const DtAssistantFederationInfo*);
213 
215  void selectLightweight();
216 
217  virtual void initializeQtToolTips();
218 
219 public slots:
220 
223  void processConnectionSelection( int index, bool ignoreVisibility = false );
224 
226  void showHelpDialog();
227 
229  void processHelpDialogClose();
230 
232  void showEvent( QShowEvent* event );
233 
235  virtual void hideEvent( QHideEvent* event );
236 
238  void closeEvent(QCloseEvent* event);
239 
241  void keyPressEvent( QKeyEvent* event );
242 
244  void shutdownCurrentRtiexec();
245 
247  void shutdownCurrentRtiForwarder();
248 
250  void updateNetworkMap();
251 
253  void changeFederationColor( const QString & federationName,
254  const QColor & newColor );
255 
257  void enableFederationColors( bool enable );
258 
260  void setFederateIdentifierType( unsigned int fedIdType );
261 
263  void showSyncPointDialog();
264 
266  void showFederateStatsDialog();
267 
269  void showFomDialog();
270 
272  void enableOrDisableMenuActions( const DtRtiConnectionInfo& conn );
273 
275  void updateFederateRemovalTime( float period );
276 
278  void clearSelection();
279 
281  void updateFederateIcon();
282 
284  void showSelectedFederateRidParams();
285 
287  void showSelectedFederateLog();
288 
289 signals:
290 
292  void viewedConnectionChanged( const DtRtiConnectionInfo& conn );
294  void shutdownRtiexec();
295 
297  void shutdownForwarder();
298 
300  void aboutDialogRequested();
301 
303  void showPopup(const MAKRti::DtString&, const MAKRti::DtString&, const MAKRti::DtString&);
304 
306  void forceFederateResign( int, const QString& );
307 
309  void forceFederationDestroy( const QString& );
310 
312  void showRtiexecRidParams();
313 
315  void showForwarderRidParams();
316 
318  void showFederateRidParams(const MAKRti::DtString& federation, int federateHandle);
319 
321  void showRtiexecLog();
322 
324  void showForwarderLog();
325 
327  void showFederateLog(const MAKRti::DtString& federation, int federateHandle);
328 
330  void showLatencyTestDialog( const QString& fedexName, int fedHandle );
331 
333  void enableNetworkTesting( const QString& fedexName );
334 
336  void disableNetworkTesting( const QString& fedexName );
337 
340  void saveToLog();
341 
343  void showFederationsViewPreferences();
344 
346  void federateSelected(const MAKRti::DtString& federation, int federateHandle);
347 
349  void rtiexecSelected();
350 
352  void forwarderSelected(const MAKRti::DtString& name);
353 
355  void peerForwarderSelected(const MAKRti::DtString& name);
356 
358  void federationSelected(const MAKRti::DtString& name);
359 
361  void lightweightSelected();
362 
364  void showSyncPointDialog(const MAKRti::DtString& name);
365 
367  void showFederateStatsDialog(const MAKRti::DtString& federation,
368  int federateHandle);
369 
371  void defunctFederateRemoved(const MAKRti::DtString& federation,
372  int federateHandle);
373 
375  void showFomDialog(const MAKRti::DtString& federation, int federateHandle);
376 
377 protected:
378 
380  void showFederateInfo(const MAKRti::DtString& federation, int federateHandle,
381  const DtAssistantFederateInfo* fedInfo,
382  const DtAssistantNetworkCompInfo* netCompInfo );
384  void showDeadFederateInfo(const MAKRti::DtString& federation,
385  const MAKRti::DtString& federateName, bool isDropped, const DtAssistantNetworkCompInfo& newInfo );
386 
388  void showRtiexecInfo( const DtAssistantNetworkCompInfo* info );
389 
391  void showForwarderInfo( const DtRtiConnectionInfo& info );
392 
394  void showPeerForwarderInfo( const DtAssistantNetworkCompInfo* netCompInfo );
395 
399  void showFederationInfo( const DtAssistantFederationInfo* info, bool update );
400 
402  void showLightweightInfo( const DtRtiConnectionInfo& info );
403 
405  MAKRti::DtString selectedFederateId() const;
406 
408 
409 
410  void setupUI();
411 
413  void setupMenus();
414 
416  void connectSignals();
418 
420  void loadGuiConfiguration();
421 
422 protected:
423 
424  Ui::FederationsViewDialog myUiImpl;
425 
427 
429  QProcess* myHelpAssistant;
430 
433 
438  QToolBar* myToolBar;
440 
443 
445 
446 
447  QMenu* myFileMenu;
448  QAction* myCloseAction;
449  QAction* mySaveAction;
450 
452  QMenu* myViewMenu;
456 
462 
468 
478 
484 
486  QMenu* myToolsMenu;
487  QAction* myOptionsAction;
488 
490  QMenu* myHelpMenu;
491  QAction* myHelpAction;
492  QAction* myAboutAction;
493 
497 
500 
503 
505  static const QString theLoadingText;
506 
511 
514 
516  QDockWidget* myNetworkMapDock;
517  QDockWidget* mySelectedItemDock;
518 
521 
524 
527 
529  MAKRti::DtFilename myConfigDir;
530 
533 
534  // Ported from federationsViewDialog
535 
537  std::map< QString, DtRtiConnectionInfo > myConnsByName;
538 
541 
544 
546  QDockWidget* myFederationsViewDock;
547 
550 
552  {
558  DtNoSelectedNode
559  };
560 
563 
565  MAKRti::DtString mySelectedFederation;
566 
569 
571  MAKRti::DtString mySelectedFederateType;
572 
574  MAKRti::DtString mySelectedFederateName;
575 
577  MAKRti::DtFilename mySelectedFederateProcess;
578 
581 
583  static const MAKRti::DtFilename theConfigFilename;
584 
587 
593 
594 };
595 
596 #endif
597 
598 

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)