Making it possible to set a bed surface and have settings for bed temperature / material

This commit is contained in:
Lars Brubaker 2022-01-17 11:33:22 -08:00
parent 2266428005
commit fa86c58a7c
18 changed files with 429 additions and 43 deletions

View file

@ -100,6 +100,15 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.bed_shape,
SettingsKey.bed_size,
SettingsKey.bed_temperature,
SettingsKey.bed_temperature_blue_tape,
SettingsKey.bed_temperature_buildtak,
SettingsKey.bed_temperature_garolite,
SettingsKey.bed_temperature_glass,
SettingsKey.bed_temperature_kapton,
SettingsKey.bed_temperature_pei,
SettingsKey.bed_temperature_pp,
SettingsKey.has_swappable_bed,
SettingsKey.bed_surface,
SettingsKey.before_toolchange_gcode,
SettingsKey.before_toolchange_gcode_1,
SettingsKey.before_toolchange_gcode_2,
@ -1030,7 +1039,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
if (setting == SettingsKey.first_layer_bed_temperature
&& !this.Slicer.Exports.ContainsKey(SettingsKey.first_layer_bed_temperature))
{
value = $"{this.GetValue<double>(SettingsKey.bed_temperature)}";
value = $"{this.Helpers.ActiveBedTemperature}";
}
// braces then brackets replacement
@ -1348,9 +1357,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
string value = this.GetValue(settingsKey);
if (SettingsData.TryGetValue(settingsKey, out SliceSettingData settingsData)
&& settingsData.Converter is ValueConverter resolver)
&& settingsData.Converter != null)
{
return resolver.Convert(value, this);
return settingsData.Converter.Convert(value, this);
}
return value;

View file

@ -204,8 +204,62 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
public double ActiveBedTemperature
{
get
{
var temp = printerSettings.GetValue<double>(ActiveBedTemperatureSetting);
// check if it might be trying to use the default
if (temp == 0)
{
// it is either the default (actual bed_temperature) or a 0. This will get the true temp requested
return printerSettings.GetValue<double>(SettingsKey.bed_temperature);
}
public void DoPrintLeveling(bool doLeveling)
// fonud a good temp return it
return temp;
}
}
public string ActiveBedTemperatureSetting
{
get
{
if (!printerSettings.GetValue<bool>(SettingsKey.has_swappable_bed))
{
return SettingsKey.bed_temperature;
}
switch(printerSettings.GetValue(SettingsKey.bed_surface))
{
case "Blue Tape":
return SettingsKey.bed_temperature_blue_tape;
case "BuildTak":
return SettingsKey.bed_temperature_buildtak;
case "Garolite":
return SettingsKey.bed_temperature_garolite;
case "Glass":
return SettingsKey.bed_temperature_glass;
case "Kapton":
return SettingsKey.bed_temperature_kapton;
case "PEI":
return SettingsKey.bed_temperature_pei;
case "Polypropylene":
return SettingsKey.bed_temperature_pp;
default:
return SettingsKey.bed_temperature;
}
}
}
public void DoPrintLeveling(bool doLeveling)
{
// Early exit if already set
if (doLeveling == printerSettings.GetValue<bool>(SettingsKey.print_leveling_enabled))

View file

@ -46,6 +46,15 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public const string bed_shape = nameof(bed_shape);
public const string bed_size = nameof(bed_size);
public const string bed_temperature = nameof(bed_temperature);
public const string bed_temperature_blue_tape = nameof(bed_temperature_blue_tape);
public const string bed_temperature_buildtak = nameof(bed_temperature_buildtak);
public const string bed_temperature_garolite = nameof(bed_temperature_garolite);
public const string bed_temperature_glass = nameof(bed_temperature_glass);
public const string bed_temperature_kapton = nameof(bed_temperature_kapton);
public const string bed_temperature_pei = nameof(bed_temperature_pei);
public const string bed_temperature_pp = nameof(bed_temperature_pp);
public const string has_swappable_bed = nameof(has_swappable_bed);
public const string bed_surface = nameof(bed_surface);
public const string before_toolchange_gcode = nameof(before_toolchange_gcode);
public const string before_toolchange_gcode_1 = nameof(before_toolchange_gcode_1);
public const string before_toolchange_gcode_2 = nameof(before_toolchange_gcode_2);

View file

@ -136,6 +136,97 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
DefaultValue = "70"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_blue_tape,
PresentationName = "Blue Tape Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is coverd with blue tape. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_buildtak,
PresentationName = "BuildTak Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is using BuildTak. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_garolite,
PresentationName = "Garolite Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is using garolite. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_glass,
PresentationName = "Glass Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is using glass. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_kapton,
PresentationName = "Kapton Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is coverd in kapton tape. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_pei,
PresentationName = "PEI Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is using PEI. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_temperature_pp,
PresentationName = "Polypropylene Bed Temperature".Localize(),
HelpText = "The temperature to print when the bed is polypropylene. Set to 0 to use default.".Localize(),
DataEditType = DataEditTypes.POSITIVE_DOUBLE,
Units = "°C".Localize(),
ShowIfSet = "has_heated_bed&has_swappable_bed",
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.has_swappable_bed,
PresentationName = "Has Swappable Bed".Localize(),
HelpText = "This should be checked if the printer supports multiple bed surfaces and the bed temperature for the different surfaces needs to vary.".Localize(),
DataEditType = DataEditTypes.CHECK_BOX,
RequiredDisplayDetail = DisplayDetailRequired.Advanced,
ShowIfSet = "has_heated_bed",
UiUpdate = UiUpdateRequired.Application,
DefaultValue = "0"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.bed_surface,
PresentationName = "Bed Surface".Localize(),
HelpText = "The current bed surfaces that the printer is using. This is used to set the correct bed temperature for a given material.".Localize(),
DataEditType = DataEditTypes.LIST,
ShowIfSet = "has_heated_bed&has_swappable_bed",
ListValues = "Default,Blue Tape,BuildTak,Garolite,Glass,Kapton,PEI,Polypropylene",
DefaultValue = "Default"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.first_layer_bed_temperature,
PresentationName = "First Layer Bed Temperature".Localize(),

View file

@ -137,6 +137,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}),
("Adhesion", new[]
{
("Bed", new []
{
SettingsKey.bed_surface,
}),
("Skirt", new[]
{
SettingsKey.create_skirt,
@ -209,6 +213,13 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.temperature2,
SettingsKey.temperature3,
SettingsKey.bed_temperature,
SettingsKey.bed_temperature_blue_tape,
SettingsKey.bed_temperature_buildtak,
SettingsKey.bed_temperature_garolite,
SettingsKey.bed_temperature_glass,
SettingsKey.bed_temperature_kapton,
SettingsKey.bed_temperature_pei,
SettingsKey.bed_temperature_pp,
SettingsKey.inactive_cool_down,
SettingsKey.seconds_to_reheat,
}),
@ -350,6 +361,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.has_fan_per_extruder,
SettingsKey.has_hardware_leveling,
SettingsKey.has_heated_bed,
SettingsKey.has_swappable_bed,
SettingsKey.has_sd_card_reader,
SettingsKey.has_power_control,
SettingsKey.filament_runout_sensor,