Added toggles for brim and skirt

This commit is contained in:
Tyler Anderson 2018-05-16 18:26:01 -07:00 committed by johnlewin
parent ab95a5ba07
commit 92c015ff18
4 changed files with 66 additions and 8 deletions

View file

@ -133,10 +133,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new AsCountOrDistance("bottom_solid_layers", "numberOfBottomLayers", SettingsKey.layer_height),
new AsCountOrDistance("perimeters", "numberOfPerimeters", SettingsKey.nozzle_diameter),
new AsCountOrDistance("raft_extra_distance_around_part", "raftExtraDistanceAroundPart", SettingsKey.nozzle_diameter),
new AsCountOrDistance("skirts", "numberOfSkirtLoops", SettingsKey.nozzle_diameter),
new AsCountOrDistance("support_material_interface_layers", "supportInterfaceLayers", SettingsKey.layer_height),
new AsCountOrDistance("top_solid_layers", "numberOfTopLayers", SettingsKey.layer_height),
new AsCountOrDistance("brims", "numberOfBrimLoops", SettingsKey.nozzle_diameter),
new AsPercentOfReferenceOrDirect(SettingsKey.external_perimeter_extrusion_width, "outsidePerimeterExtrusionWidth", SettingsKey.nozzle_diameter),
new OverrideSpeedOnSlaPrinters("external_perimeter_speed", "outsidePerimeterSpeed", "perimeter_speed"),
new AsPercentOfReferenceOrDirect(SettingsKey.first_layer_speed, "firstLayerSpeed", "infill_speed"),
@ -177,7 +175,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new MappedSetting("retract_length_tool_change", "retractionOnExtruderSwitch"),
new MappedSetting("retract_restart_extra_toolchange", "unretractExtraOnExtruderSwitch"),
new MappedToBoolString("reset_long_extrusion", "resetLongExtrusion"),
new MappedSetting("skirt_distance", "skirtDistanceFromObject"),
new MappedSetting("slowdown_below_layer_time", "minimumLayerTimeSeconds"),
new MappedSetting("support_air_gap", "supportAirGap"),
new MappedSetting("support_material_infill_angle", "supportInfillStartingAngle"),
@ -210,7 +207,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new MapLayerChangeGCode("layer_gcode", "layerChangeCode"),
new ScaledSingleNumber("fill_density", "infillPercent", 100),
new ScaledSingleNumber(SettingsKey.perimeter_start_end_overlap, "perimeterStartEndOverlapRatio", .01),
new SkirtLengthMapping("min_skirt_length", "skirtMinLength"),
new SupportExtrusionWidth("support_material_extrusion_width","supportExtrusionPercent"),
new ValuePlusConstant("raft_extruder", "raftExtruder", -1),
new ValuePlusConstant("support_material_extruder", "supportExtruder", -1),
@ -223,6 +219,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new VisibleButNotMappedToEngine(SettingsKey.laser_speed_100),
new VisibleButNotMappedToEngine("selector_ip_address"),
new VisibleButNotMappedToEngine("selector_ip_address"),
// Skirt settings
new VisibleButNotMappedToEngine("create_skirt"),
new MappedSkirtLoopsSetting("skirts", "numberOfSkirtLoops", SettingsKey.nozzle_diameter),
new MappedSetting("skirt_distance", "skirtDistanceFromObject"),
new SkirtLengthMapping("min_skirt_length", "skirtMinLength"),
// Brim settings
new VisibleButNotMappedToEngine("create_brim"),
new MappedBrimLoopsSetting("brims", "numberOfBrimLoops", SettingsKey.nozzle_diameter),
};
matterSliceSettingNames = new HashSet<string>(mappedSettings.Select(m => m.CanonicalSettingsName));

View file

@ -143,6 +143,40 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
public class MappedBrimLoopsSetting : AsCountOrDistance
{
public MappedBrimLoopsSetting(string canonicalSettingsName, string exportedName, string keyToUseAsDenominatorForCount)
: base(canonicalSettingsName, exportedName, keyToUseAsDenominatorForCount)
{
}
public override string Value {
get {
if (ActiveSliceSettings.Instance.GetValue<bool>("create_brim")) {
return base.Value;
}
return "0";
}
}
}
public class MappedSkirtLoopsSetting : AsCountOrDistance
{
public MappedSkirtLoopsSetting(string canonicalSettingsName, string exportedName, string keyToUseAsDenominatorForCount)
: base(canonicalSettingsName, exportedName, keyToUseAsDenominatorForCount)
{
}
public override string Value {
get {
if (ActiveSliceSettings.Instance.GetValue<bool>("create_skirt")) {
return base.Value;
}
return "0";
}
}
}
public class Slice3rBedShape : MappedSetting
{
public Slice3rBedShape(string canonicalSettingsName)

View file

@ -57,21 +57,21 @@ Advanced
slowdown_below_layer_time
min_print_speed
Adhesion
Adhesion
Enable
create_raft
Raft
Raft
create_raft
raft_extra_distance_around_part
raft_air_gap
raft_extruder
Skirt
Skirt
create_skirt
skirts
skirt_distance
min_skirt_length
Brim
Brim
create_brim
brims
Support
Support

View file

@ -1003,6 +1003,7 @@
"HelpText": "The minimum length of filament to use printing the skirt loops. Enough skirt loops will be drawn to use this amount of filament, overriding the value set in Loops if the value in Loops will produce a skirt shorter than this value.",
"DataEditType": "POSITIVE_DOUBLE",
"ShowIfSet": "!sla_printer",
"EnableIfSet": "create_skirt",
"Units": "mm",
"DefaultValue": "0"
},
@ -1280,6 +1281,7 @@
"HelpText": "The distance from the model at which the first skirt loop is drawn. Make this 0 to create an anchor for the part to the bed, also known as a brim.",
"DataEditType": "POSITIVE_DOUBLE",
"ShowIfSet": "!sla_printer",
"EnableIfSet": "create_skirt",
"Units": "mm",
"DefaultValue": "6"
},
@ -1297,6 +1299,7 @@
"HelpText": "The number of loops to draw around all the parts on the bed before starting on the parts. Used mostly to prime the nozzle so the flow is even when the actual print begins.",
"DataEditType": "INT_OR_MM",
"ShowIfSet": "!sla_printer",
"EnableIfSet": "create_skirt",
"Units": "count or mm",
"DefaultValue": "1"
},
@ -1305,6 +1308,7 @@
"PresentationName": "Distance or Loops",
"HelpText": "The number of loops to draw around parts. Used to provide additional bed adhesion",
"DataEditType": "INT_OR_MM",
"EnableIfSet": "create_brim",
"Units": "count or mm",
"DefaultValue": "0"
},
@ -1911,5 +1915,21 @@
"ListValues": "None,M73,M117",
"DefaultValue": "M117",
"RebuildGCodeOnChange": false
}
},
{
"SlicerConfigName": "create_brim",
"PresentationName": "Create Brim",
"HelpText": "Creates a brim attached to the base of the print. Useful to prevent warping when printing ABS (and other warping-prone plastics) as it helps parts adhere to the bed.",
"DataEditType": "CHECK_BOX",
"DefaultValue": "0",
"ReloadUiWhenChanged": true
},
{
"SlicerConfigName": "create_skirt",
"PresentationName": "Create Skirt",
"HelpText": "Creates an outline around the print, but not attached to it. This is useful for priming the nozzle to ensure the plastic is flowing when the print starts.",
"DataEditType": "CHECK_BOX",
"DefaultValue": "1",
"ReloadUiWhenChanged": true
},
]