Salome HOME
Update of CheckDone
[modules/smesh.git] / src / SMESH / MG_ADAPT.cxx
index 50f467fc03304a342577f7476898867cb505d79b..b7af53ab04a152f4750c8f36c8c4b7685d195413 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2022  CEA/DEN, EDF R&D
+// Copyright (C) 2020-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -43,6 +43,7 @@
 #include <fcntl.h>
 #include <array>
 #include <memory>   // unique_ptr
+#include <chrono>
 
 typedef SMESH_Comment ToComment;
 
@@ -956,6 +957,7 @@ std::string MgAdapt::getCommandToRun()
   cmd+= " --in "+ meshIn;
   meshFormatOutputMesh = getFileName()+".mesh";
   tmpFilesToBeDeleted.push_back(meshFormatOutputMesh);
+
   cmd+= " --out "+ meshFormatOutputMesh;
   if (useLocalMap || useConstantValue) cmd+= " --sizemap "+ solFileIn;
   else //  (useBackgroundMap)
@@ -1036,14 +1038,19 @@ std::string MgAdapt::getCommandToRun()
     if ( key.empty() )
       return ToComment( "Problem with library SalomeMeshGemsKeyGenerator: " + errorTxt );
 
-    cmd += " --key " + key;
+    if ( key!="0" )
+      cmd += " --key " + key;
   }
 
 #ifdef WIN32
   cmd += " < NUL";
 #endif
-  //   std::cout << "--- cmd :"<< std::endl;
-  //   std::cout << cmd << std::endl;
+
+  if (SALOME::VerbosityActivated())
+    {
+      std::cout << "--- cmd :"<< std::endl;
+      std::cout << cmd << std::endl;
+    }
 
   return cmd;
 }
@@ -1130,7 +1137,7 @@ std::string MgAdapt::getFileName() const
 aGenericName << _getpid();
 #endif
   aGenericName << "_";
-  aGenericName << std::abs((int)(long) aGenericName.data());
+  aGenericName << std::chrono::system_clock::now().time_since_epoch().count();
 
   return aGenericName;
 }