From fa978290738f70135fc6a5e250779c4a6b31f772 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 11 Sep 2015 10:48:24 -0700 Subject: [PATCH] Put in lots of code to break on exceptions in the debugger. Made the cloud provider able to report that it is loading --- AboutPage/AboutWidget.cs | 5 + .../HTMLParser/ImageWidget_AsyncLoadOnDraw.cs | 3 + AboutPage/UpdateControlData.cs | 2 + AboutPage/UpdateControlView.cs | 2 + .../ApplicationSettingsView.cs | 2 + ControlElements/ThemeFactory.cs | 2 + DataStorage/Datastore.cs | 4 + DataStorage/Models.cs | 3 + Library/LibraryDataView.cs | 42 ------- Library/PrintLibraryWidget.cs | 113 +++++++++++------- Library/Provider/LibraryProviderFileSystem.cs | 4 + MatterControlApplication.cs | 1 + PartPreviewWindow/View3D/View3DWidget.cs | 8 +- PartPreviewWindow/ViewGcodeWidget.cs | 5 +- .../PrinterConnectionAndCommunication.cs | 55 +++++++-- .../EditConnectionWidget.cs | 10 +- .../TerminalWindow/TerminalWidget.cs | 3 + Queue/PrintItemWrapper.cs | 8 +- SlicerConfiguration/ActiveSliceSettings.cs | 6 + .../SettingsControlSelectors.cs | 13 +- StaticData/Translations/Master.txt | 3 + Submodules/agg-sharp | 2 +- .../MatterControl/MatterControlUtilities.cs | 4 +- 23 files changed, 194 insertions(+), 106 deletions(-) diff --git a/AboutPage/AboutWidget.cs b/AboutPage/AboutWidget.cs index 4e194ded4..70e7e88e5 100644 --- a/AboutPage/AboutWidget.cs +++ b/AboutPage/AboutWidget.cs @@ -42,6 +42,7 @@ using MatterHackers.MatterControl.PrintLibrary.Provider; using MatterHackers.MatterControl.PrintQueue; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Net; @@ -202,6 +203,7 @@ namespace MatterHackers.MatterControl } catch (Exception) { + Debugger.Break(); } } else @@ -231,6 +233,7 @@ namespace MatterHackers.MatterControl } catch (Exception) { + Debugger.Break(); } } break; @@ -249,6 +252,7 @@ namespace MatterHackers.MatterControl } catch (Exception) { + Debugger.Break(); } } break; @@ -279,6 +283,7 @@ namespace MatterHackers.MatterControl } catch (Exception) { + Debugger.Break(); } } } diff --git a/AboutPage/HTMLParser/ImageWidget_AsyncLoadOnDraw.cs b/AboutPage/HTMLParser/ImageWidget_AsyncLoadOnDraw.cs index d2690c769..225555100 100644 --- a/AboutPage/HTMLParser/ImageWidget_AsyncLoadOnDraw.cs +++ b/AboutPage/HTMLParser/ImageWidget_AsyncLoadOnDraw.cs @@ -40,6 +40,7 @@ using MatterHackers.MatterControl.PrintLibrary; using MatterHackers.MatterControl.PrintQueue; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Net; @@ -74,6 +75,7 @@ namespace MatterHackers.MatterControl } catch (Exception) { + Debugger.Break(); } } @@ -109,6 +111,7 @@ namespace MatterHackers.MatterControl } catch (Exception) { + Debugger.Break(); } } } diff --git a/AboutPage/UpdateControlData.cs b/AboutPage/UpdateControlData.cs index acf52faa4..32bab9d05 100644 --- a/AboutPage/UpdateControlData.cs +++ b/AboutPage/UpdateControlData.cs @@ -292,6 +292,7 @@ namespace MatterHackers.MatterControl } catch { + Debugger.Break(); //Unknown download size downloadSize = 0; } @@ -434,6 +435,7 @@ namespace MatterHackers.MatterControl } catch { + Debugger.Break(); if (System.IO.File.Exists(friendlyFileName)) { System.IO.File.Delete(friendlyFileName); diff --git a/AboutPage/UpdateControlView.cs b/AboutPage/UpdateControlView.cs index 91d5d610b..30329cd0a 100644 --- a/AboutPage/UpdateControlView.cs +++ b/AboutPage/UpdateControlView.cs @@ -31,6 +31,7 @@ using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.Localizations; using System; +using System.Diagnostics; namespace MatterHackers.MatterControl { @@ -117,6 +118,7 @@ namespace MatterHackers.MatterControl } catch { + Debugger.Break(); installUpdateLink.Visible = false; updateStatusText.Text = string.Format("Oops! Unable to install update.".Localize()); } diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index df248ce3a..ca1e17395 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -37,6 +37,7 @@ using MatterHackers.MatterControl.PrinterCommunication; using System; using System.Collections.Generic; using System.IO; +using System.Diagnostics; namespace MatterHackers.MatterControl.ConfigurationPage { @@ -419,6 +420,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage } catch (Exception) { + Debugger.Break(); } } diff --git a/ControlElements/ThemeFactory.cs b/ControlElements/ThemeFactory.cs index 70cef2d71..4ad152568 100644 --- a/ControlElements/ThemeFactory.cs +++ b/ControlElements/ThemeFactory.cs @@ -32,6 +32,7 @@ either expressed or implied, of the FreeBSD Project. using System; using System.Collections.Generic; +using System.Diagnostics; namespace MatterHackers.MatterControl { @@ -214,6 +215,7 @@ namespace MatterHackers.MatterControl } catch { + Debugger.Break(); themeIndex = defaultThemeIndex; } diff --git a/DataStorage/Datastore.cs b/DataStorage/Datastore.cs index 43bbb4d1a..abac363fc 100644 --- a/DataStorage/Datastore.cs +++ b/DataStorage/Datastore.cs @@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project. using MatterHackers.Agg.PlatformAbstract; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Threading; @@ -217,6 +218,7 @@ namespace MatterHackers.MatterControl.DataStorage } catch { + Debugger.Break(); } } } @@ -253,6 +255,7 @@ namespace MatterHackers.MatterControl.DataStorage } catch (Exception) { + Debugger.Break(); // we faild to close so lets wait a bit and try again Thread.Sleep(1000); try @@ -261,6 +264,7 @@ namespace MatterHackers.MatterControl.DataStorage } catch (Exception) { + Debugger.Break(); } } } diff --git a/DataStorage/Models.cs b/DataStorage/Models.cs index 9502952e9..86b979b83 100644 --- a/DataStorage/Models.cs +++ b/DataStorage/Models.cs @@ -32,6 +32,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; @@ -170,6 +171,7 @@ namespace MatterHackers.MatterControl.DataStorage } catch (Exception) { + Debugger.Break(); Thread.Sleep(100); this.TryHandleInsert(); } @@ -189,6 +191,7 @@ namespace MatterHackers.MatterControl.DataStorage } catch (Exception) { + Debugger.Break(); Thread.Sleep(100); this.TryHandleUpdate(); } diff --git a/Library/LibraryDataView.cs b/Library/LibraryDataView.cs index 1127fa4fd..2642eee29 100644 --- a/Library/LibraryDataView.cs +++ b/Library/LibraryDataView.cs @@ -51,8 +51,6 @@ namespace MatterHackers.MatterControl.PrintLibrary private RGBA_Bytes hoverColor = new RGBA_Bytes(204, 204, 204, 255); - private GuiWidget providerMessageContainer; - private TextWidget providerMessageWidget; private RGBA_Bytes selectedColor = new RGBA_Bytes(180, 180, 180, 255); private bool settingLocalBounds = false; @@ -86,27 +84,6 @@ namespace MatterHackers.MatterControl.PrintLibrary AddChild(topToBottomItemList); AddAllItems(); - - providerMessageWidget = new TextWidget("") - { - PointSize = 8, - HAnchor = HAnchor.ParentRight, - VAnchor = VAnchor.ParentBottom, - TextColor = ActiveTheme.Instance.SecondaryTextColor, - Margin = new BorderDouble(6), - AutoExpandBoundsToText = true, - }; - - providerMessageContainer = new GuiWidget() - { - VAnchor = VAnchor.FitToChildren, - HAnchor = HAnchor.ParentLeftRight, - BackgroundColor = new RGBA_Bytes(ActiveTheme.Instance.SecondaryBackgroundColor, 220), - Visible = false, - }; - - providerMessageContainer.AddChild(providerMessageWidget); - this.AddChildToBackground(providerMessageContainer, -1); } public delegate void HoverValueChangedEventHandler(object sender, EventArgs e); @@ -152,8 +129,6 @@ namespace MatterHackers.MatterControl.PrintLibrary ClearSelectedItems(); - this.ProviderMessage = value.StatusMessage; - UiThread.RunOnIdle(RebuildView); } } @@ -211,23 +186,6 @@ namespace MatterHackers.MatterControl.PrintLibrary } } - public string ProviderMessage - { - get { return providerMessageWidget.Text; } - set - { - if (value != "") - { - providerMessageWidget.Text = value; - providerMessageContainer.Visible = true; - } - else - { - providerMessageContainer.Visible = false; - } - } - } - private int Count { get diff --git a/Library/PrintLibraryWidget.cs b/Library/PrintLibraryWidget.cs index 0a51178d3..1e7fe326c 100644 --- a/Library/PrintLibraryWidget.cs +++ b/Library/PrintLibraryWidget.cs @@ -72,9 +72,11 @@ namespace MatterHackers.MatterControl.PrintLibrary private static Button addToLibraryButton; private Button enterEditModeButton; private Button leaveEditModeButton; - private static FlowLayoutWidget buttonPanel; + private FlowLayoutWidget buttonPanel; private MHTextEditWidget searchInput; private LibraryDataView libraryDataView; + private GuiWidget providerMessageContainer; + private TextWidget providerMessageWidget; static PrintLibraryWidget currentPrintLibraryWidget; @@ -175,13 +177,14 @@ namespace MatterHackers.MatterControl.PrintLibrary breadCrumbWidget = new FolderBreadCrumbWidget(libraryDataView.SetCurrentLibraryProvider, libraryDataView.CurrentLibraryProvider); libraryDataView.ChangedCurrentLibraryProvider += breadCrumbWidget.SetBreadCrumbs; - libraryDataView.ChangedCurrentLibraryProvider += ClearSearchWidget; + libraryDataView.ChangedCurrentLibraryProvider += LibraryProviderChanged; allControls.AddChild(breadCrumbWidget); allControls.AddChild(libraryDataView); allControls.AddChild(buttonPanel); } + allControls.AnchorAll(); this.AddChild(allControls); @@ -189,21 +192,51 @@ namespace MatterHackers.MatterControl.PrintLibrary AddHandlers(); } - private void ClearSearchWidget(LibraryProvider previousLibraryProvider, LibraryProvider currentLibraryProvider) + public string ProviderMessage + { + get { return providerMessageWidget.Text; } + set + { + if (value != "") + { + providerMessageWidget.Text = value; + providerMessageContainer.Visible = true; + } + else + { + providerMessageContainer.Visible = false; + } + } + } + + private void LibraryProviderChanged(LibraryProvider previousLibraryProvider, LibraryProvider currentLibraryProvider) { previousLibraryProvider.KeywordFilter = ""; searchInput.Text = currentLibraryProvider.KeywordFilter; - breadCrumbWidget.SetBreadCrumbs(null, currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider); + breadCrumbWidget.SetBreadCrumbs(null, this.libraryDataView.CurrentLibraryProvider); + + previousLibraryProvider.DataReloaded -= UpdateStatus; + currentLibraryProvider.DataReloaded += UpdateStatus; + + UpdateStatus(null, null); } - private static void AddLibraryButtonElements() - { - textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor; - textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; - textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; - textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor; - buttonPanel.RemoveAllChildren(); - // the add button + void UpdateStatus(object sender, EventArgs e) + { + if (this.libraryDataView.CurrentLibraryProvider != null) + { + this.ProviderMessage = this.libraryDataView.CurrentLibraryProvider.StatusMessage; + } + } + + private void AddLibraryButtonElements() + { + textImageButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor; + textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; + textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; + textImageButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor; + buttonPanel.RemoveAllChildren(); + // the add button { addToLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addToLibraryButton.ToolTipText = "Add an .stl, .amf, .gcode or .zip file to the Library".Localize(); @@ -224,7 +257,7 @@ namespace MatterHackers.MatterControl.PrintLibrary { createFolderWindow = new CreateFolderWindow((returnInfo) => { - currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider.AddCollectionToLibrary(returnInfo.newName); + this.libraryDataView.CurrentLibraryProvider.AddCollectionToLibrary(returnInfo.newName); }); createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; }; } @@ -235,32 +268,30 @@ namespace MatterHackers.MatterControl.PrintLibrary }; } - //Add extra buttons (ex. from plugins) if available - if (privateAddLibraryButton != null) - { - privateAddLibraryButton(buttonPanel); - } + // add in the message widget + { + providerMessageWidget = new TextWidget("") + { + PointSize = 8, + HAnchor = HAnchor.ParentRight, + VAnchor = VAnchor.ParentBottom, + TextColor = ActiveTheme.Instance.SecondaryTextColor, + Margin = new BorderDouble(6), + AutoExpandBoundsToText = true, + }; - } + providerMessageContainer = new GuiWidget() + { + VAnchor = VAnchor.FitToChildren | VAnchor.ParentTop, + HAnchor = HAnchor.ParentLeftRight, + Visible = false, + }; - public delegate void AddLibraryButtonDelegate(GuiWidget extraButtonContainer); + providerMessageContainer.AddChild(providerMessageWidget); + buttonPanel.AddChild(providerMessageContainer, -1); + } + } - private static event AddLibraryButtonDelegate privateAddLibraryButton; - public static event AddLibraryButtonDelegate AddLibraryButton - { - add - { - privateAddLibraryButton += value; - // and create button container right away - AddLibraryButtonElements(); - } - - remove - { - privateAddLibraryButton -= value; - } - } - private void CreateEditBarButtons() { itemOperationButtons = new FlowLayoutWidget(); @@ -361,6 +392,8 @@ namespace MatterHackers.MatterControl.PrintLibrary public override void OnClosed(EventArgs e) { + this.libraryDataView.CurrentLibraryProvider.DataReloaded -= UpdateStatus; + if (unregisterEvents != null) { unregisterEvents(this, null); @@ -399,7 +432,7 @@ namespace MatterHackers.MatterControl.PrintLibrary libraryDataView.CurrentLibraryProvider.KeywordFilter = searchText; - breadCrumbWidget.SetBreadCrumbs(null, currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider); + breadCrumbWidget.SetBreadCrumbs(null, this.libraryDataView.CurrentLibraryProvider); }); } @@ -552,17 +585,17 @@ namespace MatterHackers.MatterControl.PrintLibrary base.OnDragDrop(fileDropEventArgs); } - private static void importToLibraryloadFile_ClickOnIdle() + private void importToLibraryloadFile_ClickOnIdle() { OpenFileDialogParams openParams = new OpenFileDialogParams(ApplicationSettings.OpenPrintableFileParams, multiSelect: true); FileDialog.OpenFileDialog(openParams, onLibraryLoadFileSelected); } - private static void onLibraryLoadFileSelected(OpenFileDialogParams openParams) + private void onLibraryLoadFileSelected(OpenFileDialogParams openParams) { if (openParams.FileNames != null) { - currentPrintLibraryWidget.libraryDataView.CurrentLibraryProvider.AddFilesToLibrary(openParams.FileNames, null); + this.libraryDataView.CurrentLibraryProvider.AddFilesToLibrary(openParams.FileNames, null); } } } diff --git a/Library/Provider/LibraryProviderFileSystem.cs b/Library/Provider/LibraryProviderFileSystem.cs index c1f58884a..1e0f0840d 100644 --- a/Library/Provider/LibraryProviderFileSystem.cs +++ b/Library/Provider/LibraryProviderFileSystem.cs @@ -264,6 +264,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } catch (Exception e) { + Debugger.Break(); } // save it to the root directory @@ -304,6 +305,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } catch (Exception e) { + Debugger.Break(); } return outputFileName; @@ -343,6 +345,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } catch (Exception) { + Debugger.Break(); } try @@ -382,6 +385,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider } catch (Exception) { + Debugger.Break(); } }); diff --git a/MatterControlApplication.cs b/MatterControlApplication.cs index ca317ab32..dc1dc8ff6 100644 --- a/MatterControlApplication.cs +++ b/MatterControlApplication.cs @@ -647,6 +647,7 @@ namespace MatterHackers.MatterControl catch (Exception e) { Debug.Print(e.Message); + Debugger.Break(); #if DEBUG throw e; #endif diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index 214fd8603..62df6b0c2 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -1888,8 +1888,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } } - catch (System.UnauthorizedAccessException) + catch (System.UnauthorizedAccessException e2) { + Debug.Print(e2.Message); + Debugger.Break(); saveSucceded = false; UiThread.RunOnIdle(() => { @@ -1897,8 +1899,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow StyledMessageBox.ShowMessageBox(null, "Oops! Unable to save changes.", "Unable to save"); }); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); saveSucceded = false; UiThread.RunOnIdle(() => { diff --git a/PartPreviewWindow/ViewGcodeWidget.cs b/PartPreviewWindow/ViewGcodeWidget.cs index fa9b3ef74..a6a8a3861 100644 --- a/PartPreviewWindow/ViewGcodeWidget.cs +++ b/PartPreviewWindow/ViewGcodeWidget.cs @@ -36,6 +36,7 @@ using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.VectorMath; using System; using System.ComponentModel; +using System.Diagnostics; namespace MatterHackers.MatterControl.PartPreviewWindow { @@ -305,8 +306,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow gCodeRenderer.GCodeFileToDraw.GetFilamentUsedMm(ActiveSliceSettings.Instance.FilamentDiameter); } } - catch (Exception) + catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); } gCodeRenderer.CreateFeaturesForLayerIfRequired(0); } diff --git a/PrinterCommunication/PrinterConnectionAndCommunication.cs b/PrinterCommunication/PrinterConnectionAndCommunication.cs index 13ad4bc34..556fa6a65 100644 --- a/PrinterCommunication/PrinterConnectionAndCommunication.cs +++ b/PrinterCommunication/PrinterConnectionAndCommunication.cs @@ -368,6 +368,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication catch { Console.WriteLine("Unable to convert BaudRate to integer"); + Debugger.Break(); } } return baudRate; @@ -888,8 +889,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication int layerCount = loadedGCode.NumChangesInZ; return layerCount; } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); return -1; } } @@ -995,8 +998,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication OnBedTemperatureSet(new TemperatureEventArgs(0, TargetBedTemperature)); } } - catch + catch(Exception e2) { + Debug.Print(e2.Message); + Debugger.Break(); Debug.WriteLine("Unable to Parse Bed Temperature: {0}".FormatWith(temp)); } } @@ -1112,8 +1117,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication OnFanSpeedSet(null); } } - catch + catch(Exception e2) { + Debug.Print(e2.Message); + Debugger.Break(); Debug.WriteLine("Unable to Parse Fan Speed: {0}".FormatWith(fanSpeed)); } } @@ -1365,6 +1372,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication } catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); // Let's track this issue if possible. MatterControlApplication.Instance.ReportException(e, this.GetType().Name, MethodBase.GetCurrentMethod().Name); } @@ -1584,26 +1593,36 @@ namespace MatterHackers.MatterControl.PrinterCommunication Thread.Sleep(1); } - catch (TimeoutException) + catch (TimeoutException e) { + Debug.Print(e.Message); + Debugger.Break(); } - catch (IOException) + catch (IOException e2) { + Debug.Print(e2.Message); + Debugger.Break(); OnConnectionFailed(null); } catch (InvalidOperationException ex) { + Debug.Print(ex.Message); + Debugger.Break(); Debug.WriteLine(ex.Message); // this happens when the serial port closes after we check and before we read it. } - catch (UnauthorizedAccessException) + catch (UnauthorizedAccessException e3) { + Debug.Print(e3.Message); + Debugger.Break(); OnConnectionFailed(null); } - catch (Exception e) + catch (Exception e4) { + Debug.Print(e4.Message); + Debugger.Break(); // Let's track this issue if possible. - MatterControlApplication.Instance.ReportException(e, this.GetType().Name, MethodBase.GetCurrentMethod().Name); + MatterControlApplication.Instance.ReportException(e4, this.GetType().Name, MethodBase.GetCurrentMethod().Name); } } } @@ -1756,6 +1775,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication } catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); MatterControlApplication.Instance.ReportException(e, this.GetType().Name, MethodBase.GetCurrentMethod().Name); } } @@ -1940,8 +1961,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication string[] portNames = FrostedSerialPort.GetPortNames(); return portNames.Any(x => string.Compare(x, portName, true) == 0); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); return false; } } @@ -2200,13 +2223,17 @@ namespace MatterHackers.MatterControl.PrinterCommunication SendLineToPrinterNow("M105"); SendLineToPrinterNow("M115"); } - catch (System.ArgumentOutOfRangeException) + catch (System.ArgumentOutOfRangeException e) { + Debug.Print(e.Message); + Debugger.Break(); connectionFailureMessage = LocalizedString.Get("Unsupported Baud Rate"); OnConnectionFailed(null); } catch (Exception ex) { + Debug.Print(ex.Message); + Debugger.Break(); Debug.WriteLine("An unexpected exception occurred: " + ex.Message); OnConnectionFailed(null); } @@ -2942,16 +2969,22 @@ namespace MatterHackers.MatterControl.PrinterCommunication } catch (IOException ex) { + Debug.Print(ex.Message); + Debugger.Break(); Trace.WriteLine("Error writing to printer: " + ex.Message); // Handle hardware disconnects by relaying the failure reason and shutting down open resources AbortConnectionAttempt("Connection Lost - " + ex.Message); } - catch (TimeoutException ex) + catch (TimeoutException e2) { + Debug.Print(e2.Message); + Debugger.Break(); } catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); // Let's track this issue if possible. MatterControlApplication.Instance.ReportException(e, this.GetType().Name, MethodBase.GetCurrentMethod().Name); } diff --git a/PrinterControls/PrinterConnections/EditConnectionWidget.cs b/PrinterControls/PrinterConnections/EditConnectionWidget.cs index 84d5f8b81..0821de76e 100644 --- a/PrinterControls/PrinterConnections/EditConnectionWidget.cs +++ b/PrinterControls/PrinterConnections/EditConnectionWidget.cs @@ -5,9 +5,9 @@ using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrinterCommunication; using MatterHackers.SerialPortCommunication.FrostedSerial; - using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections @@ -66,8 +66,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { this.ActivePrinter.ComPort = FrostedSerialPort.GetPortNames().FirstOrDefault(); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); //No active COM ports } } @@ -86,8 +88,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { this.ActivePrinter.ComPort = FrostedSerialPort.GetPortNames().FirstOrDefault(); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); //No active COM ports } } diff --git a/PrinterControls/TerminalWindow/TerminalWidget.cs b/PrinterControls/TerminalWindow/TerminalWidget.cs index e54e6bba4..563730967 100644 --- a/PrinterControls/TerminalWindow/TerminalWidget.cs +++ b/PrinterControls/TerminalWindow/TerminalWidget.cs @@ -34,6 +34,7 @@ using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.MatterControl.PrinterCommunication; using System; using System.Collections.Generic; +using System.Diagnostics; namespace MatterHackers.MatterControl { @@ -232,6 +233,8 @@ namespace MatterHackers.MatterControl } catch(UnauthorizedAccessException e) { + Debug.Print(e.Message); + Debugger.Break(); PrinterOutputCache.Instance.PrinterLines.Add(""); PrinterOutputCache.Instance.PrinterLines.Add(writeFaildeWaring); PrinterOutputCache.Instance.PrinterLines.Add(cantAccessPath.FormatWith(filePathToSave)); diff --git a/Queue/PrintItemWrapper.cs b/Queue/PrintItemWrapper.cs index e9a7a122d..2fd4bb43d 100644 --- a/Queue/PrintItemWrapper.cs +++ b/Queue/PrintItemWrapper.cs @@ -79,8 +79,10 @@ namespace MatterHackers.MatterControl.PrintQueue { this.fileType = Path.GetExtension(this.FileLocation).ToUpper(); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); //file not found } } @@ -181,8 +183,10 @@ namespace MatterHackers.MatterControl.PrintQueue this.fileHashCode = agg_basics.ComputeHash(readData); } } - catch(Exception) + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); this.fileHashCode = 0; } } diff --git a/SlicerConfiguration/ActiveSliceSettings.cs b/SlicerConfiguration/ActiveSliceSettings.cs index 69c64c429..445a3ecaa 100644 --- a/SlicerConfiguration/ActiveSliceSettings.cs +++ b/SlicerConfiguration/ActiveSliceSettings.cs @@ -685,6 +685,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); Debug.WriteLine(string.Format("Error loading configuration: {0}", e)); return null; } @@ -717,6 +719,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); Debug.WriteLine(string.Format("Error loading configuration: {0}", e)); } } @@ -912,6 +916,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); string stackTraceNoBackslashRs = e.StackTrace.Replace("\r", ""); ContactFormWindow.Open("Parse Error while slicing".Localize(), e.Message + stackTraceNoBackslashRs); return false; diff --git a/SlicerConfiguration/SettingsControlSelectors.cs b/SlicerConfiguration/SettingsControlSelectors.cs index 76293ac05..fe5e669d1 100644 --- a/SlicerConfiguration/SettingsControlSelectors.cs +++ b/SlicerConfiguration/SettingsControlSelectors.cs @@ -35,6 +35,7 @@ using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.VectorMath; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace MatterHackers.MatterControl.SlicerConfiguration @@ -251,8 +252,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { dropDownList.SelectedValue = ActivePrinterProfile.Instance.GetMaterialSetting(presetIndex).ToString(); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); //Unable to set selected value } } @@ -262,8 +265,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { dropDownList.SelectedValue = ActivePrinterProfile.Instance.ActiveQualitySettingsID.ToString(); } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); //Unable to set selected value } } @@ -318,8 +323,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { SelectedLabel = MatterSliceInfo.DisplayName; } - catch + catch(Exception e) { + Debug.Print(e.Message); + Debugger.Break(); throw new Exception("MatterSlice is not available, for some strange reason"); } } diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 587bdeb08..81136b04b 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -3706,3 +3706,6 @@ Translated:Rebuild Thumbnails Now English:You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now? Translated:You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now? +English:Loading... +Translated:Loading... + diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 4a14d1ea3..c0727e03f 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 4a14d1ea3c25c1b8ecda0e3c98a31aa9afe979cd +Subproject commit c0727e03f76f04ede32a8408985c679834bdee59 diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index c5d70be17..1efaee724 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -183,8 +183,10 @@ namespace MatterHackers.MatterControl.UI { Directory.Delete(state.userDataPath, true); } - catch (Exception) + catch (Exception e) { + Debug.Print(e.Message); + Debugger.Break(); } } Stopwatch time = Stopwatch.StartNew();