diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index fdc21512beff03f581be41ab1ec628691827f101..328d75064da1a940b3a01597f407cc191d01496c 100644 --- a/Common/GmshMessage.cpp +++ b/Common/GmshMessage.cpp @@ -415,7 +415,7 @@ void Msg::ProgressMeter(int n, int N, const char *fmt, ...) #if defined(HAVE_FLTK) if(FlGui::available() && _verbosity > 4){ FlGui::instance()->check(); - FlGui::instance()->setProgress(str, n, N); + FlGui::instance()->setProgress(str, n, 0, N); } #endif @@ -434,7 +434,7 @@ void Msg::ProgressMeter(int n, int N, const char *fmt, ...) #if defined(HAVE_FLTK) if(FlGui::available() && _verbosity > 4){ FlGui::instance()->check(); - FlGui::instance()->setProgress("", 0, N); + FlGui::instance()->setProgress("", 0, 0, N); } #endif diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index d8b45ae4306a182f8a199a3c6ba2837ac3172945..a52780a7d0cdc12f71676e24f9629507b25433af 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -810,15 +810,15 @@ void FlGui::setStatus(const char *msg, int num) } } -void FlGui::setProgress(const char *msg, int n, int N) +void FlGui::setProgress(const char *msg, double val, double min, double max) { for(unsigned int i = 0; i < FlGui::instance()->graph.size(); i++){ - if(FlGui::instance()->graph[i]->label[1]->minimum() != 0) - FlGui::instance()->graph[i]->label[1]->minimum(0); - if(FlGui::instance()->graph[i]->label[1]->maximum() != N) - FlGui::instance()->graph[i]->label[1]->maximum(N); - if(FlGui::instance()->graph[i]->label[1]->value() != n) - FlGui::instance()->graph[i]->label[1]->value(n); + if(FlGui::instance()->graph[i]->label[1]->value() != val) + FlGui::instance()->graph[i]->label[1]->value(val); + if(FlGui::instance()->graph[i]->label[1]->minimum() != min) + FlGui::instance()->graph[i]->label[1]->minimum(min); + if(FlGui::instance()->graph[i]->label[1]->maximum() != max) + FlGui::instance()->graph[i]->label[1]->maximum(max); } setStatus(msg, 1); } diff --git a/Fltk/FlGui.h b/Fltk/FlGui.h index a52131318b07aa3b4c4be4adfd7cd81b83a0b033..5afbdb5873e79cd29a2805e145501396cd0c72de 100644 --- a/Fltk/FlGui.h +++ b/Fltk/FlGui.h @@ -109,7 +109,7 @@ class FlGui{ // display status message void setStatus(const char *msg, int num); // display status message and update progress bar - void setProgress(const char *msg, int n, int N); + void setProgress(const char *msg, double val, double min, double max); // create the window for physical context dependant definitions void callForSolverPlugin(int dim); // add line in message console(s) diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp index 6320d17a553fcb177581c29eaa8548847a3b85e4..96aecc19c34707b72add1d9307fa47b47bd977d5 100644 --- a/Fltk/onelabWindow.cpp +++ b/Fltk/onelabWindow.cpp @@ -278,7 +278,8 @@ bool onelab::localNetworkClient::run() else if(type == "number"){ onelab::number p; p.fromChar(message); set(p); if(p.getName() == getName() + "/Progress") - FlGui::instance()->setProgress(p.getLabel().c_str(), p.getValue(), p.getMax()); + FlGui::instance()->setProgress(p.getLabel().c_str(), p.getValue(), + p.getMin(), p.getMax()); } else if(type == "string"){ onelab::string p; p.fromChar(message); set(p);