Wrote Re-Slice for dynamically replacing current gcode

adding comments
This commit is contained in:
Lars Brubaker 2018-09-21 13:29:39 -07:00
parent 193f65948e
commit c408ef055d
5 changed files with 273 additions and 33 deletions

View file

@ -942,6 +942,11 @@ namespace MatterControl.Printing
return false;
}
/// <summary>
/// Get the height of this layer (from the top of the previous layer to the top of this layer).
/// </summary>
/// <param name="layerIndex"></param>
/// <returns></returns>
public override double GetLayerHeight(int layerIndex)
{
if (layerHeights.Count > 0)
@ -962,6 +967,11 @@ namespace MatterControl.Printing
return .5;
}
/// <summary>
/// Get the height of the top of this layer as measure from the bed
/// </summary>
/// <param name="layerIndex"></param>
/// <returns></returns>
public override double GetLayerTop(int layerIndex)
{
double total = 0;
@ -972,6 +982,21 @@ namespace MatterControl.Printing
return total;
}
/// <summary>
/// Get the height of the bottom of this layer as measure from the bed
/// </summary>
/// <param name="layerIndex"></param>
/// <returns></returns>
public double GetLayerBottom(int layerIndex)
{
double total = 0;
for (int i = 0; i < layerIndex; i++)
{
total += GetLayerHeight(i);
}
return total;
}
public override int GetLayerIndex(int instructionIndex)
{
if (instructionIndex >= 0