pause print statistics

This commit is contained in:
PavelSindler 2017-04-07 14:56:52 +02:00
parent 2060d319f5
commit 7b962d666f
3 changed files with 6 additions and 5 deletions

View file

@ -1523,7 +1523,8 @@ void get_command()
SERIAL_PROTOCOLLNRPGM(MSG_FILE_PRINTED);
stoptime=millis();
char time[30];
unsigned long t=(stoptime-starttime)/1000;
unsigned long t=(stoptime-starttime-pause_time)/1000;
pause_time = 0;
int hours, minutes;
minutes=(t/60)%60;
hours=t/60/60;
@ -3962,7 +3963,7 @@ Sigma_Exit:
heating_status = 2;
if (farm_mode) { prusa_statistics(2); };
starttime=millis();
//starttime=millis();
previous_millis_cmd = millis();
}
break;

View file

@ -545,7 +545,6 @@ void lcd_commands()
enquecommand(cmd1);
isPrintPaused = false;
card.startFileprint();
//starttime = pause_time;
lcd_commands_step = 0;
lcd_commands_type = 0;
}
@ -3591,7 +3590,8 @@ void lcd_sdcard_stop()
card.closefile();
stoptime = millis();
unsigned long t = (stoptime - starttime) / 1000; //time in s
unsigned long t = (stoptime - starttime - pause_time) / 1000; //time in s
pause_time = 0;
save_statistics(total_filament_used, t);
lcd_return_to_status();

View file

@ -792,7 +792,7 @@ static void lcd_implementation_status_screen()
lcd.print(LCD_STR_CLOCK[0]);
if(starttime != 0)
{
uint16_t time = (isPrintPaused || (!heating_status))? pause_time/60000 : (millis() + pause_time /*- start_time*/)/60000; //is print is paused, pause also print time
uint16_t time = millis() / 60000 - starttime / 60000;
lcd.print(itostr2(time/60));
lcd.print(':');
lcd.print(itostr2(time%60));