Stellarium  0.19.3
Public Member Functions | Protected Member Functions
Scenery3dRemoteControlService Class Reference

Provides a Scenery3d service for the Remote Control Plug-in plugin.

#include <Scenery3dRemoteControlService.hpp>

Public Member Functions

 Scenery3dRemoteControlService ()
 Requires the Scenery3d module to be registered.
 
virtual QLatin1String getPath () const Q_DECL_OVERRIDE
 Returns the desired path mapping If there is a conflict, only the first object is mapped. More...
 
virtual bool isThreadSafe () const Q_DECL_OVERRIDE
 Return true if the service's get() and post() methods can safely be run in the HTTP handler thread, instead of having to queue it into the Stellarium main thread. More...
 
virtual void get (const QByteArray &operation, const APIParameters &parameters, APIServiceResponse &response) Q_DECL_OVERRIDE
 Implement this to define reactions to HTTP GET requests. More...
 
virtual void post (const QByteArray &operation, const APIParameters &parameters, const QByteArray &data, APIServiceResponse &response) Q_DECL_OVERRIDE
 Implement this to define reactions to HTTP POST requests. More...
 
virtual void update (double deltaTime) Q_DECL_OVERRIDE
 Called in the main thread each frame. More...
 

Protected Member Functions

void performMove (double x, double y, double z)
 

Member Function Documentation

◆ get()

virtual void Scenery3dRemoteControlService::get ( const QByteArray &  operation,
const APIParameters parameters,
APIServiceResponse response 
)
virtual

GET requests generally should only query data or program state, and not change it. If there is an error with the request, use APIServiceResponse::writeRequestError to notify the client.

Parameters
operationThe operation string of the request (i.e. the part of the request URL after the service name, without parameters)
parametersThe extracted service parameters (extracted from the URL)
responseThe response object, write your response into this
Note
The thread this is called in depends on the supportThreadedOperation() return value

Implements RemoteControlServiceInterface.

◆ getPath()

virtual QLatin1String Scenery3dRemoteControlService::getPath ( ) const
virtual

◆ isThreadSafe()

virtual bool Scenery3dRemoteControlService::isThreadSafe ( ) const
virtual

This can result in better performance if done correctly. Unless you are sure, return false here.

Implements RemoteControlServiceInterface.

◆ post()

virtual void Scenery3dRemoteControlService::post ( const QByteArray &  operation,
const APIParameters parameters,
const QByteArray &  data,
APIServiceResponse response 
)
virtual

POST requests generally should change data or perform some action. If there is an error with the request, use APIServiceResponse::writeRequestError to notify the client.

Parameters
operationThe operation string of the request (i.e. the part of the request URL after the service name, without parameters)
parametersThe extracted service parameters (extracted from the URL, and form data, if applicable)
dataThe unmodified data as sent from the client
responseThe response object, write your response into this
Note
The thread this is called in depends on the supportThreadedOperation() return value

Implements RemoteControlServiceInterface.

◆ update()

virtual void Scenery3dRemoteControlService::update ( double  deltaTime)
virtual

Can be used for ongoing actions, for example movement control.

Implements RemoteControlServiceInterface.