Add fail statistics menu item for MK25.
As there is only filament sensor and no crash and power interruption detection, squash everything into single screen.
This commit is contained in:
parent
0f082fa1f7
commit
67fd467ebe
|
|
@ -168,7 +168,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
|
||||||
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
|
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
|
||||||
|
|
||||||
|
|
||||||
#define PAT9125
|
#define PAT9125 //!< Filament sensor
|
||||||
#define FANCHECK
|
#define FANCHECK
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -681,6 +681,7 @@ void crashdet_cancel()
|
||||||
card.closefile();
|
card.closefile();
|
||||||
tmc2130_sg_stop_on_crash = true;
|
tmc2130_sg_stop_on_crash = true;
|
||||||
}
|
}
|
||||||
|
#endif //TMC2130
|
||||||
|
|
||||||
void failstats_reset_print()
|
void failstats_reset_print()
|
||||||
{
|
{
|
||||||
|
|
@ -690,7 +691,6 @@ void failstats_reset_print()
|
||||||
eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0);
|
eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //TMC2130
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MESH_BED_LEVELING
|
#ifdef MESH_BED_LEVELING
|
||||||
|
|
@ -4081,10 +4081,8 @@ void process_commands()
|
||||||
card.openFile(strchr_pointer + 4,true);
|
card.openFile(strchr_pointer + 4,true);
|
||||||
break;
|
break;
|
||||||
case 24: //M24 - Start SD print
|
case 24: //M24 - Start SD print
|
||||||
#ifdef TMC2130
|
|
||||||
if (!card.paused)
|
if (!card.paused)
|
||||||
failstats_reset_print();
|
failstats_reset_print();
|
||||||
#endif //TMC2130
|
|
||||||
card.startFileprint();
|
card.startFileprint();
|
||||||
starttime=millis();
|
starttime=millis();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -204,9 +204,9 @@ static void prusa_stat_temperatures();
|
||||||
static void prusa_stat_printinfo();
|
static void prusa_stat_printinfo();
|
||||||
static void lcd_farm_no();
|
static void lcd_farm_no();
|
||||||
static void lcd_menu_extruder_info();
|
static void lcd_menu_extruder_info();
|
||||||
#ifdef TMC2130
|
#if defined(TMC2130) || defined(PAT9125)
|
||||||
static void lcd_menu_fails_stats();
|
static void lcd_menu_fails_stats();
|
||||||
#endif //TMC2130
|
#endif //TMC2130 or PAT9125
|
||||||
|
|
||||||
void lcd_finishstatus();
|
void lcd_finishstatus();
|
||||||
|
|
||||||
|
|
@ -1537,7 +1537,7 @@ static void lcd_menu_extruder_info()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TMC2130
|
#if defined(TMC2130) && defined(PAT9125)
|
||||||
static void lcd_menu_fails_stats_total()
|
static void lcd_menu_fails_stats_total()
|
||||||
{
|
{
|
||||||
//01234567890123456789
|
//01234567890123456789
|
||||||
|
|
@ -1579,7 +1579,13 @@ static void lcd_menu_fails_stats_print()
|
||||||
lcd_goto_menu(lcd_menu_fails_stats, 2);
|
lcd_goto_menu(lcd_menu_fails_stats, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @brief Open fail statistics menu
|
||||||
|
*
|
||||||
|
* This version of function is used, when there is filament sensor,
|
||||||
|
* power failure and crash detection.
|
||||||
|
* There are Last print and Total menu items.
|
||||||
|
*/
|
||||||
static void lcd_menu_fails_stats()
|
static void lcd_menu_fails_stats()
|
||||||
{
|
{
|
||||||
START_MENU();
|
START_MENU();
|
||||||
|
|
@ -1588,6 +1594,34 @@ static void lcd_menu_fails_stats()
|
||||||
MENU_ITEM(submenu, PSTR("Total"), lcd_menu_fails_stats_total);
|
MENU_ITEM(submenu, PSTR("Total"), lcd_menu_fails_stats_total);
|
||||||
END_MENU();
|
END_MENU();
|
||||||
}
|
}
|
||||||
|
#else if defined(PAT9125)
|
||||||
|
/**
|
||||||
|
* @brief Print last print and total filament run outs
|
||||||
|
*
|
||||||
|
* This version of function is used, when there is filament sensor,
|
||||||
|
* but no other sensors (e.g. power failure, crash detection).
|
||||||
|
*
|
||||||
|
* Example screen:
|
||||||
|
* @code
|
||||||
|
* 01234567890123456789
|
||||||
|
* Last print failures
|
||||||
|
* Filam. runouts 0
|
||||||
|
* Total failures
|
||||||
|
* Filam. runouts 5
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
static void lcd_menu_fails_stats()
|
||||||
|
{
|
||||||
|
uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
|
||||||
|
uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
|
||||||
|
fprintf_P(lcdout, PSTR(ESC_H(0,0)"Last print failures"ESC_H(1,1)"Filam. runouts %-3d"ESC_H(0,2)"Total failures"ESC_H(1,3)"Filam. runouts %-3d"), filamentLast, filamentTotal);
|
||||||
|
if (lcd_clicked())
|
||||||
|
{
|
||||||
|
lcd_quick_feedback();
|
||||||
|
//lcd_return_to_status();
|
||||||
|
lcd_goto_menu(lcd_main_menu, 8); //TODO: Remove hard coded encoder value.
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5221,9 +5255,9 @@ static void lcd_main_menu()
|
||||||
MENU_ITEM(submenu, MSG_STATISTICS, lcd_menu_statistics);
|
MENU_ITEM(submenu, MSG_STATISTICS, lcd_menu_statistics);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TMC2130
|
#if defined(TMC2130) || defined(PAT9125)
|
||||||
MENU_ITEM(submenu, PSTR("Fail stats"), lcd_menu_fails_stats);
|
MENU_ITEM(submenu, PSTR("Fail stats"), lcd_menu_fails_stats);
|
||||||
#endif //TMC2130
|
#endif
|
||||||
|
|
||||||
MENU_ITEM(submenu, MSG_SUPPORT, lcd_support_menu);
|
MENU_ITEM(submenu, MSG_SUPPORT, lcd_support_menu);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue