From: Paul RASCLE Date: Fri, 8 Nov 2019 22:03:55 +0000 (+0100) Subject: debug an abort on progress bar show: experiment on progress bar control X-Git-Tag: SH_V2_2_0~99^2~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8e7962d4dc816f832ada2209bb835d1c4eb25b79;p=modules%2Fhydro.git debug an abort on progress bar show: experiment on progress bar control --- diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 80d85921..9e79b797 100755 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -1101,7 +1101,7 @@ NCollection_Sequence HYDROData_CalculationCase::GetAltitudesForPoints( while( aFuture.isRunning() ) { if ( aZIProgress ) { aZIProgress->Show( Standard_True ); - QThread::usleep(500); + QThread::msleep(200); } } //DEBTRACE("aZIProgress=" << aZIProgress); @@ -1166,7 +1166,7 @@ std::vector HYDROData_CalculationCase::GetStricklerCoefficientForPoints( while( aFuture.isRunning() ) { if ( aSIProgress ) { aSIProgress->Show( Standard_True ); - QThread::usleep(500); + QThread::msleep(200); } } diff --git a/src/HYDROGUI/HYDROGUI_SIProgressIndicator.cxx b/src/HYDROGUI/HYDROGUI_SIProgressIndicator.cxx index fb8b07f1..2a85c663 100755 --- a/src/HYDROGUI/HYDROGUI_SIProgressIndicator.cxx +++ b/src/HYDROGUI/HYDROGUI_SIProgressIndicator.cxx @@ -21,6 +21,8 @@ #include #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_SIProgressIndicator, Message_ProgressIndicator) @@ -49,6 +51,9 @@ HYDROGUI_SIProgressIndicator::~HYDROGUI_SIProgressIndicator() Standard_Boolean HYDROGUI_SIProgressIndicator::Show(const Standard_Boolean theForce) { Standard_Real aPosition = GetPosition(); + myCount++; + if (theForce) + DEBTRACE("aPosition=" << aPosition << " myCount:" <= 1 || ( isUserBreak && GetNbScopes() < 2 ); @@ -84,6 +89,7 @@ void HYDROGUI_SIProgressIndicator::Reset() setButtonText( Cancel, tr("CANCEL") ); setButtonEnabled( true, Cancel ); myUserBreak = Standard_False; + myCount = 0; } void HYDROGUI_SIProgressIndicator::reject() diff --git a/src/HYDROGUI/HYDROGUI_SIProgressIndicator.h b/src/HYDROGUI/HYDROGUI_SIProgressIndicator.h index b077de5b..c2801f2d 100755 --- a/src/HYDROGUI/HYDROGUI_SIProgressIndicator.h +++ b/src/HYDROGUI/HYDROGUI_SIProgressIndicator.h @@ -45,6 +45,7 @@ protected slots: private: QProgressBar* myBar; Standard_Boolean myUserBreak; + int myCount; public: DEFINE_STANDARD_RTTIEXT (HYDROGUI_SIProgressIndicator, Message_ProgressIndicator) diff --git a/src/HYDROGUI/HYDROGUI_ZIProgressIndicator.cxx b/src/HYDROGUI/HYDROGUI_ZIProgressIndicator.cxx index 58a021ee..b19674e3 100755 --- a/src/HYDROGUI/HYDROGUI_ZIProgressIndicator.cxx +++ b/src/HYDROGUI/HYDROGUI_ZIProgressIndicator.cxx @@ -25,6 +25,8 @@ #include #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_ZIProgressIndicator, Message_ProgressIndicator) @@ -66,6 +68,9 @@ Standard_Boolean HYDROGUI_ZIProgressIndicator::Show(const Standard_Boolean theFo { Standard_Boolean isUserBreak = UserBreak(); Standard_Real aPosition = GetPosition(); + myCount++; + if (theForce) + DEBTRACE("aPosition=" << aPosition << " myCount:" <