commit
463d4fd3d4
5 changed files with 31 additions and 19 deletions
|
|
@ -13,6 +13,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
public class ToggleSwitchConfig
|
||||
{
|
||||
public bool Checked { get; set; }
|
||||
public string Name { get; set; }
|
||||
public Action<bool> ToggleAction { get; set; }
|
||||
}
|
||||
|
||||
|
|
@ -90,6 +91,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
|
||||
var toggleSwitch = ImageButtonFactory.CreateToggleSwitch(toggleSwitchConfig.Checked, textColor);
|
||||
toggleSwitch.VAnchor = VAnchor.Center;
|
||||
toggleSwitch.Name = toggleSwitchConfig.Name;
|
||||
toggleSwitch.Margin = new BorderDouble(left: 16);
|
||||
toggleSwitch.CheckedStateChanged += (sender, e) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
theme.Colors.PrimaryTextColor,
|
||||
new SettingsItem.ToggleSwitchConfig()
|
||||
{
|
||||
Name = option.Title + " Toggle",
|
||||
Checked = option.IsChecked(),
|
||||
ToggleAction = option.SetValue
|
||||
},
|
||||
|
|
|
|||
|
|
@ -66,15 +66,6 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
testRunner.ClickByName("Model View Button");
|
||||
testRunner.ClickByName("View3D Overflow Menu");
|
||||
Assert.IsTrue(testRunner.WaitForName("Overhang Menu Item"), "Model overflow menu should have Overhang item");
|
||||
|
||||
testRunner.ClickByName("Layers3D Button");
|
||||
testRunner.ClickByName("View3D Overflow Menu");
|
||||
Assert.IsTrue(testRunner.WaitForName("Sync To Print Menu Item"), "GCode3D overflow menu should have sync-to-print item");
|
||||
|
||||
testRunner.ClickByName("Layers2D Button");
|
||||
testRunner.ClickByName("View3D Overflow Menu");
|
||||
Assert.IsTrue(testRunner.WaitForName("Sync To Print Menu Item"), "GCode2D overflow menu should have sync-to-print item");
|
||||
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -58,8 +58,9 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
testRunner.AddItemToBedplate();
|
||||
|
||||
testRunner.OpenGCode3DOverflowMenu();
|
||||
testRunner.ClickByName("Sync To Print Menu Item");
|
||||
// Toggle Sync-to-print
|
||||
testRunner.SwitchToGCodeTab();
|
||||
testRunner.ClickByName("Sync To Print Toggle");
|
||||
|
||||
testRunner.StartPrint();
|
||||
|
||||
|
|
@ -94,9 +95,9 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
testRunner.AddItemToBedplate();
|
||||
|
||||
// Turn on Sync-to-print
|
||||
testRunner.OpenGCode3DOverflowMenu();
|
||||
testRunner.ClickByName("Sync To Print Menu Item");
|
||||
// Toggle Sync-to-print
|
||||
testRunner.SwitchToGCodeTab();
|
||||
testRunner.ClickByName("Sync To Print Toggle");
|
||||
|
||||
testRunner.StartPrint();
|
||||
|
||||
|
|
@ -123,7 +124,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
private static void WaitForLayerAndResume(AutomationRunner testRunner, int indexToWaitFor)
|
||||
{
|
||||
testRunner.WaitForName("No Button", 30);
|
||||
|
||||
|
||||
var printer = ApplicationController.Instance.ActivePrinter;
|
||||
|
||||
// Wait for layer
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
testRunner.WaitforDraw(systemWindow);
|
||||
}
|
||||
|
||||
public static void CloseSignInAndPrinterSelect(this AutomationRunner testRunner, PrepAction preAction = PrepAction.CloseSignInAndPrinterSelect)
|
||||
public static void CloseSignInAndPrinterSelect(this AutomationRunner testRunner, bool closeInitialPlusTab = true)
|
||||
{
|
||||
testRunner.WaitForFirstDraw();
|
||||
|
||||
|
|
@ -194,10 +194,13 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
testRunner.ClickByName("Cancel Wizard Button");
|
||||
}
|
||||
|
||||
var plusTabRegion = testRunner.GetRegionByName("Initial Plus Tab");
|
||||
testRunner.ClickByName("Close Tab Button", plusTabRegion);
|
||||
if (closeInitialPlusTab)
|
||||
{
|
||||
var plusTabRegion = testRunner.GetRegionByName("Initial Plus Tab");
|
||||
testRunner.ClickByName("Close Tab Button", plusTabRegion);
|
||||
|
||||
testRunner.WaitForWidgetDisappear("Initial Plus Tab", 2);
|
||||
testRunner.WaitForWidgetDisappear("Initial Plus Tab", 2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangeToQueueContainer(this AutomationRunner testRunner)
|
||||
|
|
@ -823,6 +826,20 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
testRunner.ClickByName("Controls Tab");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switch to Printer -> GCode Tab - NOTE: as a short term hack this helper as adds content to the bed and slices to ensure GCode view options appear as expected
|
||||
/// </summary>
|
||||
/// <param name="testRunner"></param>
|
||||
public static void SwitchToGCodeTab(this AutomationRunner testRunner)
|
||||
{
|
||||
testRunner.ClickByName("Layers3D Button");
|
||||
|
||||
// TODO: Remove workaround needed to force GCode options to appear {{
|
||||
testRunner.AddItemToBedplate();
|
||||
testRunner.ClickByName("Generate Gcode Button");
|
||||
// TODO: Remove workaround needed to force GCode options to appear }}
|
||||
}
|
||||
|
||||
private static void EnsurePrinterSidebarOpen(AutomationRunner testRunner)
|
||||
{
|
||||
// If the sidebar exists, we need to expand and pin it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue