pqServer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqServer_h
5 #define pqServer_h
6 
7 class vtkObject;
8 class pqTimeKeeper;
9 class vtkProcessModule;
11 class vtkPVXMLElement;
12 class vtkSMApplication;
13 class vtkSMProxy;
16 class vtkSMSession;
18 
19 #include "pqCoreModule.h"
21 #include "pqServerResource.h"
22 #include "pqTimer.h"
23 #include "vtkSMMessageMinimal.h"
24 #include "vtkSmartPointer.h"
25 #include "vtkWeakPointer.h"
26 
27 #include <QPointer>
28 
29 class QProcess;
30 
37 class PQCORE_EXPORT pqServer : public pqServerManagerModelItem
38 {
39  Q_OBJECT
40 public:
41  pqServer(vtkIdType connectionId, QObject* parent = nullptr);
42  ~pqServer() override;
43 
44  const pqServerResource& getResource();
45  void setResource(const pqServerResource& server_resource);
46 
50  vtkSMSession* session() const;
51 
55  vtkIdType GetConnectionID() const;
56  vtkIdType sessionId() const { return this->GetConnectionID(); }
57 
61  vtkSMSessionProxyManager* proxyManager() const;
62 
67  vtkSMProxySelectionModel* activeSourcesSelectionModel() const;
68 
72  vtkSMProxySelectionModel* activeViewSelectionModel() const;
73 
78  int getNumberOfPartitions();
79 
84  bool isRemote() const;
85 
90  bool isMaster() const;
91 
97  bool isProcessingPending() const;
98 
103  bool isRenderServerSeparate();
104 
108  pqTimeKeeper* getTimeKeeper() const;
109 
114  vtkPVServerInformation* getServerInformation() const;
115 
120  bool isProgressPending() const;
121 
128  static void setHeartBeatTimeoutSetting(int msec);
129  static int getHeartBeatTimeoutSetting();
130 
134  void setMonitorServerNotifications(bool);
135 
139  int getRemainingLifeTime() const;
140 
144  void setRemainingLifeTime(int value);
145 
147 
151  void setScriptProcess(QProcess* process);
152  QProcess* getScriptProcess() const;
154 
155 Q_SIGNALS:
159  void nameChanged(pqServerManagerModelItem*);
160 
167  void fiveMinuteTimeoutWarning();
168 
174  void finalTimeoutWarning();
175 
179  void serverSideDisconnected();
180 
181 protected:
185  static const char* HEARBEAT_TIME_SETTING_KEY();
186 
190  void setHeartBeatTimeout(int msec);
191 
192  // ---- Collaboration client-to-clients communication mechanisme ----
193 
194 Q_SIGNALS:
206  void sentFromOtherClient(pqServer*, vtkSMMessage* msg);
207 
211  void triggeredMasterUser(int);
212  void triggeredUserName(int, QString&);
213  void triggeredUserListChanged();
214  void triggerFollowCamera(int);
215 
216 public Q_SLOTS:
220  void sendToOtherClients(vtkSMMessage* msg);
221 
222  // ---- Collaboration client-to-clients communication mechanisme ----
223 
224 protected Q_SLOTS:
228  void heartBeat();
229 
233  void updateRemainingLifeTime();
234 
238  void processServerNotification();
239 
245  void onCollaborationCommunication(vtkObject*, unsigned long, void*, void*);
246 
251  void onConnectionLost(vtkObject*, unsigned long, void*, void*);
252 
253 private:
254  Q_DISABLE_COPY(pqServer)
255 
256  pqServerResource Resource;
257  vtkIdType ConnectionID;
259  vtkSmartPointer<vtkSMProxy> ExecutableRunnerProxy;
260 
261  pqTimer IdleCollaborationTimer;
262 
263  class pqInternals;
264  pqInternals* Internals;
265 };
266 
267 #endif // !pqServer_h
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:22
Gets features of the server.
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
pqTimeKeeper is pqProxy for "TimeKeeper" proxy.
Definition: pqTimeKeeper.h:18
int vtkIdType
vtkIdType sessionId() const
Definition: pqServer.h:56
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
implementation for View that includes render window and renderers.
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
value
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
pqServerResource encapsulates a resource in ParaView.
process initialization and management core for ParaView processes.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:37