Callback method for the comm object, called upon any change in progress of the printjob. Triggers storage of new values for printTime, printTimeLeft and the current progress.
(self)
| 648 | self._addTemperatureData(temp, bedTemp) |
| 649 | |
| 650 | def mcProgress(self): |
| 651 | """ |
| 652 | Callback method for the comm object, called upon any change in progress of the printjob. |
| 653 | Triggers storage of new values for printTime, printTimeLeft and the current progress. |
| 654 | """ |
| 655 | |
| 656 | #Calculate estimated print time left |
| 657 | printTime = self.getPrintTime() |
| 658 | progress = self.getPrintProgress() |
| 659 | estimatedTimeLeft = None |
| 660 | |
| 661 | if self._estimatedPrintTime: |
| 662 | if printTime and progress: |
| 663 | if progress < 1.0: |
| 664 | estimatedTimeLeft = self._estimatedPrintTime * ( 1.0 - progress ) |
| 665 | elaspedTimeVariance = printTime - ( self._estimatedPrintTime - estimatedTimeLeft ) |
| 666 | adjustedEstimatedTime = self._estimatedPrintTime + elaspedTimeVariance |
| 667 | estimatedTimeLeft = ( adjustedEstimatedTime * ( 1.0 - progress) ) / 60 |
| 668 | else: |
| 669 | estimatedTimeLeft = 0 |
| 670 | |
| 671 | else: |
| 672 | estimatedTimeLeft = self._estimatedPrintTime / 60 |
| 673 | |
| 674 | value = self._formatPrintingProgressData(progress, self.getPrintFilepos(), printTime, estimatedTimeLeft, self.getCurrentLayer()) |
| 675 | eventManager().fire(Events.PRINTING_PROGRESS, value) |
| 676 | |
| 677 | self._setProgressData(progress, self.getPrintFilepos(), printTime, estimatedTimeLeft, self.getCurrentLayer()) |
| 678 | |
| 679 | def mcHeatingUpUpdate(self, value): |
| 680 | self._stateMonitor._state['flags']['heatingUp'] = value |
no test coverage detected