From d3c8c3ad4583f1ecfe1c3374d0812475a8ca4f34 Mon Sep 17 00:00:00 2001 From: Kevin Pope Date: Sat, 1 Mar 2014 16:33:41 -0800 Subject: [PATCH] PrintitemWrapper now handles empty path. --- PrintQueue/PrintItemWrapper.cs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/PrintQueue/PrintItemWrapper.cs b/PrintQueue/PrintItemWrapper.cs index 1e6b69313..78b122ed2 100644 --- a/PrintQueue/PrintItemWrapper.cs +++ b/PrintQueue/PrintItemWrapper.cs @@ -189,16 +189,24 @@ namespace MatterHackers.MatterControl.PrintQueue public string GetGCodePathAndFileName() { - if (Path.GetExtension(FileLocation).ToUpper() == ".GCODE") + if (FileLocation.Trim() != "") { - return FileLocation; + + if (Path.GetExtension(FileLocation).ToUpper() == ".GCODE") + { + return FileLocation; + } + + string engineString = ((int)ActivePrinterProfile.Instance.ActiveSliceEngineType).ToString(); + + string gcodeFileName = this.StlFileHashCode.ToString() + "_" + engineString + "_" + ActiveSliceSettings.Instance.GetHashCode().ToString(); + string gcodePathAndFileName = Path.Combine(DataStorage.ApplicationDataStorage.Instance.GCodeOutputPath, gcodeFileName + ".gcode"); + return gcodePathAndFileName; + } + else + { + return null; } - - string engineString = ((int)ActivePrinterProfile.Instance.ActiveSliceEngineType).ToString(); - - string gcodeFileName = this.StlFileHashCode.ToString() + "_" + engineString + "_" + ActiveSliceSettings.Instance.GetHashCode().ToString(); - string gcodePathAndFileName = Path.Combine(DataStorage.ApplicationDataStorage.Instance.GCodeOutputPath, gcodeFileName + ".gcode"); - return gcodePathAndFileName; }