From 51dcf9bc176efc8101de0d8d18579f363c09e62b Mon Sep 17 00:00:00 2001 From: larsbrubaker Date: Fri, 23 Jan 2015 08:03:59 -0800 Subject: [PATCH] Added has hardware leveling to slice settings and implemented in code to remove the software print leveling when present. Added the setting to lulzbot mini, robo r1 and prntrbot simple metal --- .../PrinterSettings/PrinterSettingsView.cs | 17 +++++++++++------ SlicerConfiguration/ActiveSliceSettings.cs | 15 ++++++++++----- SlicerConfiguration/SliceSettingsWidget.cs | 1 + .../SlicerMapping/EngineMappingCura.cs | 3 +-- .../SlicerMapping/EngineMappingMatterSlice.cs | 3 +-- .../SlicerMapping/EngineMappingSlic3r.cs | 6 ------ .../PrinterSettings/Lulzbot/Mini/config.ini | 1 + .../Printrbot/Simple Metal/config.ini | 1 + .../PrinterSettings/RoBo 3D/R1/config.ini | 1 + StaticData/PrinterSettings/config.ini | 1 + StaticData/SliceSettings/Layouts.txt | 1 + StaticData/SliceSettings/Properties.json | 7 +++++++ StaticData/Translations/Master.txt | 6 ++++++ 13 files changed, 42 insertions(+), 21 deletions(-) diff --git a/ConfigurationPage/PrinterSettings/PrinterSettingsView.cs b/ConfigurationPage/PrinterSettings/PrinterSettingsView.cs index 2771a8e84..23b228132 100644 --- a/ConfigurationPage/PrinterSettings/PrinterSettingsView.cs +++ b/ConfigurationPage/PrinterSettings/PrinterSettingsView.cs @@ -7,6 +7,7 @@ using MatterHackers.Agg.PlatformAbstract; using MatterHackers.Agg.UI; using MatterHackers.Localizations; using MatterHackers.MatterControl.ConfigurationPage.PrintLeveling; +using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrinterCommunication; @@ -17,7 +18,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage { public class HardwareSettingsWidget : SettingsViewBase { - Button configureAutoLevelButton; Button configureEePromButton; Button openGcodeTerminalButton; Button openCameraButton; @@ -36,10 +36,15 @@ namespace MatterHackers.MatterControl.ConfigurationPage eePromControlsContainer.AddChild(GetEEPromControl()); terminalCommunicationsContainer = new DisableableWidget(); terminalCommunicationsContainer.AddChild(GetGcodeTerminalControl()); - printLevelingContainer = new DisableableWidget(); - printLevelingContainer.AddChild(GetAutoLevelControl()); - mainContainer.AddChild(printLevelingContainer); + printLevelingContainer = new DisableableWidget(); + if (!ActiveSliceSettings.Instance.HasHardwareLeveling()) + { + printLevelingContainer.AddChild(GetAutoLevelControl()); + + mainContainer.AddChild(printLevelingContainer); + } + mainContainer.AddChild(new HorizontalLine(separatorLineColor)); mainContainer.AddChild(eePromControlsContainer); mainContainer.AddChild(new HorizontalLine(separatorLineColor)); @@ -70,9 +75,10 @@ namespace MatterHackers.MatterControl.ConfigurationPage buttonRow.HAnchor = HAnchor.ParentLeftRight; buttonRow.Margin = new BorderDouble(0,4); - configureAutoLevelButton = textImageButtonFactory.Generate("Configure".Localize().ToUpper()); + Button configureAutoLevelButton = textImageButtonFactory.Generate("Configure".Localize().ToUpper()); configureAutoLevelButton.Margin = new BorderDouble(left: 6); configureAutoLevelButton.VAnchor = VAnchor.ParentCenter; + configureAutoLevelButton.Click += new EventHandler(configureAutoLevelButton_Click); TextWidget notificationSettingsLabel = new TextWidget("Automatic Print Leveling"); notificationSettingsLabel.AutoExpandBoundsToText = true; @@ -262,7 +268,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage private void AddHandlers() { - configureAutoLevelButton.Click += new EventHandler(configureAutoLevelButton_Click); configureEePromButton.Click += new EventHandler(configureEePromButton_Click); PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); PrinterConnectionAndCommunication.Instance.EnableChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); diff --git a/SlicerConfiguration/ActiveSliceSettings.cs b/SlicerConfiguration/ActiveSliceSettings.cs index f2d165975..87bb8886b 100644 --- a/SlicerConfiguration/ActiveSliceSettings.cs +++ b/SlicerConfiguration/ActiveSliceSettings.cs @@ -228,12 +228,17 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } - public bool HasFan() - { - return GetActiveValue("has_fan") == "1"; - } + public bool HasFan() + { + return GetActiveValue("has_fan") == "1"; + } - public bool HasSdCardReader() + public bool HasHardwareLeveling() + { + return GetActiveValue("has_hardware_leveling") == "1"; + } + + public bool HasSdCardReader() { return GetActiveValue("has_sd_card_reader") == "1"; } diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 5226bb459..7e124fe44 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -259,6 +259,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { "has_fan", "has_heated_bed", + "has_hardware_leveling", "has_sd_card_reader", "extruder_count", "extruders_share_temperature", diff --git a/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs b/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs index e8d50e52e..8eeb862ed 100644 --- a/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs +++ b/SlicerConfiguration/SlicerMapping/EngineMappingCura.cs @@ -96,12 +96,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration new NotPassedItem("", "bed_temperature"), new NotPassedItem("", "bed_shape"), -#if true new NotPassedItem("", "has_fan"), new NotPassedItem("", "has_heated_bed"), + new NotPassedItem("", "has_hardware_leveling"), new NotPassedItem("", "has_sd_card_reader"), new NotPassedItem("", "z_can_be_negative"), -#endif new ScaledSingleNumber("objectSink", "bottom_clip_amount", 1000), diff --git a/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs b/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs index 177e39bd7..7d8382cf2 100644 --- a/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs +++ b/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs @@ -204,12 +204,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration new MapRepairOutlines("repairOutlines", "repair_outlines_extensive_stitching"), new NotPassedItem("", "repair_outlines_keep_open"), -#if true new NotPassedItem("", "has_fan"), + new NotPassedItem("", "has_hardware_leveling"), new NotPassedItem("", "has_heated_bed"), new NotPassedItem("", "has_sd_card_reader"), new NotPassedItem("", "z_can_be_negative"), -#endif //retractionOnExtruderSwitch=14.5 new MapItem("retractionOnExtruderSwitch", "retract_length_tool_change"), diff --git a/SlicerConfiguration/SlicerMapping/EngineMappingSlic3r.cs b/SlicerConfiguration/SlicerMapping/EngineMappingSlic3r.cs index 4ce47d7ef..db84c1cfd 100644 --- a/SlicerConfiguration/SlicerMapping/EngineMappingSlic3r.cs +++ b/SlicerConfiguration/SlicerMapping/EngineMappingSlic3r.cs @@ -79,12 +79,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration hideItems.Add("wipe_shield_distance"); hideItems.Add("extruder_count"); -#if false - hideItems.Add("has_fan"); - hideItems.Add("has_heated_bed"); - hideItems.Add("has_sd_card_reader"); -#endif - } return instance; } diff --git a/StaticData/PrinterSettings/Lulzbot/Mini/config.ini b/StaticData/PrinterSettings/Lulzbot/Mini/config.ini index e7412a457..5f3d43063 100644 --- a/StaticData/PrinterSettings/Lulzbot/Mini/config.ini +++ b/StaticData/PrinterSettings/Lulzbot/Mini/config.ini @@ -49,6 +49,7 @@ gcode_comments = 0 gcode_flavor = reprap gcode_output_type = REPRAP has_fan = 1 +has_hardware_leveling = 1 has_heated_bed = 1 has_sd_card_reader = 0 infill_acceleration = 0 diff --git a/StaticData/PrinterSettings/Printrbot/Simple Metal/config.ini b/StaticData/PrinterSettings/Printrbot/Simple Metal/config.ini index 9f62d92d0..0a0337b4b 100644 --- a/StaticData/PrinterSettings/Printrbot/Simple Metal/config.ini +++ b/StaticData/PrinterSettings/Printrbot/Simple Metal/config.ini @@ -41,6 +41,7 @@ gap_fill_speed = 30 gcode_arcs = 0 gcode_comments = 0 gcode_flavor = reprap +has_hardware_leveling = 1 infill_acceleration = 0 infill_every_layers = 1 infill_extruder = 1 diff --git a/StaticData/PrinterSettings/RoBo 3D/R1/config.ini b/StaticData/PrinterSettings/RoBo 3D/R1/config.ini index 4fbbea940..d219d021d 100644 --- a/StaticData/PrinterSettings/RoBo 3D/R1/config.ini +++ b/StaticData/PrinterSettings/RoBo 3D/R1/config.ini @@ -49,6 +49,7 @@ gcode_comments = 0 gcode_flavor = reprap gcode_output_type = REPRAP has_sd_card_reader = 1 +has_hardware_leveling = 1 infill_acceleration = 0 infill_every_layers = 1 infill_extruder = 1 diff --git a/StaticData/PrinterSettings/config.ini b/StaticData/PrinterSettings/config.ini index 698905474..5f3a4bd65 100644 --- a/StaticData/PrinterSettings/config.ini +++ b/StaticData/PrinterSettings/config.ini @@ -49,6 +49,7 @@ gcode_comments = 0 gcode_flavor = reprap gcode_output_type = REPRAP has_fan = 1 +has_hardware_leveling = 0 has_heated_bed = 1 has_sd_card_reader = 0 infill_acceleration = 0 diff --git a/StaticData/SliceSettings/Layouts.txt b/StaticData/SliceSettings/Layouts.txt index 269159886..490796969 100644 --- a/StaticData/SliceSettings/Layouts.txt +++ b/StaticData/SliceSettings/Layouts.txt @@ -237,6 +237,7 @@ Advanced bed_shape Hardware has_fan + has_hardware_leveling has_heated_bed has_sd_card_reader extruder_count diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index 000b6364f..cb5093187 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -385,6 +385,13 @@ "DataEditType": "HARDWARE_PRESENT", "ExtraSettings": "bridge_fan_speed,disable_fan_first_layers,fan_always_on,fan_below_layer_time,max_fan_speed,min_fan_speed" }, + { + "SlicerConfigName": "has_hardware_leveling", + "PresentationName": "Has Hardware Leveling", + "HelpText": "Specify if your printer has the ability to do print leveling directly (support for G29).", + "DataEditType": "HARDWARE_PRESENT", + "ExtraSettings": "" + }, { "SlicerConfigName": "has_heated_bed", "PresentationName": "Has Heated Bed", diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 58f5e1d26..9ecb91e1f 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -3086,3 +3086,9 @@ Translated:Please wait. Sending files... English:File too big to load. Translated:File too big to load. +English:Specify if your printer has the ability to do print leveling directly (support for G29). +Translated:Specify if your printer has the ability to do print leveling directly (support for G29). + +English:Has Hardware Leveling +Translated:Has Hardware Leveling +