From ae38346b4d1387154ae83e4f0edcb1718404fa1d Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Mon, 19 Sep 2022 22:48:34 -0700 Subject: [PATCH 1/3] Made the old align show its icon in the tree view --- MatterControlLib/ApplicationView/SceneOperations.cs | 4 +++- .../Library/ContentProviders/MeshContentProvider.cs | 4 ++-- Submodules/agg-sharp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MatterControlLib/ApplicationView/SceneOperations.cs b/MatterControlLib/ApplicationView/SceneOperations.cs index c082bc87b..721492179 100644 --- a/MatterControlLib/ApplicationView/SceneOperations.cs +++ b/MatterControlLib/ApplicationView/SceneOperations.cs @@ -882,6 +882,9 @@ namespace MatterHackers.MatterControl Icons.Add(typeof(SelectionGroupObject3D), groupIconSource); } + // register legacy types so they still show, they don't have ui to create so they don't have icons set dynamically + Icons.Add(typeof(AlignObject3D), (theme) => StaticData.Instance.LoadIcon("align_left_dark.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply()); + // image operations PrimaryOperations.Add(typeof(ImageObject3D), new List { SceneOperations.ById("ImageConverter"), SceneOperations.ById("ImageToPath"), }); @@ -919,7 +922,6 @@ namespace MatterHackers.MatterControl PrimaryOperations.Add(typeof(Object3D), new List { SceneOperations.ById("Scale") }); Icons.Add(typeof(ImageObject3D), (theme) => StaticData.Instance.LoadIcon("image_converter.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply()); - // Icons.Add(typeof(CubeObject3D), (theme) => StaticData.Instance.LoadIcon("image_converter.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply()); } private static SceneOperation CombineOperation() diff --git a/MatterControlLib/Library/ContentProviders/MeshContentProvider.cs b/MatterControlLib/Library/ContentProviders/MeshContentProvider.cs index 03aca8c98..d5951cb03 100644 --- a/MatterControlLib/Library/ContentProviders/MeshContentProvider.cs +++ b/MatterControlLib/Library/ContentProviders/MeshContentProvider.cs @@ -176,9 +176,9 @@ namespace MatterHackers.MatterControl // TODO: Wire up limits for thumbnail generation. If content is too big, return null allowing the thumbnail to fall back to content default object3D = await contentModel.CreateContent(); } - else if (libraryItem is ILibraryObject3D) + else if (libraryItem is ILibraryObject3D libraryObject3D) { - object3D = await (libraryItem as ILibraryObject3D)?.GetObject3D(null); + object3D = await libraryObject3D.GetObject3D(null); } if (object3D == null) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 8dd82c825..80691d427 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 8dd82c825266791e6d51461bdf4de83df238dc6e +Subproject commit 80691d427aed19ef7578efa573cf3f0fd08030ee From 75e137e16081746dce40e78caff40328f52d0dd6 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Tue, 20 Sep 2022 18:01:15 -0700 Subject: [PATCH 2/3] Working on path stitching, fixing tests --- Submodules/agg-sharp | 2 +- .../PrintQueueTests.cs | 4 --- .../PrintingTests.cs | 18 +++------- .../MatterControl/InteractiveSceneTests.cs | 3 +- .../MatterControl/OemProfileTests.cs | 36 ++++++++++++++++--- 5 files changed, 39 insertions(+), 24 deletions(-) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 80691d427..a93c6d342 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 80691d427aed19ef7578efa573cf3f0fd08030ee +Subproject commit a93c6d3427f9df9403aae1ad69b88bdf3aae5747 diff --git a/Tests/MatterControl.AutomationTests/PrintQueueTests.cs b/Tests/MatterControl.AutomationTests/PrintQueueTests.cs index 502dd8a13..56c3e21b5 100644 --- a/Tests/MatterControl.AutomationTests/PrintQueueTests.cs +++ b/Tests/MatterControl.AutomationTests/PrintQueueTests.cs @@ -27,12 +27,8 @@ of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ -using System.Threading; using System.Threading.Tasks; -using MatterHackers.Agg.UI; -using MatterHackers.GuiAutomation; using MatterHackers.MatterControl.PartPreviewWindow; -using MatterHackers.MatterControl.PrintQueue; using NUnit.Framework; using TestInvoker; diff --git a/Tests/MatterControl.AutomationTests/PrintingTests.cs b/Tests/MatterControl.AutomationTests/PrintingTests.cs index b2711d8f9..a5726d043 100644 --- a/Tests/MatterControl.AutomationTests/PrintingTests.cs +++ b/Tests/MatterControl.AutomationTests/PrintingTests.cs @@ -518,13 +518,6 @@ namespace MatterHackers.MatterControl.Tests.Automation var printer = testRunner.FirstPrinter(); - // Wait for printing to complete - var printFinishedResetEvent = new AutoResetEvent(false); - printer.Connection.PrintFinished += (s, e) => - { - printFinishedResetEvent.Set(); - }; - testRunner.StartPrint(printer) .ScrollIntoView("Extrusion Multiplier NumberEdit") .ScrollIntoView("Feed Rate NumberEdit"); @@ -552,14 +545,13 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ResumePrint(); - // Wait up to 60 seconds for the print to finish - printFinishedResetEvent.WaitOne(60 * 1000); + // Wait up to 60 seconds for the print to finish + testRunner.WaitForPrintFinished(printer, 60); - // Values should match entered values - ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After print finished"); + // Values should match entered values + ConfirmExpectedSpeeds(testRunner, targetExtrusionRate, targetFeedRate, "After print finished"); - testRunner.WaitForPrintFinished(printer) - .StartPrint(printer) // Restart the print + testRunner.StartPrint(printer) // Restart the print .Delay(1); // Values should match entered values diff --git a/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs b/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs index 67d1f418f..6be4c5538 100644 --- a/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs @@ -44,6 +44,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading; using System.Threading.Tasks; +using TestInvoker; namespace MatterControl.Tests.MatterControl { @@ -393,7 +394,7 @@ namespace MatterControl.Tests.MatterControl var copy = cubeA1.Clone() as CubeObject3D; - Assert.AreEqual(10, copy.Width.Expression, "10"); + Assert.AreEqual("10", copy.Width.Expression, "10"); Assert.AreEqual(10, copy.GetAxisAlignedBoundingBox().XSize, .001); } } diff --git a/Tests/MatterControl.Tests/MatterControl/OemProfileTests.cs b/Tests/MatterControl.Tests/MatterControl/OemProfileTests.cs index fc3d57c6c..ca49a2aaf 100644 --- a/Tests/MatterControl.Tests/MatterControl/OemProfileTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/OemProfileTests.cs @@ -1,13 +1,39 @@ -using System; +/* +Copyright (c) 2022, Lars Brubaker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using System; using System.Collections.Generic; using System.IO; using System.Linq; -using MatterHackers.Agg; using MatterHackers.Agg.Platform; -using MatterHackers.MatterControl; using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.MatterControl.Tests.Automation; -using Newtonsoft.Json; using NUnit.Framework; using TestInvoker; @@ -266,7 +292,7 @@ M300 S3000 P30 ; Resume Tone"; } - [Test, ChildProcessTest] + [Test] public void LayerGCodeHasExpectedValue() { // Verifies "layer_gcode" is expected value: "; LAYER:[layer_num]" From 0ea7f39932519b90427ca3374bed5128c8073873 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 28 Sep 2022 17:19:18 -0700 Subject: [PATCH 3/3] latest agg Fixing invalid aabb exception --- Submodules/agg-sharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index a93c6d342..39d473690 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit a93c6d3427f9df9403aae1ad69b88bdf3aae5747 +Subproject commit 39d47369081d0434eb7ae0610bc76b71c4e0c210