View Issue Details

IDProjectCategoryView StatusLast Update
0031092Open CASCADEOCCT:DRAWpublic2020-12-02 17:12
Reporterosa Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.3.1 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031092: Foundation Classes - incorrect last output value for Infinite progress indicator
Descriptionะก++ code to reproduce:
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDI, 1);

Message_ProgressSentry aPSentry (aProgress, "Global sentry", 0, 1, 1);
{
  Message_ProgressSentry aSubPSentry (aProgress, "Sub sentry 1", 0, 1, 1, true);
  for (size_t anIdx = 0; anIdx < 10; ++anIdx)
  {
    aSubPSentry.Next (anIdx / 10.0);
  }
}
aPSentry.Next();

If activate progress indicator in text mode using XProgress +t -g the result output will be:
Progress: 0% Global sentry: 1 / 1
Progress: 50% Global sentry: 1 / 1 Sub sentry 1: 1
Progress: 52% Global sentry: 1 / 1 Sub sentry 1: 1
Progress: 57% Global sentry: 1 / 1 Sub sentry 1: 1
Progress: 62% Global sentry: 1 / 1 Sub sentry 1: 2
Progress: 67% Global sentry: 1 / 1 Sub sentry 1: 2
Progress: 71% Global sentry: 1 / 1 Sub sentry 1: 3
Progress: 76% Global sentry: 1 / 1 Sub sentry 1: 3
Progress: 79% Global sentry: 1 / 1 Sub sentry 1: 4
Progress: 82% Global sentry: 1 / 1 Sub sentry 1: 5
Progress: 85% Global sentry: 1 / 1 Sub sentry 1: 6
Progress: 100% Global sentry: 1 / 1 Sub sentry 1: 10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104

The last output is value of Infinite constant (1e100).That is not correct.

Steps To Reproducetest bugs fclasses bug31092
TagsNo tags attached.
Test case numberbugs fclasses bug31092

Relationships

related to 0025748 closedabv Open CASCADE Foundation Classes - Parallel version of progress indicator 

Activities

kgv

2019-10-22 15:08

developer   ~0088421

Last edited: 2019-10-22 15:09

From old project code...
      // print progress info differently for finite and infinite scopes
      if (scale.GetInfinite())
      {
        Standard_Real aVal = scale.BaseToLocal(locPos);
        if ( Precision::IsInfinite(aVal) )
        {
          n += sprintf_s (&text[n], BUFSIZE - n, "\n    %s: finished",
                          scale.GetName()->ToCString());
        }
        else {
          n += sprintf_s (&text[n], BUFSIZE - n, "\n    %s: %.0f",
                          scale.GetName()->ToCString(), aVal);
        }
      }


git

2019-10-25 17:13

administrator   ~0088611

Branch CR31092 has been created by abv.

SHA-1: 1e4851198011d89126edf9aa3160eb51a9c8456e


Detailed log of new commits:

Author: abv
Date: Fri Oct 25 17:11:33 2019 +0300

    0031092: Foundation Classes - incorrect last output value for Infinite progress indicator
    
    DRAW implementation of progress indicator is corrected to print "finished" instead of 1e100 for the end of infinite range.
    Added test bugs fclasses bug31092

abv

2019-10-25 20:13

manager   ~0088615

Fix is pushed to branch CR31092 and tested, see Jenkins job CR31092-abv. Please review

kgv

2019-10-25 22:17

developer   ~0088619

Last edited: 2019-10-25 22:18

+    {
+        Standard_Real aVal = scale.BaseToLocal(locPos);

Unexpected indentation.
     else 
-      n += Sprintf ( &text[n], " %s: %.0f / %.0f", scale.GetName()->ToCString(), 

-                     scale.BaseToLocal ( locPos ), scale.GetMax() );
+      aText << scale.BaseToLocal ( locPos ) << " / " << scale.GetMax();

Brackets are desired for else statement.

osa

2019-10-30 15:11

developer   ~0088666

Please take a look at kgv remarks. I don't have others.

git

2019-10-30 16:28

administrator   ~0088670

Branch CR31092 has been updated forcibly by abv.

SHA-1: 5f52175c9e2f393b3123a0a09e75439c09a5739b

abv

2019-10-30 17:35

manager   ~0088676

Indentation is corrected and braces added, please review again

git

2019-11-10 11:41

administrator   ~0088846

Branch CR31092 has been deleted by inv.

SHA-1: 5f52175c9e2f393b3123a0a09e75439c09a5739b

Related Changesets

occt: master 53d770b3

2019-10-25 14:11:33

abv


Committer: apn Details Diff
0031092: Foundation Classes - incorrect last output value for Infinite progress indicator

DRAW implementation of progress indicator is corrected to print "finished" instead of 1e100 for the end of infinite range.
Added test bugs fclasses bug31092
Affected Issues
0031092
mod - src/Draw/Draw_ProgressIndicator.cxx Diff File
mod - src/QABugs/QABugs_11.cxx Diff File
add - tests/bugs/fclasses/bug31092 Diff File

Issue History

Date Modified Username Field Change
2019-10-21 17:14 osa New Issue
2019-10-21 17:14 osa Assigned To => abv
2019-10-21 17:19 kgv Relationship added related to 0025748
2019-10-22 15:08 kgv Note Added: 0088421
2019-10-22 15:09 kgv Note Edited: 0088421
2019-10-25 17:13 git Note Added: 0088611
2019-10-25 20:13 abv Note Added: 0088615
2019-10-25 20:13 abv Assigned To abv => osa
2019-10-25 20:13 abv Status new => resolved
2019-10-25 20:13 abv Resolution open => fixed
2019-10-25 20:13 abv Category OCCT:Foundation Classes => OCCT:DRAW
2019-10-25 20:13 abv Steps to Reproduce Updated
2019-10-25 22:17 kgv Note Added: 0088619
2019-10-25 22:17 kgv Note Edited: 0088619
2019-10-25 22:18 kgv Note Edited: 0088619
2019-10-30 15:11 osa Note Added: 0088666
2019-10-30 15:11 osa Assigned To osa => abv
2019-10-30 15:11 osa Status resolved => assigned
2019-10-30 16:28 git Note Added: 0088670
2019-10-30 17:35 abv Note Added: 0088676
2019-10-30 17:35 abv Assigned To abv => kgv
2019-10-30 17:35 abv Status assigned => resolved
2019-10-30 17:53 kgv Assigned To kgv => bugmaster
2019-10-30 17:53 kgv Status resolved => reviewed
2019-10-30 17:53 kgv Product Version => 6.3.1
2019-10-30 23:23 apn Test case number => bugs fclasses bug31092
2019-10-31 10:59 apn Status reviewed => tested
2019-11-02 17:43 apn Changeset attached => occt master 53d770b3
2019-11-02 17:43 apn Assigned To bugmaster => apn
2019-11-02 17:43 apn Status tested => verified
2019-11-10 11:41 git Note Added: 0088846
2020-12-02 16:40 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed