Merge branch 'master' into master
This commit is contained in:
commit
52db917937
10 changed files with 318 additions and 166 deletions
|
|
@ -55,6 +55,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
private TextWidget targetTemp;
|
||||
private TextWidget actualTemp;
|
||||
|
||||
private ProgressBar progressBar;
|
||||
|
||||
public ExtruderStatusWidget(int extruderIndex)
|
||||
{
|
||||
this.extruderIndex = extruderIndex;
|
||||
|
|
@ -68,32 +70,46 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
|
||||
this.AddChild(extruderName);
|
||||
|
||||
this.AddChild(new ImageWidget(StaticData.Instance.LoadIcon(Path.Combine("Screensaver", "extruder_temp.png")))
|
||||
progressBar = new ProgressBar(200, 6)
|
||||
{
|
||||
Margin = new BorderDouble(right: 8)
|
||||
});
|
||||
FillColor = ActiveTheme.Instance.PrimaryAccentColor,
|
||||
Margin = new BorderDouble(right: 10),
|
||||
BorderColor = ActiveTheme.Instance.PrimaryAccentColor.AdjustLightness(1.5).GetAsRGBA_Bytes(),
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
//BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor.AdjustLightness(2.4).GetAsRGBA_Bytes()
|
||||
|
||||
};
|
||||
this.AddChild(progressBar);
|
||||
|
||||
actualTemp = new TextWidget("", pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor)
|
||||
{
|
||||
AutoExpandBoundsToText = true,
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
Margin = new BorderDouble(right: 8)
|
||||
Margin = new BorderDouble(right: 0),
|
||||
Width = 60
|
||||
};
|
||||
this.AddChild(actualTemp);
|
||||
|
||||
this.AddChild(new VerticalLine()
|
||||
{
|
||||
BackgroundColor = new RGBA_Bytes(200, 200, 200, 30),
|
||||
BackgroundColor = new RGBA_Bytes(200, 200, 200),
|
||||
Margin = new BorderDouble(right: 8)
|
||||
});
|
||||
|
||||
targetTemp = new TextWidget("", pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor)
|
||||
{
|
||||
AutoExpandBoundsToText = true,
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
Margin = new BorderDouble(right: 8)
|
||||
Margin = new BorderDouble(right: 8),
|
||||
Width = 60
|
||||
};
|
||||
this.AddChild(targetTemp);
|
||||
|
||||
UiThread.RunOnIdle(UpdateTemperatures);
|
||||
}
|
||||
|
||||
public RGBA_Bytes BorderColor
|
||||
{
|
||||
get { return progressBar.BorderColor; }
|
||||
set { progressBar.BorderColor = value; }
|
||||
}
|
||||
|
||||
public void UpdateTemperatures()
|
||||
|
|
@ -101,6 +117,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
double targetValue = PrinterConnectionAndCommunication.Instance.GetTargetExtruderTemperature(extruderIndex);
|
||||
double actualValue = PrinterConnectionAndCommunication.Instance.GetActualExtruderTemperature(extruderIndex);
|
||||
|
||||
progressBar.RatioComplete = actualValue / targetValue;
|
||||
|
||||
this.actualTemp.Text = $"{actualValue:0.#}°";
|
||||
this.targetTemp.Text = $"{targetValue:0.#}°";
|
||||
}
|
||||
|
|
@ -595,7 +613,9 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
|
||||
int extruderCount = mockMode ? 3 : ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
|
||||
extruderStatusWidgets = Enumerable.Range(0, extruderCount).Select((i) => new ExtruderStatusWidget(i)).ToList();
|
||||
var borderColor = bodyContainer.BackgroundColor.AdjustLightness(1.5).GetAsRGBA_Bytes();
|
||||
|
||||
extruderStatusWidgets = Enumerable.Range(0, extruderCount).Select((i) => new ExtruderStatusWidget(i) { BorderColor = borderColor }).ToList();
|
||||
|
||||
if (extruderCount == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -892,6 +892,24 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return false;
|
||||
}
|
||||
|
||||
if (GetValue<double>(SettingsKey.external_perimeter_extrusion_width) > GetValue<double>(SettingsKey.nozzle_diameter) * 4)
|
||||
{
|
||||
string error = "'External Perimeter Extrusion Width' must be less than or equal to the 'Nozzle Diameter' * 4.".Localize();
|
||||
string details = string.Format("External Perimeter Extrusion Width = {0}\nNozzle Diameter = {1}".Localize(), GetValue(SettingsKey.external_perimeter_extrusion_width), GetValue<double>(SettingsKey.nozzle_diameter));
|
||||
string location = "Location: 'Settings & Controls' -> 'Settings' -> 'Filament' -> 'Extrusion' -> 'External Perimeter'".Localize();
|
||||
StyledMessageBox.ShowMessageBox(null, string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error".Localize());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetValue<double>(SettingsKey.external_perimeter_extrusion_width) <= 0)
|
||||
{
|
||||
string error = "'External Perimeter Extrusion Width' must be greater than 0.".Localize();
|
||||
string details = string.Format("External Perimeter Extrusion Width = {0}".Localize(), GetValue(SettingsKey.external_perimeter_extrusion_width));
|
||||
string location = "Location: 'Settings & Controls' -> 'Settings' -> 'Filament' -> 'Extrusion' -> 'External Perimeter'".Localize();
|
||||
StyledMessageBox.ShowMessageBox(null, string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error".Localize());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetValue<double>(SettingsKey.min_fan_speed) > 100)
|
||||
{
|
||||
string error = "The Minimum Fan Speed can only go as high as 100%.".Localize();
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public const string merge_overlapping_lines = nameof(merge_overlapping_lines);
|
||||
public const string extruder_count = nameof(extruder_count);
|
||||
public const string extruders_share_temperature = nameof(extruders_share_temperature);
|
||||
public const string external_perimeter_extrusion_width = nameof(external_perimeter_extrusion_width);
|
||||
public const string filament_cost = nameof(filament_cost);
|
||||
public const string filament_density = nameof(filament_density);
|
||||
public const string filament_diameter = nameof(filament_diameter);
|
||||
|
|
@ -418,7 +419,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
if (!string.IsNullOrWhiteSpace(saveParams.FileName))
|
||||
{
|
||||
GenerateConfigFile(saveParams.FileName, false);
|
||||
Slic3rEngineMappings.WriteSliceSettingsFile(saveParams.FileName);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -430,24 +431,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
});
|
||||
}
|
||||
|
||||
public void GenerateConfigFile(string fileName, bool replaceMacroValues)
|
||||
{
|
||||
using (var outstream = new StreamWriter(fileName))
|
||||
{
|
||||
// TODO: No longer valid to check for leading MatterControl. token
|
||||
foreach (var key in PrinterSettings.KnownSettings.Where(k => !k.StartsWith("MatterControl.")))
|
||||
{
|
||||
string activeValue = printerSettings.GetValue(key);
|
||||
if (replaceMacroValues)
|
||||
{
|
||||
activeValue = GCodeProcessing.ReplaceMacroValues(activeValue);
|
||||
}
|
||||
outstream.Write(string.Format("{0} = {1}\n", key, activeValue));
|
||||
activeValue = GCodeProcessing.ReplaceMacroValues(activeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ExportAsCuraConfig()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ of the authors and should not be interpreted as representing official policies,
|
|||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.VectorMath;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -42,12 +42,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
private HashSet<string> matterSliceSettingNames;
|
||||
|
||||
private MappedSetting[] matterSliceSettings;
|
||||
private MappedSetting[] mappedSettings;
|
||||
|
||||
// Singleton use only - prevent external construction
|
||||
private EngineMappingsMatterSlice() : base("MatterSlice")
|
||||
{
|
||||
matterSliceSettings = new MappedSetting[]
|
||||
mappedSettings = new MappedSetting[]
|
||||
{
|
||||
new AsCountOrDistance("bottom_solid_layers", "numberOfBottomLayers", SettingsKey.layer_height),
|
||||
new AsCountOrDistance("perimeters", "numberOfPerimeters", SettingsKey.nozzle_diameter),
|
||||
|
|
@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
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("external_perimeter_extrusion_width", "outsidePerimeterExtrusionWidth", SettingsKey.nozzle_diameter),
|
||||
new AsPercentOfReferenceOrDirect(SettingsKey.external_perimeter_extrusion_width, SettingsKey.external_perimeter_extrusion_width, SettingsKey.nozzle_diameter),
|
||||
new AsPercentOfReferenceOrDirect("external_perimeter_speed", "outsidePerimeterSpeed", "perimeter_speed"),
|
||||
new AsPercentOfReferenceOrDirect(SettingsKey.first_layer_speed, "firstLayerSpeed", "infill_speed"),
|
||||
new AsPercentOfReferenceOrDirect("raft_print_speed", "raftPrintSpeed", "infill_speed"),
|
||||
|
|
@ -137,20 +137,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
new VisibleButNotMappedToEngine("solid_shell"),
|
||||
};
|
||||
|
||||
matterSliceSettingNames = new HashSet<string>(matterSliceSettings.Select(m => m.CanonicalSettingsName));
|
||||
matterSliceSettingNames = new HashSet<string>(mappedSettings.Select(m => m.CanonicalSettingsName));
|
||||
}
|
||||
|
||||
public override bool MapContains(string canonicalSettingsName)
|
||||
{
|
||||
return matterSliceSettingNames.Contains(canonicalSettingsName)
|
||||
|| base.applicationLevelSettings.Contains(canonicalSettingsName);
|
||||
}
|
||||
|
||||
public static void WriteMatterSliceSettingsFile(string outputFilename)
|
||||
public static void WriteSliceSettingsFile(string outputFilename)
|
||||
{
|
||||
using (StreamWriter sliceSettingsFile = new StreamWriter(outputFilename))
|
||||
{
|
||||
foreach (MappedSetting mappedSetting in Instance.matterSliceSettings)
|
||||
foreach (MappedSetting mappedSetting in Instance.mappedSettings)
|
||||
{
|
||||
if (mappedSetting.Value != null)
|
||||
{
|
||||
|
|
@ -160,6 +154,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
public override bool MapContains(string canonicalSettingsName)
|
||||
{
|
||||
return matterSliceSettingNames.Contains(canonicalSettingsName)
|
||||
|| base.applicationLevelSettings.Contains(canonicalSettingsName);
|
||||
}
|
||||
|
||||
public class ExtruderOffsets : MappedSetting
|
||||
{
|
||||
public ExtruderOffsets(string canonicalSettingsName, string exportedName)
|
||||
|
|
@ -218,6 +218,81 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
public class GCodeForSlicer : InjectGCodeCommands
|
||||
{
|
||||
public GCodeForSlicer(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value => GCodeProcessing.ReplaceMacroValues(base.Value.Replace("\n", "\\n"));
|
||||
}
|
||||
|
||||
public class InfillTranslator : MappedSetting
|
||||
{
|
||||
public InfillTranslator(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double infillRatio0To1 = ParseDouble(base.Value);
|
||||
// 400 = solid (extruder width)
|
||||
double nozzle_diameter = ParseDoubleFromRawValue(SettingsKey.nozzle_diameter);
|
||||
double linespacing = 1000;
|
||||
if (infillRatio0To1 > .01)
|
||||
{
|
||||
linespacing = nozzle_diameter / infillRatio0To1;
|
||||
}
|
||||
|
||||
return ((int)(linespacing * 1000)).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MapPositionToPlaceObjectCenter : MappedSetting
|
||||
{
|
||||
public MapPositionToPlaceObjectCenter(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector2 PrinteCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
|
||||
return "[{0},{1}]".FormatWith(PrinteCenter.x, PrinteCenter.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SkirtLengthMapping : MappedSetting
|
||||
{
|
||||
public SkirtLengthMapping(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double lengthToExtrudeMm = ParseDouble(base.Value);
|
||||
// we need to convert mm of filament to mm of extrusion path
|
||||
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.filament_diameter) * MathHelper.Tau * lengthToExtrudeMm;
|
||||
double extrusionSquareSize = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.first_layer_height) * ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.nozzle_diameter);
|
||||
double lineLength = amountOfFilamentCubicMms / extrusionSquareSize;
|
||||
|
||||
return lineLength.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SupportExtrusionWidth : MappedSetting
|
||||
{
|
||||
public SupportExtrusionWidth(string canonicalSettingsName, string exportedName)
|
||||
|
|
@ -267,80 +342,5 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public override string Value => (ParseDouble(base.Value) + constant).ToString();
|
||||
}
|
||||
|
||||
public class InfillTranslator : MappedSetting
|
||||
{
|
||||
public InfillTranslator(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double infillRatio0To1 = ParseDouble(base.Value);
|
||||
// 400 = solid (extruder width)
|
||||
double nozzle_diameter = ParseDoubleFromRawValue(SettingsKey.nozzle_diameter);
|
||||
double linespacing = 1000;
|
||||
if (infillRatio0To1 > .01)
|
||||
{
|
||||
linespacing = nozzle_diameter / infillRatio0To1;
|
||||
}
|
||||
|
||||
return ((int)(linespacing * 1000)).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GCodeForSlicer : InjectGCodeCommands
|
||||
{
|
||||
public GCodeForSlicer(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value => GCodeProcessing.ReplaceMacroValues(base.Value.Replace("\n", "\\n"));
|
||||
}
|
||||
|
||||
public class MapPositionToPlaceObjectCenter : MappedSetting
|
||||
{
|
||||
public MapPositionToPlaceObjectCenter(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector2 PrinteCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
|
||||
return "[{0},{1}]".FormatWith(PrinteCenter.x, PrinteCenter.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SkirtLengthMapping : MappedSetting
|
||||
{
|
||||
public SkirtLengthMapping(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double lengthToExtrudeMm = ParseDouble(base.Value);
|
||||
// we need to convert mm of filament to mm of extrusion path
|
||||
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.filament_diameter) * MathHelper.Tau * lengthToExtrudeMm;
|
||||
double extrusionSquareSize = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.first_layer_height) * ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.nozzle_diameter);
|
||||
double lineLength = amountOfFilamentCubicMms / extrusionSquareSize;
|
||||
|
||||
return lineLength.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,61 +28,100 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MatterHackers.Agg;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
public class Slic3rEngineMappings : SliceEngineMapping
|
||||
{
|
||||
public static readonly Slic3rEngineMappings Instance = new Slic3rEngineMappings();
|
||||
|
||||
private List<string> hiddenSettings = null;
|
||||
private List<MappedSetting> mappedSettings = new List<MappedSetting>();
|
||||
private HashSet<string> slic3rSliceSettingNames;
|
||||
|
||||
// Singleton use only - prevent external construction
|
||||
private Slic3rEngineMappings() : base ("Slic3r")
|
||||
private Slic3rEngineMappings() : base("Slic3r")
|
||||
{
|
||||
hiddenSettings = new List<string>();
|
||||
hiddenSettings.Add("cool_extruder_lift");
|
||||
hiddenSettings.Add("support_material_create_internal_support");
|
||||
hiddenSettings.Add("support_material_create_perimeter");
|
||||
hiddenSettings.Add("min_extrusion_before_retract");
|
||||
hiddenSettings.Add("support_material_xy_distance");
|
||||
hiddenSettings.Add("support_material_z_distance");
|
||||
hiddenSettings.Add(SettingsKey.center_part_on_bed);
|
||||
hiddenSettings.Add(SettingsKey.expand_thin_walls);
|
||||
hiddenSettings.Add(SettingsKey.merge_overlapping_lines);
|
||||
hiddenSettings.Add(SettingsKey.fill_thin_gaps);
|
||||
hiddenSettings.Add("infill_overlap_perimeter");
|
||||
hiddenSettings.Add("support_type");
|
||||
hiddenSettings.Add("infill_type");
|
||||
hiddenSettings.Add("create_raft");
|
||||
hiddenSettings.Add("z_gap");
|
||||
hiddenSettings.Add(SettingsKey.bottom_clip_amount);
|
||||
hiddenSettings.Add("gcode_output_type");
|
||||
hiddenSettings.Add("raft_extra_distance_around_part");
|
||||
hiddenSettings.Add("output_only_first_layer");
|
||||
hiddenSettings.Add("raft_air_gap");
|
||||
hiddenSettings.Add("support_air_gap");
|
||||
hiddenSettings.Add("repair_outlines_extensive_stitching");
|
||||
hiddenSettings.Add("repair_outlines_keep_open");
|
||||
hiddenSettings.Add("complete_objects");
|
||||
hiddenSettings.Add("output_filename_format");
|
||||
hiddenSettings.Add("support_material_percent");
|
||||
hiddenSettings.Add("post_process");
|
||||
hiddenSettings.Add("extruder_clearance_height");
|
||||
hiddenSettings.Add("extruder_clearance_radius");
|
||||
hiddenSettings.Add("wipe_shield_distance");
|
||||
hiddenSettings.Add(SettingsKey.heat_extruder_before_homing);
|
||||
hiddenSettings.Add("extruders_share_temperature");
|
||||
hiddenSettings.Add("print_leveling_method");
|
||||
hiddenSettings.Add("solid_shell");
|
||||
hiddenSettings.Add("retractWhenChangingIslands");
|
||||
hiddenSettings.Add(SettingsKey.perimeter_start_end_overlap);
|
||||
foreach (var key in PrinterSettings.KnownSettings.Where(k => !k.StartsWith("MatterControl.")))
|
||||
{
|
||||
mappedSettings.Add(new MappedSetting(key, key));
|
||||
}
|
||||
|
||||
string[] hiddenSettings =
|
||||
{
|
||||
"cool_extruder_lift",
|
||||
"support_material_create_internal_support",
|
||||
"support_material_create_perimeter",
|
||||
"min_extrusion_before_retract",
|
||||
"support_material_xy_distance",
|
||||
"support_material_z_distance",
|
||||
SettingsKey.print_center,
|
||||
SettingsKey.expand_thin_walls,
|
||||
SettingsKey.merge_overlapping_lines,
|
||||
SettingsKey.fill_thin_gaps,
|
||||
"infill_overlap_perimeter",
|
||||
"support_type",
|
||||
"infill_type",
|
||||
"create_raft",
|
||||
"z_gap",
|
||||
SettingsKey.bottom_clip_amount,
|
||||
"gcode_output_type",
|
||||
"raft_extra_distance_around_part",
|
||||
"output_only_first_layer",
|
||||
"raft_air_gap",
|
||||
"support_air_gap",
|
||||
"repair_outlines_extensive_stitching",
|
||||
"repair_outlines_keep_open",
|
||||
"complete_objects",
|
||||
"output_filename_format",
|
||||
"support_material_percent",
|
||||
"post_process",
|
||||
"extruder_clearance_height",
|
||||
"extruder_clearance_radius",
|
||||
"wipe_shield_distance",
|
||||
SettingsKey.heat_extruder_before_homing,
|
||||
"extruders_share_temperature",
|
||||
"print_leveling_method",
|
||||
"solid_shell",
|
||||
"retractWhenChangingIslands",
|
||||
SettingsKey.perimeter_start_end_overlap,
|
||||
SettingsKey.bed_shape,
|
||||
};
|
||||
|
||||
foreach(string key in hiddenSettings)
|
||||
{
|
||||
for (int i = mappedSettings.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (mappedSettings[i].CanonicalSettingsName == key)
|
||||
{
|
||||
mappedSettings.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mappedSettings.Add(new Slice3rBedShape(SettingsKey.bed_shape));
|
||||
slic3rSliceSettingNames = new HashSet<string>(mappedSettings.Select(m => m.CanonicalSettingsName));
|
||||
}
|
||||
|
||||
public override bool MapContains(string key)
|
||||
public static void WriteSliceSettingsFile(string outputFilename)
|
||||
{
|
||||
// Visible items are anything not in hiddenSettings or that does not start with 'MatterControl.'
|
||||
return !hiddenSettings.Contains(key);
|
||||
using (StreamWriter sliceSettingsFile = new StreamWriter(outputFilename))
|
||||
{
|
||||
foreach (MappedSetting mappedSetting in Instance.mappedSettings)
|
||||
{
|
||||
if (mappedSetting.Value != null)
|
||||
{
|
||||
sliceSettingsFile.WriteLine("{0} = {1}".FormatWith(mappedSetting.ExportedName, mappedSetting.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool MapContains(string canonicalSettingsName)
|
||||
{
|
||||
return slic3rSliceSettingNames.Contains(canonicalSettingsName)
|
||||
|| base.applicationLevelSettings.Contains(canonicalSettingsName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,8 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -115,6 +117,57 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public virtual string Value => ActiveSliceSettings.Instance.GetValue(CanonicalSettingsName);
|
||||
}
|
||||
|
||||
public class Slice3rBedShape : MappedSetting
|
||||
{
|
||||
public Slice3rBedShape(string canonicalSettingsName)
|
||||
: base(canonicalSettingsName, canonicalSettingsName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector2 printCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
Vector2 bedSize = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size);
|
||||
switch (ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape))
|
||||
{
|
||||
case BedShape.Circular:
|
||||
{
|
||||
int numPoints = 10;
|
||||
double angle = MathHelper.Tau / numPoints;
|
||||
string bedString = "";
|
||||
bool first = true;
|
||||
for (int i = 0; i < numPoints; i++)
|
||||
{
|
||||
if(!first)
|
||||
{
|
||||
bedString += ",";
|
||||
}
|
||||
double x = Math.Cos(angle*i);
|
||||
double y = Math.Sin(angle*i);
|
||||
bedString += $"{printCenter.x + x * bedSize.x / 2:0.####}x{printCenter.y + y * bedSize.y / 2:0.####}";
|
||||
first = false;
|
||||
}
|
||||
return bedString;
|
||||
}
|
||||
//bed_shape = 99.4522x10.4528,97.8148x20.7912,95.1057x30.9017,91.3545x40.6737,86.6025x50,80.9017x58.7785,74.3145x66.9131,66.9131x74.3145,58.7785x80.9017,50x86.6025,40.6737x91.3545,30.9017x95.1057,20.7912x97.8148,10.4528x99.4522,0x100,-10.4528x99.4522,-20.7912x97.8148,-30.9017x95.1057,-40.6737x91.3545,-50x86.6025,-58.7785x80.9017,-66.9131x74.3145,-74.3145x66.9131,-80.9017x58.7785,-86.6025x50,-91.3545x40.6737,-95.1057x30.9017,-97.8148x20.7912,-99.4522x10.4528,-100x0,-99.4522x - 10.4528,-97.8148x - 20.7912,-95.1057x - 30.9017,-91.3545x - 40.6737,-86.6025x - 50,-80.9017x - 58.7785,-74.3145x - 66.9131,-66.9131x - 74.3145,-58.7785x - 80.9017,-50x - 86.6025,-40.6737x - 91.3545,-30.9017x - 95.1057,-20.7912x - 97.8148,-10.4528x - 99.4522,0x - 100,10.4528x - 99.4522,20.7912x - 97.8148,30.9017x - 95.1057,40.6737x - 91.3545,50x - 86.6025,58.7785x - 80.9017,66.9131x - 74.3145,74.3145x - 66.9131,80.9017x - 58.7785,86.6025x - 50,91.3545x - 40.6737,95.1057x - 30.9017,97.8148x - 20.7912,99.4522x - 10.4528,100x0
|
||||
|
||||
case BedShape.Rectangular:
|
||||
default:
|
||||
{
|
||||
//bed_shape = 0x0,200x0,200x200,0x200
|
||||
string bedString = $"{printCenter.x - bedSize.x / 2}x{printCenter.y - bedSize.y / 2}";
|
||||
bedString += $",{printCenter.x + bedSize.x / 2}x{printCenter.y - bedSize.y / 2}";
|
||||
bedString += $",{printCenter.x + bedSize.x / 2}x{printCenter.y + bedSize.y / 2}";
|
||||
bedString += $",{printCenter.x - bedSize.x / 2}x{printCenter.y + bedSize.y / 2}";
|
||||
return bedString;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MapFirstValue : MappedSetting
|
||||
{
|
||||
public MapFirstValue(string canonicalSettingsName, string exportedName)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -323,7 +325,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return extruder1StlFileToSlice;
|
||||
}
|
||||
|
||||
public static bool runInProcess = false;
|
||||
public static bool runInProcess = true;
|
||||
private static Process slicerProcess = null;
|
||||
|
||||
private static void CreateSlicedPartsThread()
|
||||
|
|
@ -346,7 +348,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
itemToSlice.CurrentlySlicing = true;
|
||||
|
||||
string currentConfigurationFileAndPath = Path.Combine(ApplicationDataStorage.Instance.GCodeOutputPath, "config_" + ActiveSliceSettings.Instance.GetLongHashCode().ToString() + ".ini");
|
||||
ActiveSliceSettings.Instance.Helpers.GenerateConfigFile(currentConfigurationFileAndPath, true);
|
||||
|
||||
string gcodePathAndFileName = itemToSlice.GetGCodePathAndFileName();
|
||||
bool gcodeFileIsComplete = itemToSlice.IsGCodeFileComplete(gcodePathAndFileName);
|
||||
|
|
@ -358,7 +359,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
switch (ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType())
|
||||
{
|
||||
case SlicingEngineTypes.Slic3r:
|
||||
commandArgs = "--load \"" + currentConfigurationFileAndPath + "\" --output \"" + gcodePathAndFileName + "\" \"" + fileToSlice + "\"";
|
||||
Slic3rEngineMappings.WriteSliceSettingsFile(currentConfigurationFileAndPath);
|
||||
// if we have centering turend on and are printing a model loaded up from meshes (not gcode)
|
||||
if(ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.center_part_on_bed))
|
||||
{
|
||||
// figure out the center position of this file
|
||||
Vector2 bedCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
commandArgs = $"--print-center {bedCenter.x:0.##},{bedCenter.y:0.##} " + "--load \"" + currentConfigurationFileAndPath + "\" --output \"" + gcodePathAndFileName + "\" \"" + fileToSlice + "\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
commandArgs = "--load \"" + currentConfigurationFileAndPath + "\" --output \"" + gcodePathAndFileName + "\" \"" + fileToSlice + "\"";
|
||||
}
|
||||
break;
|
||||
|
||||
case SlicingEngineTypes.CuraEngine:
|
||||
|
|
@ -367,7 +379,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
case SlicingEngineTypes.MatterSlice:
|
||||
{
|
||||
EngineMappingsMatterSlice.WriteMatterSliceSettingsFile(currentConfigurationFileAndPath);
|
||||
EngineMappingsMatterSlice.WriteSliceSettingsFile(currentConfigurationFileAndPath);
|
||||
if (mergeRules == "")
|
||||
{
|
||||
commandArgs = "-v -o \"" + gcodePathAndFileName + "\" -c \"" + currentConfigurationFileAndPath + "\"";
|
||||
|
|
|
|||
|
|
@ -5848,3 +5848,30 @@ Translated:Clear ZOffset
|
|||
English:Printing Window...
|
||||
Translated:Printing Window...
|
||||
|
||||
English:Only Retract When Crossing Perimeters
|
||||
Translated:Only Retract When Crossing Perimeters
|
||||
|
||||
English:baby_step_z_offset
|
||||
Translated:baby_step_z_offset
|
||||
|
||||
English:gcode_arcs
|
||||
Translated:gcode_arcs
|
||||
|
||||
English:calibration_files
|
||||
Translated:calibration_files
|
||||
|
||||
English:'External Perimeter Extrusion Width' must be less than or equal to the 'Nozzle Diameter' * 4.
|
||||
Translated:'External Perimeter Extrusion Width' must be less than or equal to the 'Nozzle Diameter' * 4.
|
||||
|
||||
English:External Perimeter Extrusion Width = {0}\nNozzle Diameter = {1}
|
||||
Translated:External Perimeter Extrusion Width = {0}\nNozzle Diameter = {1}
|
||||
|
||||
English:Location: 'Settings & Controls' -> 'Settings' -> 'Filament' -> 'Extrusion' -> 'External Perimeter'
|
||||
Translated:Location: 'Settings & Controls' -> 'Settings' -> 'Filament' -> 'Extrusion' -> 'External Perimeter'
|
||||
|
||||
English:'External Perimeter Extrusion Width' must be greater than 0.
|
||||
Translated:'External Perimeter Extrusion Width' must be greater than 0.
|
||||
|
||||
English:External Perimeter Extrusion Width = {0}
|
||||
Translated:External Perimeter Extrusion Width = {0}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 87a13e46cfa54f10838947fde28c7268ed80ded9
|
||||
Subproject commit 4f7fce255f7ab6d5b64411243284e9ba2cceea47
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 664c38a385f297571c6646bf57d27b724c10b427
|
||||
Subproject commit 7b17867d17aba65963fb492a8f97b266fba7dffa
|
||||
Loading…
Add table
Add a link
Reference in a new issue