Browse Source

Make sure estimate time = 0 not displayed

Robby Candra 5 years ago
parent
commit
52a8bbefcf
1 changed files with 13 additions and 7 deletions
  1. 13
    7
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 13
- 7
Marlin/src/lcd/dogm/status_screen_DOGM.cpp View File

432
         #if ENABLED(SHOW_REMAINING_TIME)
432
         #if ENABLED(SHOW_REMAINING_TIME)
433
           if (!(ev & 0x3)) {
433
           if (!(ev & 0x3)) {
434
             duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
434
             duration_t estimation = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
435
-            const bool has_days = (estimation.value >= 60*60*24L);
436
-            const uint8_t len = estimation.toDigital(estimation_string, has_days);
437
-            #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
438
-              estimation_x_pos = _SD_DURATION_X(len);
439
-            #else
440
-              estimation_x_pos = _SD_DURATION_X(len + 1);
441
-            #endif
435
+            if (estimation.value == 0) {
436
+              estimation_string[0] = '\0';
437
+              estimation_x_pos = _PROGRESS_CENTER_X(0);
438
+            }
439
+            else {
440
+              const bool has_days = (estimation.value >= 60*60*24L);
441
+              const uint8_t len = estimation.toDigital(estimation_string, has_days);
442
+              #if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
443
+                estimation_x_pos = _SD_DURATION_X(len);
444
+              #else
445
+                estimation_x_pos = _SD_DURATION_X(len + 1);
446
+              #endif
447
+            }
442
           }
448
           }
443
         #endif
449
         #endif
444
       }
450
       }

Loading…
Cancel
Save