Regularising function names...

This commit is contained in:
reprappro 2013-03-01 22:23:38 +00:00
parent 09a5aa6310
commit c2e201cda3
14 changed files with 221 additions and 22 deletions

View file

@ -27,7 +27,8 @@ class GCodes
public:
GCodes(Platform* p, Move* m, Heat* h, Webserver* w);
void spin();
void Spin();
void Init();
private:

View file

@ -28,6 +28,11 @@ GCodes::GCodes(Platform* p, Move* m, Heat* h, Webserver* w)
move = m;
heat = h;
webserver = w;
Init();
}
void GCodes::Init()
{
lastTime = platform->time();
gcodePointer = 0;
}
@ -39,7 +44,9 @@ void GCodes::ActOnGcode()
platform->Message(HOST_MESSAGE, "\n");
}
void GCodes::spin()
void GCodes::Spin()
{
if(webserver->Available())
{

3
Heat.h
View file

@ -37,7 +37,8 @@ class Heat
public:
Heat(Platform* p);
void spin();
void Spin();
void Init();
private:

View file

@ -24,12 +24,17 @@ Heat::Heat(Platform* p)
{
//Serial.println("Heat constructor");
platform = p;
lastTime = platform->time();
//frac = 0;
//inc = 0.01;
Init();
}
void Heat::spin()
void Heat::Init()
{
lastTime = platform->time();
//frac = 0;
//inc = 0.01;
}
void Heat::Spin()
{
unsigned long t = platform->time();
if(t - lastTime < 3000)

3
Move.h
View file

@ -26,7 +26,8 @@ class Move
public:
Move(Platform* p);
void spin();
void Init();
void Spin();
private:

View file

@ -24,14 +24,19 @@ Move::Move(Platform* p)
{
//Serial.println("Move constructor");
platform = p;
Init();
}
void Move::Init()
{
lastTime = platform->time();
platform->setDirection(X_AXIS, FORWARDS);
platform->setDirection(Y_AXIS, FORWARDS);
platform->setDirection(Z_AXIS, FORWARDS);
platform->setDirection(3, FORWARDS);
platform->setDirection(3, FORWARDS);
}
void Move::spin()
void Move::Spin()
{
unsigned long t = platform->time();
if(t - lastTime < 300)

View file

@ -368,7 +368,7 @@ inline void Platform::setInterrupt(long t)
inline void Platform::interrupt()
{
reprap->interrupt(); // Put nothing else in this function
reprap->Interrupt(); // Put nothing else in this function
}
//*****************************************************************************************************************

View file

@ -26,12 +26,12 @@ Licence: GPL
void setup()
{
reprap.init();
reprap.Init();
}
void loop()
{
reprap.spin();
reprap.Spin();
}
//*************************************************************************************************

View file

@ -38,14 +38,14 @@ class RepRap
public:
RepRap();
void init();
void spin();
void Init();
void Spin();
// Platform* getPlatform();
// Move* getMove();
// Heat* getHeat();
// GCodes* getGcodes();
// Webserver* getWebserver();
void interrupt();
void Interrupt();
private:

View file

@ -53,7 +53,7 @@ RepRap reprap;
//*************************************************************************************************
void RepRap::init()
void RepRap::Init()
{
platform = new Platform(this);
move = new Move(platform);
@ -63,16 +63,16 @@ void RepRap::init()
platform->Message(HOST_MESSAGE, "RepRapPro RepRap Firmware Started\n\n");
}
void RepRap::spin()
void RepRap::Spin()
{
platform->spin();
move->spin();
heat->spin();
gcodes->spin();
move->Spin();
heat->Spin();
gcodes->Spin();
webserver->spin();
}
void RepRap::interrupt()
void RepRap::Interrupt()
{
}

130
SD-image/www/control.php~ Normal file
View file

@ -0,0 +1,130 @@
<!DOCTYPE HTML>
<head>
<style type="text/css">td { text-align: center; } </style>
</head>
<html>
<h2>RepRap:
<?php print(getMyName()); ?>
<?php if(gotPassword()) echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://reprappro.com" target="_blank"><img src="logo.png" alt="RepRapPro logo"></a>'; ?>
</h2><br><br>
<?php if(printLinkTable()) echo '<table><tr>
<td>&nbsp;&nbsp;&nbsp;<a href="control.php">Control</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="print.php">Print</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="http://reprap.org/wiki/RepRapPro_RepRap_Firmware" target="_blank">Help</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="settings.php">Settings</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="logout.php">Logout</a>&nbsp;&nbsp;&nbsp;</td>
</tr></table>
<br><br>'; ?>
<table border="1"><div align="center">
<tr>
<th colspan="9">Move X Y Z</th>
</tr>
<tr>
<td rowspan="2"><button type="button" onclick="return homea()">Home<br>All</button></td>
<td colspan="4">- mm</td>
<td colspan="4">+ mm</td>
</tr>
<tr>
<td>-100</td>
<td>-10</td>
<td>-1</td>
<td>-0.1</td>
<td>0.1</td>
<td>1</td>
<td>10</td>
<td>100</td>
</tr>
<tr>
<td><button type="button" onclick="return homex()">Home X</button></td>
<td><button type="button" onclick="return xm100mm()">&lt;--- X</button></td>
<td><button type="button" onclick="return xm10mm()">&lt;-- X</button></td>
<td><button type="button" onclick="return xm1mm()">&lt;- X</button></td>
<td><button type="button" onclick="return xm01mm()">&lt; X</button></td>
<td><button type="button" onclick="return xp01mm()">X &gt;</button></td>
<td><button type="button" onclick="return xp1mm()">X --&gt;</button></td>
<td><button type="button" onclick="return xp10mm()">X --&gt;</button></td>
<td><button type="button" onclick="return xp100mm()">X ---&gt;</button></td>
</tr>
<tr>
<td><button type="button" onclick="return homey()">Home Y</button></td>
<td><button type="button" onclick="return ym100mm()">&lt;--- Y</button></td>
<td><button type="button" onclick="return ym10mm()">&lt;-- Y</button></td>
<td><button type="button" onclick="return ym1mm()">&lt;- Y</button></td>
<td><button type="button" onclick="return ym01mm()">&lt; Y</button></td>
<td><button type="button" onclick="return yp01mm()">Y &gt;</button></td>
<td><button type="button" onclick="return yp1mm()">Y -&gt;</button></td>
<td><button type="button" onclick="return yp10mm()">Y --&gt;</button></td>
<td><button type="button" onclick="return yp100mm()">Y ---&gt;</button></td>
</tr>
<tr>
<td><button type="button" onclick="return homez()">Home Z</button></td>
<td><button type="button" onclick="return zm100mm()">&lt;--- Z</button></td>
<td><button type="button" onclick="return zm10mm()">&lt;-- Z</button></td>
<td><button type="button" onclick="return zm1mm()">&lt;- Z</button></td>
<td><button type="button" onclick="return zm01mm()">&lt; Z</button></td>
<td><button type="button" onclick="return zp01mm()">Z &gt;</button></td>
<td><button type="button" onclick="return zp1mm()">Z -&gt;</button></td>
<td><button type="button" onclick="return zp10mm()">Z --&gt;</button></td>
<td><button type="button" onclick="return zp100mm()">Z ---&gt;</button></td>
</tr>
</div></table>
<br><br><form name="input" action="gather.asp" method="get">Send a G Code: <input type="text" name="gcode"><input type="submit" value="Send"></form>
<script language="javascript" type="text/javascript">
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";}
</script>
<br><br></html>

6
SD-image/www/logout.php~ Normal file
View file

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<head>
<?php print(logout()); ?>
</head>
<html>
</html>

13
SD-image/www/passwd.php~ Normal file
View file

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html>
<h2>RepRap:
<?php print(getMyName()); ?>
<br>
<form name="input" action="control.php" method="get">Password: <input type="password" name="pwd"><input type="submit" value="Submit">
<br><br>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE HTML>
<head>
</head>
<html>
<h2>RepRap:
<?php print(getMyName()); ?>
<?php if(gotPassword()) echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://reprappro.com" target="_blank"><img src="logo.png" alt="RepRapPro logo"></a>'; ?>
</h2><br><br>
<?php if(printLinkTable()) echo '<table><tr>
<td>&nbsp;&nbsp;&nbsp;<a href="control.php">Control</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="print.php">Print</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="http://reprap.org/wiki/RepRapPro_RepRap_Firmware" target="_blank">Help</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="settings.php">Settings</a>&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a href="logout.php">Logout</a>&nbsp;&nbsp;&nbsp;</td>
</tr></table>
<br><br>'; ?>
<br><br>Settings: allow user to rename machine, set password, set steps/mm etc etc and record the lot.
</html>