diff --git a/MatterControlLib/ApplicationView/PrinterConfig.cs b/MatterControlLib/ApplicationView/PrinterConfig.cs index 4796c4ed3..227477f27 100644 --- a/MatterControlLib/ApplicationView/PrinterConfig.cs +++ b/MatterControlLib/ApplicationView/PrinterConfig.cs @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl new MappedSetting(this, "air_gap_speed", "air_gap_speed"), new MappedSetting(this, "extruder_wipe_temperature","extruder_wipe_temperature"), new MappedSetting(this, SettingsKey.filament_diameter,SettingsKey.filament_diameter), - new MappedSetting(this, "first_layer_bed_temperature", SettingsKey.bed_temperature), + new ReplaceWithSetting(this, "first_layer_bed_temperature", SettingsKey.bed_temperature, SettingsKey.bed_temperature), new MappedSetting(this, "first_layer_temperature", SettingsKey.temperature), new MappedSetting(this, SettingsKey.max_fan_speed,"max_fan_speed"), new MappedSetting(this, SettingsKey.min_fan_speed,"min_fan_speed"), @@ -85,6 +85,9 @@ namespace MatterHackers.MatterControl new MappedSetting(this, SettingsKey.temperature,SettingsKey.temperature), new MappedSetting(this, "z_offset","z_offset"), new MappedSetting(this, SettingsKey.bed_temperature,SettingsKey.bed_temperature), + new MappedSetting(this, SettingsKey.temperature1, SettingsKey.temperature1), + new MappedSetting(this, SettingsKey.temperature2, SettingsKey.temperature2), + new MappedSetting(this, SettingsKey.temperature3, SettingsKey.temperature3), new ScaledSingleNumber(this, "infill_speed", "infill_speed", 60), new ScaledSingleNumber(this, "min_print_speed", "min_print_speed", 60), new ScaledSingleNumber(this, "perimeter_speed","perimeter_speed", 60), diff --git a/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs b/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs index 94df4e4f4..9c08c7313 100644 --- a/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs +++ b/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs @@ -91,7 +91,6 @@ namespace MatterHackers.MatterControl.CustomWidgets expandWidget.Click += (s, e) => { this.Expanded = !this.Expanded; - this.ExpandedChanged?.Invoke(this, null); expandWidget.Expanded = this.Expanded; }; diff --git a/MatterControlLib/DesignTools/Operations/FitToBoundsObject3D_2.cs b/MatterControlLib/DesignTools/Operations/FitToBoundsObject3D_2.cs index 7d64da3d2..d6828bc4a 100644 --- a/MatterControlLib/DesignTools/Operations/FitToBoundsObject3D_2.cs +++ b/MatterControlLib/DesignTools/Operations/FitToBoundsObject3D_2.cs @@ -78,9 +78,10 @@ namespace MatterHackers.MatterControl.DesignTools.Operations scaleItem.Children.Add(itemToFit); fitToBounds.Children.Add(bounds); - fitToBounds.SizeX = aabb.XSize; - fitToBounds.SizeY = aabb.YSize; - fitToBounds.SizeZ = aabb.ZSize; + fitToBounds.boundsSize.X = aabb.XSize; + fitToBounds.boundsSize.Y = aabb.YSize; + fitToBounds.boundsSize.Z = aabb.ZSize; + fitToBounds.Rebuild(null); return fitToBounds; } diff --git a/MatterControlLib/DesignTools/Operations/PinchObject3D.cs b/MatterControlLib/DesignTools/Operations/PinchObject3D.cs index a81664503..923e68751 100644 --- a/MatterControlLib/DesignTools/Operations/PinchObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/PinchObject3D.cs @@ -42,6 +42,14 @@ namespace MatterHackers.MatterControl.DesignTools public PinchObject3D() { Name = "Pinch".Localize(); + // TODO: This feels like the wronge approach. I think changing the safe list should always + // call into invalidate for every Object3D (this will cause a lot of classes to need to be fixed). + Children.ItemsModified += Children_ItemsModified; + } + + private void Children_ItemsModified(object sender, System.EventArgs e) + { + OnInvalidate(new InvalidateArgs(null, InvalidateType.Content)); } [DisplayName("Back Ratio")] diff --git a/MatterControlLib/PartPreviewWindow/View3D/Actions/MeshWrapperObject3D.cs b/MatterControlLib/PartPreviewWindow/View3D/Actions/MeshWrapperObject3D.cs index 8aa45211b..2ba118dfe 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Actions/MeshWrapperObject3D.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Actions/MeshWrapperObject3D.cs @@ -49,27 +49,44 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D public override void Flatten(UndoBuffer undoBuffer) { - var meshWrappers = this.Descendants().Where(o => o.OwnerID == this.ID).ToList(); + var ownedMeshWrappers = this.Descendants().Where(o => o.OwnerID == this.ID).ToList(); + + var newMeshObjects = new List(); // remove all the meshWrappers (collapse the children) - foreach (var meshWrapper in meshWrappers) + foreach (var ownedMeshWrapper in ownedMeshWrappers) { - var parent = meshWrapper.Parent; - if (meshWrapper.Visible) + var wrapperParent = ownedMeshWrapper.Parent; + if (ownedMeshWrapper.Visible) { var newMesh = new Object3D() { - Mesh = meshWrapper.Mesh + Mesh = ownedMeshWrapper.Mesh.Copy(CancellationToken.None) }; - newMesh.CopyProperties(meshWrapper, Object3DPropertyFlags.All); + newMesh.CopyProperties(ownedMeshWrapper, Object3DPropertyFlags.All); + var matrix = ownedMeshWrapper.WorldMatrix(this); + newMesh.Mesh.Transform(matrix); + newMesh.Matrix = Matrix4X4.Identity; newMesh.Name = this.Name; - parent.Children.Add(newMesh); + newMeshObjects.Add(newMesh); } // remove it - parent.Children.Remove(meshWrapper); + wrapperParent.Children.Remove(ownedMeshWrapper); } + this.Matrix = Matrix4X4.Identity; + + this.Children.Modify(children => + { + children.Clear(); + children.AddRange(newMeshObjects); + foreach(var child in children) + { + child.MakeNameNonColliding(); + } + }); + base.Flatten(undoBuffer); } diff --git a/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs b/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs index 4068908ba..eb5f5ef7d 100644 --- a/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs +++ b/MatterControlLib/SlicerConfiguration/EngineMappingMatterSlice.cs @@ -49,6 +49,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration "enable_fan", "extruder_wipe_temperature", "extruders_share_temperature", + "first_layer_bed_temperature", "g0", "layer_to_pause", "selector_ip_address", diff --git a/MatterControlLib/SlicerConfiguration/MappingClasses/ReplaceWithSetting.cs b/MatterControlLib/SlicerConfiguration/MappingClasses/ReplaceWithSetting.cs new file mode 100644 index 000000000..1fbda0f5e --- /dev/null +++ b/MatterControlLib/SlicerConfiguration/MappingClasses/ReplaceWithSetting.cs @@ -0,0 +1,44 @@ +/* +Copyright (c) 2016, 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. +*/ + +namespace MatterHackers.MatterControl.SlicerConfiguration.MappingClasses +{ + public class ReplaceWithSetting : MappedSetting + { + string replaceSettingsName; + + public ReplaceWithSetting(PrinterConfig printer, string canonicalSettingsName, string replaceSettingsName, string exportedName) + : base(printer, canonicalSettingsName, exportedName) + { + this.replaceSettingsName = replaceSettingsName; + } + + public override string Value => printer.Settings.GetValue(replaceSettingsName); + } +} \ No newline at end of file diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index e35115dc0..c7b18e1cb 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -404,15 +404,6 @@ "ShowIfSet": "!sla_printer", "DefaultValue": "1" }, - { - "SlicerConfigName": "first_layer_bed_temperature", - "PresentationName": "Bed First Layer", - "HelpText": "The temperature to set the bed to before printing the first layer. The printer will wait until this temperature has been reached before printing. Set to 0 to eliminate bed temperature commands.", - "DataEditType": "DOUBLE", - "Units": "°C", - "ShowIfSet": "has_heated_bed", - "DefaultValue": "75" - }, { "SlicerConfigName": "first_layer_extrusion_width", "PresentationName": "First Layer", diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index c0dd75b18..c583dd6d0 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit c0dd75b189ef909264a736e7d9db9eca67a0c333 +Subproject commit c583dd6d0a62f478e456a25552935370446ab099 diff --git a/Tests/MatterControl.Tests/MatterControl/GCodeProcessingTests.cs b/Tests/MatterControl.Tests/MatterControl/GCodeProcessingTests.cs index b7aeacca3..f9e8e2e93 100644 --- a/Tests/MatterControl.Tests/MatterControl/GCodeProcessingTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/GCodeProcessingTests.cs @@ -89,7 +89,7 @@ namespace MatterControl.Tests.MatterControl TestMacroReplacement("[external_perimeter_speed]", "1260"); TestMacroReplacement("[extruder_wipe_temperature]", "0"); TestMacroReplacement("[filament_diameter]", "3"); - TestMacroReplacement("[first_layer_bed_temperature]", "75"); + TestMacroReplacement("[first_layer_bed_temperature]", "70"); TestMacroReplacement("[first_layer_temperature]", "205"); TestMacroReplacement("{max_fan_speed}", "100"); TestMacroReplacement("{min_fan_speed}", "35"); diff --git a/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs b/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs index 362a85937..1cbcf61a3 100644 --- a/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/InteractiveSceneTests.cs @@ -62,7 +62,6 @@ namespace MatterControl.Tests.MatterControl { var root = new Object3D(); var cube = new CubeObject3D(20, 20, 20); - root.Children.Add(cube); var fit = FitToBoundsObject3D_2.Create(cube); fit.SizeX = 50;