Show troubleshooting information for connection errors
This commit is contained in:
parent
8d495ffe67
commit
4e09a2cc2f
1 changed files with 48 additions and 2 deletions
|
|
@ -1110,8 +1110,18 @@ namespace MatterHackers.MatterControl.PrinterCommunication
|
|||
catch (ArgumentOutOfRangeException e)
|
||||
{
|
||||
TerminalLog.WriteLine("Exception:" + e.Message);
|
||||
|
||||
OnConnectionFailed(ConnectionFailure.UnsupportedBaudRate);
|
||||
UiThread.RunOnIdle(() => {
|
||||
string message = @"The chosen baud rate is not supported by your operating system. Use a different baud rate, if possible.";
|
||||
if (AggContext.OperatingSystem == OSType.X11)
|
||||
{
|
||||
message +=
|
||||
@"
|
||||
|
||||
On Linux, MatterControl requires a serial helper library in order to use certain baud rates. It is possible that this component is missing or not installed properly. ";
|
||||
}
|
||||
StyledMessageBox.ShowMessageBox(message, "Unsupported Baud Rate".Localize(), useMarkdown: true);
|
||||
});
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
|
@ -1121,7 +1131,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication
|
|||
{
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
string message = @"In order for MatterControl to access the serial ports on Linux, you will need to give your user account the appropriate permissions. Run these commands in a terminal to add yourself to the correct group.
|
||||
string message =
|
||||
@"In order for MatterControl to access the serial ports on Linux, you will need to give your user account the appropriate permissions. Run these commands in a terminal to add yourself to the correct group.
|
||||
|
||||
Ubuntu/Debian
|
||||
--------------
|
||||
|
|
@ -1142,15 +1153,45 @@ You will then need to logout and log back in to the computer for the changes to
|
|||
StyledMessageBox.ShowMessageBox(message, "Permission Denied".Localize(), useMarkdown: true);
|
||||
});
|
||||
}
|
||||
else if (e.Message == "The semaphore timeout period has expired." || e.Message == "A device attached to the system is not functioning.")
|
||||
{
|
||||
UiThread.RunOnIdle(() => {
|
||||
string message =
|
||||
@"The operating system has reported that your printer is malfunctioning. MatterControl cannot communicate with it. Contact your printer's manufacturer for assistance.
|
||||
|
||||
Details
|
||||
-------
|
||||
|
||||
" + e.Message;
|
||||
StyledMessageBox.ShowMessageBox(message, "Hardware Error".Localize(), useMarkdown: true);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
UiThread.RunOnIdle(() => {
|
||||
StyledMessageBox.ShowMessageBox(e.Message, e.GetType().ToString());
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
OnConnectionFailed(ConnectionFailure.ConnectionTimeout);
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
string message =
|
||||
@"MatterControl tried to communicate with your printer, but never received a response.
|
||||
|
||||
Make sure that your printer is turned on. Some printers will appear to be connected, even when they are turned off.";
|
||||
StyledMessageBox.ShowMessageBox(message, "Connection Timeout".Localize(), useMarkdown: true);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TerminalLog.WriteLine("Exception:" + ex.Message);
|
||||
OnConnectionFailed(ConnectionFailure.Unknown);
|
||||
UiThread.RunOnIdle(() => {
|
||||
StyledMessageBox.ShowMessageBox(ex.Message, ex.GetType().ToString());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1159,6 +1200,11 @@ You will then need to logout and log back in to the computer for the changes to
|
|||
if (serialPortIsAlreadyOpen)
|
||||
{
|
||||
OnConnectionFailed(ConnectionFailure.PortInUse);
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
string message = @"MatterControl cannot connect to your printer because another program on your computer is already connected. Close any other 3D printing programs or other other programs which access serial ports and try again.";
|
||||
StyledMessageBox.ShowMessageBox(message, "Port In Use".Localize(), useMarkdown: true);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue