diff --git a/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleWidthDepthEdgeControl.cs b/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleWidthDepthEdgeControl.cs index 96078fc58..adaa1fa75 100644 --- a/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleWidthDepthEdgeControl.cs +++ b/MatterControlLib/DesignTools/EditorTools/ScaleControls/ScaleWidthDepthEdgeControl.cs @@ -88,6 +88,22 @@ namespace MatterHackers.Plugins.EditorTools { theme = MatterControl.AppContext.Theme; + switch (edgeIndex) + { + case 0: + Name = "ScaleDepthBack"; + break; + case 1: + Name = "ScaleWidthLeft"; + break; + case 2: + Name = "ScaleDepthFront"; + break; + case 3: + Name = "ScaleWidthRight"; + break; + } + this.getWidth = getWidth; this.setWidth = setWidth; this.getDepth = getDepth; @@ -100,6 +116,7 @@ namespace MatterHackers.Plugins.EditorTools { ForceHide = ForceHideScale, GetDisplayString = (value) => "{0:0.0}".FormatWith(value), + Name = "XValueDisplay", }; xValueDisplayInfo.EditComplete += EditComplete; @@ -115,7 +132,8 @@ namespace MatterHackers.Plugins.EditorTools yValueDisplayInfo = new InlineEditControl() { ForceHide = ForceHideScale, - GetDisplayString = (value) => "{0:0.0}".FormatWith(value) + GetDisplayString = (value) => "{0:0.0}".FormatWith(value), + Name = "YValueDisplay", }; yValueDisplayInfo.EditComplete += EditComplete; diff --git a/MatterControlLib/DesignTools/PublicPropertyEditor.cs b/MatterControlLib/DesignTools/PublicPropertyEditor.cs index e04adf07e..e8c3ea6ac 100644 --- a/MatterControlLib/DesignTools/PublicPropertyEditor.cs +++ b/MatterControlLib/DesignTools/PublicPropertyEditor.cs @@ -682,7 +682,10 @@ namespace MatterHackers.MatterControl.DesignTools else if (propertyValue is DoubleOrExpression doubleExpresion) { // create a string editor - var field = new ExpressionField(theme); + var field = new ExpressionField(theme) + { + Name = property.DisplayName + " Field" + }; field.Initialize(0); field.SetValue(doubleExpresion.Expression, false); field.ClearUndoHistory(); diff --git a/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs b/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs index df736aba8..f0cd5dc9d 100644 --- a/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs +++ b/MatterControlLib/DesignTools/Sheets/SheetObject3D.cs @@ -28,17 +28,19 @@ either expressed or implied, of the FreeBSD Project. */ using System; +using System.Collections.Generic; using System.IO; -using System.Linq; using System.Threading; using System.Threading.Tasks; using MatterHackers.Agg; using MatterHackers.Agg.Platform; +using MatterHackers.Agg.UI; using MatterHackers.DataConverters3D; using MatterHackers.MatterControl.PartPreviewWindow; using MatterHackers.PolygonMesh; using MatterHackers.PolygonMesh.Processors; using MatterHackers.VectorMath; +using org.mariuszgromada.math.mxparser; namespace MatterHackers.MatterControl.DesignTools { @@ -87,6 +89,8 @@ namespace MatterHackers.MatterControl.DesignTools this.Matrix *= Matrix4X4.CreateScale(20 / aabb.XSize); } + public override bool Persistable => false; + public override void OnInvalidate(InvalidateArgs invalidateType) { if (invalidateType.InvalidateType.HasFlag(InvalidateType.SheetUpdated) && invalidateType.Source == this) @@ -107,22 +111,49 @@ namespace MatterHackers.MatterControl.DesignTools private void SendInvalidateToAll() { + var updatedItems = new HashSet(); + updatedItems.Add(this); foreach (var sibling in this.Parent.Children) { - SendInvalidateRecursive(sibling); + SendInvalidateRecursive(sibling, updatedItems); } } - private void SendInvalidateRecursive(IObject3D item) + private void SendInvalidateRecursive(IObject3D item, HashSet updatedItems) { + if (updatedItems.Contains(item)) + { + return; + } + // process depth first foreach(var child in item.Children) { - SendInvalidateRecursive(child); + SendInvalidateRecursive(child, updatedItems); } // and send the invalidate - item.Invalidate(new InvalidateArgs(item, InvalidateType.SheetUpdated)); + RunningInterval runningInterval = null; + void RebuildWhenUnlocked() + { + if (!item.RebuildLocked) + { + updatedItems.Add(item); + UiThread.ClearInterval(runningInterval); + item.Invalidate(new InvalidateArgs(item, InvalidateType.SheetUpdated)); + } + } + + if (!item.RebuildLocked) + { + updatedItems.Add(item); + item.Invalidate(new InvalidateArgs(item, InvalidateType.SheetUpdated)); + } + else + { + // we need to get back to the user requested change when not locked + runningInterval = UiThread.SetInterval(RebuildWhenUnlocked, .2); + } } public static T EvaluateExpression(IObject3D owner, string inputExpression) @@ -175,50 +206,57 @@ namespace MatterHackers.MatterControl.DesignTools if (sibling != owner && sibling is SheetObject3D sheet) { - // try to manage the cell into the correct data type string value = sheet.SheetData.EvaluateExpression(inputExpression); - - if (typeof(T) == typeof(string)) - { - // if parsing the equation resulted in NaN as the output - if (value == "NaN") - { - // return the actual expression - return (T)(object)inputExpression; - } - - // get the value of the cell - return (T)(object)value; - } - - if (typeof(T) == typeof(double)) - { - if (double.TryParse(value, out double doubleValue) - && !double.IsNaN(doubleValue) - && !double.IsInfinity(doubleValue)) - { - return (T)(object)doubleValue; - } - // else return an error - return (T)(object).1; - } - - if (typeof(T) == typeof(int)) - { - if (double.TryParse(value, out double doubleValue) - && !double.IsNaN(doubleValue) - && !double.IsInfinity(doubleValue)) - { - return (T)(object)(int)Math.Round(doubleValue); - } - // else return an error - return (T)(object)1; - } + return CastResult(value, inputExpression); } } } + // could not find a sheet, try to evaluate the expression directly + var evaluator = new Expression(inputExpression); + return CastResult(evaluator.calculate().ToString(), inputExpression); + } + + public static T CastResult(string value, string inputExpression) + { + if (typeof(T) == typeof(string)) + { + // if parsing the equation resulted in NaN as the output + if (value == "NaN") + { + // return the actual expression + return (T)(object)inputExpression; + } + + // get the value of the cell + return (T)(object)value; + } + + if (typeof(T) == typeof(double)) + { + if (double.TryParse(value, out double doubleValue) + && !double.IsNaN(doubleValue) + && !double.IsInfinity(doubleValue)) + { + return (T)(object)doubleValue; + } + // else return an error + return (T)(object).1; + } + + if (typeof(T) == typeof(int)) + { + if (double.TryParse(value, out double doubleValue) + && !double.IsNaN(doubleValue) + && !double.IsInfinity(doubleValue)) + { + return (T)(object)(int)Math.Round(doubleValue); + } + // else return an error + return (T)(object)1; + } + return (T)(object)default(T); } diff --git a/MatterControlLib/PartPreviewWindow/View3D/Actions/SheetEditor.cs b/MatterControlLib/PartPreviewWindow/View3D/Actions/SheetEditor.cs index b05f737e6..5fada982b 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Actions/SheetEditor.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Actions/SheetEditor.cs @@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.DesignTools HAnchor = HAnchor.Absolute, SelectAllOnFocus = true, }; - editSelectedName.ActualTextEditWidget.EditComplete += ActualTextEditWidget_EditComplete; + editSelectedName.ActualTextEditWidget.EditComplete += SelectedName_EditComplete; editSelectionGroup.AddChild(editSelectedName); editSelectedExpression = new MHTextEditWidget("", theme, messageWhenEmptyAndNotSelected: "Select cell to edit".Localize()) { @@ -152,14 +152,32 @@ namespace MatterHackers.MatterControl.DesignTools CellWidgetsByLocation[(selectedCell.x, selectedCell.y)].Text = editSelectedExpression.Text; } - private void ActualTextEditWidget_EditComplete(object sender, EventArgs e) + private void SelectedName_EditComplete(object sender, EventArgs e) { if (selectedCell.x == -1) { return; } - sheetData[selectedCell.x, selectedCell.y].Name = editSelectedName.Text; + var existingNames = new HashSet(); + for (int y = 0; y < sheetData.Height; y++) + { + for (int x = 0; x < sheetData.Width; x++) + { + if (x != selectedCell.x || y != selectedCell.y) + { + var currentName = sheetData[x, y].Name; + if (!string.IsNullOrEmpty(currentName)) + { + existingNames.Add(currentName); + } + } + } + } + + var name = agg_basics.GetNonCollidingName(editSelectedName.Text, existingNames); + editSelectedName.Text = name; + sheetData[selectedCell.x, selectedCell.y].Name = name; } private void SelectCell(int x, int y) { diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index c71a0368a..53e703573 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit c71a0368af2e32a2091d05c03d4e9385f3858e27 +Subproject commit 53e703573d54be5bf4962483abfbb8c91dff11c4 diff --git a/Tests/MatterControl.AutomationTests/DesignTools/PrimitveTests.cs b/Tests/MatterControl.AutomationTests/DesignTools/PrimitveTests.cs index 5ab23518d..a1d020721 100644 --- a/Tests/MatterControl.AutomationTests/DesignTools/PrimitveTests.cs +++ b/Tests/MatterControl.AutomationTests/DesignTools/PrimitveTests.cs @@ -1,5 +1,8 @@ using System.Threading; using System.Threading.Tasks; +using MatterHackers.Agg; +using MatterHackers.DataConverters3D; +using MatterHackers.MatterControl.DesignTools; using MatterHackers.MatterControl.PartPreviewWindow; using MatterHackers.MatterControl.PrintQueue; using NUnit.Framework; @@ -16,27 +19,66 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.OpenEmptyPartTab(); - testRunner.AddItemToBedplate(); + var primitive = "Cube"; + var primitiveName = "Row Item " + primitive; + testRunner.DoubleClickByName(primitiveName); // Get View3DWidget View3DWidget view3D = testRunner.GetWidgetByName("View3DWidget", out _, 3) as View3DWidget; var scene = view3D.Object3DControlLayer.Scene; - testRunner.WaitForName("Calibration - Box.stl"); - Assert.AreEqual(1, scene.Children.Count, "Should have 1 part before copy"); + testRunner.WaitForName(primitive); + Assert.AreEqual(1, scene.Children.Count, "Should have 1 part"); + + var cube = testRunner.GetObjectByName(primitive, out _) as CubeObject3D; + + Assert.AreEqual(20, cube.Width.Value(cube)); // Select scene object - testRunner.Select3DPart("Calibration - Box.stl"); + testRunner.Select3DPart(primitive); - // Click Copy button and count Scene.Children - testRunner.ClickByName("Duplicate Button"); - testRunner.WaitFor(() => scene.Children.Count == 2); - Assert.AreEqual(2, scene.Children.Count, "Should have 2 parts after copy"); + // Scale it wider + testRunner.DragDropByName("ScaleWidthRight", + "ScaleWidthRight", + offsetDrag: new Point2D(0, 0), + offsetDrop: new Point2D(0, 10)); + Assert.Greater(cube.Width.Value(cube), 20.0); + + testRunner.ClickByName("3D View Undo"); + Assert.AreEqual(20, cube.Width.Value(cube)); - // Click Copy button a second time and count Scene.Children - testRunner.ClickByName("Duplicate Button"); - testRunner.WaitFor(() => scene.Children.Count > 2); - Assert.AreEqual(3, scene.Children.Count, "Should have 3 parts after 2nd copy"); + // try scaling by text entry + testRunner.ClickByName("ScaleWidthLeft") + .ClickByName("XValueDisplay") + .Type("35") + .Type("{Enter}"); + + Assert.AreEqual(35, cube.Width.Value(cube)); + + testRunner.ClickByName("3D View Undo"); + Assert.AreEqual(20, cube.Width.Value(cube)); + + // try scaling by text entry of an equation + testRunner.ClickByName("Width Field") + .Type("=40 + 5") + .Type("{Enter}"); + + Assert.AreEqual(45, cube.Width.Value(cube)); + + // Select Nothing + testRunner.ClickByName("View3DWidget"); + testRunner.Type(" "); + Assert.AreEqual(null, scene.SelectedItem); + // and re-select the object + testRunner.Type("^a"); + Assert.AreEqual(1, scene.Children.Count); + Assert.AreEqual(cube, scene.SelectedItem); + + // now that has an equation in the width it should not have an x edge controls + Assert.IsFalse(testRunner.NameExists("ScaleWidthRight", .2)); + + testRunner.ClickByName("3D View Undo"); + Assert.AreEqual(20, cube.Width.Value(cube)); return Task.CompletedTask; }, overrideWidth: 1300, maxTimeToRun: 60); diff --git a/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs b/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs index ee08772fb..e34bcbb2b 100644 --- a/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs +++ b/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs @@ -50,7 +50,7 @@ namespace MatterHackers.MatterControl.Tests.Automation // add an item to the bed fullPathToGcodeFile = Path.Combine(gcodeOutputPath, "Cube"); - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .ClickByName("PrintPopupMenu") .ClickByName("Export GCode Button") .Type(fullPathToGcodeFile) @@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Directory.CreateDirectory(gcodeOutputPath); testRunner.EnsureWelcomePageClosed() .ClickByName("Create New") - .AddItemToBedplate() + .AddItemToBed() .ClickByName("Bed Options Menu") .ClickByName("Export Menu Item") .WaitForName("Export Item Window"); diff --git a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs index b4d723535..b48932686 100644 --- a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs +++ b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Complete9StepLeveling(); // Satisfy non-empty bed requirement - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); testRunner.OpenPrintPopupMenu(); diff --git a/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs b/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs index 3e9254538..5cdc9eda7 100644 --- a/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs +++ b/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs @@ -133,7 +133,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.AddAndSelectPrinter(); - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .ClickByName("Save Menu SplitButton", offset: new Agg.Point2D(10, 0)) .ClickByName("Save As Menu Item") .DoubleClickByName("Library Row Item Collection") diff --git a/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj b/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj index e78e8fe6e..e24bb95f0 100644 --- a/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj +++ b/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj @@ -52,6 +52,7 @@ MatterControlUtilities.cs + diff --git a/Tests/MatterControl.AutomationTests/PartPreviewTests.cs b/Tests/MatterControl.AutomationTests/PartPreviewTests.cs index c3c9bb879..fed6dfb29 100644 --- a/Tests/MatterControl.AutomationTests/PartPreviewTests.cs +++ b/Tests/MatterControl.AutomationTests/PartPreviewTests.cs @@ -16,7 +16,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.OpenEmptyPartTab(); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); // Get View3DWidget View3DWidget view3D = testRunner.GetWidgetByName("View3DWidget", out _, 3) as View3DWidget; @@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.OpenEmptyPartTab(); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); // Get View3DWidget and count Scene.Children before Copy button is clicked View3DWidget view3D = testRunner.GetWidgetByName("View3DWidget", out _, 3) as View3DWidget; @@ -96,7 +96,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.OpenEmptyPartTab(); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget; var scene = view3D.Object3DControlLayer.Scene; @@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.AddAndSelectPrinter(); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget; diff --git a/Tests/MatterControl.AutomationTests/PrintingTests.cs b/Tests/MatterControl.AutomationTests/PrintingTests.cs index 41a8c6676..f6cf63355 100644 --- a/Tests/MatterControl.AutomationTests/PrintingTests.cs +++ b/Tests/MatterControl.AutomationTests/PrintingTests.cs @@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.Tests.Automation printer.Settings.GetValue(SettingsKey.end_gcode), "Failure persisting GCode/MultilineTextField value"); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); // Shorten the delay so the test runs in a reasonable time printer.Connection.TimeToHoldTemperature = 5; @@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.OpenPrintPopupMenu() .ClickByName("SetupPrinter") .Complete9StepLeveling() - .AddItemToBedplate(); + .AddItemToBed(); var printer = testRunner.FirstPrinter(); @@ -291,7 +291,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add"); // print a part - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); testRunner.StartPrint(testRunner.FirstPrinter(), pauseAtLayers: "2;6"); @@ -330,7 +330,7 @@ namespace MatterHackers.MatterControl.Tests.Automation var printer = testRunner.FirstPrinter(); // print a part - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); testRunner.StartPrint(printer, pauseAtLayers: "2"); ProfileManager.DebugPrinterDelete = true; @@ -361,7 +361,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.IsTrue(printer.Connection.RecoveryIsEnabled); // print a part - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .StartPrint(printer, pauseAtLayers: "2;4;6") .ClickResumeButton(printer, true, 1) // Resume .ClickResumeButton(printer, false, 3) // close the pause dialog pop-up do not resume @@ -405,8 +405,8 @@ namespace MatterHackers.MatterControl.Tests.Automation }; // print a part - testRunner.AddItemToBedplate() - .AddItemToBedplate(partName: "Row Item Set Temperature") + testRunner.AddItemToBed() + .AddItemToBed(partName: "Row Item Set Temperature") .DragDropByName("MoveInZControl", "MoveInZControl", offsetDrag: new Point2D(0, 0), offsetDrop: new Point2D(0, 10)) .ClickByName("Temperature Edit") .Type("222.2") @@ -454,7 +454,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.IsTrue(printer.Connection.RecoveryIsEnabled); // print a part - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .ClickByName("ItemMaterialButton") .ClickByName("Material 2 Button") .StartPrint(printer, pauseAtLayers: "2;3;4;5"); @@ -504,7 +504,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add"); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); testRunner.SwitchToControlsTab(); @@ -582,7 +582,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should be defined after add"); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); testRunner.SwitchToControlsTab(); @@ -711,7 +711,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after add"); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); var printer = testRunner.FirstPrinter(); diff --git a/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs b/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs index c5f138a98..82aecee14 100644 --- a/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs +++ b/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs @@ -23,7 +23,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.WaitForFirstDraw() .AddAndSelectPrinter() .AddTestAssetsToLibrary(new[] { "Rook.amf" }) - .AddItemToBedplate("", "Row Item Rook") + .AddItemToBed("", "Row Item Rook") .SwitchToSliceSettings() .SelectSliceSettingsField(SettingsKey.create_raft) .WaitForReloadAll(() => testRunner.StartSlicing()) @@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.Tests.Automation farthestE = Math.Max(farthestE, printer.Connection.CurrentExtruderDestination); }; - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .StartPrint(printer) .WaitFor(() => printer.Connection.Printing, 60) // wait for the print to start .WaitFor(() => !printer.Connection.Printing, 60); // wait for the print to finish @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { var printer = testRunner.FirstPrinter(); - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .StartPrint(printer, pauseAtLayers: "4;2;a;not;6") .WaitForLayerAndResume(printer, 2) .WaitForLayerAndResume(printer, 4) @@ -213,7 +213,7 @@ namespace MatterHackers.MatterControl.Tests.Automation var printer = testRunner.FirstPrinter(); printer.Settings.SetValue(SettingsKey.cancel_gcode, "G28 ; Cancel GCode"); - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .StartPrint(printer, pauseAtLayers: "2") // Wait for the Ok button .WaitForName("Yes Button", 30); diff --git a/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs b/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs index 9ffe9c86c..6633a8cd0 100644 --- a/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs +++ b/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs @@ -15,7 +15,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { testRunner.OpenEmptyPartTab(); - testRunner.AddItemToBedplate(); + testRunner.AddItemToBed(); var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget; var scene = view3D.Object3DControlLayer.Scene; diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index 5425136f6..9ddbd62bf 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -225,9 +225,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("3D View Edit"); } - testRunner.DragDropByName("Object3DControlLayer", "Object3DControlLayer", offsetDrop: new Agg.Point2D(10, 15), mouseButtons: MouseButtons.Right) - .Delay(1) - .ClickByName(partNameToSelect); + testRunner.ClickByName(partNameToSelect); } public static AutomationRunner WaitForFirstDraw(this AutomationRunner testRunner) @@ -617,6 +615,7 @@ namespace MatterHackers.MatterControl.Tests.Automation break; case "Calibration Parts Row Item Collection": + case "Primitives Row Item Collection": case "Cloud Library Row Item Collection": case "Print Queue Row Item Collection": case "Local Library Row Item Collection": @@ -722,7 +721,7 @@ namespace MatterHackers.MatterControl.Tests.Automation .WaitForWidgetDisappear("Automation Dialog TextEdit", 5); } - public static AutomationRunner AddItemToBedplate(this AutomationRunner testRunner, string containerName = "Calibration Parts Row Item Collection", string partName = "Row Item Calibration - Box.stl") + public static AutomationRunner AddItemToBed(this AutomationRunner testRunner, string containerName = "Calibration Parts Row Item Collection", string partName = "Row Item Calibration - Box.stl") { if (!testRunner.NameExists(partName, 1) && !string.IsNullOrEmpty(containerName)) { @@ -1316,7 +1315,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("Layers3D Button"); // TODO: Remove workaround needed to force GCode options to appear {{ - testRunner.AddItemToBedplate() + testRunner.AddItemToBed() .ClickByName("Generate Gcode Button"); // TODO: Remove workaround needed to force GCode options to appear }} }