ProgressStatus ProgressStatus.hxx cadex/Base/ProgressStatus.hxx. More...
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) | |
![]() | |
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. | |
Static Protected Member Functions | |
_close (obj) | |
Protected Attributes | |
_myObservers | |
_myCancellationChecker | |
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.
manufacturingtoolkit.CadExMTK.ProgressStatus.__init__ | ( | self | ) |
Constructor.
Reimplemented from manufacturingtoolkit.CadExMTK.BaseObject.
manufacturingtoolkit.CadExMTK.ProgressStatus.__init__ | ( | self, | |
* | args ) |
Reimplemented from manufacturingtoolkit.CadExMTK.BaseObject.
|
static |
Returns a maximum value of the progress status.
By convention, returns 100.
|
static |
Returns a minimum value of the progress status.
By convention, returns 0.
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.