Hide menu
Loading...
Searching...
No Matches

ProgressStatus ProgressStatus.hxx cadex/Base/ProgressStatus.hxx. More...

Inheritance diagram for manufacturingtoolkit.CadExMTK.ProgressStatus:
manufacturingtoolkit.CadExMTK.BaseObject

Public Member Functions

 __init__ (self)
 Constructor.
 
 Value (self)
 Returns a current value.
 
 SetObserversNotifyingThread (self)
 Sets the current thread as the only thread sending notifications for all registered observers.
 
 Cancel (self)
 A callback called when the progress status object was set to the canceled state.
 
 WasCanceled (self)
 Returns true if the operation has been canceled.
 
 __init__ (self, *args)
 
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 Register (self, theObserver, theValueThreshold=None, theTimeThreshold=None)
 
 Unregister (self, theObserver)
 
 SetCancellationChecker (self, theChecker)
 
 RemoveCancellationChecker (self, theChecker)
 
- Public Member Functions inherited from manufacturingtoolkit.CadExMTK.BaseObject
 Id (self)
 Return unique identifier of public object.
 
 IsNull (self)
 

Static Public Member Functions

 MinValue ()
 Returns a minimum value of the progress status.
 
 MaxValue ()
 Returns a maximum value of the progress status.
 

Protected Member Functions

 _Register (self, theObserver, theValueThreshold=0.1, theTimeThreshold=20)
 Adds an observer that will be notified when the progress status has changed.
 
 _Unregister (self, theObserver)
 Removes a previously added observer.
 
 _SetCancellationChecker (self, theChecker)
 Sets the cancellation checker.
 
 _RemoveCancellationChecker (self)
 Removes the cancellation checker.
 
 _AddObserver (self, theObserver)
 
 _RemoveObserver (self, theObserver)
 

Static Protected Member Functions

 _close (obj)
 

Protected Attributes

 _myObservers
 
 _myCancellationChecker
 

Detailed Description

ProgressStatus ProgressStatus.hxx cadex/Base/ProgressStatus.hxx.

Provides progress status and notification mechanism.

ProgressStatus has a current Value() which belongs to the range [0, 100]. The algorithms that support progress status update increment this value during their execution.

Upon value change the status object notifies its observers (subclasses of the ProgressStatus.Observer class) registered with the Register() method. Thus, it implements the observer design pattern. The life span of the observer must be greater than the life span of the status object.

In the case there are no observers, the progress status incurs minimum overhead to the algorithm.

The status objects can be assigned to each other to create a chained range shared by several algorithms.

ProgressScope objects can be used to split progress status range into smaller scopes. The scopes can be nested.

For details refer to Progress Status Support section.

Constructor & Destructor Documentation

◆ __init__() [1/2]

manufacturingtoolkit.CadExMTK.ProgressStatus.__init__ ( self)

Constructor.

Reimplemented from manufacturingtoolkit.CadExMTK.BaseObject.

◆ __init__() [2/2]

manufacturingtoolkit.CadExMTK.ProgressStatus.__init__ ( self,
* args )

Member Function Documentation

◆ MaxValue()

manufacturingtoolkit.CadExMTK.ProgressStatus.MaxValue ( )
static

Returns a maximum value of the progress status.

By convention, returns 100.

◆ MinValue()

manufacturingtoolkit.CadExMTK.ProgressStatus.MinValue ( )
static

Returns a minimum value of the progress status.

By convention, returns 0.

◆ Value()

manufacturingtoolkit.CadExMTK.ProgressStatus.Value ( self)

Returns a current value.

The values is in the range [0, 100]. Beware of internal rounding errors. You might want to round the returned value to get a required precision for more confident usage.


The documentation for this class was generated from the following file:
  • CadExMTK.py