Show bed_temperature for materials that are not setup for bed types

This commit is contained in:
LarsBrubaker 2022-03-27 08:32:07 -07:00
parent c6c494916a
commit 1b3bf975cf
4 changed files with 12 additions and 19 deletions

View file

@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project.
*/
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -1089,7 +1090,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
// Otherwise, set and save
persistenceLayer[settingsKey] = settingsValue;
this.OnSettingChanged(settingsKey);
// delay to make sure all settings changes have completed
UiThread.RunOnIdle(() => this.OnSettingChanged(settingsKey));
}
public string ToJson()

View file

@ -234,21 +234,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
get
{
var activeKey = ActiveBedTemperatureSetting;
var bedTemperature = printerSettings.GetValue<double>(activeKey);
// Check if the Active Material has settings for bed surfaces
// If the setting for this bed is 0
// and there are not settings (actual temperatures) for differnt beds, return the normal bed_temperature
if (!ActiveMaterialHasAnyBedTemperatures
&& bedTemperature == 0)
{
return printerSettings.GetValue<double>(SettingsKey.bed_temperature);
}
// looks like this is a legitimate setting, send it back
return bedTemperature;
return printerSettings.GetValue<double>(ActiveBedTemperatureSetting);
}
}
@ -256,7 +242,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
get
{
if (!printerSettings.GetValue<bool>(SettingsKey.has_swappable_bed))
if (!printerSettings.GetValue<bool>(SettingsKey.has_swappable_bed)
|| !ActiveMaterialHasAnyBedTemperatures)
{
return SettingsKey.bed_temperature;
}

View file

@ -131,7 +131,8 @@ namespace MatterHackers.MatterControl.ActionBar
{
graph.GoalValue = printer.Settings.Helpers.ActiveBedTemperature;
}
else if (stringEvent.Data == SettingsKey.bed_surface)
else if (stringEvent.Data == SettingsKey.bed_surface
|| stringEvent.Data == SettingsKey.active_material_key)
{
AddTemperatureControlForBedSurface();
graph.GoalValue = printer.Settings.Helpers.ActiveBedTemperature;

View file

@ -489,7 +489,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
printer.Settings.OnSettingChanged(updateList[i]);
}
ProfileManager.SaveOnSingleSettingChange = true;
printer.Settings.OnSettingChanged(updateList[updateList.Count-1]);
if (updateList.Count > 0)
{
printer.Settings.OnSettingChanged(updateList[updateList.Count - 1]);
}
// update the style of every setting
var sliceSettingsWidget = this.Parents<SliceSettingsWidget>().FirstOrDefault();