Putting in info for tool change timing
refactoring extruder index to tool index
This commit is contained in:
parent
0c6a0fe4be
commit
457e31ef10
8 changed files with 41 additions and 24 deletions
|
|
@ -34,7 +34,7 @@ namespace MatterHackers.GCodeVisualizer
|
|||
{
|
||||
public abstract class RenderFeatureBase
|
||||
{
|
||||
protected int extruderIndex;
|
||||
protected int toolIndex;
|
||||
|
||||
public static Color HighlightColor { get; set; } = new Color("#D0F476");
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ namespace MatterHackers.GCodeVisualizer
|
|||
|
||||
public RenderFeatureBase(int extruderIndex)
|
||||
{
|
||||
this.extruderIndex = extruderIndex;
|
||||
this.toolIndex = extruderIndex;
|
||||
}
|
||||
|
||||
static public void CreateCylinder(VectorPOD<ColorVertexData> colorVertexData, VectorPOD<int> indexData, Vector3 startPos, Vector3 endPos, double radius, int steps, Color color, double layerHeight)
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ namespace MatterHackers.GCodeVisualizer
|
|||
private Color color;
|
||||
private Color gray;
|
||||
|
||||
public RenderFeatureExtrusion(Vector3 start, Vector3 end, int extruderIndex, double travelSpeed, double totalExtrusionMm, double filamentDiameterMm, double layerHeight, Color color, Color gray)
|
||||
: base(start, end, extruderIndex, travelSpeed)
|
||||
public RenderFeatureExtrusion(Vector3 start, Vector3 end, int toolIndex, double travelSpeed, double totalExtrusionMm, double filamentDiameterMm, double layerHeight, Color color, Color gray)
|
||||
: base(start, end, toolIndex, travelSpeed)
|
||||
{
|
||||
this.color = color;
|
||||
this.gray = gray;
|
||||
|
|
@ -101,7 +101,7 @@ namespace MatterHackers.GCodeVisualizer
|
|||
}
|
||||
else
|
||||
{
|
||||
lineColor = renderInfo.GetMaterialColor(extruderIndex);
|
||||
lineColor = renderInfo.GetMaterialColor(toolIndex);
|
||||
}
|
||||
|
||||
CreateCylinder(colorVertexData, indexData, new Vector3(start), new Vector3(end), radius, 6, lineColor, layerHeight);
|
||||
|
|
@ -130,7 +130,7 @@ namespace MatterHackers.GCodeVisualizer
|
|||
}
|
||||
else
|
||||
{
|
||||
extrusionColor = renderInfo.GetMaterialColor(extruderIndex);
|
||||
extrusionColor = renderInfo.GetMaterialColor(toolIndex);
|
||||
}
|
||||
|
||||
if (renderInfo.CurrentRenderType.HasFlag(RenderType.TransparentExtrusion))
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ namespace MatterHackers.GCodeVisualizer
|
|||
var position = new Vector3(this.position);
|
||||
|
||||
// retract and unretract are the extruder color
|
||||
Color color = renderInfo.GetMaterialColor(extruderIndex);
|
||||
Color color = renderInfo.GetMaterialColor(toolIndex);
|
||||
// except for extruder 0 where they are the red and blue we are familiar with
|
||||
if (extruderIndex == 0)
|
||||
if (toolIndex == 0)
|
||||
{
|
||||
if (extrusionAmount > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ namespace MatterHackers.GCodeVisualizer
|
|||
|
||||
public Vector3Float End => end;
|
||||
|
||||
public RenderFeatureTravel(Vector3 start, Vector3 end, int extruderIndex, double travelSpeed)
|
||||
: base(extruderIndex)
|
||||
public RenderFeatureTravel(Vector3 start, Vector3 end, int toolIndex, double travelSpeed)
|
||||
: base(toolIndex)
|
||||
{
|
||||
this.extruderIndex = extruderIndex;
|
||||
this.toolIndex = toolIndex;
|
||||
this.start = new Vector3Float(start);
|
||||
this.end = new Vector3Float(end);
|
||||
this.travelSpeed = (float)travelSpeed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue