MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
trayIconMgr.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "rtiMsConfig.h"
13 #include "assistantMgr.h"
14 #include "rtiAssistantClient.h"
15 #include <QtGui/QIcon>
16 #include <QSystemTrayIcon>
17 #include <vlutil/vlSmartPointers.h>
18 #include <vlutil/vlPrint.h>
19 #include <map>
20 
22 class DtRtiAssistantPeer;
23 class DtAssistantComponentMenu;
25 class DtConsoleDialog;
27 class DtAboutBox;
34 class QMenu;
35 class QAction;
36 class QProcess;
37 
43 { Q_OBJECT;
44 public:
45 
47  DtAssistantTrayIconMgr( DtBoost::shared_ptr<DtRtiAssistantServer> server,
48  DtBoost::shared_ptr<DtRtiAssistantPeer> peer,
49  DtAssistantSignalRouter& signalRouter,
50  DtBoost::shared_ptr<DtAssistantComponentMgr> compMgr );
51 
53  virtual ~DtAssistantTrayIconMgr();
54 
55 private:
56 
59 
62 
63 public:
64 
66  virtual void startShutdown();
67 
68 protected:
69 
71 
72 
74  static void processNotifyMsg(const DtAssistantNotifyMsg& msg, void* usr);
75 
77  virtual void processNotifyMsg(const DtAssistantNotifyMsg& msg);
78 
80  static void processShowDialogMsg(const DtAssistantShowDialogMsg& msg, void* usr);
81 
83  virtual void processShowDialogMsg(const DtAssistantShowDialogMsg& msg);
84 
86  static void processNotifyObserveMsg(const DtAssistantNotifyObserveMsg& msg, void* usr);
87 
90  virtual void processNotifyObserveMsg(const DtAssistantNotifyObserveMsg& msg);
91 
93 
95  virtual void loadBrowserPage(const QString &page);
96 
97 signals:
98 
100  void shutdown();
101 
103  void displayActiveWarningDialogs();
104 
106  void showConfigDialog( DtPreferencesPage pageNum = DtInvalidPreferencesPage );
107 
109  void showFederationsDialog();
110 
112  void showNetworkComponentsDialog();
113 
115  void showRidConfigDialog();
116 
117 public slots:
118 
121  void showNotifyConsole();
122 
123 // //! Show the federate/federation configuration dialog.
124 // void showIndevConfigDialog();
125 
127  void showVersionsWebpage();
128 
130  void showAboutDialog();
131 
133  void showHelpDialog();
134 
136  void processHelpDialogClose();
137 
139  void notification( const MAKRti::DtString& message,
140  MAKRti::DtNotifyLevelType notifyLevel, int sourceCompId = -1,
141  bool logOnly = false, bool forward = true);
142 
144  void notification( const MAKRti::DtString& message,
145  MAKRti::DtNotifyLevelType notifyLevel, const MAKRti::DtString& source,
146  bool logOnly = false, bool forward = true);
147 
151  void showNotifyIcon();
152 
154  void clearNotifyIcon();
155 
158  void showWarningIcon();
159 
162  void clearWarningIcon();
163 
165  void processTrayIconActivation( QSystemTrayIcon::ActivationReason reason );
166 
168  void setEnableNotifications( bool enable );
169 
172  void setObservingNotifications( bool isObserving );
173 
175  void sendNotifyObserveMsg();
176 
178  void pruneStaleNotifyObservers();
179 
180 #ifdef DtDIAGNOSTIC
181  void showMsgDump();
183 #endif
184 
185 
186 protected:
187 
189  DtBoost::shared_ptr<DtAssistantComponentMgr> myCompMgr;
190 
192  QSystemTrayIcon* myTrayIcon;
193 
195  QMenu* myMenu;
196 
199 
202 
206 
209 
212 
215 
218 
221 
225 
228 
230  QProcess* myHelpAssistant;
231 
234 
238 
241 
244  std::map<int, MAKRti::DtString> myLastNotifyNames;
245 
248 
250  std::map< DtAssistantInfo, bool > myNotifyObservers;
251 
252 #ifdef _WIN32
253  bool myShowingMsgDump;
255  std::streambuf* myOriginalRdbuf;
256  DtWindowsConsolePrinter *myWinConsole;
257  std::ofstream* myConsoleStream;
258 #endif
259 
260 };
QAction * myShowNotifyHistoryAction
Context menu action to show the notification console.
Definition: trayIconMgr.h:198
The DtAssistantNotifyMsg defines a wrapper for the RTI Assistant notify message used to send informat...
Definition: assistantNotifyMsg.h:32
DtPreferencesPage
Definition: assistantEnums.h:17
std::map< int, MAKRti::DtString > myLastNotifyNames
Map of names previously displayed in a notification for a given component ID.
Definition: trayIconMgr.h:244
The DtAssistantShowDialogMsg defines a wrapper for the messages sent to and from the Assistant to del...
Definition: assistantShowDialogMsg.h:32
Dialog to hold a DtConsoleWidget.
Definition: consoleWidget.h:176
At startup all of the assistant manager classes will register their signals and slots with the signal...
Definition: assistantSignalRouter.h:29
DtBoost::shared_ptr< DtAssistantComponentMgr > myCompMgr
The manager that keeps track of all local RTI components.
Definition: trayIconMgr.h:189
unsigned myDisplayWarningCount
The count of the number of dialogs currently displayed which cause a warning icon to be displayed in ...
Definition: trayIconMgr.h:237
Definition: assistantEnums.h:27
Dialog widget to display important notifications and events by the RTI Assistant. ...
Definition: notifyDialog.h:26
virtual void startShutdown()
Performs any necessary processing at the start of shutdown.
Definition: assistantMgr.h:62
QAction * myShowAboutAction
Context menu action to show the RTI about dialog.
Definition: trayIconMgr.h:208
QMenu * myMenu
The tray icon context menu.
Definition: trayIconMgr.h:195
The &#39;about&#39; box widget.
Definition: aboutBox.h:23
DtConsoleDialog * myNotifyConsole
The dialog for the console widget which displays the full notification history.
Definition: trayIconMgr.h:224
Provides the GUI for a console which displays the contents of a log file.
Definition: fileConsoleWidget.h:27
Stores information on any RTI components.
Definition: compInfo.h:25
Base class for all classes which perform management activities for the Assistant. ...
Definition: assistantMgr.h:31
This file contains the declaration of DtAssistantMgr.
DtRtiAssistantPeer manages the sharing of information between one Assistant to other Assistants using...
Definition: rtiAssistantPeer.h:82
Contains the DtRtiAssistantClient class declaration.
Manages the server connections of the RTI Assistant.
Definition: rtiAssistantServer.h:45
bool myDisplayNotifyIcon
Indicates that the notification icon should be displayed in the tray.
Definition: trayIconMgr.h:233
QAction * myShowFederationsViewAction
Context Menu action to show the Assistant Federates View dialog.
Definition: trayIconMgr.h:211
bool myObservingNotifications
Whether notifications from other assistants are being observed.
Definition: trayIconMgr.h:247
DtAssistantMgr & operator=(DtAssistantMgr const &)
Assignment not implemented – Assignment Not Allowed!
std::map< DtAssistantInfo, bool > myNotifyObservers
The list of remote Assistants that are observing notifications.
Definition: trayIconMgr.h:250
QAction * myShowHelpAction
Context menu action to show the help dialog.
Definition: trayIconMgr.h:214
#define DT_DLL_ASSISTANTAPP
Definition: rtiMsConfig.h:122
QAction * myShowPreferencesAction
Context menu action to show the Assistant configuration preferences dialog.
Definition: trayIconMgr.h:205
DtAboutBox * myAboutDialog
The dialog that displays information about this version of the RTI.
Definition: trayIconMgr.h:227
bool myEnableNotifications
Whether or not notifications are disabled.
Definition: trayIconMgr.h:240
The DtAssistantNotifyObserveMsg defines a wrapper for the RTI Assistant message used by the Assistant...
Definition: assistantNotifyObserveMsg.h:30
DtAssistantNotifyDialog * myNotifyDialog
The dialog which displays brief notification messages.
Definition: trayIconMgr.h:220
QAction * myShutdownAllAction
Action to exit all RTI applications on this machine.
Definition: trayIconMgr.h:217
Processes information on each local RTI component that is connected to this Assistant.
Definition: componentMgr.h:38
QAction * myVersionsWebSiteAction
Context menu action to show the RTI versions web site.
Definition: trayIconMgr.h:201
QProcess * myHelpAssistant
Help application.
Definition: trayIconMgr.h:230
Responsible for maintaining the assistant tray icon, its menu, and the notifications displayed by it...
Definition: trayIconMgr.h:42
QSystemTrayIcon * myTrayIcon
The tray icon.
Definition: trayIconMgr.h:192

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)