diff --git a/CustomWidgets/ExportQueueItemWindow.cs b/CustomWidgets/ExportQueueItemWindow.cs index 45dd8592d..3966c88a2 100644 --- a/CustomWidgets/ExportQueueItemWindow.cs +++ b/CustomWidgets/ExportQueueItemWindow.cs @@ -210,7 +210,7 @@ namespace MatterHackers.MatterControl if (streamToSaveTo != null) { streamToSaveTo.Close (); - Close (); + Close(); } // windows vista +: filePathToSave 'test.stl' // windows xp: filePathToSave 'test' diff --git a/MatterControl.csproj b/MatterControl.csproj index 4a945a51b..a6f5a2763 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -192,6 +192,7 @@ + False .\ICSharpCode.SharpZipLib.dll diff --git a/PrintQueue/PartsSheet.cs b/PrintQueue/PartsSheet.cs index ecc5ea31f..7f3371410 100644 --- a/PrintQueue/PartsSheet.cs +++ b/PrintQueue/PartsSheet.cs @@ -231,6 +231,7 @@ namespace MatterHackers.MatterControl document.Info.Subject = "This is a list of the parts that are in a queue from MatterControl."; document.Info.Keywords = "MatterControl, STL, 3D Printing"; + int nextPartToPrintIndex = 0; int plateNumber = 1; bool done = false; @@ -241,11 +242,14 @@ namespace MatterHackers.MatterControl } try { + // save the final document document.Save(pathAndFileToSaveTo); + // Now try and open the document. This will lanch whatever PDF viewer is on the system and ask it + // to show the file (at least on Windows). Process.Start(pathAndFileToSaveTo); } - catch { - + catch (Exception) + { } OnDoneSaving(); diff --git a/PrintQueue/PrintQueueMenu.cs b/PrintQueue/PrintQueueMenu.cs index f186488d2..407bf9f22 100644 --- a/PrintQueue/PrintQueueMenu.cs +++ b/PrintQueue/PrintQueueMenu.cs @@ -56,17 +56,34 @@ namespace MatterHackers.MatterControl.PrintQueue void SetMenuItems() { - //Set the name and callback function of the menu items - menuItems = new TupleList> + // The pdf export library is not working on the mac at the moment so we don't include the + // part sheet export option on mac. + if (MatterHackers.Agg.UI.WindowsFormsAbstract.GetOSType() == WindowsFormsAbstract.OSType.Mac) { - {"STL", null}, - {new LocalizedString(" Import from Zip").Translated, importQueueFromZipMenu_Click}, - {new LocalizedString(" Export to Zip").Translated, exportQueueToZipMenu_Click}, - {"GCode", null}, - {new LocalizedString(" Export to Folder").Translated, exportGCodeToFolderButton_Click}, - {new LocalizedString("Extra").Translated, null}, - {new LocalizedString(" Create Part Sheet").Translated, createPartsSheetsButton_Click}, - }; + //Set the name and callback function of the menu items + menuItems = new TupleList> + { + {"STL", null}, + {new LocalizedString(" Import from Zip").Translated, importQueueFromZipMenu_Click}, + {new LocalizedString(" Export to Zip").Translated, exportQueueToZipMenu_Click}, + {"GCode", null}, + {new LocalizedString(" Export to Folder").Translated, exportGCodeToFolderButton_Click}, + }; + } + else + { + //Set the name and callback function of the menu items + menuItems = new TupleList> + { + {"STL", null}, + {new LocalizedString(" Import from Zip").Translated, importQueueFromZipMenu_Click}, + {new LocalizedString(" Export to Zip").Translated, exportQueueToZipMenu_Click}, + {"GCode", null}, + {new LocalizedString(" Export to Folder").Translated, exportGCodeToFolderButton_Click}, + {new LocalizedString("Extra").Translated, null}, + {new LocalizedString(" Create Part Sheet").Translated, createPartsSheetsButton_Click}, + }; + } BorderDouble padding = MenuDropList.MenuItemsPadding; //Add the menu items to the menu itself @@ -99,13 +116,19 @@ namespace MatterHackers.MatterControl.PrintQueue if (parts.Count > 0) { SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Parts Sheet|*.pdf"); + saveParams.ActionButtonLabel = new LocalizedString("Save Parts Sheet").Translated; string saveParamsTitleLbl = new LocalizedString("MatterContol").Translated; string saveParamsTitleLblFull = new LocalizedString ("Save").Translated; saveParams.Title = string.Format("{0}: {1}",saveParamsTitleLbl,saveParamsTitleLblFull); System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams); - if (streamToSaveTo != null) + if (streamToSaveTo != null) + { + streamToSaveTo.Close (); + } + + if (saveParams.FileName != null) { PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName); diff --git a/PrinterCommunication/PrinterCommunication.cs b/PrinterCommunication/PrinterCommunication.cs index 4417a9989..cab175870 100644 --- a/PrinterCommunication/PrinterCommunication.cs +++ b/PrinterCommunication/PrinterCommunication.cs @@ -663,6 +663,8 @@ namespace MatterHackers.MatterControl { string lineToWrite = LinesToWriteQueue[0]; + lineToWrite = ApplyPrintLeveling(lineToWrite, false, false); + WriteToPrinter(lineToWrite + "\r\n", lineToWrite); LinesToWriteQueue.RemoveAt(0); System.Threading.Thread.Sleep(1); @@ -828,18 +830,18 @@ namespace MatterHackers.MatterControl string lineToParse = foundStringEventArgs.LineToCheck; Vector3 positionRead = Vector3.Zero; - GCodeFile.GetFirstNumberAfter('X', lineToParse, ref positionRead.x); - GCodeFile.GetFirstNumberAfter('Y', lineToParse, ref positionRead.y); - GCodeFile.GetFirstNumberAfter('Z', lineToParse, ref positionRead.z); + GCodeFile.GetFirstNumberAfter("X:", lineToParse, ref positionRead.x); + GCodeFile.GetFirstNumberAfter("Y:", lineToParse, ref positionRead.y); + GCodeFile.GetFirstNumberAfter("Z:", lineToParse, ref positionRead.z); int xPosition = lineToParse.IndexOf('X'); int secondXPosition = lineToParse.IndexOf("Count", xPosition); if (secondXPosition != -1) { Vector3 currentPositionRead = Vector3.Zero; - GCodeFile.GetFirstNumberAfter('X', lineToParse, ref currentPositionRead.x, secondXPosition - 1); - GCodeFile.GetFirstNumberAfter('Y', lineToParse, ref currentPositionRead.y, secondXPosition - 1); - GCodeFile.GetFirstNumberAfter('Z', lineToParse, ref currentPositionRead.z, secondXPosition - 1); + GCodeFile.GetFirstNumberAfter("X:", lineToParse, ref currentPositionRead.x, secondXPosition - 1); + GCodeFile.GetFirstNumberAfter("Y:", lineToParse, ref currentPositionRead.y, secondXPosition - 1); + GCodeFile.GetFirstNumberAfter("Z:", lineToParse, ref currentPositionRead.z, secondXPosition - 1); lastReportedPosition = currentPositionRead; } @@ -1310,9 +1312,9 @@ namespace MatterHackers.MatterControl newDestination = Vector3.Zero; } - GCodeFile.GetFirstNumberAfter('X', lineBeingSent, ref newDestination.x); - GCodeFile.GetFirstNumberAfter('Y', lineBeingSent, ref newDestination.y); - GCodeFile.GetFirstNumberAfter('Z', lineBeingSent, ref newDestination.z); + GCodeFile.GetFirstNumberAfter("X", lineBeingSent, ref newDestination.x); + GCodeFile.GetFirstNumberAfter("Y", lineBeingSent, ref newDestination.y); + GCodeFile.GetFirstNumberAfter("Z", lineBeingSent, ref newDestination.z); if (movementMode == PrinterMachineInstruction.MovementTypes.Relative) { @@ -1327,7 +1329,8 @@ namespace MatterHackers.MatterControl if (ActivePrinter.DoPrintLeveling) { - lineBeingSent = PrintLeveling.Instance.ApplyLeveling(currentDestination, movementMode, lineBeingSent, addLFCR, includeSpaces); + string inputLine = lineBeingSent; + lineBeingSent = PrintLeveling.Instance.ApplyLeveling(currentDestination, movementMode, inputLine, addLFCR, includeSpaces); } } @@ -1339,7 +1342,7 @@ namespace MatterHackers.MatterControl lineBeingSent = lineBeingSent.ToUpper().Trim(); if (lineBeingSent.StartsWith("G0") || lineBeingSent.StartsWith("G1")) { - if (GCodeFile.GetFirstNumberAfter('E', lineBeingSent, ref gcodeRequestedExtrusionPosition)) + if (GCodeFile.GetFirstNumberAfter("E", lineBeingSent, ref gcodeRequestedExtrusionPosition)) { double delta = gcodeRequestedExtrusionPosition - previousGcodeRequestedExtrusionPosition; if (extruderMode == PrinterMachineInstruction.MovementTypes.Relative) @@ -1354,7 +1357,7 @@ namespace MatterHackers.MatterControl } else if (lineBeingSent.StartsWith("G92")) { - if (GCodeFile.GetFirstNumberAfter('E', lineBeingSent, ref gcodeRequestedExtrusionPosition)) + if (GCodeFile.GetFirstNumberAfter("E", lineBeingSent, ref gcodeRequestedExtrusionPosition)) { previousGcodeRequestedExtrusionPosition = gcodeRequestedExtrusionPosition; currentActualExtrusionPosition = gcodeRequestedExtrusionPosition; @@ -1372,7 +1375,7 @@ namespace MatterHackers.MatterControl if (lineBeingSent.StartsWith("G0") || lineBeingSent.StartsWith("G1")) { double feedRate = 0; - if (GCodeFile.GetFirstNumberAfter('F', lineBeingSent, ref feedRate)) + if (GCodeFile.GetFirstNumberAfter("F", lineBeingSent, ref feedRate)) { lineBeingSent = GCodeFile.ReplaceNumberAfter('F', lineBeingSent, feedRate * FeedRateRatio); } diff --git a/PrinterControls/PrintLeveling.cs b/PrinterControls/PrintLeveling.cs index 5c7de53bb..1e118182b 100644 --- a/PrinterControls/PrintLeveling.cs +++ b/PrinterControls/PrintLeveling.cs @@ -85,9 +85,9 @@ namespace MatterHackers.MatterControl && lineBeingSent[2] == ' ') { double extruderDelta = 0; - GCodeFile.GetFirstNumberAfter('E', lineBeingSent, ref extruderDelta); + GCodeFile.GetFirstNumberAfter("E", lineBeingSent, ref extruderDelta); double feedRate = 0; - GCodeFile.GetFirstNumberAfter('F', lineBeingSent, ref feedRate); + GCodeFile.GetFirstNumberAfter("F", lineBeingSent, ref feedRate); string newLine = "G1 "; @@ -97,9 +97,9 @@ namespace MatterHackers.MatterControl if (movementMode == PrinterMachineInstruction.MovementTypes.Relative) { Vector3 relativeMove = Vector3.Zero; - GCodeFile.GetFirstNumberAfter('X', lineBeingSent, ref relativeMove.x); - GCodeFile.GetFirstNumberAfter('Y', lineBeingSent, ref relativeMove.y); - GCodeFile.GetFirstNumberAfter('Z', lineBeingSent, ref relativeMove.z); + GCodeFile.GetFirstNumberAfter("X", lineBeingSent, ref relativeMove.x); + GCodeFile.GetFirstNumberAfter("Y", lineBeingSent, ref relativeMove.y); + GCodeFile.GetFirstNumberAfter("Z", lineBeingSent, ref relativeMove.z); outPosition = PrintLeveling.Instance.ApplyLevelingRotation(relativeMove); } diff --git a/StaticData/PrinterSettings/SeeMeCNC/Orion ABS/config.ini b/StaticData/PrinterSettings/SeeMeCNC/Orion ABS/config.ini index 169b99313..b9e1ad21f 100644 --- a/StaticData/PrinterSettings/SeeMeCNC/Orion ABS/config.ini +++ b/StaticData/PrinterSettings/SeeMeCNC/Orion ABS/config.ini @@ -1,7 +1,7 @@ avoid_crossing_perimeters = 1 bed_shape = circular bed_size = 260,260 -bed_temperature = 70 +bed_temperature = 90 bottom_solid_layers = 5 bridge_acceleration = 0 bridge_fan_speed = 100 @@ -32,11 +32,11 @@ filament_diameter = 1.75 fill_angle = 0 fill_density = 0.2 fill_pattern = rectilinear -first_layer_bed_temperature = 70 +first_layer_bed_temperature = 90 first_layer_extrusion_width = 0.6 first_layer_height = 0.35 first_layer_speed = 40% -first_layer_temperature = 182 +first_layer_temperature = 230 g0 = 0 gap_fill_speed = 30 gcode_arcs = 0 @@ -102,7 +102,7 @@ support_material_pattern = rectilinear support_material_spacing = 2.5 support_material_speed = 3 support_material_threshold = 0 -temperature = 188 +temperature = 230 threads = 4 toolchange_gcode = top_infill_extrusion_width = 0.6 diff --git a/Utilities/ProjectFileHandler.cs b/Utilities/ProjectFileHandler.cs index 7f3ae90a2..bcf1c8df8 100644 --- a/Utilities/ProjectFileHandler.cs +++ b/Utilities/ProjectFileHandler.cs @@ -242,8 +242,8 @@ namespace MatterHackers.MatterControl { OpenFileDialogParams openParams = new OpenFileDialogParams("Zip file|*.zip"); - System.IO.Stream streamToLoadFrom = FileDialog.OpenFileDialog(ref openParams); - if (streamToLoadFrom != null) + FileDialog.OpenFileDialog(ref openParams); + if (openParams.FileNames != null) { string loadedFileName = openParams.FileName; return ImportFromProjectArchive(loadedFileName);