Skip to content
Snippets Groups Projects
Commit 80ee88f6 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Added progress message while reading .msh files (idea from Nicolas)

Instead of popping up a progress bar, I just used a Msg() call. Not
sure which is best, but this is a bit simpler..
parent d478ff79
No related branches found
No related tags found
No related merge requests found
// $Id: Main.cpp,v 1.46 2005-01-01 19:35:27 geuzaine Exp $ // $Id: Main.cpp,v 1.47 2005-02-16 05:17:54 geuzaine Exp $
// //
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
// //
...@@ -184,6 +184,7 @@ void Msg(int level, char *fmt, ...) ...@@ -184,6 +184,7 @@ void Msg(int level, char *fmt, ...)
switch (level) { switch (level) {
case PROGRESS:
case STATUS1N: case STATUS1N:
case STATUS2N: case STATUS2N:
case STATUS3N: case STATUS3N:
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
#define SOLVER 31 // Solver message #define SOLVER 31 // Solver message
#define SOLVERR 32 // Solver errors and warnings #define SOLVERR 32 // Solver errors and warnings
#define PROGRESS 40 // Progress indicator
#define WHITE_STR " : " #define WHITE_STR " : "
#define FATAL_STR "Fatal : " #define FATAL_STR "Fatal : "
#define ERROR_STR "Error : " #define ERROR_STR "Error : "
......
// $Id: Message.cpp,v 1.62 2005-01-16 20:41:38 geuzaine Exp $ // $Id: Message.cpp,v 1.63 2005-02-16 05:17:54 geuzaine Exp $
// //
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
// //
...@@ -85,6 +85,8 @@ void Msg(int level, char *fmt, ...) ...@@ -85,6 +85,8 @@ void Msg(int level, char *fmt, ...)
case SOLVER : color = 4; verb = 3; break ; case SOLVER : color = 4; verb = 3; break ;
case SOLVERR : color = 1; verb = 3; break ; case SOLVERR : color = 1; verb = 3; break ;
case PROGRESS : log = 0; window = 2; break ;
case STATUS1N : log = 0; //fallthrough case STATUS1N : log = 0; //fallthrough
case STATUS1 : str = INFO_STR; verb = 1; window = 0; break ; case STATUS1 : str = INFO_STR; verb = 1; window = 0; break ;
case STATUS2N : log = 0; //fallthrough case STATUS2N : log = 0; //fallthrough
......
// $Id: Read_Mesh.cpp,v 1.82 2005-01-01 19:35:31 geuzaine Exp $ // $Id: Read_Mesh.cpp,v 1.83 2005-02-16 05:17:54 geuzaine Exp $
// //
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
// //
...@@ -221,7 +221,10 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp) ...@@ -221,7 +221,10 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
else else
Tree_Add(Duplicates, &vert); Tree_Add(Duplicates, &vert);
} }
if(i_Node % (Nbr_Nodes/50) == (Nbr_Nodes/50) - 1)
Msg(PROGRESS, "Read %d nodes", i_Node + 1);
} }
Msg(PROGRESS, "");
if(CTX.mesh.check_duplicates) if(CTX.mesh.check_duplicates)
Tree_Delete(Duplicates); Tree_Delete(Duplicates);
} }
...@@ -458,7 +461,11 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp) ...@@ -458,7 +461,11 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
Msg(GERROR, "Unknown type for element %d", Num); Msg(GERROR, "Unknown type for element %d", Num);
break; break;
} }
if(i_Element % (Nbr_Elements/50) == (Nbr_Elements/50) - 1)
Msg(PROGRESS, "Read %d elements", i_Element + 1);
} }
Msg(PROGRESS, "");
if(CTX.mesh.check_duplicates) { if(CTX.mesh.check_duplicates) {
Tree_Action(Duplicates, Free_Vertex); Tree_Action(Duplicates, Free_Vertex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment