]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESH/SMESH_Mesh.cxx
Salome HOME
Compute Progress bar
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index 3c3dca37fa017cf9042db31a4b12d1746227757c..d630792175db9a40c38d1601cbd30248dd95772d 100644 (file)
@@ -1476,13 +1476,16 @@ double SMESH_Mesh::GetComputeProgress() const
     while ( smIt->more() )
     {
       SMESH_subMesh* sm = smIt->next();
-      const int smCost = sm->GetComputeCost();
-      totalCost += smCost;
-      if ( sm != curSM &&
-           ( !sm->IsEmpty() ||
-             sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE ))
+      if ( sm->GetComputeState() != SMESH_subMesh::NOT_READY )
       {
-        computedCost += smCost;
+        const int smCost = sm->GetComputeCost();
+        totalCost += smCost;
+        if ( sm != curSM &&
+             ( !sm->IsEmpty() ||
+               sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE ))
+        {
+          computedCost += smCost;
+        }
       }
     }
   }
@@ -1496,10 +1499,14 @@ double SMESH_Mesh::GetComputeProgress() const
         //cout << " rate: " << rate << " cost " << algo->GetComputeCost() << endl;
         computedCost += rate * algo->GetComputeCost();
       }
-      else
+      else if ( curSM->IsEmpty() )
       {
         computedCost += algo->GetProgressByTic() * algo->GetComputeCost();
       }
+      else
+      {
+        computedCost += 0.99 * algo->GetComputeCost();
+      }
     }
   //cout << "Total: " << totalCost << " progress: " << computedCost / totalCost << endl;
   return computedCost / totalCost;