Make sure we clear z_offset_after_home on reset.

This commit is contained in:
Lars Brubaker 2016-10-18 15:58:38 -07:00
parent b9249c2c3f
commit b659a3ea50
2 changed files with 9 additions and 5 deletions

View file

@ -1848,12 +1848,15 @@ namespace MatterHackers.MatterControl.PrinterCommunication
ApplicationController.Instance.ReloadAdvancedControlsPanel();
}
// now send a G92 to set the position that we want to think is home
double zOffset = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.z_offset_after_home);
if (zOffset != 0)
if (ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.print_leveling_enabled))
{
double newHomePosition = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.printer_z_after_home) + zOffset;
SendLineToPrinterNow($"G92 Z{newHomePosition}");
// now send a G92 to set the position that we want to think is home
double zOffset = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.z_offset_after_home);
if (zOffset != 0)
{
double newHomePosition = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.printer_z_after_home) + zOffset;
SendLineToPrinterNow($"G92 Z{newHomePosition}");
}
}
}
}

View file

@ -538,6 +538,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
// Print leveling data has no SliceSettingsWidget editor but should be removed on 'Reset to Defaults'
keysToRetain.Remove(SettingsKey.print_leveling_data);
keysToRetain.Remove(SettingsKey.print_leveling_enabled);
keysToRetain.Remove(SettingsKey.z_offset_after_home);
// Iterate all items that have .ShowAsOverride = false and conditionally add to the retention list
foreach (var item in SliceSettingsOrganizer.Instance.SettingsData.Where(settingsItem => settingsItem.ShowAsOverride == false))