Send the actual WeldTolerance

Fixe tests
This commit is contained in:
LarsBrubaker 2022-05-08 18:22:11 -07:00
parent 05026d4e6c
commit 4f0b03ce78
5 changed files with 19 additions and 15 deletions

View file

@ -130,7 +130,7 @@ namespace MatterHackers.MatterControl.DesignTools
inMesh = sourceMesh.Copy(cancellationToken);
if (WeldTolerance > 0)
{
inMesh.MergeVertices(.01);
inMesh.MergeVertices(WeldTolerance);
}
else
{

View file

@ -40,21 +40,24 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
private List<PrinterMove> movesToSend = new List<PrinterMove>();
private int layerCount = -1;
public MaxLengthStream(PrinterConfig printer, GCodeStream internalStream, double maxSegmentLength)
public MaxLengthStream(PrinterConfig printer, GCodeStream internalStream, double maxSegmentLength, bool testing = false)
: base(printer, internalStream)
{
// make sure there is no BabyStepStream already (it must come after max length)
#if DEBUG
foreach(var subStream in this.InternalStreams())
{
if (subStream is BabyStepsStream)
{
throw new Exception("MaxLengthStream must come before BabyStepsSteam (we need the max length points to be baby stepped).");
}
if (subStream is PrintLevelingStream)
if (!testing)
{
foreach (var subStream in this.InternalStreams())
{
throw new Exception("MaxLengthStream must come before PrintLevelingStream (we need the max length points to be leveled).");
if (subStream is BabyStepsStream)
{
throw new Exception("MaxLengthStream must come before BabyStepsSteam (we need the max length points to be baby stepped).");
}
if (subStream is PrintLevelingStream)
{
throw new Exception("MaxLengthStream must come before PrintLevelingStream (we need the max length points to be leveled).");
}
}
}
#endif

@ -1 +1 @@
Subproject commit 180be9e945fdc3361b737fac2b73bd01cce6987a
Subproject commit 4c63a61d416a4741d4b0d2e100ec50c7ef2dca9d

View file

@ -245,7 +245,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
.SelectNone()
.WaitFor(() => scene.Children.Count() == 1);
Assert.AreEqual(1, scene.Children.Count());
Assert.AreEqual(4, scene.DescendantsAndSelf().Count(), "The scene, the group and the 2 objects");
// group object can now process holes so it is a source object and has an extra object in it.
Assert.AreEqual(5, scene.DescendantsAndSelf().Count(), "The scene, the group and the 2 objects");
// test un-group 2 grouped objects
testRunner.RunDoUndoTest(

View file

@ -80,7 +80,7 @@ namespace MatterControl.Tests.MatterControl
PrinterConfig printer = null;
MaxLengthStream maxLengthStream = new MaxLengthStream(printer, new TestGCodeStream(printer, lines), 6);
MaxLengthStream maxLengthStream = new MaxLengthStream(printer, new TestGCodeStream(printer, lines), 6, true);
ValidateStreamResponse(expected, maxLengthStream);
}
@ -291,7 +291,7 @@ namespace MatterControl.Tests.MatterControl
streamList.Add(new RelativeToAbsoluteStream(printer, streamList[streamList.Count - 1]));
streamList.Add(new WaitForTempStream(printer, streamList[streamList.Count - 1]));
streamList.Add(new BabyStepsStream(printer, streamList[streamList.Count - 1]));
streamList.Add(new MaxLengthStream(printer, streamList[streamList.Count - 1], 1));
streamList.Add(new MaxLengthStream(printer, streamList[streamList.Count - 1], 1, true));
streamList.Add(new ExtrusionMultiplierStream(printer, streamList[streamList.Count - 1]));
streamList.Add(new FeedRateMultiplierStream(printer, streamList[streamList.Count - 1]));
GCodeStream totalGCodeStream = streamList[streamList.Count - 1];