Add overload for with GCodeFileStream param

This commit is contained in:
John Lewin 2018-07-19 15:29:16 -07:00
parent 402ce9fc24
commit dfa455040b

View file

@ -208,19 +208,10 @@ namespace MatterHackers.MatterControl.Library.Export
public bool ApplyLeveling { get; set; } = true;
private void ApplyStreamPipelineAndExport(string gcodeFilename, string outputPath)
private void ApplyStreamPipelineAndExport(GCodeFileStream gCodeFileStream, string outputPath)
{
try
{
var gCodeFileStream = new GCodeFileStream(
GCodeFile.Load(
gcodeFilename,
new Vector4(),
new Vector4(),
new Vector4(),
Vector4.One,
CancellationToken.None));
bool addLevelingStream = printer.Settings.GetValue<bool>(SettingsKey.print_leveling_enabled) && this.ApplyLeveling;
var queueStream = new QueuedCommandsStream(gCodeFileStream);
@ -252,5 +243,29 @@ namespace MatterHackers.MatterControl.Library.Export
});
}
}
private void ApplyStreamPipelineAndExport(string gcodeFilename, string outputPath)
{
try
{
this.ApplyStreamPipelineAndExport(
new GCodeFileStream(
GCodeFile.Load(
gcodeFilename,
new Vector4(),
new Vector4(),
new Vector4(),
Vector4.One,
CancellationToken.None)),
outputPath);
}
catch (Exception e)
{
UiThread.RunOnIdle(() =>
{
StyledMessageBox.ShowMessageBox(e.Message, "Couldn't load file".Localize());
});
}
}
}
}