(self, data, sendMessage)
| 268 | sendMessage("invalid_params",True) |
| 269 | |
| 270 | def printingInfo(self, data, sendMessage): |
| 271 | pm = printerManager() |
| 272 | result = {} |
| 273 | |
| 274 | if pm.isPrinting() or pm.isPaused(): |
| 275 | |
| 276 | # PRINTING INFO |
| 277 | currentFile = pm.selectedFile |
| 278 | fileName = currentFile["filename"] |
| 279 | |
| 280 | result = pm.getFileInfo(fileName) |
| 281 | |
| 282 | # PRINTING PROGRESS |
| 283 | printTime = pm.getPrintTime() |
| 284 | progress = pm.getPrintProgress() |
| 285 | estimatedTimeLeft = None |
| 286 | |
| 287 | if pm._estimatedPrintTime: |
| 288 | if printTime and progress: |
| 289 | if progress < 1.0: |
| 290 | estimatedTimeLeft = pm._estimatedPrintTime * ( 1.0 - progress ) |
| 291 | elaspedTimeVariance = printTime - ( pm._estimatedPrintTime - estimatedTimeLeft ) |
| 292 | adjustedEstimatedTime = pm._estimatedPrintTime + elaspedTimeVariance |
| 293 | estimatedTimeLeft = ( adjustedEstimatedTime * ( 1.0 - progress) ) / 60 |
| 294 | else: |
| 295 | estimatedTimeLeft = 0 |
| 296 | |
| 297 | else: |
| 298 | estimatedTimeLeft = pm._estimatedPrintTime / 60 |
| 299 | |
| 300 | value = pm._formatPrintingProgressData(progress, pm.getPrintFilepos(), printTime, estimatedTimeLeft, pm.getCurrentLayer()) |
| 301 | result['progress'] = value |
| 302 | |
| 303 | sendMessage(result) |
| 304 | |
| 305 | def saveTempPreset(self, data, sendMessage): |
| 306 | ppm = printerProfileManager() |
nothing calls this directly
no test coverage detected