diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 5f0a9615c..d1cedf99f 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -66,12 +66,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage mainContainer.AddChild(new HorizontalLine(50)); mainContainer.AddChild(GetLanguageControl()); mainContainer.AddChild(new HorizontalLine(50)); - GuiWidget sliceEngineControl = GetSliceEngineControl(); - if (ActiveSliceSettings.Instance.PrinterSelected) - { - mainContainer.AddChild(sliceEngineControl); - mainContainer.AddChild(new HorizontalLine(50)); - } #if !__ANDROID__ @@ -447,42 +441,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage return buttonRow; } - private FlowLayoutWidget GetSliceEngineControl() - { - FlowLayoutWidget buttonRow = new FlowLayoutWidget(); - buttonRow.HAnchor = HAnchor.ParentLeftRight; - buttonRow.Margin = new BorderDouble(top: 4); - - TextWidget settingsLabel = new TextWidget("Slice Engine".Localize()); - settingsLabel.AutoExpandBoundsToText = true; - settingsLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; - settingsLabel.VAnchor = VAnchor.ParentTop; - - FlowLayoutWidget controlsContainer = new FlowLayoutWidget(); - controlsContainer.HAnchor = HAnchor.ParentLeftRight; - - FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); - optionsContainer.Margin = new BorderDouble(bottom: 6); - - var settings = ActiveSliceSettings.Instance; - - // Reset active slicer to MatterSlice when multi-extruder is detected and MatterSlice is not already set - if (settings?.GetValue(SettingsKey.extruder_count) > 1 - && settings.Helpers.ActiveSliceEngineType() != SlicingEngineTypes.MatterSlice) - { - settings.Helpers.ActiveSliceEngineType(SlicingEngineTypes.MatterSlice); - ApplicationController.Instance.ReloadAll(); - } - - optionsContainer.AddChild(new SliceEngineSelector("Slice Engine".Localize())); - optionsContainer.Width = 200; - - buttonRow.AddChild(settingsLabel); - buttonRow.AddChild(new HorizontalSpacer()); - buttonRow.AddChild(optionsContainer); - return buttonRow; - } - private FlowLayoutWidget GetThumbnailRenderingControl() { FlowLayoutWidget buttonRow = new FlowLayoutWidget(); diff --git a/MatterControl.csproj b/MatterControl.csproj index 71ac76dec..dd0132d11 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -304,10 +304,7 @@ - - - diff --git a/PartPreviewWindow/View3D/Gui3D/HeightValueDisplay.cs b/PartPreviewWindow/View3D/Gui3D/HeightValueDisplay.cs index ac45c712d..5736d7d10 100644 --- a/PartPreviewWindow/View3D/Gui3D/HeightValueDisplay.cs +++ b/PartPreviewWindow/View3D/Gui3D/HeightValueDisplay.cs @@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow Vector2 pointerBottom = new Vector2(startLineGroundPos.x + HorizontalLineLength / 2, yGround); Vector2 pointerTop = new Vector2(startLineSelectionPos.x + HorizontalLineLength / 2, ySelection); - InteractionVolume.DrawMeasureLine(drawEvent.graphics2D, pointerBottom, pointerTop, RGBA_Bytes.Black, InteractionVolume.LineArrows.End); + InteractionVolume.DrawMeasureLine(drawEvent.graphics2D, pointerBottom, pointerTop, RGBA_Bytes.Black, LineArrows.End); } } } diff --git a/Queue/PrintItemWrapper.cs b/Queue/PrintItemWrapper.cs index 1ba032100..a733dd628 100644 --- a/Queue/PrintItemWrapper.cs +++ b/Queue/PrintItemWrapper.cs @@ -266,7 +266,7 @@ namespace MatterHackers.MatterControl.PrintQueue return FileLocation; } - string engineString = ((int)ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType()).ToString(); + string engineString = (0).ToString(); string gcodeFileName = this.FileHashCode.ToString() + "_" + engineString + "_" + ActiveSliceSettings.Instance.GetLongHashCode().ToString(); string gcodePathAndFileName = Path.Combine(ApplicationDataStorage.Instance.GCodeOutputPath, gcodeFileName + ".gcode"); @@ -298,19 +298,9 @@ namespace MatterHackers.MatterControl.PrintQueue } // check if there is a known line at the end of the file (this will let us know if slicer finished building the file). - switch (ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType()) + if (gcodeFileContents.Contains("filament used =")) { - case SlicingEngineTypes.CuraEngine: - case SlicingEngineTypes.MatterSlice: - case SlicingEngineTypes.Slic3r: - if (gcodeFileContents.Contains("filament used =")) - { - gCodeFileIsComplete = true; - } - break; - - default: - throw new NotImplementedException(); + gCodeFileIsComplete = true; } } diff --git a/SlicerConfiguration/CuraEngineInfo.cs b/SlicerConfiguration/CuraEngineInfo.cs deleted file mode 100644 index 3ab69249d..000000000 --- a/SlicerConfiguration/CuraEngineInfo.cs +++ /dev/null @@ -1,44 +0,0 @@ -using MatterHackers.MatterControl.DataStorage; -using System.IO; - -namespace MatterHackers.MatterControl.SlicerConfiguration -{ - public class CuraEngineInfo : SliceEngineInfo - { - public CuraEngineInfo() - : base("CuraEngine") - { - } - - public override SlicingEngineTypes GetSliceEngineType() - { - return SlicingEngineTypes.CuraEngine; - } - - protected override string getWindowsPath() - { - string curaEngineRelativePath = Path.Combine("..", "CuraEngine.exe"); - if (!File.Exists(curaEngineRelativePath)) - { - curaEngineRelativePath = Path.Combine(".", "CuraEngine.exe"); - } - return Path.GetFullPath(curaEngineRelativePath); - } - - protected override string getMacPath() - { - string applicationPath = Path.Combine(ApplicationDataStorage.Instance.ApplicationPath, "CuraEngine"); - return applicationPath; - } - - protected override string getLinuxPath() - { - string curaEngineRelativePath = Path.Combine("..", "CuraEngine.exe"); - if (!File.Exists(curaEngineRelativePath)) - { - curaEngineRelativePath = Path.Combine(".", "CuraEngine.exe"); - } - return Path.GetFullPath(curaEngineRelativePath); - } - } -} \ No newline at end of file diff --git a/SlicerConfiguration/MatterSliceInfo.cs b/SlicerConfiguration/MatterSliceInfo.cs index 1af0041a5..d912ee8fd 100644 --- a/SlicerConfiguration/MatterSliceInfo.cs +++ b/SlicerConfiguration/MatterSliceInfo.cs @@ -1,55 +1,48 @@ using MatterHackers.Agg.PlatformAbstract; using MatterHackers.MatterControl.DataStorage; using System.IO; +using System; namespace MatterHackers.MatterControl.SlicerConfiguration { - public class MatterSliceInfo : SliceEngineInfo + public static class MatterSliceInfo { - public MatterSliceInfo() - : base(MatterSliceInfo.DisplayName) - { - } + public static string DisplayName { get; } = "MatterSlice"; - public static string DisplayName = "MatterSlice"; - - public override SlicingEngineTypes GetSliceEngineType() + public static string GetEnginePath() { - return SlicingEngineTypes.MatterSlice; - } - - public override bool Exists() - { - if (OsInformation.OperatingSystem == OSType.Android || OsInformation.OperatingSystem == OSType.Mac || SlicingQueue.runInProcess) + switch (OsInformation.OperatingSystem) { - return true; - } - else - { - if (this.GetEnginePath() == null) - { - return false; - } - else - { - return System.IO.File.Exists(this.GetEnginePath()); - } + case OSType.Windows: + return getWindowsPath(); + + case OSType.Mac: + return getMacPath(); + + case OSType.X11: + return getLinuxPath(); + + case OSType.Android: + return null; + + default: + throw new NotImplementedException(); } } - protected override string getWindowsPath() + private static string getWindowsPath() { string matterSliceRelativePath = Path.Combine(".", "MatterSlice.exe"); return Path.GetFullPath(matterSliceRelativePath); } - protected override string getMacPath() + private static string getMacPath() { string applicationPath = Path.Combine(ApplicationDataStorage.Instance.ApplicationPath, "MatterSlice"); return applicationPath; } - protected override string getLinuxPath() + private static string getLinuxPath() { string matterSliceRelativePath = Path.Combine(".", "MatterSlice.exe"); return Path.GetFullPath(matterSliceRelativePath); diff --git a/SlicerConfiguration/Settings/ActiveSliceSettings.cs b/SlicerConfiguration/Settings/ActiveSliceSettings.cs index 5ebe444ae..ccc939d55 100644 --- a/SlicerConfiguration/Settings/ActiveSliceSettings.cs +++ b/SlicerConfiguration/Settings/ActiveSliceSettings.cs @@ -178,6 +178,4 @@ namespace MatterHackers.MatterControl.SlicerConfiguration MaterialPresetChanged?.Invoke(null, null); } } - - public enum SlicingEngineTypes { Slic3r, CuraEngine, MatterSlice }; } \ No newline at end of file diff --git a/SlicerConfiguration/Settings/PrinterSettings.cs b/SlicerConfiguration/Settings/PrinterSettings.cs index 8a312e41a..5b43fc86d 100644 --- a/SlicerConfiguration/Settings/PrinterSettings.cs +++ b/SlicerConfiguration/Settings/PrinterSettings.cs @@ -1092,7 +1092,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } if (!valueWasNumber - || (ActiveSliceSettings.Instance.Helpers.ActiveSliceEngine().MapContains(speedSetting) + || (EngineMappingsMatterSlice.Instance.MapContains(speedSetting) && speedToCheck <= 0)) { SliceSettingData data = SliceSettingsOrganizer.Instance.GetSettingsData(speedSetting); diff --git a/SlicerConfiguration/Settings/SettingsHelpers.cs b/SlicerConfiguration/Settings/SettingsHelpers.cs index c99468710..0c9210491 100644 --- a/SlicerConfiguration/Settings/SettingsHelpers.cs +++ b/SlicerConfiguration/Settings/SettingsHelpers.cs @@ -243,11 +243,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration printerSettings.SetValue($"{Environment.MachineName}_com_port", port, layer); } - public void SetSlicingEngine(string engine) - { - printerSettings.SetValue("slicing_engine", engine); - } - public void SetDriverType(string driver) { printerSettings.SetValue("driver_type", driver); @@ -347,48 +342,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration return Vector2.Zero; } - public SlicingEngineTypes ActiveSliceEngineType() - { - if (OsInformation.OperatingSystem == OSType.Android - || SlicingQueue.AvailableSliceEngines.Count == 1) - { - // android only has MatterSlice available, so always return it. - return SlicingEngineTypes.MatterSlice; - } - - string engineType = printerSettings.GetValue("slicing_engine"); - if (string.IsNullOrEmpty(engineType)) - { - return SlicingEngineTypes.MatterSlice; - } - - var engine = (SlicingEngineTypes)Enum.Parse(typeof(SlicingEngineTypes), engineType); - return engine; - } - - public void ActiveSliceEngineType(SlicingEngineTypes type) - { - printerSettings.SetValue("slicing_engine", type.ToString()); - } - - public SliceEngineMapping ActiveSliceEngine() - { - switch (ActiveSliceEngineType()) - { - case SlicingEngineTypes.CuraEngine: - return EngineMappingCura.Instance; - - case SlicingEngineTypes.MatterSlice: - return EngineMappingsMatterSlice.Instance; - - case SlicingEngineTypes.Slic3r: - return Slic3rEngineMappings.Instance; - - default: - return null; - } - } - public void ExportAsMatterControlConfig() { FileDialog.SaveFileDialog( diff --git a/SlicerConfiguration/SettingsControlSelectors.cs b/SlicerConfiguration/SettingsControlSelectors.cs index 097e41867..d69005710 100644 --- a/SlicerConfiguration/SettingsControlSelectors.cs +++ b/SlicerConfiguration/SettingsControlSelectors.cs @@ -378,52 +378,4 @@ namespace MatterHackers.MatterControl.SlicerConfiguration RebuildDropDownList(); } } - - public class SliceEngineSelector : DropDownList - { - public SliceEngineSelector(string label) - : base(label) - { - HAnchor = HAnchor.ParentLeftRight; - - //Add Each SliceEngineInfo Objects to DropMenu - foreach (SliceEngineInfo engineMenuItem in SlicingQueue.AvailableSliceEngines) - { - MenuItem item = AddItem(engineMenuItem.Name); - item.Enabled = ActiveSliceSettings.Instance.GetValue(SettingsKey.extruder_count) < 2 || engineMenuItem.Name == "MatterSlice"; - - SlicingEngineTypes itemEngineType = engineMenuItem.GetSliceEngineType(); - item.Selected += (sender, e) => - { - if (ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType() != itemEngineType) - { - ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType(itemEngineType); - ApplicationController.Instance.ReloadAdvancedControlsPanel(); - } - }; - - //Set item as selected if it matches the active slice engine - if (itemEngineType == ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType()) - { - SelectedLabel = engineMenuItem.Name; - } - } - - //If nothing is selected (i.e. selected engine is not available) set to - if (SelectedLabel == "") - { - try - { - SelectedLabel = MatterSliceInfo.DisplayName; - } - catch (Exception ex) - { - GuiWidget.BreakInDebugger(ex.Message); - throw new Exception("Unable to find MatterSlice executable"); - } - } - - MinimumSize = new Vector2(LocalBounds.Width, LocalBounds.Height); - } - } } \ No newline at end of file diff --git a/SlicerConfiguration/Slic3rInfo.cs b/SlicerConfiguration/Slic3rInfo.cs deleted file mode 100644 index e529a8dcb..000000000 --- a/SlicerConfiguration/Slic3rInfo.cs +++ /dev/null @@ -1,44 +0,0 @@ -using MatterHackers.MatterControl.DataStorage; -using System.IO; - -namespace MatterHackers.MatterControl.SlicerConfiguration -{ - public class Slic3rInfo : SliceEngineInfo - { - public Slic3rInfo() - : base("Slic3r") - { - } - - public override SlicingEngineTypes GetSliceEngineType() - { - return SlicingEngineTypes.Slic3r; - } - - protected override string getWindowsPath() - { - string slic3rRelativePathWindows = Path.Combine("..", "Slic3r", "slic3r.exe"); - if (!File.Exists(slic3rRelativePathWindows)) - { - slic3rRelativePathWindows = Path.Combine(".", "Slic3r", "slic3r.exe"); - } - return Path.GetFullPath(slic3rRelativePathWindows); - } - - protected override string getMacPath() - { - string applicationPath = Path.Combine(ApplicationDataStorage.Instance.ApplicationPath, "Slic3r.app", "Contents", "MacOS", "slic3r"); - return applicationPath; - } - - protected override string getLinuxPath() - { - string slic3rRelativePathWindows = Path.Combine("..", "Slic3r", "bin","slic3r"); - if (!File.Exists(slic3rRelativePathWindows)) - { - slic3rRelativePathWindows = Path.Combine(".", "Slic3r", "bin","slic3r"); - } - return Path.GetFullPath(slic3rRelativePathWindows); - } - } -} \ No newline at end of file diff --git a/SlicerConfiguration/SliceEngineInfo.cs b/SlicerConfiguration/SliceEngineInfo.cs deleted file mode 100644 index 56321f21c..000000000 --- a/SlicerConfiguration/SliceEngineInfo.cs +++ /dev/null @@ -1,56 +0,0 @@ -using MatterHackers.Agg.PlatformAbstract; -using System; - -namespace MatterHackers.MatterControl.SlicerConfiguration -{ - public abstract class SliceEngineInfo - { - public string Name { get; set; } - - protected abstract string getWindowsPath(); - - protected abstract string getMacPath(); - - protected abstract string getLinuxPath(); - - public abstract SlicingEngineTypes GetSliceEngineType(); - - public SliceEngineInfo(string name) - { - this.Name = name; - } - - public virtual bool Exists() - { - if (this.GetEnginePath() == null) - { - return false; - } - else - { - return System.IO.File.Exists(this.GetEnginePath()); - } - } - - public string GetEnginePath() - { - switch (OsInformation.OperatingSystem) - { - case OSType.Windows: - return getWindowsPath(); - - case OSType.Mac: - return getMacPath(); - - case OSType.X11: - return getLinuxPath(); - - case OSType.Android: - return null; - - default: - throw new NotImplementedException(); - } - } - } -} \ No newline at end of file diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 0af5bf153..0460649ca 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -371,8 +371,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { this.HAnchor = HAnchor.ParentLeftRight; - var sliceEngineMapping = ActiveSliceSettings.Instance.Helpers.ActiveSliceEngine(); - TabControl leftSideGroupTabs = new TabControl(Orientation.Vertical); leftSideGroupTabs.Margin = new BorderDouble(0, 0, 0, 5); leftSideGroupTabs.TabBar.BorderColor = ActiveTheme.Instance.PrimaryTextColor; @@ -420,7 +418,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration // settingShouldBeShown / addedSettingToSubGroup / needToAddSubGroup bool settingShouldBeShown = CheckIfShouldBeShown(settingData); - if (sliceEngineMapping.MapContains(settingData.SlicerConfigName) + if (EngineMappingsMatterSlice.Instance.MapContains(settingData.SlicerConfigName) && settingShouldBeShown) { addedSettingToSubGroup = true; @@ -574,14 +572,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.HAnchor = HAnchor.ParentLeftRight; - var sliceEngineMapping = ActiveSliceSettings.Instance.Helpers.ActiveSliceEngine(); - foreach (var keyValue in ActiveSliceSettings.Instance.BaseLayer) { if (!SliceSettingsOrganizer.Instance.Contains(UserLevel, keyValue.Key)) { SliceSettingData settingData = new SliceSettingData(keyValue.Key, keyValue.Key, SliceSettingData.DataEditTypes.STRING); - if (sliceEngineMapping.MapContains(settingData.SlicerConfigName)) + if (EngineMappingsMatterSlice.Instance.MapContains(settingData.SlicerConfigName)) { GuiWidget controlsForThisSetting = CreateSettingInfoUIControls( settingData, diff --git a/SlicerConfiguration/SlicingQueue.cs b/SlicerConfiguration/SlicingQueue.cs index 76f2120c7..93a0fc2ef 100644 --- a/SlicerConfiguration/SlicingQueue.cs +++ b/SlicerConfiguration/SlicingQueue.cs @@ -55,47 +55,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration private static List listOfSlicingItems = new List(); private static bool haltSlicingThread = false; - private static List availableSliceEngines; - - static public List AvailableSliceEngines - { - get - { - if (availableSliceEngines == null) - { - availableSliceEngines = new List(); - Slic3rInfo slic3rEngineInfo = new Slic3rInfo(); - if (slic3rEngineInfo.Exists()) - { - availableSliceEngines.Add(slic3rEngineInfo); - } - CuraEngineInfo curaEngineInfo = new CuraEngineInfo(); - if (curaEngineInfo.Exists()) - { - availableSliceEngines.Add(curaEngineInfo); - } - MatterSliceInfo matterSliceEngineInfo = new MatterSliceInfo(); - if (matterSliceEngineInfo.Exists()) - { - availableSliceEngines.Add(matterSliceEngineInfo); - } - } - return availableSliceEngines; - } - } - - static private SliceEngineInfo getSliceEngineInfoByType(SlicingEngineTypes engineType) - { - foreach (SliceEngineInfo info in AvailableSliceEngines) - { - if (info.GetSliceEngineType() == engineType) - { - return info; - } - } - return null; - } - private SlicingQueue() { if (slicePartThread == null) @@ -151,15 +110,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } - private static string getSlicerFullPath() - { - var engineType = ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType(); - return getSliceEngineInfoByType(engineType)?.GetEnginePath(); - } - public static List extrudersUsed = new List(); - public static string[] GetStlFileLocations(string fileToSlice, bool doMergeInSlicer, ref string mergeRules) + public static string[] GetStlFileLocations(string fileToSlice, ref string mergeRules) { extrudersUsed.Clear(); @@ -244,63 +197,56 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } - if (doMergeInSlicer) + int meshCount = meshGroup.Meshes.Count; + if (meshCount > 0) { - int meshCount = meshGroup.Meshes.Count; - if (meshCount > 0) + for (int meshIndex = 0; meshIndex < meshCount; meshIndex++) { - for (int meshIndex = 0; meshIndex < meshCount; meshIndex++) + Mesh mesh = meshGroup.Meshes[meshIndex]; + if ((meshIndex % 2) == 0) { - Mesh mesh = meshGroup.Meshes[meshIndex]; - if ((meshIndex % 2) == 0) + mergeRules += "({0}".FormatWith(savedStlCount); + } + else + { + if (meshIndex < meshCount - 1) { - mergeRules += "({0}".FormatWith(savedStlCount); + mergeRules += ",({0}".FormatWith(savedStlCount); } else { - if (meshIndex < meshCount - 1) - { - mergeRules += ",({0}".FormatWith(savedStlCount); - } - else - { - mergeRules += ",{0}".FormatWith(savedStlCount); - } + mergeRules += ",{0}".FormatWith(savedStlCount); } - int currentMeshMaterialIntdex = MeshMaterialData.Get(mesh).MaterialIndex; - if (materialsToInclude.Contains(currentMeshMaterialIntdex)) - { - extruderFilesToSlice.Add(SaveAndGetFilenameForMesh(mesh)); - } - savedStlCount++; } - - for (int i = 0; i < meshCount; i++) + int currentMeshMaterialIntdex = MeshMaterialData.Get(mesh).MaterialIndex; + if (materialsToInclude.Contains(currentMeshMaterialIntdex)) { - mergeRules += ")"; + extruderFilesToSlice.Add(SaveAndGetFilenameForMesh(mesh)); } - } - else // this extruder has no meshes - { - // check if there are any more meshes after this extruder that will be added - int otherMeshCounts = 0; - for (int otherExtruderIndex = extruderIndex + 1; otherExtruderIndex < extruderMeshGroups.Count; otherExtruderIndex++) - { - otherMeshCounts += extruderMeshGroups[otherExtruderIndex].Meshes.Count; - } - if (otherMeshCounts > 0) // there are more extrudes to use after this not used one - { - // add in a blank for this extruder - mergeRules += $"({savedStlCount})"; - } - // save an empty mesh - extruderFilesToSlice.Add(SaveAndGetFilenameForMesh(PlatonicSolids.CreateCube(.001,.001,.001))); savedStlCount++; } + + for (int i = 0; i < meshCount; i++) + { + mergeRules += ")"; + } } - else + else // this extruder has no meshes { - extruderFilesToSlice.Add(SaveAndGetFilenameForMaterial(meshGroup, materialsToInclude)); + // check if there are any more meshes after this extruder that will be added + int otherMeshCounts = 0; + for (int otherExtruderIndex = extruderIndex + 1; otherExtruderIndex < extruderMeshGroups.Count; otherExtruderIndex++) + { + otherMeshCounts += extruderMeshGroups[otherExtruderIndex].Meshes.Count; + } + if (otherMeshCounts > 0) // there are more extrudes to use after this not used one + { + // add in a blank for this extruder + mergeRules += $"({savedStlCount})"; + } + // save an empty mesh + extruderFilesToSlice.Add(SaveAndGetFilenameForMesh(PlatonicSolids.CreateCube(.001, .001, .001))); + savedStlCount++; } } @@ -359,10 +305,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration if (listOfSlicingItems.Count > 0) { PrintItemWrapper itemToSlice = listOfSlicingItems[0]; - bool doMergeInSlicer = ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType() == SlicingEngineTypes.MatterSlice; string mergeRules = ""; - string[] stlFileLocations = GetStlFileLocations(itemToSlice.FileLocation, doMergeInSlicer, ref mergeRules); + string[] stlFileLocations = GetStlFileLocations(itemToSlice.FileLocation, ref mergeRules); string fileToSlice = stlFileLocations[0]; // check that the STL file is currently on disk @@ -381,21 +326,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { string commandArgs = ""; - switch (ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType()) - { - case SlicingEngineTypes.Slic3r: - Slic3rEngineMappings.WriteSliceSettingsFile(configFilePath); - - // if we have centering turend on and are printing a model loaded up from meshes (not gcode) - commandArgs = $"--load \"{configFilePath}\" --output \"{gcodeFilePath}\" \"{fileToSlice}\""; - break; - - case SlicingEngineTypes.CuraEngine: - commandArgs = $"-v -o \"{gcodeFilePath}\" {EngineMappingCura.GetCuraCommandLineSettings()} \"{fileToSlice}\""; - break; - - case SlicingEngineTypes.MatterSlice: - { EngineMappingsMatterSlice.WriteSliceSettingsFile(configFilePath); if (mergeRules == "") { @@ -410,10 +340,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { commandArgs += $" \"{filename}\""; } - } - break; - } - #if false Mesh loadedMesh = StlProcessing.Load(fileToSlice); SliceLayers layers = new SliceLayers(); @@ -421,9 +347,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration layers.DumpSegmentsToGcode("test.gcode"); #endif - if (OsInformation.OperatingSystem == OSType.Android || - ((OsInformation.OperatingSystem == OSType.Mac || runInProcess) - && ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType() == SlicingEngineTypes.MatterSlice)) + if (OsInformation.OperatingSystem == OSType.Android + || OsInformation.OperatingSystem == OSType.Mac + || runInProcess) { itemCurrentlySlicing = itemToSlice; MatterHackers.MatterSlice.LogOutput.GetLogWrites += SendProgressToItem; @@ -442,7 +368,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardOutput = true, - FileName = getSlicerFullPath(), + FileName = MatterSliceInfo.GetEnginePath(), UseShellExecute = false } }; diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 7e4effb1b..12da29407 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 7e4effb1bbcd9307add0049c5519aeef2d50d082 +Subproject commit 12da2940771e1c9480fe8a75ea9768ebf2ef6f2c