Try to connect to printers that have auto connect enabled when they are selected

removed dead code
This commit is contained in:
Lars Brubaker 2016-07-14 17:07:04 -07:00
parent b9eb54a4e1
commit cec9a85435
4 changed files with 15 additions and 20 deletions

View file

@ -76,6 +76,17 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
if (!MatterControlApplication.IsLoading)
{
OnActivePrinterChanged(null);
string[] comportNames = FrostedSerialPort.GetPortNames();
if (Instance.GetValue<bool>(SettingsKey.auto_connect))
{
UiThread.RunOnIdle(() =>
{
//PrinterConnectionAndCommunication.Instance.HaltConnectionThread();
PrinterConnectionAndCommunication.Instance.ConnectToActivePrinter();
}, 2);
}
}
}
}
@ -127,24 +138,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
static ActiveSliceSettings()
{
// Load Startup Profile
bool portExists = false;
string[] comportNames = FrostedSerialPort.GetPortNames();
var startupProfile = ProfileManager.Instance.LoadLastProfile();
if (startupProfile != null)
{
portExists = comportNames.Contains(startupProfile.ComPort());
Instance = startupProfile;
if (portExists && startupProfile.GetValue<bool>(SettingsKey.auto_connect))
{
UiThread.RunOnIdle(() =>
{
//PrinterConnectionAndCommunication.Instance.HaltConnectionThread();
PrinterConnectionAndCommunication.Instance.ConnectToActivePrinter();
}, 2);
}
}
if (Instance == null)

View file

@ -851,11 +851,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
#endregion
public void SetAutoConnect(bool autoConnectPrinter)
{
layeredProfile.SetValue(SettingsKey.auto_connect, autoConnectPrinter ? "1" : "0");
}
public void SetMarkedForDelete(bool markedForDelete)
{
var printerInfo = ProfileManager.Instance.ActiveProfile;

View file

@ -5185,3 +5185,6 @@ Translated:Printers to Upload:
English:Upload
Translated:Upload
English:Printer History
Translated:Printer History

@ -1 +1 @@
Subproject commit 82e2c37a7beb2d974181a5c34fae278693f38fd6
Subproject commit 3468527712576a49973dd7688b7d9e0685104c20