Put in regex read write translation code

This commit is contained in:
Lars Brubaker 2017-06-29 09:47:34 -07:00
parent 10223878f5
commit 9635b3308b
17 changed files with 173 additions and 34 deletions

View file

@ -46,6 +46,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.build_height,
SettingsKey.cancel_gcode,
SettingsKey.connect_gcode,
SettingsKey.write_regex,
SettingsKey.read_regex,
SettingsKey.has_fan,
SettingsKey.has_hardware_leveling,
SettingsKey.has_heated_bed,

View file

@ -104,8 +104,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new InfillTranslator("fill_density", "sparseInfillLineDistance"),
new MapStartGCode("start_gcode", "startCode", false),
new MapEndGCode("end_gcode", "endCode"),
new MapStartGCode(SettingsKey.start_gcode, "startCode", false),
new MapEndGCode(SettingsKey.end_gcode, "endCode"),
};
curaSettingNames = new HashSet<string>(curaSettings.Select(m => m.CanonicalSettingsName));

View file

@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new AsPercentOfReferenceOrDirect(SettingsKey.first_layer_height, "firstLayerThickness", SettingsKey.layer_height),
new ExtruderOffsets("extruder_offset", "extruderOffsets"),
new GCodeForSlicer("before_toolchange_gcode", "beforeToolchangeCode"),
new GCodeForSlicer("end_gcode", "endCode"),
new GCodeForSlicer(SettingsKey.end_gcode, "endCode"),
new GCodeForSlicer("toolchange_gcode", "toolChangeCode"),
new MapFirstValue("retract_before_travel", "minimumTravelToCauseRetraction"),
new MapFirstValue("retract_length", "retractionOnTravel"),
@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
new MappedToBoolString(SettingsKey.fill_thin_gaps, "fillThinGaps"),
new MappedToBoolString(SettingsKey.spiral_vase, "continuousSpiralOuterPerimeter"),
new MapPositionToPlaceObjectCenter(SettingsKey.print_center, "positionToPlaceObjectCenter"),
new MapStartGCode("start_gcode", "startCode", true),
new MapStartGCode(SettingsKey.start_gcode, "startCode", true),
new MapLayerChangeGCode("layer_gcode", "layerChangeCode"),
new ScaledSingleNumber("fill_density", "infillPercent", 100),
new ScaledSingleNumber(SettingsKey.perimeter_start_end_overlap, "perimeterStartEndOverlapRatio", .01),

View file

@ -268,7 +268,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public List<string> PreStartGCode(List<bool> extrudersUsed)
{
string startGCode = ActiveSliceSettings.Instance.GetValue("start_gcode");
string startGCode = ActiveSliceSettings.Instance.GetValue(SettingsKey.start_gcode);
string[] preStartGCodeLines = startGCode.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries);
List<string> preStartGCode = new List<string>();
@ -339,7 +339,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public List<string> PostStartGCode(List<bool> extrudersUsed)
{
string startGCode = ActiveSliceSettings.Instance.GetValue("start_gcode");
string startGCode = ActiveSliceSettings.Instance.GetValue(SettingsKey.start_gcode);
string[] postStartGCodeLines = startGCode.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries);
List<string> postStartGCode = new List<string>();