Rename PrinterConnectionAndCommunication

This commit is contained in:
John Lewin 2017-06-13 17:22:49 -07:00
parent 6c0e78eef6
commit 9aaf0f6311
71 changed files with 504 additions and 504 deletions

View file

@ -12,7 +12,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{
public ConnectionWizardPage()
{
cancelButton.Click += (s, e) => PrinterConnectionAndCommunication.Instance.HaltConnectionThread();
cancelButton.Click += (s, e) => PrinterConnection.Instance.HaltConnectionThread();
}
}
}

View file

@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
PrinterConnection.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
}
public override void OnClosed(ClosedEventArgs e)
@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
private void onPrinterStatusChanged(object sender, EventArgs e)
{
if (PrinterConnectionAndCommunication.Instance.PrinterIsConnected)
if (PrinterConnection.Instance.PrinterIsConnected)
{
printerComPortHelpLink.Visible = false;
printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
connectButton.Visible = false;
UiThread.RunOnIdle(() => this?.Parent?.Close());
}
else if (PrinterConnectionAndCommunication.Instance.CommunicationState != PrinterConnectionAndCommunication.CommunicationStates.AttemptingToConnect)
else if (PrinterConnection.Instance.CommunicationState != PrinterConnection.CommunicationStates.AttemptingToConnect)
{
printerComPortHelpLink.Visible = false;
printerComPortError.TextColor = RGBA_Bytes.Red;
@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
ActiveSliceSettings.Instance.Helpers.SetComPort(GetSelectedSerialPort());
PrinterConnectionAndCommunication.Instance.ConnectToActivePrinter();
PrinterConnection.Instance.ConnectToActivePrinter();
connectButton.Visible = false;
refreshButton.Visible = false;

View file

@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
private void SkipConnectionLink_Click(object sender, EventArgs mouseEvent)
{
UiThread.RunOnIdle(() => {
PrinterConnectionAndCommunication.Instance.HaltConnectionThread();
PrinterConnection.Instance.HaltConnectionThread();
Parent.Close();
});
}

View file

@ -33,7 +33,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
connectButton = textImageButtonFactory.Generate("Connect".Localize());
connectButton.Click += ConnectButton_Click;
PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
PrinterConnection.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
//Add buttons to buttonContainer
footerRow.AddChild(nextButton);
@ -116,14 +116,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
printerErrorMessage.Text = "Attempting to connect".Localize() + "...";
ActiveSliceSettings.Instance.Helpers.SetComPort(candidatePort);
PrinterConnectionAndCommunication.Instance.ConnectToActivePrinter();
PrinterConnection.Instance.ConnectToActivePrinter();
connectButton.Visible = false;
}
}
private void onPrinterStatusChanged(object sender, EventArgs e)
{
if (PrinterConnectionAndCommunication.Instance.PrinterIsConnected)
if (PrinterConnection.Instance.PrinterIsConnected)
{
printerErrorMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor;
printerErrorMessage.Text = "Connection succeeded".Localize() + "!";
@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
connectButton.Visible = false;
UiThread.RunOnIdle(() => this?.Parent?.Close());
}
else if (PrinterConnectionAndCommunication.Instance.CommunicationState != PrinterConnectionAndCommunication.CommunicationStates.AttemptingToConnect)
else if (PrinterConnection.Instance.CommunicationState != PrinterConnection.CommunicationStates.AttemptingToConnect)
{
printerErrorMessage.TextColor = RGBA_Bytes.Red;
printerErrorMessage.Text = "Uh-oh! Could not connect to printer.".Localize();