Stellarium  23.4
Data Structures
RemoteSync plug-in

Data Structures

class  RemoteSync
 Main class of the RemoteSync plug-in. More...
 

Detailed Description

Provides state synchronization for multiple Stellarium instances running in a network. See manual for detailed description.

This plugin makes use of the QLoggingCategory infrastructure. By default it is very verbose. To reduce verbosity, configure an environment variable with these entries (Note the closing semicolon!): QT_LOGGING_RULES="stel.plugin.remoteSync.debug=false; stel.plugin.remoteSync.client.debug=false; stel.plugin.remoteSync.protocol.debug=true;"

The final parts may be debug|info|warning|critical = true|false. Default=true.


Data Structure Documentation

◆ RemoteSync

class RemoteSync

Main class of the RemoteSync plug-in.

Provides a synchronization mechanism for multiple Stellarium instances in a network. This plugin has been developed during ESA SoCiS 2015/2016.

Author
Florian Schaukowitsch
Georg Zotti

Public Types

enum  SyncState {
  IDLE , SERVER , CLIENT , CLIENT_CONNECTING ,
  CLIENT_CLOSING , CLIENT_WAIT_RECONNECT
}
 
enum  ClientBehavior { NONE , RECONNECT , QUIT }
 Defines behavior when client connection is lost/server quits.
 
- Public Types inherited from StelModule
enum  StelModuleSelectAction { AddToSelection , ReplaceSelection , RemoveFromSelection }
 Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More...
 
enum  StelModuleActionName {
  ActionDraw , ActionUpdate , ActionHandleMouseClicks , ActionHandleMouseMoves ,
  ActionHandleKeys
}
 Define the possible action for which an order is defined. More...
 

Public Slots

void setClientServerHost (const QString &clientServerHost)
 
void setClientServerPort (const int port)
 
void setServerPort (const int port)
 
void setClientSyncOptions (SyncClient::SyncOptions options)
 
void setStelPropFilter (const QStringList &stelPropFilter)
 
void setConnectionLostBehavior (const RemoteSync::ClientBehavior bh)
 
void setQuitBehavior (const RemoteSync::ClientBehavior bh)
 
void startServer ()
 Starts the plugin in server mode, on the port specified by the serverPort property. More...
 
void stopServer ()
 Tries to disconnect all current clients and stops the server, returning to the IDLE state. More...
 
void connectToServer ()
 Connects the plugin to the server specified by the clientServerHost and clientServerPort properties. More...
 
void disconnectFromServer ()
 Disconnects from the server and returns to the IDLE state. More...
 
void loadSettings ()
 Load the plug-in's settings from the configuration file. More...
 
void saveSettings ()
 Save the plug-in's settings to the configuration file. More...
 
void restoreDefaultSettings ()
 Restore the plug-in's settings to the default state. More...
 

Signals

void errorOccurred (const QString &errorString)
 
void clientServerHostChanged (const QString &clientServerHost)
 
void clientServerPortChanged (const int port)
 
void serverPortChanged (const int port)
 
void clientSyncOptionsChanged (const SyncClient::SyncOptions options)
 
void stelPropFilterChanged (const QStringList &stelPropFilter)
 
void connectionLostBehaviorChanged (const RemoteSync::ClientBehavior bh)
 
void quitBehaviorChanged (const RemoteSync::ClientBehavior bh)
 
void stateChanged (RemoteSync::SyncState state)
 

Public Member Functions

void init () override
 Initialize itself. More...
 
void update (double deltaTime) override
 Update the module with respect to the time. More...
 
double getCallOrder (StelModuleActionName actionName) const override
 Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations. More...
 
bool configureGui (bool show=true) override
 Detect or show the configuration GUI elements for the module. More...
 
QString getClientServerHost () const
 
quint16 getClientServerPort () const
 
quint16 getServerPort () const
 
SyncClient::SyncOptions getClientSyncOptions () const
 
QStringList getStelPropFilter () const
 
ClientBehavior getConnectionLostBehavior () const
 
ClientBehavior getQuitBehavior () const
 
SyncState getState () const
 
- Public Member Functions inherited from StelModule
 StelModule ()
 Constructor. Every derived class MUST call setObjectName(className) in its constructor.
 
virtual void deinit ()
 Called before the module will be deleted, and before the OpenGL context is suppressed. More...
 
virtual QSettings * getSettings ()
 Return module-specific settings. More...
 
virtual void draw (StelCore *core)
 Execute all the drawing functions for this module. More...
 
virtual QString getModuleVersion () const
 Get the version of the module, default is stellarium main version.
 
virtual QString getAuthorName () const
 Get the name of the module author.
 
virtual QString getAuthorEmail () const
 Get the email address of the module author.
 
virtual void handleMouseClicks (class QMouseEvent *)
 Handle mouse clicks. More...
 
virtual void handleMouseWheel (class QWheelEvent *)
 Handle mouse wheel. More...
 
virtual bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves. More...
 
virtual void handleKeys (class QKeyEvent *e)
 Handle key events. More...
 
virtual bool handlePinch (qreal scale, bool started)
 Handle pinch gesture events. More...
 

Static Public Member Functions

static bool isPropertyBlacklisted (const QString &name)
 Very few propertries cannot be synchronized for technical reasons.
 

Additional Inherited Members

- Protected Member Functions inherited from StelModule
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to slot) to the StelActionMgr object. More...
 
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to own slot) to the StelActionMgr object. More...
 
StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *contextObject, std::function< void()> lambda, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to Lambda functor) to the StelActionMgr object. More...
 

Member Function Documentation

◆ configureGui()

bool RemoteSync::configureGui ( bool  show = true)
overridevirtual

Detect or show the configuration GUI elements for the module.

This is to be used with plugins to display a configuration dialog from the plugin list window.

Parameters
showif true, make the configuration GUI visible. If false, hide the config GUI if there is one.
Returns
true if the module has a configuration GUI, else false.

Reimplemented from StelModule.

◆ connectToServer

void RemoteSync::connectToServer ( )
slot

Connects the plugin to the server specified by the clientServerHost and clientServerPort properties.

If currently in a state other than IDLE or CLIENT_WAIT_RECONNECT, this call has no effect.

◆ disconnectFromServer

void RemoteSync::disconnectFromServer ( )
slot

Disconnects from the server and returns to the IDLE state.

Only has an effect in the CLIENT state.

◆ getCallOrder()

double RemoteSync::getCallOrder ( StelModuleActionName  actionName) const
overridevirtual

Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.

Parameters
actionNamethe name of the action for which we want the call order
Returns
the value defining the order. The closer to 0 the earlier the module's action will be called

Reimplemented from StelModule.

◆ init()

void RemoteSync::init ( )
overridevirtual

Initialize itself.

If the initialization takes significant time, the progress should be displayed on the loading bar.

Implements StelModule.

◆ loadSettings

void RemoteSync::loadSettings ( )
slot

Load the plug-in's settings from the configuration file.

Settings are kept in the "RemoteSync" section in Stellarium's configuration file. If no such section exists, it will load default values.

See also
saveSettings(), restoreSettings()

◆ restoreDefaultSettings

void RemoteSync::restoreDefaultSettings ( )
slot

Restore the plug-in's settings to the default state.

Replace the plug-in's settings in Stellarium's configuration file with the default values and re-load them. Uses internally loadSettings() and saveSettings().

◆ saveSettings

void RemoteSync::saveSettings ( )
slot

Save the plug-in's settings to the configuration file.

See also
loadSettings(), restoreSettings()

◆ startServer

void RemoteSync::startServer ( )
slot

Starts the plugin in server mode, on the port specified by the serverPort property.

If currently in a state other than IDLE, this call has no effect.

◆ stopServer

void RemoteSync::stopServer ( )
slot

Tries to disconnect all current clients and stops the server, returning to the IDLE state.

Only has an effect in the SERVER state.

◆ update()

void RemoteSync::update ( double  deltaTime)
overridevirtual

Update the module with respect to the time.

Parameters
deltaTimethe time increment in second since last call.

Reimplemented from StelModule.