Remove duplicate code
This commit is contained in:
parent
e60e77eba7
commit
c881624aac
1 changed files with 9 additions and 20 deletions
|
|
@ -289,30 +289,19 @@ namespace MatterHackers.MatterControl
|
|||
footerRow.AddChild(cancelButton);
|
||||
}
|
||||
|
||||
public void ExportGcodeCommandLineUtility(String nameOfFile)
|
||||
public void ExportGcodeCommandLineUtility(string gcodePathAndFilenameToSave)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(nameOfFile))
|
||||
string sourceExtension = Path.GetExtension(printItemWrapper.FileLocation).ToUpper();
|
||||
if (MeshFileIo.ValidFileExtensions().Contains(sourceExtension))
|
||||
{
|
||||
gcodePathAndFilenameToSave = nameOfFile;
|
||||
string extension = Path.GetExtension(gcodePathAndFilenameToSave);
|
||||
if (extension == "")
|
||||
{
|
||||
File.Delete(gcodePathAndFilenameToSave);
|
||||
gcodePathAndFilenameToSave += ".gcode";
|
||||
}
|
||||
|
||||
string sourceExtension = Path.GetExtension(printItemWrapper.FileLocation).ToUpper();
|
||||
if (MeshFileIo.ValidFileExtensions().Contains(sourceExtension))
|
||||
{
|
||||
SlicingQueue.Instance.QueuePartForSlicing(printItemWrapper);
|
||||
printItemWrapper.SlicingDone += sliceItem_Done;
|
||||
}
|
||||
else if (partIsGCode)
|
||||
{
|
||||
SaveGCodeToNewLocation(printItemWrapper.FileLocation, gcodePathAndFilenameToSave);
|
||||
}
|
||||
SlicingQueue.Instance.QueuePartForSlicing(printItemWrapper);
|
||||
printItemWrapper.SlicingDone += sliceItem_Done;
|
||||
}
|
||||
else if (partIsGCode)
|
||||
{
|
||||
SaveGCodeToNewLocation(printItemWrapper.FileLocation, gcodePathAndFilenameToSave);
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue