Add Sheet bit check
Add Sheet warning bit check Improve `M115` steel check when `Always` is selected for host connection Add some debug output
This commit is contained in:
parent
c38d965e94
commit
9a189e8f64
|
|
@ -5840,8 +5840,8 @@ void process_commands()
|
||||||
#endif //EXTENDED_CAPABILITIES_REPORT
|
#endif //EXTENDED_CAPABILITIES_REPORT
|
||||||
}
|
}
|
||||||
#ifdef STEEL_SHEET_TYPES
|
#ifdef STEEL_SHEET_TYPES
|
||||||
if (eeprom_read_byte((uint8_t*)EEPROM_CHECK_SHEET_TYPE) == (uint8_t)ClCheckMode::_Always) {
|
if ((eeprom_read_byte((uint8_t*)EEPROM_CHECK_SHEET_TYPE) == (uint8_t)ClCheckMode::_Always) && printer_active()) {
|
||||||
uint8_t result = lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_CHECK_SHEET_TYPE), false, LCD_MIDDLE_BUTTON_CHOICE);
|
uint8_t result = lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_CHECK_SHEET_TYPE), true, LCD_MIDDLE_BUTTON_CHOICE);
|
||||||
if (result == LCD_MIDDLE_BUTTON_CHOICE) {
|
if (result == LCD_MIDDLE_BUTTON_CHOICE) {
|
||||||
print_stop(false, true);
|
print_stop(false, true);
|
||||||
}
|
}
|
||||||
|
|
@ -7424,7 +7424,7 @@ void process_commands()
|
||||||
- M862.4 { P<fw_version> | Q }
|
- M862.4 { P<fw_version> | Q }
|
||||||
- M862.5 { P<gcode_level> | Q }
|
- M862.5 { P<gcode_level> | Q }
|
||||||
- M862.6 Not used but reserved by 32-bit
|
- M862.6 Not used but reserved by 32-bit
|
||||||
- M862.7 { P<sheet type> | Q }
|
- M862.7 { P<sheet type> | W<warn sheet type>| Q }
|
||||||
|
|
||||||
When run with P<> argument, the check is performed against the input value.
|
When run with P<> argument, the check is performed against the input value.
|
||||||
When run with Q argument, the current value is shown.
|
When run with Q argument, the current value is shown.
|
||||||
|
|
@ -7500,8 +7500,8 @@ void process_commands()
|
||||||
case ClPrintChecking::_Gcode: // ~ .5
|
case ClPrintChecking::_Gcode: // ~ .5
|
||||||
if(code_seen('P'))
|
if(code_seen('P'))
|
||||||
{
|
{
|
||||||
uint16_t nGcodeLevel;
|
uint8_t nGcodeLevel;
|
||||||
nGcodeLevel=(uint16_t)code_value_long();
|
nGcodeLevel=(uint8_t)code_value_uint8();
|
||||||
gcode_level_check(nGcodeLevel);
|
gcode_level_check(nGcodeLevel);
|
||||||
}
|
}
|
||||||
else if(code_seen('Q'))
|
else if(code_seen('Q'))
|
||||||
|
|
@ -7513,9 +7513,14 @@ void process_commands()
|
||||||
case ClPrintChecking::_SheetType: // ~ .7
|
case ClPrintChecking::_SheetType: // ~ .7
|
||||||
if(code_seen('P'))
|
if(code_seen('P'))
|
||||||
{
|
{
|
||||||
uint16_t nSheetType;
|
uint8_t nSheetType;
|
||||||
nSheetType=(uint16_t)code_value_long();
|
uint8_t wSheetType;
|
||||||
sheet_type_check(nSheetType);
|
nSheetType=(uint8_t)code_value_uint8();
|
||||||
|
if(code_seen('W'))
|
||||||
|
{
|
||||||
|
wSheetType=(uint8_t)code_value_uint8();
|
||||||
|
}
|
||||||
|
sheet_type_check(nSheetType, wSheetType);
|
||||||
}
|
}
|
||||||
else if(code_seen('Q'))
|
else if(code_seen('Q'))
|
||||||
SERIAL_PROTOCOLLN((int)eeprom_read_byte(&EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].type));
|
SERIAL_PROTOCOLLN((int)eeprom_read_byte(&EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].type));
|
||||||
|
|
|
||||||
|
|
@ -412,10 +412,10 @@ done:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gcode_level_check(uint16_t nGcodeLevel) {
|
void gcode_level_check(uint8_t nGcodeLevel) {
|
||||||
if (oCheckGcode == ClCheckMode::_None)
|
if (oCheckGcode == ClCheckMode::_None)
|
||||||
return;
|
return;
|
||||||
if (nGcodeLevel <= (uint16_t)GCODE_LEVEL)
|
if (nGcodeLevel <= (uint8_t)GCODE_LEVEL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// SERIAL_ECHO_START;
|
// SERIAL_ECHO_START;
|
||||||
|
|
@ -433,23 +433,32 @@ void gcode_level_check(uint16_t nGcodeLevel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STEEL_SHEET_TYPES
|
#ifdef STEEL_SHEET_TYPES
|
||||||
void sheet_type_check(uint16_t nSheetType) {
|
void sheet_type_check(uint8_t nSheetType, uint8_t wSheetType) {
|
||||||
uint16_t actualSheetType;
|
uint8_t actualSheetType;
|
||||||
if (oCheckSheets == ClCheckMode::_None)
|
if (oCheckSheets == ClCheckMode::_None)
|
||||||
return;
|
return;
|
||||||
actualSheetType = eeprom_read_byte(&EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].type);
|
actualSheetType = eeprom_read_byte(&EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].type);
|
||||||
if (nSheetType == actualSheetType)
|
bool n_SheetType = (nSheetType & actualSheetType) ? 1 : 0; //Expected sheet found
|
||||||
return;
|
bool w_SheetType = (wSheetType & actualSheetType) ? 1 : 0; //Warn sheet found
|
||||||
/*
|
/*
|
||||||
SERIAL_PROTOCOLPGM("Active sheet number: ");
|
SERIAL_PROTOCOLPGM("Active sheet number: ");
|
||||||
SERIAL_PROTOCOL((int)eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)));
|
SERIAL_PROTOCOL((int)eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)));
|
||||||
SERIAL_PROTOCOLPGM(" Sheet type differs from actual : ");
|
SERIAL_PROTOCOLPGM(" actual sheet type: ");
|
||||||
SERIAL_PROTOCOL((int)eeprom_read_byte(&EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].type));
|
SERIAL_PROTOCOL((int)eeprom_read_byte(&EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].type));
|
||||||
SERIAL_PROTOCOLPGM(" expected: ");
|
SERIAL_PROTOCOLPGM(" expected sheet type: ");
|
||||||
SERIAL_PROTOCOL((int)nSheetType);
|
SERIAL_PROTOCOL((int)nSheetType);
|
||||||
|
SERIAL_PROTOCOLPGM(" warn sheet type: ");
|
||||||
|
SERIAL_PROTOCOL((int)wSheetType);
|
||||||
|
SERIAL_PROTOCOLPGM(" n_sheet found: ");
|
||||||
|
SERIAL_PROTOCOL((int)n_SheetType);
|
||||||
|
SERIAL_PROTOCOLPGM(" w_sheet not found: ");
|
||||||
|
SERIAL_PROTOCOL((int)w_SheetType);
|
||||||
SERIAL_PROTOCOLPGM(" oCheckSheets: ");
|
SERIAL_PROTOCOLPGM(" oCheckSheets: ");
|
||||||
SERIAL_PROTOCOLLN((int)oCheckSheets);
|
SERIAL_PROTOCOLLN((int)oCheckSheets);
|
||||||
*/
|
*/
|
||||||
|
if (n_SheetType && !w_SheetType && oCheckSheets != ClCheckMode::_Always)
|
||||||
|
return;
|
||||||
|
|
||||||
render_M862_warnings(
|
render_M862_warnings(
|
||||||
_T(MSG_CHECK_SHEET_TYPE)
|
_T(MSG_CHECK_SHEET_TYPE)
|
||||||
,_T(MSG_CHECK_SHEET_TYPE) //Identical messages
|
,_T(MSG_CHECK_SHEET_TYPE) //Identical messages
|
||||||
|
|
|
||||||
|
|
@ -135,9 +135,9 @@ void nozzle_diameter_check(uint16_t nDiameter);
|
||||||
void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel);
|
void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel);
|
||||||
void printer_smodel_check(const char *pStrPos, const char *actualPrinterSModel);
|
void printer_smodel_check(const char *pStrPos, const char *actualPrinterSModel);
|
||||||
void fw_version_check(const char *pVersion);
|
void fw_version_check(const char *pVersion);
|
||||||
void gcode_level_check(uint16_t nGcodeLevel);
|
void gcode_level_check(uint8_t nGcodeLevel);
|
||||||
#ifdef STEEL_SHEET_TYPES
|
#ifdef STEEL_SHEET_TYPES
|
||||||
void sheet_type_check(uint16_t nSheetType);
|
void sheet_type_check(uint8_t nSheetType, uint8_t wSheetType);
|
||||||
#endif //STEEL_SHEET_TYPES
|
#endif //STEEL_SHEET_TYPES
|
||||||
|
|
||||||
/// Check if the filament is present before starting a print job.
|
/// Check if the filament is present before starting a print job.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue