Finished regularising function names.
This commit is contained in:
parent
44f6516fc8
commit
816e626dac
5 changed files with 69 additions and 100 deletions
|
@ -69,7 +69,7 @@ void RepRap::Spin()
|
|||
move->Spin();
|
||||
heat->Spin();
|
||||
gcodes->Spin();
|
||||
webserver->spin();
|
||||
webserver->Spin();
|
||||
}
|
||||
|
||||
void RepRap::Interrupt()
|
||||
|
|
|
@ -49,39 +49,39 @@
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button type="button" onclick="return homex()">Home X</button></td>
|
||||
<td><button type="button" onclick="return xm100mm()"><--- X</button></td>
|
||||
<td><button type="button" onclick="return xm10mm()"><-- X</button></td>
|
||||
<td><button type="button" onclick="return xm1mm()"><- X</button></td>
|
||||
<td><button type="button" onclick="return xm01mm()">< X</button></td>
|
||||
<td><button type="button" onclick="return xp01mm()">X ></button></td>
|
||||
<td><button type="button" onclick="return xp1mm()">X --></button></td>
|
||||
<td><button type="button" onclick="return xp10mm()">X --></button></td>
|
||||
<td><button type="button" onclick="return xp100mm()">X ---></button></td>
|
||||
<td><button type="button" onclick="return home('X')">Home X</button></td>
|
||||
<td><button type="button" onclick="return move('X', -100)"><--- X</button></td>
|
||||
<td><button type="button" onclick="return move('X', -10)"><-- X</button></td>
|
||||
<td><button type="button" onclick="return move('X', -1)"><- X</button></td>
|
||||
<td><button type="button" onclick="return move('X', -0.1)">< X</button></td>
|
||||
<td><button type="button" onclick="return move('X', 0.1)">X ></button></td>
|
||||
<td><button type="button" onclick="return move('X', 1)">X --></button></td>
|
||||
<td><button type="button" onclick="return move('X', 10)">X --></button></td>
|
||||
<td><button type="button" onclick="return move('X', 100)">X ---></button></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button type="button" onclick="return homey()">Home Y</button></td>
|
||||
<td><button type="button" onclick="return ym100mm()"><--- Y</button></td>
|
||||
<td><button type="button" onclick="return ym10mm()"><-- Y</button></td>
|
||||
<td><button type="button" onclick="return ym1mm()"><- Y</button></td>
|
||||
<td><button type="button" onclick="return ym01mm()">< Y</button></td>
|
||||
<td><button type="button" onclick="return yp01mm()">Y ></button></td>
|
||||
<td><button type="button" onclick="return yp1mm()">Y -></button></td>
|
||||
<td><button type="button" onclick="return yp10mm()">Y --></button></td>
|
||||
<td><button type="button" onclick="return yp100mm()">Y ---></button></td>
|
||||
<td><button type="button" onclick="return home('Y')">Home Y</button></td>
|
||||
<td><button type="button" onclick="return move('Y', -100)"><--- Y</button></td>
|
||||
<td><button type="button" onclick="return move('Y', -10)"><-- Y</button></td>
|
||||
<td><button type="button" onclick="return move('Y', -1)"><- Y</button></td>
|
||||
<td><button type="button" onclick="return move('Y', -0.1)">< Y</button></td>
|
||||
<td><button type="button" onclick="return move('Y', 0.1)">Y ></button></td>
|
||||
<td><button type="button" onclick="return move('Y', 1)">Y -></button></td>
|
||||
<td><button type="button" onclick="return move('Y', 10)">Y --></button></td>
|
||||
<td><button type="button" onclick="return move('Y', 100)">Y ---></button></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button type="button" onclick="return homez()">Home Z</button></td>
|
||||
<td><button type="button" onclick="return zm100mm()"><--- Z</button></td>
|
||||
<td><button type="button" onclick="return zm10mm()"><-- Z</button></td>
|
||||
<td><button type="button" onclick="return zm1mm()"><- Z</button></td>
|
||||
<td><button type="button" onclick="return zm01mm()">< Z</button></td>
|
||||
<td><button type="button" onclick="return zp01mm()">Z ></button></td>
|
||||
<td><button type="button" onclick="return zp1mm()">Z -></button></td>
|
||||
<td><button type="button" onclick="return zp10mm()">Z --></button></td>
|
||||
<td><button type="button" onclick="return zp100mm()">Z ---></button></td>
|
||||
<td><button type="button" onclick="return home('Z')">Home Z</button></td>
|
||||
<td><button type="button" onclick="return move('Z', -100)"><--- Z</button></td>
|
||||
<td><button type="button" onclick="return move('Z', -10)"><-- Z</button></td>
|
||||
<td><button type="button" onclick="return move('Z', -1)"><- Z</button></td>
|
||||
<td><button type="button" onclick="return move('Z', -0.1)">< Z</button></td>
|
||||
<td><button type="button" onclick="return move('Z', 0.1)">Z ></button></td>
|
||||
<td><button type="button" onclick="return move('Z', 1)">Z -></button></td>
|
||||
<td><button type="button" onclick="return move('Z', 10)">Z --></button></td>
|
||||
<td><button type="button" onclick="return move('Z', 100)">Z ---></button></td>
|
||||
</tr>
|
||||
|
||||
</div></table>
|
||||
|
@ -92,39 +92,8 @@
|
|||
|
||||
|
||||
function homea(){ window.location.href = "control.php?gcode=G28";}
|
||||
function homex(){ window.location.href = "control.php?gcode=G28%20X0";}
|
||||
function homey(){ window.location.href = "control.php?gcode=G28%20Y0";}
|
||||
function homez(){ window.location.href = "control.php?gcode=G28%20Z0";}
|
||||
|
||||
function xp01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X0.1%0AG90";}
|
||||
function xp1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X1%0AG90";}
|
||||
function xp10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X10%0AG90";}
|
||||
function xp100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X100%0AG90";}
|
||||
|
||||
function xm01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X-0.1%0AG90";}
|
||||
function xm1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X-1%0AG90";}
|
||||
function xm10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X10%0AG90";}
|
||||
function xm100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X100%0AG90";}
|
||||
|
||||
function yp01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y0.1%0AG90";}
|
||||
function yp1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y1%0AG90";}
|
||||
function yp10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y10%0AG90";}
|
||||
function yp100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y100%0AG90";}
|
||||
|
||||
function ym01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y-0.1%0AG90";}
|
||||
function ym1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y-1%0AG90";}
|
||||
function ym10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y10%0AG90";}
|
||||
function ym100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y100%0AG90";}
|
||||
|
||||
function zp01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z0.1%0AG90";}
|
||||
function zp1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z1%0AG90";}
|
||||
function zp10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z10%0AG90";}
|
||||
function zp100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z100%0AG90";}
|
||||
|
||||
function zm01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z-0.1%0AG90";}
|
||||
function zm1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z-1%0AG90";}
|
||||
function zm10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z10%0AG90";}
|
||||
function zm100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z100%0AG90";}
|
||||
function home(axis){ window.location.href = "control.php?gcode=G28%20" + axis + "0";}
|
||||
function move(axis, d){ window.location.href = "control.php?gcode=G91%0AG1%20" + axis + d + "%0AG90";}
|
||||
|
||||
</script>
|
||||
<br><br></html>
|
||||
|
|
|
@ -103,8 +103,8 @@
|
|||
|
||||
function xm01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X-0.1%0AG90";}
|
||||
function xm1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X-1%0AG90";}
|
||||
function xm10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X10%0AG90";}
|
||||
function xm100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X100%0AG90";}
|
||||
function xm10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X-10%0AG90";}
|
||||
function xm100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20X-100%0AG90";}
|
||||
|
||||
function yp01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y0.1%0AG90";}
|
||||
function yp1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y1%0AG90";}
|
||||
|
@ -113,8 +113,8 @@
|
|||
|
||||
function ym01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y-0.1%0AG90";}
|
||||
function ym1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y-1%0AG90";}
|
||||
function ym10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y10%0AG90";}
|
||||
function ym100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y100%0AG90";}
|
||||
function ym10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y-10%0AG90";}
|
||||
function ym100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Y-100%0AG90";}
|
||||
|
||||
function zp01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z0.1%0AG90";}
|
||||
function zp1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z1%0AG90";}
|
||||
|
@ -123,8 +123,8 @@
|
|||
|
||||
function zm01mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z-0.1%0AG90";}
|
||||
function zm1mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z-1%0AG90";}
|
||||
function zm10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z10%0AG90";}
|
||||
function zm100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z100%0AG90";}
|
||||
function zm10mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z-10%0AG90";}
|
||||
function zm100mm(){ window.location.href = "control.php?gcode=G91%0AG1%20Z-100%0AG90";}
|
||||
|
||||
</script>
|
||||
<br><br></html>
|
||||
|
|
16
Webserver.h
16
Webserver.h
|
@ -51,7 +51,7 @@ class Webserver
|
|||
Webserver(Platform* p);
|
||||
boolean Available();
|
||||
byte Read();
|
||||
void spin();
|
||||
void Spin();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -64,16 +64,16 @@ class Webserver
|
|||
void CheckPassword();
|
||||
boolean LoadGcodeBuffer(char* gc, boolean convertWeb);
|
||||
void CloseClient();
|
||||
void initialisePHP();
|
||||
void InitialisePHP();
|
||||
char PHPParse(char* phpString);
|
||||
boolean printHeadString();
|
||||
boolean printLinkTable();
|
||||
void getGCodeList();
|
||||
boolean callPHPBoolean(char* phpRecord);
|
||||
void callPHPString(char* phpRecord);
|
||||
boolean PrintHeadString();
|
||||
boolean PrintLinkTable();
|
||||
void GetGCodeList();
|
||||
boolean CallPHPBoolean(char* phpRecord);
|
||||
void CallPHPString(char* phpRecord);
|
||||
void ProcessPHPByte(char b);
|
||||
void WritePHPByte();
|
||||
char* prependRoot(char* root, char* fileName);
|
||||
char* PrependRoot(char* root, char* fileName);
|
||||
void ParseGetPost();
|
||||
void CharFromClient(char c);
|
||||
void BlankLineFromClient();
|
||||
|
|
|
@ -103,7 +103,7 @@ boolean Webserver::MatchBoundary(char c)
|
|||
return false;
|
||||
}
|
||||
|
||||
char* Webserver::prependRoot(char* root, char* fileName)
|
||||
char* Webserver::PrependRoot(char* root, char* fileName)
|
||||
{
|
||||
strcpy(scratchString, root);
|
||||
return strcat(scratchString, fileName);
|
||||
|
@ -214,7 +214,7 @@ void Webserver::CloseClient()
|
|||
{
|
||||
writing = false;
|
||||
inPHPFile = false;
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
clientCloseTime = platform->Time();
|
||||
needToCloseClient = true;
|
||||
}
|
||||
|
@ -255,17 +255,17 @@ void Webserver::SendFile(char* nameOfFileToSend)
|
|||
//Serial.print("File requested: ");
|
||||
//Serial.println(nameOfFileToSend);
|
||||
|
||||
fileBeingSent = platform->OpenFile(prependRoot(platform->GetWebDir(), nameOfFileToSend), false);
|
||||
fileBeingSent = platform->OpenFile(PrependRoot(platform->GetWebDir(), nameOfFileToSend), false);
|
||||
if(fileBeingSent < 0)
|
||||
{
|
||||
sendTable = false;
|
||||
nameOfFileToSend = "html404.htm";
|
||||
fileBeingSent = platform->OpenFile(prependRoot(platform->GetWebDir(), nameOfFileToSend), false);
|
||||
fileBeingSent = platform->OpenFile(PrependRoot(platform->GetWebDir(), nameOfFileToSend), false);
|
||||
}
|
||||
|
||||
inPHPFile = StringEndsWith(nameOfFileToSend, ".php");
|
||||
if(inPHPFile)
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
writing = true;
|
||||
}
|
||||
|
||||
|
@ -462,11 +462,11 @@ void Webserver::BlankLineFromClient()
|
|||
|
||||
if(receivingPost)
|
||||
{
|
||||
postFile = platform->OpenFile(prependRoot(platform->GetGcodeDir(), postFileName), true);
|
||||
postFile = platform->OpenFile(PrependRoot(platform->GetGcodeDir(), postFileName), true);
|
||||
if(postFile < 0 || !postBoundary[0])
|
||||
{
|
||||
platform->Message(HOST_MESSAGE, "Can't open file for write or no post boundary: ");
|
||||
platform->Message(HOST_MESSAGE, prependRoot(platform->GetGcodeDir(), postFileName));
|
||||
platform->Message(HOST_MESSAGE, PrependRoot(platform->GetGcodeDir(), postFileName));
|
||||
platform->Message(HOST_MESSAGE, "\n");
|
||||
InitialisePost();
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ void Webserver::CharFromClient(char c)
|
|||
|
||||
// Deal with input/output from/to the client (if any) one byte at a time.
|
||||
|
||||
void Webserver::spin()
|
||||
void Webserver::Spin()
|
||||
{
|
||||
if(writing)
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ void Webserver::spin()
|
|||
|
||||
// PHP interpreter
|
||||
|
||||
void Webserver::initialisePHP()
|
||||
void Webserver::InitialisePHP()
|
||||
{
|
||||
phpTag[0] = 0;
|
||||
inPHPString = 0;
|
||||
|
@ -588,15 +588,15 @@ char Webserver::PHPParse(char* phpString)
|
|||
}
|
||||
|
||||
|
||||
boolean Webserver::printLinkTable() { boolean r = sendTable; sendTable = true; return r; }
|
||||
boolean Webserver::PrintLinkTable() { boolean r = sendTable; sendTable = true; return r; }
|
||||
|
||||
boolean Webserver::callPHPBoolean(char* phpRecord)
|
||||
boolean Webserver::CallPHPBoolean(char* phpRecord)
|
||||
{
|
||||
if(!strcmp(phpRecord, "gotPassword("))
|
||||
return gotPassword;
|
||||
|
||||
if(!strcmp(phpRecord, "printLinkTable("))
|
||||
return printLinkTable();
|
||||
return PrintLinkTable();
|
||||
|
||||
platform->Message(HOST_MESSAGE, "callPHPBoolean(): non-existent function - ");
|
||||
platform->Message(HOST_MESSAGE, phpRecord);
|
||||
|
@ -605,12 +605,12 @@ boolean Webserver::callPHPBoolean(char* phpRecord)
|
|||
return true; // Best default
|
||||
}
|
||||
|
||||
void Webserver::getGCodeList()
|
||||
void Webserver::GetGCodeList()
|
||||
{
|
||||
platform->SendToClient(platform->FileList(platform->GetGcodeDir()));
|
||||
}
|
||||
|
||||
void Webserver::callPHPString(char* phpRecord)
|
||||
void Webserver::CallPHPString(char* phpRecord)
|
||||
{
|
||||
if(!strcmp(phpRecord, "getMyName("))
|
||||
{
|
||||
|
@ -620,7 +620,7 @@ void Webserver::callPHPString(char* phpRecord)
|
|||
|
||||
if(!strcmp(phpRecord, "getGCodeList("))
|
||||
{
|
||||
getGCodeList();
|
||||
GetGCodeList();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -658,7 +658,7 @@ void Webserver::ProcessPHPByte(char b)
|
|||
if(phpRecordPointer >= PHP_TAG_LENGTH)
|
||||
{
|
||||
platform->Message(HOST_MESSAGE, "ProcessPHPByte: PHP record buffer overflow.\n");
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
}
|
||||
phpRecord[phpRecordPointer] = 0;
|
||||
return;
|
||||
|
@ -672,7 +672,7 @@ void Webserver::ProcessPHPByte(char b)
|
|||
platform->SendToClient(b);
|
||||
} else
|
||||
{
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
eatInput = true;
|
||||
eatInputChar = '>';
|
||||
}
|
||||
|
@ -681,8 +681,8 @@ void Webserver::ProcessPHPByte(char b)
|
|||
|
||||
if(phpIfing)
|
||||
{
|
||||
boolean ifWas = callPHPBoolean(phpRecord);
|
||||
initialisePHP();
|
||||
boolean ifWas = CallPHPBoolean(phpRecord);
|
||||
InitialisePHP();
|
||||
ifWasTrue = ifWas;
|
||||
inPHPString = 5;
|
||||
if(b != ')')
|
||||
|
@ -695,8 +695,8 @@ void Webserver::ProcessPHPByte(char b)
|
|||
|
||||
if(phpPrinting)
|
||||
{
|
||||
callPHPString(phpRecord);
|
||||
initialisePHP();
|
||||
CallPHPString(phpRecord);
|
||||
InitialisePHP();
|
||||
eatInput = true;
|
||||
eatInputChar = '>';
|
||||
return;
|
||||
|
@ -715,7 +715,7 @@ void Webserver::ProcessPHPByte(char b)
|
|||
platform->Message(HOST_MESSAGE, "ProcessPHPByte: PHP buffer overflow: ");
|
||||
platform->Message(HOST_MESSAGE, phpTag);
|
||||
platform->Message(HOST_MESSAGE, "\n");
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -823,7 +823,7 @@ void Webserver::ProcessPHPByte(char b)
|
|||
default:
|
||||
platform->Message(HOST_MESSAGE, "ProcessPHPByte: PHP tag runout.\n");
|
||||
platform->SendToClient(b);
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -835,7 +835,7 @@ void Webserver::WritePHPByte()
|
|||
else
|
||||
{
|
||||
platform->Close(fileBeingSent);
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
CloseClient();
|
||||
}
|
||||
}
|
||||
|
@ -855,7 +855,7 @@ Webserver::Webserver(Platform* p)
|
|||
getSeen = false;
|
||||
postLength = 0L;
|
||||
inPHPFile = false;
|
||||
initialisePHP();
|
||||
InitialisePHP();
|
||||
clientLineIsBlank = true;
|
||||
needToCloseClient = false;
|
||||
clientLinePointer = 0;
|
||||
|
|
Reference in a new issue