From 60aaa5abea0bde84cf4ad516c8aba2ee98c6f800 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 10 Jan 2019 15:21:33 -0800 Subject: [PATCH 1/2] Switch to Model view when dragging items from the file system - Issue MatterHackers/MCCentral#4781 DragDrop STL from desktop to printing GCode view fails to switch to model view --- MatterControlLib/ApplicationView/BedConfig.cs | 12 ++++++++++-- .../DesignTools/Primitives/ImageObject3D.cs | 1 - .../DesignTools/Primitives/TextObject3D.cs | 1 - .../PartPreviewWindow/View3D/View3DWidget.cs | 14 ++------------ 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/MatterControlLib/ApplicationView/BedConfig.cs b/MatterControlLib/ApplicationView/BedConfig.cs index 3caa20982..4719de161 100644 --- a/MatterControlLib/ApplicationView/BedConfig.cs +++ b/MatterControlLib/ApplicationView/BedConfig.cs @@ -193,6 +193,11 @@ namespace MatterHackers.MatterControl } public InsertionGroupObject3D AddToPlate(IEnumerable itemsToAdd) + { + return this.AddToPlate(itemsToAdd, (this.Printer != null) ? this.Printer.Bed.BedCenter : Vector2.Zero, true); + } + + public InsertionGroupObject3D AddToPlate(IEnumerable itemsToAdd, Vector2 initialPosition, bool moveToOpenPosition) { if (this.Printer != null && this.Printer.ViewState.ViewMode != PartViewMode.Model) @@ -211,10 +216,13 @@ namespace MatterHackers.MatterControl itemsToAdd, context.View3DWidget, scene, - (Printer != null) ? Printer.Bed.BedCenter : Vector2.Zero, + initialPosition, (item, itemsToAvoid) => { - PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid); + if (moveToOpenPosition) + { + PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid); + } })); }); diff --git a/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs b/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs index d857ab218..d24eda6f1 100644 --- a/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs @@ -92,7 +92,6 @@ namespace MatterHackers.MatterControl.DesignTools var graphics2D = _image.NewGraphics2D(); graphics2D.Clear(Color.White); graphics2D.DrawString("Bad Load", 100, 100); - } // we don't want to invalidate on the mesh change diff --git a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs index 1e7c63b26..7be124365 100644 --- a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs @@ -142,7 +142,6 @@ namespace MatterHackers.MatterControl.DesignTools } }); - if (aabb.ZSize > 0) { // If the part was already created and at a height, maintain the height. diff --git a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs index 311fb8609..bec8e7206 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs @@ -999,13 +999,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // Set the hitplane to the bed plane CurrentSelectInfo.HitPlane = bedPlane; - var insertionGroup = new InsertionGroupObject3D( - items, - this, - Scene, - Vector2.Zero, - null, - trackSourceFiles); + // Add item to scene + var insertionGroup = sceneContext.AddToPlate(items, Vector2.Zero, moveToOpenPosition: false); // Find intersection position of the mouse with the bed plane var intersectInfo = GetIntersectPosition(screenSpaceMousePosition); @@ -1020,11 +1015,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.deferEditorTillMouseUp = true; - // Add item to scene and select it - Scene.Children.Modify(list => - { - list.Add(insertionGroup); - }); Scene.SelectedItem = insertionGroup; this.DragDropObject = insertionGroup; From b33780d5f87d1e61776110841466b9135ad0b366 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 10 Jan 2019 15:44:45 -0800 Subject: [PATCH 2/2] Revise layouts.txt --- StaticData/SliceSettings/Layouts.txt | 48 +++++++++++++--------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/StaticData/SliceSettings/Layouts.txt b/StaticData/SliceSettings/Layouts.txt index 14f843713..f6dd026ad 100644 --- a/StaticData/SliceSettings/Layouts.txt +++ b/StaticData/SliceSettings/Layouts.txt @@ -146,18 +146,6 @@ Printer extruders_share_temperature extruder_offset Features - Features - Interface - sla_printer - show_reset_connection - include_firmware_updater - backup_firmware_before_update - Print Recovery - recover_is_enabled - recover_first_layer_speed - recover_position_before_z_home - Other - progress_reporting Leveling Print Leveling print_leveling_solution @@ -172,6 +160,28 @@ Printer z_probe_z_offset z_servo_depolyed_angle z_servo_retracted_angle + Features + Interface + show_reset_connection + include_firmware_updater + backup_firmware_before_update + Print Recovery + recover_is_enabled + recover_first_layer_speed + recover_position_before_z_home + Other + progress_reporting + Behavior + Behavior + z_homes_to_max + heat_extruder_before_homing + auto_release_motors + validate_layer_height + send_with_checksum + reset_long_extrusion + Slicing Options + output_only_first_layer + g0 Hardware Hardware has_fan @@ -184,23 +194,11 @@ Printer has_z_servo enable_network_printing enable_sailfish_communication - Behavior - Behavior - z_homes_to_max - heat_extruder_before_homing - auto_release_motors - validate_layer_height - send_with_checksum - reset_long_extrusion + sla_printer max_acceleration max_velocity jerk_velocity print_time_estimate_multiplier - Slicing - Slicing Options - output_only_first_layer - g0 - Material Loading Loading load_filament_length unload_filament_length