From 80ee88f6e01ba7494b7dcc6588a463b18c8c6d1d Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 16 Feb 2005 05:17:54 +0000 Subject: [PATCH] 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.. --- Box/Main.cpp | 3 ++- Common/Message.h | 2 ++ Fltk/Message.cpp | 4 +++- Mesh/Read_Mesh.cpp | 9 ++++++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Box/Main.cpp b/Box/Main.cpp index 216bcf9d83..fd669dcb39 100644 --- a/Box/Main.cpp +++ b/Box/Main.cpp @@ -1,4 +1,4 @@ -// $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 // @@ -184,6 +184,7 @@ void Msg(int level, char *fmt, ...) switch (level) { + case PROGRESS: case STATUS1N: case STATUS2N: case STATUS3N: diff --git a/Common/Message.h b/Common/Message.h index f0818fd8c9..1055815a16 100644 --- a/Common/Message.h +++ b/Common/Message.h @@ -61,6 +61,8 @@ #define SOLVER 31 // Solver message #define SOLVERR 32 // Solver errors and warnings +#define PROGRESS 40 // Progress indicator + #define WHITE_STR " : " #define FATAL_STR "Fatal : " #define ERROR_STR "Error : " diff --git a/Fltk/Message.cpp b/Fltk/Message.cpp index 2a1aa33040..79c67fa072 100644 --- a/Fltk/Message.cpp +++ b/Fltk/Message.cpp @@ -1,4 +1,4 @@ -// $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 // @@ -85,6 +85,8 @@ void Msg(int level, char *fmt, ...) case SOLVER : color = 4; verb = 3; break ; case SOLVERR : color = 1; verb = 3; break ; + case PROGRESS : log = 0; window = 2; break ; + case STATUS1N : log = 0; //fallthrough case STATUS1 : str = INFO_STR; verb = 1; window = 0; break ; case STATUS2N : log = 0; //fallthrough diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index 64d3609603..b8be37d7b0 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -// $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 // @@ -221,7 +221,10 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp) else 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) Tree_Delete(Duplicates); } @@ -458,7 +461,11 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp) Msg(GERROR, "Unknown type for element %d", Num); 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) { Tree_Action(Duplicates, Free_Vertex); -- GitLab