Made all the streams disposable

Made them get disposed
The leveling stream seems to be working.
This commit is contained in:
Lars Brubaker 2015-12-01 14:49:50 -08:00
parent c62cf36818
commit 88a00079a2
13 changed files with 125 additions and 79 deletions

View file

@ -38,10 +38,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
{
public struct PrinterMove
{
public Vector3 position;
public double feedRate;
public double extrusion;
public static readonly PrinterMove Zero;
public static readonly PrinterMove Nowhere = new PrinterMove()
{
position = new Vector3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity),
@ -49,6 +45,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
feedRate = double.PositiveInfinity,
};
public static readonly PrinterMove Zero;
public double extrusion;
public double feedRate;
public Vector3 position;
public PrinterMove(Vector3 absoluteDestination, double currentExtruderDestination, double currentFeedRate) : this()
{
this.position = absoluteDestination;
@ -56,12 +56,12 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
this.feedRate = currentFeedRate;
}
public static PrinterMove operator +(PrinterMove left, PrinterMove right)
public double LengthSquared
{
left.position += right.position;
left.extrusion += right.extrusion;
left.feedRate += right.feedRate;
return left;
get
{
return position.LengthSquared;
}
}
public static PrinterMove operator -(PrinterMove left, PrinterMove right)
@ -80,12 +80,12 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
return left;
}
public double LengthSquared
public static PrinterMove operator +(PrinterMove left, PrinterMove right)
{
get
{
return position.LengthSquared;
}
left.position += right.position;
left.extrusion += right.extrusion;
left.feedRate += right.feedRate;
return left;
}
}
}