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;
65 %rename (GetForwardCurrentDirectoryStatus) GetForwardCurrentDirectoryStatusSwig;
66 %rename (SetForwardCurrentDirectoryStatus) SetForwardCurrentDirectoryStatusSwig;
69 void setSSLMode(bool sslMode);
72 void setGUIMode(bool guiMode);
74 std::string getIOROfEmbeddedNS();
75 void setIOROfEmbeddedNS(const std::string& ior);
77 double GetTimeAdjustmentCst();
79 long LaunchMonitoring(const std::string& pyScriptToEvaluate);
81 void StopMonitoring(long pid);
83 bool VerbosityActivated();
85 void SetVerbosityActivated(bool flag);
91 bool IsWarningLevel();
95 void WriteInStdout(const std::string& msg);
97 void WriteInStderr(const std::string& msg);
99 %rename (SetVerbosityLevel) SetVerbosityLevelSwig;
100 %rename (VerbosityLevel) VerbosityLevelSwig;
101 %rename (SetPyExecutionMode) SetPyExecutionModeStrSwig;
102 %rename (GetPyExecutionMode) GetPyExecutionModeStrSwig;
103 %rename (GetAllPyExecutionModes) GetAllPyExecutionModesSwig;
107 PyObject *HeatMarcelSwig(double timeAjustment, unsigned int nbThreads = 0)
109 double timeInS = 0.0;
110 long double piVal = HeatMarcel(timeAjustment,timeInS,nbThreads);
111 PyObject *ret(PyTuple_New(2));
112 PyTuple_SetItem(ret,0,SWIG_From_double((double)piVal));
113 PyTuple_SetItem(ret,1,SWIG_From_double(timeInS));
117 std::vector<double> ReadFloatsInFileSwig(const std::string& fileName)
119 std::vector<double> ret;
122 ret = SALOME::ReadFloatsInFile( fileName );
124 catch(std::exception& e) { }
128 int GetBigObjOnDiskThresholdSwig()
130 return SALOME::GetBigObjOnDiskThreshold();
133 void SetBigObjOnDiskThresholdSwig(int newThreshold)
135 return SALOME::SetBigObjOnDiskThreshold(newThreshold);
138 void SetBigObjOnDiskDirectorySwig(const std::string& directory)
140 return SALOME::SetBigObjOnDiskDirectory(directory);
143 bool BigObjOnDiskDirectoryDefinedSwig()
145 return SALOME::BigObjOnDiskDirectoryDefined();
148 void SetNumberOfRetrySwig(int nbRetry)
150 SALOME::SetNumberOfRetry( nbRetry );
153 int GetNumberOfRetrySwig()
155 return SALOME::GetNumberOfRetry( );
158 bool GetForwardCurrentDirectoryStatusSwig()
160 return SALOME::GetForwardCurrentDirectoryStatus();
163 void SetForwardCurrentDirectoryStatusSwig(bool newStatus)
165 SALOME::SetForwardCurrentDirectoryStatus(newStatus);
168 std::string GetDirectoryForReplayFilesSwig()
170 return SALOME::GetDirectoryForReplayFiles();
173 void SetDirectoryForReplayFilesSwig(const std::string& directory)
175 SALOME::SetDirectoryForReplayFiles(directory);
178 std::string BigObjOnDiskProtocolToStrSwig( int protocol )
180 return SALOME::BigObjOnDiskProtocolToStr( SALOME::FromIntToBigObjOnDiskProtocol( protocol ) );
183 int BigObjOnDiskProtocolFromStrSwig(const std::string& protocol)
185 return static_cast<char>( SALOME::BigObjOnDiskProtocolFromStr( protocol ) );
188 PyObject *GetBigObjOnDiskProtocolAndDirectorySwig()
190 std::string directory;
191 SALOME::BigObjTransferProtocol ret0 = SALOME::GetBigObjOnDiskProtocolAndDirectory(directory);
192 PyObject *ret(PyTuple_New(2));
193 PyTuple_SetItem(ret,0,PyInt_FromLong(static_cast<char>( ret0 ) ));
194 PyTuple_SetItem(ret,1,PyUnicode_FromString(directory.c_str()));
198 void SetVerbosityLevelSwig(const std::string& level)
200 SetVerbosityLevelStr(level);
203 std::string VerbosityLevelSwig()
205 return VerbosityLevelStr();
208 void SetPyExecutionModeStrSwig(const std::string& mode)
210 SetPyExecutionModeStr( mode );
213 std::string GetPyExecutionModeStrSwig()
215 return GetPyExecutionModeStr();
218 std::vector<std::string> GetAllPyExecutionModesSwig()
220 return GetAllPyExecutionModes();
225 def ReadFloatsInFile( fileName ):
226 ret = ReadFloatsInFileSwig( fileName )