1 // Copyright (C) 2021-2024 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "KernelBasis.hxx"
24 #include "HeatMarcel.hxx"
25 #include "libSALOMELog.hxx"
26 #include "Monitoring.hxx"
27 using namespace SALOME;
35 %template(dvec) std::vector<double>;
36 %template(strvec) std::vector<std::string>;
43 catch(std::exception& e)
45 SWIG_exception(SWIG_SystemError, e.what() );
49 SWIG_exception(SWIG_UnknownError, "Unknown exception");
53 %rename (HeatMarcel) HeatMarcelSwig;
54 %rename (GetBigObjOnDiskThreshold) GetBigObjOnDiskThresholdSwig;
55 %rename (SetBigObjOnDiskThreshold) SetBigObjOnDiskThresholdSwig;
56 %rename (GetBigObjOnDiskDirectory) GetBigObjOnDiskDirectorySwig;
57 %rename (SetBigObjOnDiskDirectory) SetBigObjOnDiskDirectorySwig;
58 %rename (BigObjOnDiskDirectoryDefined) BigObjOnDiskDirectoryDefinedSwig;
59 %rename (SetNumberOfRetry) SetNumberOfRetrySwig;
60 %rename (GetNumberOfRetry) GetNumberOfRetrySwig;
63 void setSSLMode(bool sslMode);
66 void setGUIMode(bool guiMode);
68 std::string getIOROfEmbeddedNS();
69 void setIOROfEmbeddedNS(const std::string& ior);
71 double GetTimeAdjustmentCst();
73 long LaunchMonitoring(const std::string& pyScriptToEvaluate);
75 void StopMonitoring(long pid);
77 bool VerbosityActivated();
79 void SetVerbosityActivated(bool flag);
85 bool IsWarningLevel();
89 void WriteInStdout(const std::string& msg);
91 void WriteInStderr(const std::string& msg);
93 %rename (SetVerbosityLevel) SetVerbosityLevelSwig;
94 %rename (VerbosityLevel) VerbosityLevelSwig;
95 %rename (SetPyExecutionMode) SetPyExecutionModeStrSwig;
96 %rename (GetPyExecutionMode) GetPyExecutionModeStrSwig;
97 %rename (GetAllPyExecutionModes) GetAllPyExecutionModesSwig;
101 PyObject *HeatMarcelSwig(double timeAjustment, unsigned int nbThreads = 0)
103 double timeInS = 0.0;
104 long double piVal = HeatMarcel(timeAjustment,timeInS,nbThreads);
105 PyObject *ret(PyTuple_New(2));
106 PyTuple_SetItem(ret,0,SWIG_From_double((double)piVal));
107 PyTuple_SetItem(ret,1,SWIG_From_double(timeInS));
111 std::vector<double> ReadFloatsInFileSwig(const std::string& fileName)
113 std::vector<double> ret;
116 ret = SALOME::ReadFloatsInFile( fileName );
118 catch(std::exception& e) { }
122 int GetBigObjOnDiskThresholdSwig()
124 return SALOME::GetBigObjOnDiskThreshold();
127 void SetBigObjOnDiskThresholdSwig(int newThreshold)
129 return SALOME::SetBigObjOnDiskThreshold(newThreshold);
132 std::string GetBigObjOnDiskDirectorySwig()
134 return SALOME::GetBigObjOnDiskDirectory();
137 void SetBigObjOnDiskDirectorySwig(const std::string& directory)
139 return SALOME::SetBigObjOnDiskDirectory(directory);
142 bool BigObjOnDiskDirectoryDefinedSwig()
144 return SALOME::BigObjOnDiskDirectoryDefined();
147 void SetNumberOfRetrySwig(int nbRetry)
149 SALOME::SetNumberOfRetry( nbRetry );
152 int GetNumberOfRetrySwig()
154 return SALOME::GetNumberOfRetry( );
157 void SetVerbosityLevelSwig(const std::string& level)
159 SetVerbosityLevelStr(level);
162 std::string VerbosityLevelSwig()
164 return VerbosityLevelStr();
167 void SetPyExecutionModeStrSwig(const std::string& mode)
169 SetPyExecutionModeStr( mode );
172 std::string GetPyExecutionModeStrSwig()
174 return GetPyExecutionModeStr();
177 std::vector<std::string> GetAllPyExecutionModesSwig()
179 return GetAllPyExecutionModes();
184 def ReadFloatsInFile( fileName ):
185 ret = ReadFloatsInFileSwig( fileName )