MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031092Open CASCADE[OCCT] OCCT:DRAWpublic2019-10-21 17:142019-11-10 11:41
Reporterosa 
Assigned Toapn 
PrioritynormalSeverityminor 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.3.1 
Target Version[OCCT] 7.5.0*Fixed in Version 
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
Attached Files

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

-  Notes
(0088421)
kgv (developer)
2019-10-22 15:08
edited on: 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);
        }
      }


(0088611)
git (administrator)
2019-10-25 17:13

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
(0088615)
abv (manager)
2019-10-25 20:13

Fix is pushed to branch CR31092 and tested, see Jenkins job CR31092-abv. Please review
(0088619)
kgv (developer)
2019-10-25 22:17
edited on: 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.

(0088666)
osa (developer)
2019-10-30 15:11

Please take a look at kgv remarks. I don't have others.
(0088670)
git (administrator)
2019-10-30 16:28

Branch CR31092 has been updated forcibly by abv.

SHA-1: 5f52175c9e2f393b3123a0a09e75439c09a5739b
(0088676)
abv (manager)
2019-10-30 17:35

Indentation is corrected and braces added, please review again
(0088846)
git (administrator)
2019-11-10 11:41

Branch CR31092 has been deleted by inv.

SHA-1: 5f52175c9e2f393b3123a0a09e75439c09a5739b

- Related Changesets
occt: master 53d770b3
Timestamp: 2019-10-25 14:11:33
Author: 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
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:18 kgv Relationship added related to 0031091
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 View Revisions
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 View Revisions
2019-10-25 22:17 kgv Note Added: 0088619
2019-10-25 22:17 kgv Note Edited: 0088619 View Revisions
2019-10-25 22:18 kgv Note Edited: 0088619 View Revisions
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


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker