OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ExternalServicesComponent Class Reference

#include "ExternalServicesComponent.h"

Inheritance diagram for ExternalServicesComponent:
ak::aNotifier ot::ActionHandler

Public Types

enum  RequestType { EXECUTE , QUEUE }
 

Public Slots

char * performAction (const char *json, const char *senderIP)
 
void queueAction (const char *json, const char *senderIP)
 
void deallocateData (const char *data)
 
void shutdownAfterSessionServiceDisconnected (void)
 
void sendExecuteRequest (const char *url, const char *message)
 
char * sendExecuteRequestWithAnswer (const char *url, const char *message)
 
void setProgressState (bool visible, const char *message, bool continuous)
 
void setProgressValue (int percentage)
 
void lockGui (void)
 
void unlockGui (void)
 
void showError (const char *message)
 
void showInformation (const char *message)
 
void activateModelVersion (const char *version)
 
void keepAlive ()
 

Public Member Functions

 ExternalServicesComponent (AppBase *_owner)
 
virtual ~ExternalServicesComponent (void)
 
void shutdown (void)
 
const std::string & sessionServiceURL (void) const
 
const std::string & uiServiceURL (void) const
 
ControlsManagercontrolsManager (void)
 
LockManagerlockManager (void)
 
void setSessionServiceURL (const std::string &_url)
 
void setUiServiceURL (const std::string &_url)
 
void setRelayServiceIsRequired (void)
 
void setMessagingRelay (const std::string &_relayAddress)
 
KeyboardCommandHandleraddShortcut (ServiceDataUi *_sender, const std::string &_keySequence)
 
std::list< std::string > GetAllUserProjects ()
 
ModelUIDtype createModel (const std::string &_projectName, const std::string &_collectionName)
 
bool deleteModel (ModelUIDtype modelID)
 
void setVisualizationModel (ModelUIDtype modelID, ModelUIDtype visualizationModelID)
 
ModelUIDtype getVisualizationModel (ModelUIDtype modelID)
 
bool isModelModified (ModelUIDtype modelID)
 
bool isCurrentModelModified (void)
 
virtual void notify (ak::UID _senderId, ak::eventType _event, int _info1, int _info2) override
 Will notify this receiver that a message was received by a sender.
 
void fillPropertyGrid (const std::string &_settings)
 
void modelSelectionChangedNotification (ModelUIDtype modelID, std::list< ModelUIDtype > &selectedEntityID, std::list< ModelUIDtype > &selectedVisibleEntityID)
 
void itemRenamed (ModelUIDtype modelID, const std::string &newName)
 
ot::PropertycreateCleanedProperty (const ot::Property *const _item)
 
void propertyGridValueChanged (const ot::Property *_property)
 
void propertyGridValueDeleteRequested (const ot::Property *_property)
 
void executeAction (ModelUIDtype modelID, ModelUIDtype buttonID)
 
void entitiesSelected (ModelUIDtype modelID, ot::serviceID_t replyToServiceID, const std::string &selectionAction, const std::string &selectionInfo, std::list< std::string > &optionNames, std::list< std::string > &optionValues)
 
void prefetchDataThread (const std::string &projectName, std::list< std::pair< unsigned long long, unsigned long long > > prefetchIDs)
 
void sendToModelService (const std::string &_message, std::string _response)
 
bool sendHttpRequest (RequestType operation, const std::string &url, ot::JsonDocument &doc, std::string &response)
 
bool sendHttpRequest (RequestType operation, ot::OwnerService _service, ot::JsonDocument &doc, std::string &response)
 
bool sendHttpRequest (RequestType operation, const ot::BasicServiceInformation &_service, ot::JsonDocument &doc, std::string &response)
 
bool sendHttpRequest (RequestType operation, const std::string &url, const std::string &message, std::string &response)
 
bool sendRelayedRequest (RequestType operation, const std::string &url, const std::string &json, std::string &response)
 
bool sendKeySequenceActivatedMessage (KeyboardCommandHandler *_sender)
 
void sendRubberbandResultsToService (ot::serviceID_t _serviceId, const std::string &_note, const std::string &_pointJson, const std::vector< double > &transform)
 
void requestUpdateVTKEntity (unsigned long long modelEntityID)
 
void versionSelected (const std::string &_version)
 
void versionDeselected (void)
 
void activateVersion (const std::string &_version)
 
std::list< ot::ProjectTemplateInformationgetListOfProjectTemplates (void)
 
void openProject (const std::string &projectName, const std::string &projectType, const std::string &collectionName)
 
void closeProject (bool saveChanges)
 
void saveProject ()
 
bool projectIsOpened (const std::string &projectName, std::string &projectUser)
 
std::list< std::string > RequestFileNames (const std::string &dialogTitle, const std::string &fileMask)
 
void ReadFileContent (const std::string &fileName, std::string &fileContent, unsigned long long &uncompressedDataLength)
 
void InformSenderAboutFinishedAction (std::string URL, std::string subsequentFunction)
 
ServiceDataUigetServiceFromName (const std::string &_serviceName)
 
ServiceDataUigetServiceFromNameType (const ot::BasicServiceInformation &_info)
 
ServiceDataUigetServiceFromNameType (const std::string &_serviceName, const std::string &_serviceType)
 
 OT_HANDLER (handleStudioSuiteAction, ExternalServicesComponent, OT_ACTIONLIST(OT_ACTION_CMD_UI_SS_IMPORT, OT_ACTION_CMD_UI_SS_COMMIT, OT_ACTION_CMD_UI_SS_GET, OT_ACTION_CMD_UI_SS_UPLOAD, OT_ACTION_CMD_UI_SS_DOWNLOAD, OT_ACTION_CMD_UI_SS_COPY, OT_ACTION_CMD_UI_SS_INFORMATION, OT_ACTION_CMD_UI_SS_SETCSTFILE), ot::MessageType::ALL_MESSAGE_TYPES) OT_HANDLER(handleLTSpiceAction
 
 OT_ACTIONLIST (OT_ACTION_CMD_UI_LTS_IMPORT, OT_ACTION_CMD_UI_LTS_COMMIT, OT_ACTION_CMD_UI_LTS_GET, OT_ACTION_CMD_UI_LTS_UPLOAD, OT_ACTION_CMD_UI_LTS_DOWNLOAD, OT_ACTION_CMD_UI_LTS_COPY, OT_ACTION_CMD_UI_LTS_INFORMATION, OT_ACTION_CMD_UI_LTS_SETLTSPICEFILE)
 
- Public Member Functions inherited from ak::aNotifier
 aNotifier ()
 Will initialize the notifier.
 
virtual ~aNotifier ()
 Destructor.
 
void enable (void)
 Will enable this notifier.
 
void disable (void)
 Will disable this notifier.
 
bool isEnabled (void) const
 Will return true if this notifier is enabled.
 
- Public Member Functions inherited from ot::ActionHandler
 ActionHandler ()
 
 ActionHandler (const ActionHandler &_other)=default
 
 ActionHandler (ActionHandler &&_other)=default
 
virtual ~ActionHandler ()
 
ActionHandleroperator= (const ActionHandler &_other)=default
 
ActionHandleroperator= (ActionHandler &&_other)=default
 

Public Attributes

 ExternalServicesComponent
 

Additional Inherited Members

- Protected Attributes inherited from ak::aNotifier
bool m_isEnabled
 

Member Enumeration Documentation

◆ RequestType

Enumerator
EXECUTE 
QUEUE 

Constructor & Destructor Documentation

◆ ExternalServicesComponent()

ExternalServicesComponent::ExternalServicesComponent ( AppBase * _owner)

◆ ~ExternalServicesComponent()

ExternalServicesComponent::~ExternalServicesComponent ( void )
virtual

Member Function Documentation

◆ activateModelVersion

void ExternalServicesComponent::activateModelVersion ( const char * version)
slot

◆ activateVersion()

void ExternalServicesComponent::activateVersion ( const std::string & _version)

◆ addShortcut()

KeyboardCommandHandler * ExternalServicesComponent::addShortcut ( ServiceDataUi * _sender,
const std::string & _keySequence )

◆ closeProject()

void ExternalServicesComponent::closeProject ( bool saveChanges)

◆ controlsManager()

ControlsManager * ExternalServicesComponent::controlsManager ( void )
inline

◆ createCleanedProperty()

ot::Property * ExternalServicesComponent::createCleanedProperty ( const ot::Property *const _item)

◆ createModel()

ModelUIDtype ExternalServicesComponent::createModel ( const std::string & _projectName,
const std::string & _collectionName )

◆ deallocateData

void ExternalServicesComponent::deallocateData ( const char * data)
slot

◆ deleteModel()

bool ExternalServicesComponent::deleteModel ( ModelUIDtype modelID)

◆ entitiesSelected()

void ExternalServicesComponent::entitiesSelected ( ModelUIDtype modelID,
ot::serviceID_t replyToServiceID,
const std::string & selectionAction,
const std::string & selectionInfo,
std::list< std::string > & optionNames,
std::list< std::string > & optionValues )

◆ executeAction()

void ExternalServicesComponent::executeAction ( ModelUIDtype modelID,
ModelUIDtype buttonID )

◆ fillPropertyGrid()

void ExternalServicesComponent::fillPropertyGrid ( const std::string & _settings)

◆ GetAllUserProjects()

std::list< std::string > ExternalServicesComponent::GetAllUserProjects ( )

◆ getListOfProjectTemplates()

std::list< ot::ProjectTemplateInformation > ExternalServicesComponent::getListOfProjectTemplates ( void )

◆ getServiceFromName()

ServiceDataUi * ExternalServicesComponent::getServiceFromName ( const std::string & _serviceName)

◆ getServiceFromNameType() [1/2]

ServiceDataUi * ExternalServicesComponent::getServiceFromNameType ( const ot::BasicServiceInformation & _info)

◆ getServiceFromNameType() [2/2]

ServiceDataUi * ExternalServicesComponent::getServiceFromNameType ( const std::string & _serviceName,
const std::string & _serviceType )

◆ getVisualizationModel()

ModelUIDtype ExternalServicesComponent::getVisualizationModel ( ModelUIDtype modelID)

◆ InformSenderAboutFinishedAction()

void ExternalServicesComponent::InformSenderAboutFinishedAction ( std::string URL,
std::string subsequentFunction )

◆ isCurrentModelModified()

bool ExternalServicesComponent::isCurrentModelModified ( void )

◆ isModelModified()

bool ExternalServicesComponent::isModelModified ( ModelUIDtype modelID)

◆ itemRenamed()

void ExternalServicesComponent::itemRenamed ( ModelUIDtype modelID,
const std::string & newName )

◆ keepAlive

void ExternalServicesComponent::keepAlive ( )
slot

◆ lockGui

void ExternalServicesComponent::lockGui ( void )
slot

◆ lockManager()

LockManager * ExternalServicesComponent::lockManager ( void )
inline

◆ modelSelectionChangedNotification()

void ExternalServicesComponent::modelSelectionChangedNotification ( ModelUIDtype modelID,
std::list< ModelUIDtype > & selectedEntityID,
std::list< ModelUIDtype > & selectedVisibleEntityID )

◆ notify()

void ExternalServicesComponent::notify ( ak::UID _senderId,
ak::eventType _event,
int _info1,
int _info2 )
overridevirtual

Will notify this receiver that a message was received by a sender.

Parameters
_senderIdThe id of the sender the message was sent from
_eventThe event message
_info1Message addition 1
_info2Message addition 2
Exceptions
std::exceptionon any error occuring during the execution

Implements ak::aNotifier.

◆ openProject()

void ExternalServicesComponent::openProject ( const std::string & projectName,
const std::string & projectType,
const std::string & collectionName )

◆ OT_ACTIONLIST()

◆ OT_HANDLER()

◆ performAction

char * ExternalServicesComponent::performAction ( const char * json,
const char * senderIP )
slot

◆ prefetchDataThread()

void ExternalServicesComponent::prefetchDataThread ( const std::string & projectName,
std::list< std::pair< unsigned long long, unsigned long long > > prefetchIDs )

◆ projectIsOpened()

bool ExternalServicesComponent::projectIsOpened ( const std::string & projectName,
std::string & projectUser )

◆ propertyGridValueChanged()

void ExternalServicesComponent::propertyGridValueChanged ( const ot::Property * _property)

◆ propertyGridValueDeleteRequested()

void ExternalServicesComponent::propertyGridValueDeleteRequested ( const ot::Property * _property)

◆ queueAction

void ExternalServicesComponent::queueAction ( const char * json,
const char * senderIP )
slot

◆ ReadFileContent()

void ExternalServicesComponent::ReadFileContent ( const std::string & fileName,
std::string & fileContent,
unsigned long long & uncompressedDataLength )

◆ RequestFileNames()

std::list< std::string > ExternalServicesComponent::RequestFileNames ( const std::string & dialogTitle,
const std::string & fileMask )

◆ requestUpdateVTKEntity()

void ExternalServicesComponent::requestUpdateVTKEntity ( unsigned long long modelEntityID)

◆ saveProject()

void ExternalServicesComponent::saveProject ( )

◆ sendExecuteRequest

void ExternalServicesComponent::sendExecuteRequest ( const char * url,
const char * message )
slot

◆ sendExecuteRequestWithAnswer

char * ExternalServicesComponent::sendExecuteRequestWithAnswer ( const char * url,
const char * message )
slot

◆ sendHttpRequest() [1/4]

bool ExternalServicesComponent::sendHttpRequest ( RequestType operation,
const ot::BasicServiceInformation & _service,
ot::JsonDocument & doc,
std::string & response )

◆ sendHttpRequest() [2/4]

bool ExternalServicesComponent::sendHttpRequest ( RequestType operation,
const std::string & url,
const std::string & message,
std::string & response )

◆ sendHttpRequest() [3/4]

bool ExternalServicesComponent::sendHttpRequest ( RequestType operation,
const std::string & url,
ot::JsonDocument & doc,
std::string & response )

◆ sendHttpRequest() [4/4]

bool ExternalServicesComponent::sendHttpRequest ( RequestType operation,
ot::OwnerService _service,
ot::JsonDocument & doc,
std::string & response )

◆ sendKeySequenceActivatedMessage()

bool ExternalServicesComponent::sendKeySequenceActivatedMessage ( KeyboardCommandHandler * _sender)

◆ sendRelayedRequest()

bool ExternalServicesComponent::sendRelayedRequest ( RequestType operation,
const std::string & url,
const std::string & json,
std::string & response )

◆ sendRubberbandResultsToService()

void ExternalServicesComponent::sendRubberbandResultsToService ( ot::serviceID_t _serviceId,
const std::string & _note,
const std::string & _pointJson,
const std::vector< double > & transform )

◆ sendToModelService()

void ExternalServicesComponent::sendToModelService ( const std::string & _message,
std::string _response )

◆ sessionServiceURL()

const std::string & ExternalServicesComponent::sessionServiceURL ( void ) const
inline

◆ setMessagingRelay()

void ExternalServicesComponent::setMessagingRelay ( const std::string & _relayAddress)

◆ setProgressState

void ExternalServicesComponent::setProgressState ( bool visible,
const char * message,
bool continuous )
slot

◆ setProgressValue

void ExternalServicesComponent::setProgressValue ( int percentage)
slot

◆ setRelayServiceIsRequired()

void ExternalServicesComponent::setRelayServiceIsRequired ( void )

◆ setSessionServiceURL()

void ExternalServicesComponent::setSessionServiceURL ( const std::string & _url)
inline

◆ setUiServiceURL()

void ExternalServicesComponent::setUiServiceURL ( const std::string & _url)
inline

◆ setVisualizationModel()

void ExternalServicesComponent::setVisualizationModel ( ModelUIDtype modelID,
ModelUIDtype visualizationModelID )

◆ showError

void ExternalServicesComponent::showError ( const char * message)
slot

◆ showInformation

void ExternalServicesComponent::showInformation ( const char * message)
slot

◆ shutdown()

void ExternalServicesComponent::shutdown ( void )

◆ shutdownAfterSessionServiceDisconnected

void ExternalServicesComponent::shutdownAfterSessionServiceDisconnected ( void )
slot

◆ uiServiceURL()

const std::string & ExternalServicesComponent::uiServiceURL ( void ) const
inline

◆ unlockGui

void ExternalServicesComponent::unlockGui ( void )
slot

◆ versionDeselected()

void ExternalServicesComponent::versionDeselected ( void )

◆ versionSelected()

void ExternalServicesComponent::versionSelected ( const std::string & _version)

Member Data Documentation

◆ ExternalServicesComponent

ExternalServicesComponent::ExternalServicesComponent

The documentation for this class was generated from the following files: