Return the estimated time until user interaction is required e.g. to change filament
| 469 | |
| 470 | // Return the estimated time until user interaction is required e.g. to change filament |
| 471 | ExpressionValue PrintMonitor::EstimateTimeToPause() const noexcept |
| 472 | { |
| 473 | ExpressionValue ret(nullptr); |
| 474 | if (isPrinting && !gCodes.IsSimulating() && slicerTimeToPause > 0.0) |
| 475 | { |
| 476 | const float timeToPause = slicerTimeToPause - (millis64() - whenSlicerTimeToPauseSet) * MillisToSeconds; |
| 477 | if (timeToPause > 0.0) |
| 478 | { |
| 479 | ret.SetInt(lrintf(timeToPause)); |
| 480 | } |
| 481 | } |
| 482 | return ret; |
| 483 | } |
| 484 | |
| 485 | #endif |
| 486 |