Merge pull request #736 from larsbrubaker/1.5.3

Only send G28 when requesting all 3 axis.
This commit is contained in:
Lars Brubaker 2016-05-11 17:16:12 -07:00
commit 6613015ede

View file

@ -1189,17 +1189,22 @@ namespace MatterHackers.MatterControl.PrinterCommunication
public void HomeAxis(Axis axis)
{
string command = "G28";
if ((axis & Axis.X) == Axis.X)
// If we are homing everything we don't need to add any details
if (!axis.HasFlag(Axis.XYZ))
{
command += " X0";
}
if ((axis & Axis.Y) == Axis.Y)
{
command += " Y0";
}
if ((axis & Axis.Z) == Axis.Z)
{
command += " Z0";
if ((axis & Axis.X) == Axis.X)
{
command += " X0";
}
if ((axis & Axis.Y) == Axis.Y)
{
command += " Y0";
}
if ((axis & Axis.Z) == Axis.Z)
{
command += " Z0";
}
}
SendLineToPrinterNow(command);