Add special menu entry to reset the mesh leveling grid to -1.

This commit is contained in:
Knutwurst
2021-06-20 12:00:31 +02:00
parent aac24f36ce
commit 74bef229c1
3 changed files with 39 additions and 22 deletions

View File

@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
#define CUSTOM_BUILD_VERSION "1.2.0-b_4.6" #define CUSTOM_BUILD_VERSION "1.2.0-b_4.7"
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2021-06-19" #define STRING_DISTRIBUTION_DATE "2021-06-19"

View File

@@ -727,7 +727,7 @@ void AnycubicTouchscreenClass::HandleSpecialMenu()
} }
#endif #endif
#if EITHER(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if ENABLED(KNUTWURST_BLTOUCH)
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_BLTOUCH_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_BLTOUCH_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_BLTOUCH_S)) != NULL)) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_BLTOUCH_S)) != NULL))
{ {
@@ -738,6 +738,18 @@ void AnycubicTouchscreenClass::HandleSpecialMenu()
} }
#endif #endif
#if ENABLED(KNUTWURST_TFT_LEVELING)
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_RESETLV_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_RESETLV_S)) != NULL))
{
SERIAL_ECHOLNPGM("Special Menu: initializeGrid()");
initializeGrid();
settings.save();
buzzer.tone(105, 1108);
buzzer.tone(210, 1661);
}
#endif
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_PAUSE_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_PAUSE_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PAUSE_L)) != NULL)) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PAUSE_L)) != NULL))
{ {
@@ -990,7 +1002,7 @@ void AnycubicTouchscreenClass::PrintList()
break; break;
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
case 4: // Page 2 case 4: // Page 2 for Manual Mesh Bed Level
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_S); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_L); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_L);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_MESH_MENU_S); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_MESH_MENU_S);
@@ -1002,8 +1014,8 @@ void AnycubicTouchscreenClass::PrintList()
break; break;
#endif #endif
#if EITHER(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if ENABLED(KNUTWURST_BLTOUCH)
case 4: // Page 2 case 4: // Page 2 for BLTouch
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_S); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_L); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_L);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_BLTOUCH_S); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_BLTOUCH_S);
@@ -1015,6 +1027,19 @@ void AnycubicTouchscreenClass::PrintList()
break; break;
#endif #endif
#if ENABLED(KNUTWURST_TFT_LEVELING)
case 4: // Page 2 for Chiron ABL
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_EZLVL_MENU_L);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_RESETLV_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_RESETLV_L);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_PID_HOTEND_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_PID_HOTEND_L);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_PID_BED_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_PID_BED_L);
break;
#endif
case 8: // Page 3 case 8: // Page 3
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_LOAD_DEFAULTS_S); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_LOAD_DEFAULTS_S);
HARDWARE_SERIAL_PROTOCOLLNPGM(SM_LOAD_DEFAULTS_L); HARDWARE_SERIAL_PROTOCOLLNPGM(SM_LOAD_DEFAULTS_L);
@@ -1981,15 +2006,8 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
{ {
int mx, my; int mx, my;
if(CodeSeen('X')) if(CodeSeen('X')) { mx = CodeValueInt(); }
{ if(CodeSeen('Y')) { my = CodeValueInt(); }
mx = CodeValueInt();
}
if(CodeSeen('Y'))
{
my = CodeValueInt();
}
float Zvalue = z_values[mx][my]; float Zvalue = z_values[mx][my];
Zvalue = Zvalue * 100; Zvalue = Zvalue * 100;
@@ -2089,14 +2107,9 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
break; break;
case 34: //a34 bed grid write case 34: //a34 bed grid write
{ {
if(CodeSeen('X')) if(CodeSeen('X')) { x = constrain(CodeValueInt(),0,GRID_MAX_POINTS_X); }
{ if(CodeSeen('Y')) { y = constrain(CodeValueInt(),0,GRID_MAX_POINTS_Y); }
x = constrain(CodeValueInt(),0,GRID_MAX_POINTS_X);
}
if(CodeSeen('Y'))
{
y = constrain(CodeValueInt(),0,GRID_MAX_POINTS_Y);
}
if(CodeSeen('V')) if(CodeSeen('V'))
{ {
//z_values[x][y] = (float)constrain(CodeValue()/100,-10,10); //z_values[x][y] = (float)constrain(CodeValue()/100,-10,10);

View File

@@ -97,6 +97,8 @@ char *ftostr32(const float &);
#define SM_Z_DN_001_S "<ZDN001>" #define SM_Z_DN_001_S "<ZDN001>"
#define SM_BLTOUCH_L "<Start Auto Leveling>" #define SM_BLTOUCH_L "<Start Auto Leveling>"
#define SM_BLTOUCH_S "<BLTCH>" #define SM_BLTOUCH_S "<BLTCH>"
#define SM_RESETLV_L "<Reset Auto Leveling>"
#define SM_RESETLV_S "<RSTLV>"
#define SM_PAUSE_L "<Fil. Change Pause>" #define SM_PAUSE_L "<Fil. Change Pause>"
#define SM_PAUSE_S "<PAUSE>" #define SM_PAUSE_S "<PAUSE>"
#define SM_RESUME_L "<Fil. Change Resume>" #define SM_RESUME_L "<Fil. Change Resume>"
@@ -172,6 +174,8 @@ char *ftostr32(const float &);
#define SM_Z_DN_001_S "<ZDOWN~3.GCO" #define SM_Z_DN_001_S "<ZDOWN~3.GCO"
#define SM_BLTOUCH_L "<Start AutoLeveling>.gcode" #define SM_BLTOUCH_L "<Start AutoLeveling>.gcode"
#define SM_BLTOUCH_S "<BLTOU~1.GCO" #define SM_BLTOUCH_S "<BLTOU~1.GCO"
#define SM_RESETLV_L "<Reset AutoLeveling>.gcode"
#define SM_RESETLV_S "<RSTLV~1.GCO>"
#define SM_PAUSE_L "<Fil. Change Pause> .gcode" #define SM_PAUSE_L "<Fil. Change Pause> .gcode"
#define SM_PAUSE_S "<FILCH~2.GCO" #define SM_PAUSE_S "<FILCH~2.GCO"
#define SM_RESUME_L "<Fil. Change Resume>.gcode" #define SM_RESUME_L "<Fil. Change Resume>.gcode"