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 (GetBigObjOnDiskProtocolAndDirectory) GetBigObjOnDiskProtocolAndDirectorySwig;
57 %rename (BigObjOnDiskProtocolFromStr) BigObjOnDiskProtocolFromStrSwig;
58 %rename (BigObjOnDiskProtocolToStr) BigObjOnDiskProtocolToStrSwig;
59 %rename (SetBigObjOnDiskDirectory) SetBigObjOnDiskDirectorySwig;
60 %rename (BigObjOnDiskDirectoryDefined) BigObjOnDiskDirectoryDefinedSwig;
61 %rename (GetDirectoryForReplayFiles) GetDirectoryForReplayFilesSwig;
62 %rename (SetDirectoryForReplayFiles) SetDirectoryForReplayFilesSwig;
63 %rename (SetNumberOfRetry) SetNumberOfRetrySwig;
64 %rename (GetNumberOfRetry) GetNumberOfRetrySwig;
67 void setSSLMode(bool sslMode);
70 void setGUIMode(bool guiMode);
72 std::string getIOROfEmbeddedNS();
73 void setIOROfEmbeddedNS(const std::string& ior);
75 double GetTimeAdjustmentCst();
77 long LaunchMonitoring(const std::string& pyScriptToEvaluate);
79 void StopMonitoring(long pid);
81 bool VerbosityActivated();
83 void SetVerbosityActivated(bool flag);
89 bool IsWarningLevel();
93 void WriteInStdout(const std::string& msg);
95 void WriteInStderr(const std::string& msg);
97 %rename (SetVerbosityLevel) SetVerbosityLevelSwig;
98 %rename (VerbosityLevel) VerbosityLevelSwig;
99 %rename (SetPyExecutionMode) SetPyExecutionModeStrSwig;
100 %rename (GetPyExecutionMode) GetPyExecutionModeStrSwig;
101 %rename (GetAllPyExecutionModes) GetAllPyExecutionModesSwig;
105 PyObject *HeatMarcelSwig(double timeAjustment, unsigned int nbThreads = 0)
107 double timeInS = 0.0;
108 long double piVal = HeatMarcel(timeAjustment,timeInS,nbThreads);
109 PyObject *ret(PyTuple_New(2));
110 PyTuple_SetItem(ret,0,SWIG_From_double((double)piVal));
111 PyTuple_SetItem(ret,1,SWIG_From_double(timeInS));
115 std::vector<double> ReadFloatsInFileSwig(const std::string& fileName)
117 std::vector<double> ret;
120 ret = SALOME::ReadFloatsInFile( fileName );
122 catch(std::exception& e) { }
126 int GetBigObjOnDiskThresholdSwig()
128 return SALOME::GetBigObjOnDiskThreshold();
131 void SetBigObjOnDiskThresholdSwig(int newThreshold)
133 return SALOME::SetBigObjOnDiskThreshold(newThreshold);
136 void SetBigObjOnDiskDirectorySwig(const std::string& directory)
138 return SALOME::SetBigObjOnDiskDirectory(directory);
141 bool BigObjOnDiskDirectoryDefinedSwig()
143 return SALOME::BigObjOnDiskDirectoryDefined();
146 void SetNumberOfRetrySwig(int nbRetry)
148 SALOME::SetNumberOfRetry( nbRetry );
151 int GetNumberOfRetrySwig()
153 return SALOME::GetNumberOfRetry( );
156 std::string GetDirectoryForReplayFilesSwig()
158 return SALOME::GetDirectoryForReplayFiles();
161 void SetDirectoryForReplayFilesSwig(const std::string& directory)
163 SALOME::SetDirectoryForReplayFiles(directory);
166 std::string BigObjOnDiskProtocolToStrSwig( int protocol )
168 return SALOME::BigObjOnDiskProtocolToStr( SALOME::FromIntToBigObjOnDiskProtocol( protocol ) );
171 int BigObjOnDiskProtocolFromStrSwig(const std::string& protocol)
173 return static_cast<char>( SALOME::BigObjOnDiskProtocolFromStr( protocol ) );
176 PyObject *GetBigObjOnDiskProtocolAndDirectorySwig()
178 std::string directory;
179 SALOME::BigObjTransferProtocol ret0 = SALOME::GetBigObjOnDiskProtocolAndDirectory(directory);
180 PyObject *ret(PyTuple_New(2));
181 PyTuple_SetItem(ret,0,PyInt_FromLong(static_cast<char>( ret0 ) ));
182 PyTuple_SetItem(ret,1,PyUnicode_FromString(directory.c_str()));
186 void SetVerbosityLevelSwig(const std::string& level)
188 SetVerbosityLevelStr(level);
191 std::string VerbosityLevelSwig()
193 return VerbosityLevelStr();
196 void SetPyExecutionModeStrSwig(const std::string& mode)
198 SetPyExecutionModeStr( mode );
201 std::string GetPyExecutionModeStrSwig()
203 return GetPyExecutionModeStr();
206 std::vector<std::string> GetAllPyExecutionModesSwig()
208 return GetAllPyExecutionModes();
213 def ReadFloatsInFile( fileName ):
214 ret = ReadFloatsInFileSwig( fileName )