ParaView
pqMemoryInspectorPanel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #ifndef pqMemoryInspectorPanel_h
16 #define pqMemoryInspectorPanel_h
17 
18 #include "pqComponentsModule.h"
19 #include <QMenu>
20 #include <QProcess>
21 #include <QWidget>
22 
23 #include <map>
24 using std::map;
25 #include <string>
26 using std::string;
27 #include <vector>
28 using std::vector;
29 
30 class pqMemoryInspectorPanelUI;
31 class HostData;
32 class RankData;
33 class QTreeWidgetItem;
35 class pqView;
36 
37 class PQCOMPONENTS_EXPORT pqMemoryInspectorPanel : public QWidget
38 {
39  Q_OBJECT
40 public:
41  pqMemoryInspectorPanel(QWidget* parent = 0, Qt::WindowFlags f = 0);
43 
44  // Description:
45  // Test for successful initialization.
46  int Initialized() { return this->ClientHost != NULL; }
47 
48 protected:
49  // Description:
50  // Update when the panel is made visible.
51  virtual void showEvent(QShowEvent* event);
52 
53 protected slots:
54 
55  // Description:
56  // Configure the UI based on conneccted servers.
57  void ServerDisconnected();
58  void ServerConnected();
59 
60  // Description:
61  // The panel will update itself after render events end. Render events are
62  // used because they occur only after all server side action is complete
63  // and rendering initself can use significant resources. The update is
64  // enabled only after pqView::dataUpdatedEvent.
65  void ConnectToView(pqView* view);
66  void RenderCompleted();
67  void EnableUpdate();
68 
69  // Description:
70  // Update the UI with values from the server(s).
71  int Initialize();
72 
73  // Description:
74  // Update the UI with the latest values from the server(s).
75  void Update();
76 
77  // Description:
78  // Enable auto update.
79  void SetAutoUpdate(bool state) { this->AutoUpdate = state; }
80 
81  // Description:
82  // enable/disable stack trace.
83  void EnableStackTraceOnClient(bool enable);
84  void EnableStackTraceOnServer(bool enable);
85  void EnableStackTraceOnDataServer(bool enable);
86  void EnableStackTraceOnRenderServer(bool enable);
87 
88  // Description:
89  // run remote command on one of the client or server ranks.
90  void ExecuteRemoteCommand();
91  void RemoteCommandFailed(QProcess::ProcessError code);
92 
93  // Description:
94  // Display host properties
95  void ShowHostPropertiesDialog();
96 
97  // Description:
98  // Create a context menu for the config view.
99  void ConfigViewContextMenu(const QPoint& pos);
100 
101  // Description:
102  // Collapse or expand the view for easier navigation
103  // when larger jobs are in play.
104  void ShowOnlyNodes();
105  void ShowAllRanks();
106 
107 private:
108  void ClearClient();
109  void ClearServers();
110  void ClearServer(map<string, HostData*>& hosts, vector<RankData*>& ranks);
111 
112  void UpdateRanks();
113  void UpdateHosts();
114  void UpdateHosts(map<string, HostData*>& hosts);
115 
116  void InitializeServerGroup(long long clientPid, vtkPVSystemConfigInformation* configs,
117  int validProcessType, QTreeWidgetItem* group, string groupName, map<string, HostData*>& hosts,
118  vector<RankData*>& ranks, int& systemType);
119 
120  void EnableStackTrace(bool enable, int group);
121  void AddEnableStackTraceMenuAction(int serverType, QMenu& context);
122 
123  QWidget* NewGroupWidget(string name, string icon);
124 
125 private:
126  pqMemoryInspectorPanelUI* Ui;
127 
128  int ClientOnly;
129  HostData* ClientHost;
130  int ClientSystemType;
131  bool StackTraceOnClient;
132 
133  map<string, HostData*> ServerHosts;
134  vector<RankData*> ServerRanks;
135  int ServerSystemType;
136  bool StackTraceOnServer;
137 
138  map<string, HostData*> DataServerHosts;
139  vector<RankData*> DataServerRanks;
140  int DataServerSystemType;
141  bool StackTraceOnDataServer;
142 
143  map<string, HostData*> RenderServerHosts;
144  vector<RankData*> RenderServerRanks;
145  int RenderServerSystemType;
146  bool StackTraceOnRenderServer;
147 
148  int UpdateEnabled;
149  int PendingUpdate;
150  bool AutoUpdate;
151 };
152 
153 #endif
A vtkClientServerStream serializable conatiner of information describing memory configuration of the ...
This is a PQ abstraction of a generic view module.
Definition: pqView.h:56