mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-14 13:55:54 +08:00
Fix display issue linked to string replace function
Use substring to extract positions from string instead of using replace function
This commit is contained in:
parent
41018db174
commit
5cd45b2976
@ -1563,11 +1563,20 @@ void handle_web_interface_status()
|
||||
}
|
||||
buffer2send+=(PROGMEM2CHAR(DIV_E));
|
||||
buffer2send+=(PROGMEM2CHAR(DIV_POSITION));
|
||||
int Epos = web_interface->answer4M114.indexOf("E:");
|
||||
description=web_interface->answer4M114.substring(0,Epos);
|
||||
description.replace("X:","<LABEL>X:</LABEL><LABEL class=\"text-info\">");
|
||||
description.replace("Y:","</LABEL><LABEL> Y:</LABEL><LABEL class=\"text-info\">");
|
||||
description.replace("Z:","</LABEL><LABEL> Z:</LABEL><LABEL class=\"text-info\">");
|
||||
int tagpos = web_interface->answer4M114.indexOf("X:");
|
||||
int tagpos2 = web_interface->answer4M114.indexOf(" ",tagpos);
|
||||
description=web_interface->answer4M114.substring(tagpos+2,tagpos2);
|
||||
buffer2send+="<LABEL>X:</LABEL><LABEL class=\"text-info\">";
|
||||
buffer2send+=description;
|
||||
buffer2send+="</LABEL> <LABEL>Y:</LABEL><LABEL class=\"text-info\">";
|
||||
tagpos = web_interface->answer4M114.indexOf("Y:");
|
||||
tagpos2 = web_interface->answer4M114.indexOf(" ",tagpos);
|
||||
description=web_interface->answer4M114.substring(tagpos+2,tagpos2);
|
||||
buffer2send+=description;
|
||||
buffer2send+="</LABEL> <LABEL>Z:</LABEL><LABEL class=\"text-info\">";
|
||||
tagpos = web_interface->answer4M114.indexOf("Z:");
|
||||
tagpos2 = web_interface->answer4M114.indexOf(" ",tagpos);
|
||||
description=web_interface->answer4M114.substring(tagpos+2,tagpos2);
|
||||
buffer2send+=description;
|
||||
buffer2send+="</LABEL> ";
|
||||
buffer2send+=(PROGMEM2CHAR(DIV_E));
|
||||
@ -1680,7 +1689,7 @@ WEBINTERFACE_CLASS::WEBINTERFACE_CLASS (int port):WebServer(port)
|
||||
WebServer.on("/CMD",HTTP_ANY, handle_web_command);
|
||||
WebServer.onNotFound( handle_not_found);
|
||||
answer4M105="T:0 /0 ";
|
||||
answer4M114="X:0.0 Y:0.0 Z:0.0";
|
||||
answer4M114="X:0.0 Y:0.0 Z:0.000";
|
||||
answer4M220="100";
|
||||
answer4M221="100";
|
||||
last_temp=system_get_time();
|
||||
|
Loading…
x
Reference in New Issue
Block a user