OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
MicroServiceSolver.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "ModelState.h"
7#include "ClassFactory.h"
8
10#include "EntityUnits.h"
14
16{
17public:
18 MicroServiceSolver(std::string solverName, int serviceID, int sessionCount, ClassFactory& classFactory);
19 virtual ~MicroServiceSolver();
20
21 void setDataBaseURL(const std::string &dbURL);
22 void setProjectName(const std::string &prjName);
25 void setModelStateVersion(const std::string &modelVersion);
26 void setSolverEntityID(ot::UID entityID);
27
28 void setMeshDataEntityID(ot::UID entityID);
30
31 void setSolverTopologyBase(const std::string &base);
32
33 void displayMessage(const std::string &msg);
34
35 void setProgressInformation(std::string message, bool continuous);
36 void setProgress(int percentage);
37 void closeProgressInformation(void);
38
39 void RemoveOldResults(void);
40
41 std::pair<ot::UID, std::string> addResultCurve(const std::string &name,
42 std::vector<double> xdata, std::vector<double> ydataRe, std::vector<double> ydataIm,
43 std::string xlabel, std::string xunit, std::string ylabel, std::string yunit, int colorID, bool visualize);
44 void addPlot1D(std::string name, std::string title, const std::list<std::pair<ot::UID, std::string>> &curves);
45 void addResultFD(std::string name, std::string title, double * xComponent, double * yComponent, double * zComponent, size_t size);
46
47 void StoreLogDataInResultItem(std::string logData);
48
49 std::list<ot::UID> getResultTopologyIDList(void);
50 std::list<ot::UID> getResultTopologyVersionList(void);
51 std::list<bool> getResultForceVisibleList(void);
52 std::list<ot::UID> getResultDataIDList(void);
53 std::list<ot::UID> getResultDataVersionList(void);
54 std::list<ot::UID> getResultDataParentList(void);
55
56protected:
61 std::string solverName;
62
63 EntityBase * LoadEntityFromName(std::string name);
64
66 EntityMeshCartesianData * LoadMeshData(std::string meshName);
67 Signal LoadSignal(std::string signalName);
68 PortSettings LoadPortSetting(std::string portName, std::string solverName);
69 MonitorSettings LoadMonitorSetting(std::string monitorName);
70
71 void ApplyFrequencyUnit(double& value, std::string& formerUnit);
72 void UpdateModel(void);
73private:
74 std::string dataBaseURL;
75 std::string projectName;
76 std::string modelStateVersion;
77 ot::UID solverEntityID;
78 ClassFactory* classFactory;
79
80 std::list<ot::UID> topologyEntityIDList;
81 std::list<ot::UID> topologyEntityVersionList;
82 std::list<bool> topologyEntityForceVisibleList;
83 std::list<ot::UID> dataEntityIDList;
84 std::list<ot::UID> dataEntityVersionList;
85 std::list<ot::UID> dataEntityParentList;
86
87 EntityUnits * _units = nullptr;
88};
89
90
bsoncxx::types::value value
Definition DocumentManager.h:16
Definition MicroServiceSolver.h:16
std::list< ot::UID > getResultDataIDList(void)
Definition MicroServiceSolver.cpp:129
MicroServiceSolver(std::string solverName, int serviceID, int sessionCount, ClassFactory &classFactory)
Definition MicroServiceSolver.cpp:17
std::pair< ot::UID, std::string > addResultCurve(const std::string &name, std::vector< double > xdata, std::vector< double > ydataRe, std::vector< double > ydataIm, std::string xlabel, std::string xunit, std::string ylabel, std::string yunit, int colorID, bool visualize)
Definition MicroServiceSolver.cpp:323
virtual ~MicroServiceSolver()
Definition MicroServiceSolver.cpp:28
ot::components::UiComponent * uiComponent
Definition MicroServiceSolver.h:57
void setSolverTopologyBase(const std::string &base)
Definition MicroServiceSolver.cpp:74
std::list< ot::UID > getResultTopologyIDList(void)
Definition MicroServiceSolver.cpp:114
void addPlot1D(std::string name, std::string title, const std::list< std::pair< ot::UID, std::string > > &curves)
Definition MicroServiceSolver.cpp:342
MonitorSettings LoadMonitorSetting(std::string monitorName)
Definition MicroServiceSolver.cpp:274
void setMeshDataEntityID(ot::UID entityID)
Definition MicroServiceSolver.cpp:64
void closeProgressInformation(void)
Definition MicroServiceSolver.cpp:109
void setSolverEntityID(ot::UID entityID)
Definition MicroServiceSolver.cpp:79
PortSettings LoadPortSetting(std::string portName, std::string solverName)
Definition MicroServiceSolver.cpp:239
void setModelComponent(ot::components::ModelComponent *mdlComp)
Definition MicroServiceSolver.cpp:54
void setDataBaseURL(const std::string &dbURL)
Definition MicroServiceSolver.cpp:39
ot::UID meshDataEntityID
Definition MicroServiceSolver.h:59
EntityMeshCartesianData * LoadMeshData(std::string meshName)
Definition MicroServiceSolver.cpp:193
std::list< ot::UID > getResultDataParentList(void)
Definition MicroServiceSolver.cpp:139
void setUIComponent(ot::components::UiComponent *uiComp)
Definition MicroServiceSolver.cpp:49
ot::components::ModelComponent * modelComponent
Definition MicroServiceSolver.h:58
std::string solverName
Definition MicroServiceSolver.h:61
EntityBase * LoadEntityFromName(std::string name)
Definition MicroServiceSolver.cpp:144
void addResultFD(std::string name, std::string title, double *xComponent, double *yComponent, double *zComponent, size_t size)
Definition MicroServiceSolver.cpp:354
SolverSettings LoadSolverSettings(std::string solverName)
Definition MicroServiceSolver.cpp:162
std::list< ot::UID > getResultTopologyVersionList(void)
Definition MicroServiceSolver.cpp:119
void setModelStateVersion(const std::string &modelVersion)
Definition MicroServiceSolver.cpp:59
void displayMessage(const std::string &msg)
Definition MicroServiceSolver.cpp:89
ot::UID meshDataVersion
Definition MicroServiceSolver.h:60
void setProgressInformation(std::string message, bool continuous)
Definition MicroServiceSolver.cpp:99
void setProgress(int percentage)
Definition MicroServiceSolver.cpp:104
void setProjectName(const std::string &prjName)
Definition MicroServiceSolver.cpp:44
void ApplyFrequencyUnit(double &value, std::string &formerUnit)
Definition MicroServiceSolver.cpp:313
void RemoveOldResults(void)
Definition MicroServiceSolver.cpp:153
void setMeshDataEntityVersionID(ot::UID entityID)
Definition MicroServiceSolver.cpp:69
std::list< bool > getResultForceVisibleList(void)
Definition MicroServiceSolver.cpp:124
void UpdateModel(void)
Definition MicroServiceSolver.cpp:318
void StoreLogDataInResultItem(std::string logData)
Definition MicroServiceSolver.cpp:420
std::list< ot::UID > getResultDataVersionList(void)
Definition MicroServiceSolver.cpp:134
Signal LoadSignal(std::string signalName)
Definition MicroServiceSolver.cpp:206
Definition MonitorSettings.h:22
Definition PortSettings.h:18
Definition Signal.h:18
Definition SolverSettings.h:8
Definition ModelComponent.h:42
Definition UiComponent.h:31
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27