diff --git a/MatterControl.Printing/Settings/PrinterSettings.cs b/MatterControl.Printing/Settings/PrinterSettings.cs index cbec0499b..fe85ae027 100644 --- a/MatterControl.Printing/Settings/PrinterSettings.cs +++ b/MatterControl.Printing/Settings/PrinterSettings.cs @@ -66,8 +66,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public void OnSettingChanged(string slicerConfigName) { - if (slicerConfigName == SettingsKey.nozzle1_inset - || slicerConfigName == SettingsKey.nozzle2_inset + if (slicerConfigName == SettingsKey.t0_inset + || slicerConfigName == SettingsKey.t1_inset || slicerConfigName == SettingsKey.bed_size || slicerConfigName == SettingsKey.print_center) { @@ -373,7 +373,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration RectangleDouble GetHotendBounds(int index) { - string settingsKey = index == 0 ? SettingsKey.nozzle1_inset : SettingsKey.nozzle2_inset; + string settingsKey = index == 0 ? SettingsKey.t0_inset : SettingsKey.t1_inset; var inset = this.GetValue(settingsKey); return new RectangleDouble( @@ -383,7 +383,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration bounds.Top - inset.W); } - this.HotendBounds = new[] + this.ToolBounds = new[] { GetHotendBounds(0), GetHotendBounds(1), @@ -393,7 +393,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration /// /// Gets the bounds that are accessible for a given hotend /// - public RectangleDouble[] HotendBounds { get; private set; } + public RectangleDouble[] ToolBounds { get; private set; } [JsonIgnore] public bool AutoSave { get; set; } = true; diff --git a/MatterControl.Printing/Settings/SettingsHelpers.cs b/MatterControl.Printing/Settings/SettingsHelpers.cs index 8f4317190..e220ea4d1 100644 --- a/MatterControl.Printing/Settings/SettingsHelpers.cs +++ b/MatterControl.Printing/Settings/SettingsHelpers.cs @@ -323,7 +323,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration return presets; } - public int NumberOfHotends() + public int NumberOfTools() { if (printerSettings.GetValue(SettingsKey.extruders_share_temperature)) { diff --git a/MatterControl.Printing/Settings/SettingsKey.cs b/MatterControl.Printing/Settings/SettingsKey.cs index 4322211a6..492e4270f 100644 --- a/MatterControl.Printing/Settings/SettingsKey.cs +++ b/MatterControl.Printing/Settings/SettingsKey.cs @@ -256,7 +256,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public const string z_probe_samples = nameof(z_probe_samples); public const string z_servo_depolyed_angle = nameof(z_servo_depolyed_angle); public const string z_servo_retracted_angle = nameof(z_servo_retracted_angle); - public const string nozzle1_inset = nameof(nozzle1_inset); - public const string nozzle2_inset = nameof(nozzle2_inset); + public const string t0_inset = nameof(t0_inset); + public const string t1_inset = nameof(t1_inset); } } diff --git a/MatterControl.Printing/Settings/SliceSettingsFields.cs b/MatterControl.Printing/Settings/SliceSettingsFields.cs index f0000f386..5d8082432 100644 --- a/MatterControl.Printing/Settings/SliceSettingsFields.cs +++ b/MatterControl.Printing/Settings/SliceSettingsFields.cs @@ -1792,7 +1792,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration }, new SliceSettingData() { - SlicerConfigName = SettingsKey.nozzle1_inset, + SlicerConfigName = SettingsKey.t0_inset, PresentationName = "Nozzle 1 Inset".Localize(), HelpText = "The inset amount for nozzle 1 from the bed".Localize(), DataEditType = DataEditTypes.BOUNDS, @@ -1801,7 +1801,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration }, new SliceSettingData() { - SlicerConfigName = SettingsKey.nozzle2_inset, + SlicerConfigName = SettingsKey.t1_inset, PresentationName = "Nozzle 2 Inset".Localize(), HelpText = "The inset amount for nozzle 2 from the bed".Localize(), DataEditType = DataEditTypes.BOUNDS, diff --git a/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs b/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs index bcb2684c6..2a840f3e8 100644 --- a/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs +++ b/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs @@ -240,7 +240,7 @@ namespace MatterHackers.MatterControl.ActionBar GuiWidget hotendRow; container.AddChild(hotendRow = new SettingsItem( - printer.Settings.Helpers.NumberOfHotends() == 1 ? "Hotend".Localize() : "Hotend {0}".Localize().FormatWith(hotendIndex + 1), + printer.Settings.Helpers.NumberOfTools() == 1 ? "Hotend".Localize() : "Hotend {0}".Localize().FormatWith(hotendIndex + 1), menuTheme, new SettingsItem.ToggleSwitchConfig() { diff --git a/MatterControlLib/ApplicationView/PrinterExtensionMethods.cs b/MatterControlLib/ApplicationView/PrinterExtensionMethods.cs index 87ce0db12..7ebcdf716 100644 --- a/MatterControlLib/ApplicationView/PrinterExtensionMethods.cs +++ b/MatterControlLib/ApplicationView/PrinterExtensionMethods.cs @@ -94,7 +94,7 @@ namespace MatterHackers.MatterControl private static bool InsideHotendBounds(this PrinterConfig printer, IObject3D item) { - if (printer.Settings.Helpers.NumberOfHotends() == 1) + if (printer.Settings.Helpers.NumberOfTools() == 1) { return true; } @@ -108,7 +108,7 @@ namespace MatterHackers.MatterControl bool isWipeTower = item?.OutputType == PrintOutputTypes.WipeTower; // Determine if the given item is outside the bounds of the given extruder - if (materialIndex < printer.Settings.HotendBounds.Length + if (materialIndex < printer.Settings.ToolBounds.Length || isWipeTower) { var itemAABB = item.WorldAxisAlignedBoundingBox(); @@ -125,7 +125,7 @@ namespace MatterHackers.MatterControl // Validate against active hotends foreach (var hotendIndex in activeHotends) { - var hotendBounds = printer.Settings.HotendBounds[hotendIndex]; + var hotendBounds = printer.Settings.ToolBounds[hotendIndex]; if (!hotendBounds.Contains(itemBounds)) { return false; diff --git a/MatterControlLib/PartPreviewWindow/SceneViewer/FloorDrawable.cs b/MatterControlLib/PartPreviewWindow/SceneViewer/FloorDrawable.cs index b5813aa7d..40e745814 100644 --- a/MatterControlLib/PartPreviewWindow/SceneViewer/FloorDrawable.cs +++ b/MatterControlLib/PartPreviewWindow/SceneViewer/FloorDrawable.cs @@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private Color buildVolumeColor; - private int activeBedHotendClippingImage = int.MinValue; + private int activeBedToolClippingImage = int.MinValue; private ImageBuffer[] bedTextures = null; @@ -197,7 +197,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { var bedImage = BedMeshGenerator.CreatePrintBedImage(sceneContext.Printer); - if (printer.Settings.Helpers.NumberOfHotends() > 1) + if (printer.Settings.Helpers.NumberOfTools() > 1) { bedTextures = new[] { @@ -207,11 +207,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow new ImageBuffer(bedImage) // Unioned T0 & T1 limits }; - GenerateNozzleLimitsTexture(printer, 0, bedTextures[1]); - GenerateNozzleLimitsTexture(printer, 1, bedTextures[2]); + GenerateToolLimitsTexture(printer, 0, bedTextures[1]); + GenerateToolLimitsTexture(printer, 1, bedTextures[2]); - // Special case for union of both hotends - GenerateNozzleLimitsTexture(printer, 2, bedTextures[3]); + // Special case for union of both tools + GenerateToolLimitsTexture(printer, 2, bedTextures[3]); } else { @@ -220,7 +220,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow bedImage, // No limits, basic themed bed }; - activeBedHotendClippingImage = 0; + activeBedToolClippingImage = 0; } this.SetActiveTexture(bedTextures[0]); @@ -232,21 +232,21 @@ namespace MatterHackers.MatterControl.PartPreviewWindow loadingTextures = false; }); } - else if (printer.Settings.Helpers.NumberOfHotends() > 1 + else if (printer.Settings.Helpers.NumberOfTools() > 1 && printer.Bed.BedShape == BedShape.Rectangular) { - int hotendIndex = GetActiveHotendIndex(selectedItem); + int toolIndex = GetActiveToolIndex(selectedItem); - if (activeBedHotendClippingImage != hotendIndex) + if (activeBedToolClippingImage != toolIndex) { // Clamp to the range that's currently supported - if (hotendIndex > 2) + if (toolIndex > 2) { - hotendIndex = -1; + toolIndex = -1; } - this.SetActiveTexture(bedTextures[hotendIndex + 1]); - activeBedHotendClippingImage = hotendIndex; + this.SetActiveTexture(bedTextures[toolIndex + 1]); + activeBedToolClippingImage = toolIndex; } } } @@ -256,14 +256,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow string settingsKey = e.Data; // Invalidate bed textures on related settings change - if (settingsKey == SettingsKey.nozzle1_inset - || settingsKey == SettingsKey.nozzle2_inset + if (settingsKey == SettingsKey.t0_inset + || settingsKey == SettingsKey.t1_inset || settingsKey == SettingsKey.bed_size || settingsKey == SettingsKey.print_center || settingsKey == SettingsKey.extruder_count || settingsKey == SettingsKey.bed_shape) { - activeBedHotendClippingImage = int.MinValue; + activeBedToolClippingImage = int.MinValue; // Force texture rebuild, don't clear allowing redraws of the stale data until rebuilt bedTextures = null; @@ -283,7 +283,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ApplicationController.Instance.MainView.Invalidate(); } - private static int GetActiveHotendIndex(IObject3D selectedItem) + private static int GetActiveToolIndex(IObject3D selectedItem) { if (selectedItem == null) { @@ -318,7 +318,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow return worldMaterialIndex; } - private void GenerateNozzleLimitsTexture(PrinterConfig printer, int hotendIndex, ImageBuffer bedplateImage) + private void GenerateToolLimitsTexture(PrinterConfig printer, int toolIndex, ImageBuffer bedplateImage) { var xScale = bedplateImage.Width / printer.Settings.BedBounds.Width; var yScale = bedplateImage.Height / printer.Settings.BedBounds.Height; @@ -327,33 +327,33 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var graphics = bedplateImage.NewGraphics2D(); - RectangleDouble hotendBounds; + RectangleDouble toolBounds; - if (hotendIndex == 2) + if (toolIndex == 2) { - var hotend0 = printer.Settings.HotendBounds[0]; - var hotend1 = printer.Settings.HotendBounds[1]; + var tool0Bounds = printer.Settings.ToolBounds[0]; + var tool1Bounds = printer.Settings.ToolBounds[1]; - hotend0.IntersectWithRectangle(hotend1); + tool0Bounds.IntersectWithRectangle(tool1Bounds); - hotendBounds = hotend0; + toolBounds = tool0Bounds; } else { - hotendBounds = printer.Settings.HotendBounds[hotendIndex]; + toolBounds = printer.Settings.ToolBounds[toolIndex]; } // move relative to the texture origin, move to the bed lower left position var bedBounds = printer.Settings.BedBounds; - hotendBounds.Offset(-bedBounds.Left, -bedBounds.Bottom); + toolBounds.Offset(-bedBounds.Left, -bedBounds.Bottom); - // Scale hotendBounds into textures units - hotendBounds = new RectangleDouble( - hotendBounds.Left * xScale, - hotendBounds.Bottom * yScale, - hotendBounds.Right * xScale, - hotendBounds.Top * yScale); + // Scale toolBounds into textures units + toolBounds = new RectangleDouble( + toolBounds.Left * xScale, + toolBounds.Bottom * yScale, + toolBounds.Right * xScale, + toolBounds.Top * yScale); var imageBounds = bedplateImage.GetBounds(); @@ -364,23 +364,23 @@ namespace MatterHackers.MatterControl.PartPreviewWindow dimRegion.LineTo(imageBounds.Left, imageBounds.Top); var targetRect = new VertexStorage(); - targetRect.MoveTo(hotendBounds.Right, hotendBounds.Bottom); - targetRect.LineTo(hotendBounds.Left, hotendBounds.Bottom); - targetRect.LineTo(hotendBounds.Left, hotendBounds.Top); - targetRect.LineTo(hotendBounds.Right, hotendBounds.Top); + targetRect.MoveTo(toolBounds.Right, toolBounds.Bottom); + targetRect.LineTo(toolBounds.Left, toolBounds.Bottom); + targetRect.LineTo(toolBounds.Left, toolBounds.Top); + targetRect.LineTo(toolBounds.Right, toolBounds.Top); targetRect.ClosePolygon(); var overlayMinusTargetRect = new CombinePaths(dimRegion, targetRect); graphics.Render(overlayMinusTargetRect, new Color(Color.Black, alpha)); - string hotendTitle = string.Format("{0} {1}", "Nozzle ".Localize(), hotendIndex + 1); + string toolTitle = string.Format("{0} {1}", "Tool ".Localize(), toolIndex + 1); - if (hotendIndex == 2) + if (toolIndex == 2) { - hotendTitle = "Nozzles ".Localize() + "1 & 2"; + toolTitle = "Tools ".Localize() + "1 & 2"; } - var stringPrinter = new TypeFacePrinter(hotendTitle, theme.DefaultFontSize, bold: true); + var stringPrinter = new TypeFacePrinter(toolTitle, theme.DefaultFontSize, bold: true); var printerBounds = stringPrinter.GetBounds(); int textPadding = 8; @@ -388,15 +388,15 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var textBounds = printerBounds; textBounds.Inflate(textPadding); - var cornerRect = new RectangleDouble(hotendBounds.Right - textBounds.Width, hotendBounds.Top - textBounds.Height, hotendBounds.Right, hotendBounds.Top); + var cornerRect = new RectangleDouble(toolBounds.Right - textBounds.Width, toolBounds.Top - textBounds.Height, toolBounds.Right, toolBounds.Top); graphics.Render( new RoundedRectShape(cornerRect, bottomLeftRadius: 6), theme.PrimaryAccentColor); graphics.DrawString( - hotendTitle, - hotendBounds.Right - textPadding, + toolTitle, + toolBounds.Right - textPadding, cornerRect.Bottom + (cornerRect.Height / 2 - printerBounds.Height / 2) + 1, theme.DefaultFontSize, justification: Justification.Right, diff --git a/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs b/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs index f042059e1..b41866721 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs @@ -129,8 +129,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow string settingsKey = e.Data; // Invalidate bed textures on related settings change - if (settingsKey == SettingsKey.nozzle1_inset - || settingsKey == SettingsKey.nozzle2_inset + if (settingsKey == SettingsKey.t0_inset + || settingsKey == SettingsKey.t1_inset || settingsKey == SettingsKey.bed_size || settingsKey == SettingsKey.print_center) { diff --git a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs index 4b3f82231..7d8a837d8 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -299,7 +299,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (printer.InsideBuildVolume(item)) { - if (printer.Settings.Helpers.NumberOfHotends() > 1) + if (printer.Settings.Helpers.NumberOfTools() > 1) { var materialIndex = item.WorldMaterialIndex(); if (materialIndex == -1) @@ -310,7 +310,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow bool isWipeTower = item?.OutputType == PrintOutputTypes.WipeTower; // Determine if the given item is outside the bounds of the given extruder - if (materialIndex < printer.Settings.HotendBounds.Length + if (materialIndex < printer.Settings.ToolBounds.Length || isWipeTower) { var itemAABB = item.WorldAxisAlignedBoundingBox(); @@ -327,7 +327,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // Validate against active hotends foreach(var hotendIndex in activeHotends) { - var hotendBounds = printer.Settings.HotendBounds[hotendIndex]; + var hotendBounds = printer.Settings.ToolBounds[hotendIndex]; if (!hotendBounds.Contains(itemBounds)) { // Draw in red outside of the bounds for the hotend diff --git a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs index 8c9eeeb27..6dbbe7627 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs @@ -187,7 +187,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.AddChild(new HorizontalSpacer()); - int hotendCount = printer.Settings.Helpers.NumberOfHotends(); + int hotendCount = printer.Settings.Helpers.NumberOfTools(); if (!printer.Settings.GetValue(SettingsKey.sla_printer)) { for (int extruderIndex = 0; extruderIndex < hotendCount; extruderIndex++) diff --git a/MatterControlLib/PrinterControls/ControlWidgets/FilamentSetupWizard.cs b/MatterControlLib/PrinterControls/ControlWidgets/FilamentSetupWizard.cs index d53fceee3..e143799bb 100644 --- a/MatterControlLib/PrinterControls/ControlWidgets/FilamentSetupWizard.cs +++ b/MatterControlLib/PrinterControls/ControlWidgets/FilamentSetupWizard.cs @@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl { public FilamentSetupWizard(PrinterConfig printer, ThemeConfig theme) { - this.Stages = Enumerable.Range(0, printer.Settings.Helpers.NumberOfHotends()).Select(i => + this.Stages = Enumerable.Range(0, printer.Settings.Helpers.NumberOfTools()).Select(i => { return new LoadFilamentWizard(printer, extruderIndex: i, showAlreadyLoadedButton: true); }).ToList(); diff --git a/MatterControlLib/PrinterControls/ControlWidgets/TemperatureControls.cs b/MatterControlLib/PrinterControls/ControlWidgets/TemperatureControls.cs index 9426fff49..371e20e6a 100644 --- a/MatterControlLib/PrinterControls/ControlWidgets/TemperatureControls.cs +++ b/MatterControlLib/PrinterControls/ControlWidgets/TemperatureControls.cs @@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.PrinterControls this.HAnchor = HAnchor.Stretch; this.printer = printer; - int hotendCount = printer.Settings.Helpers.NumberOfHotends(); + int hotendCount = printer.Settings.Helpers.NumberOfTools(); // add in the hotend controls for (int extruderIndex = 0; extruderIndex < hotendCount; extruderIndex++) diff --git a/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs b/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs index cf0a4b870..9b4b1a8ed 100644 --- a/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs +++ b/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs @@ -105,8 +105,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration SettingsKey.load_filament_speed, SettingsKey.make, SettingsKey.model, - SettingsKey.nozzle1_inset, - SettingsKey.nozzle2_inset, + SettingsKey.t0_inset, + SettingsKey.t1_inset, SettingsKey.number_of_first_layers, SettingsKey.extruder_offset, SettingsKey.pause_gcode, diff --git a/MatterControlLib/SlicerConfiguration/MappingClasses/MapStartGCode.cs b/MatterControlLib/SlicerConfiguration/MappingClasses/MapStartGCode.cs index 8d7f4c25a..628ae43ac 100644 --- a/MatterControlLib/SlicerConfiguration/MappingClasses/MapStartGCode.cs +++ b/MatterControlLib/SlicerConfiguration/MappingClasses/MapStartGCode.cs @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration.MappingClasses AddDefaultIfNotPresent(preStartGCode, setBedTempString, preStartGCodeLines, "start heating the bed"); } - int numberOfHeatedExtruders = printer.Settings.Helpers.NumberOfHotends(); + int numberOfHeatedExtruders = printer.Settings.Helpers.NumberOfTools(); // Start heating all the extruder that we are going to use. for (int extruderIndex0Based = 0; extruderIndex0Based < numberOfHeatedExtruders; extruderIndex0Based++) diff --git a/MatterControlLib/SlicerConfiguration/PresetsToolbar.cs b/MatterControlLib/SlicerConfiguration/PresetsToolbar.cs index d44c46868..a94d40aa5 100644 --- a/MatterControlLib/SlicerConfiguration/PresetsToolbar.cs +++ b/MatterControlLib/SlicerConfiguration/PresetsToolbar.cs @@ -38,7 +38,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { this.HAnchor = HAnchor.Stretch; - int numberOfHeatedExtruders = printer.Settings.Helpers.NumberOfHotends(); + int numberOfHeatedExtruders = printer.Settings.Helpers.NumberOfTools(); this.AddChild(new PresetSelectorWidget(printer, "Quality".Localize(), theme.PresetColors.QualityPreset, NamedSettingsLayers.Quality, 0, theme) { diff --git a/StaticData/SliceSettings/Layouts.txt b/StaticData/SliceSettings/Layouts.txt index 2d9d4a3a9..eaaf49d80 100644 --- a/StaticData/SliceSettings/Layouts.txt +++ b/StaticData/SliceSettings/Layouts.txt @@ -147,8 +147,8 @@ Printer Extruders extruder_count nozzle_diameter - nozzle1_inset - nozzle2_inset + t0_inset + t1_inset extruders_share_temperature extruder_offset Features diff --git a/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs b/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs index 8d8472d06..a7cd4e539 100644 --- a/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs @@ -195,7 +195,7 @@ namespace MatterControl.Tests.MatterControl // shared temp { string[] settings = new string[] { SettingsKey.extruder_count, "2", SettingsKey.extruders_share_temperature, "1" }; - Assert.AreEqual(GetProfile(settings).Helpers.NumberOfHotends(), 1); + Assert.AreEqual(GetProfile(settings).Helpers.NumberOfTools(), 1); } } }