]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
New method was not working when mesh was removed yan/compute_dump
authoryoann.audouin <yoann.audouin@edf.fr>
Thu, 4 Jan 2024 13:10:43 +0000 (14:10 +0100)
committeryoann.audouin <yoann.audouin@edf.fr>
Thu, 4 Jan 2024 13:10:43 +0000 (14:10 +0100)
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_Gen_i.cxx

index a45b96abf643367551b20be08bead4603a26131a..c9ac03e245d010e5cd22e5575b55bcbc90298b8b 100644 (file)
@@ -1092,6 +1092,14 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
       theCommand->RemoveArgs();
       id_mesh->second->Process( theCommand );
       id_mesh->second->AddProcessedCmd( theCommand );
+
+      // Changing command for compute adding a check on isDone and raising
+      // exception if not completed
+      _AString meshStr = theCommand->GetObject().ToCString();
+      _AString excStr = "\"Could not compute mesh: \"+";
+      excStr += meshStr + ".GetName()";
+      _AString compStr = theCommand->GetString()+"\nif not isDone:\n\traise Exception("+excStr+")";
+      theCommand->GetString() = compStr;
       return;
     }
   }
index 8d380c6da5a8276ddf3c3c225d9db6c478243874..88a3a4b2d00cdb3a4d236f70695abcca4e1fbd14 100644 (file)
@@ -2079,7 +2079,6 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
   // Update Python script
   TPythonDump(this) << "isDone = " << this << ".Compute( "
                     << theMesh << ", " << theShapeObject << ")";
-  TPythonDump(this) << "if not isDone: \n    raise Exception(\"Issue while computing Mesh\")";
 
   try {
     // get mesh servant