diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-22 19:49:09 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-22 19:49:09 +0300 |
| commit | c2945492e7c4d168c36b632d1f28dd8ca569b5ac (patch) | |
| tree | f00b91ce4985e2fcae6d245df3d21839a193a23a /Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs | |
| parent | 14f0ccfdac1b5bcecab3854204be1e071faa80f5 (diff) | |
| download | Tango-c2945492e7c4d168c36b632d1f28dd8ca569b5ac.tar.gz Tango-c2945492e7c4d168c36b632d1f28dd8ca569b5ac.zip | |
Improved ExternalBridge discovery greatly!
Implemented volume gradient generation!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 82d805a70..3ffb6f634 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -79,6 +79,13 @@ namespace Tango.PPC.Common.Connection MachineOperator.UseKeepAlive = true; MachineOperator.EnableDiagnostics = false; MachineOperator.EnableEmbeddedDebugging = false; + + var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + + MachineOperator.JobUploadStrategy = settings.JobUploadStrategy; + + MachineOperator.GradientGenerationConfiguration.IsEnabled = settings.EnableGradientGeneration; + MachineOperator.GradientGenerationConfiguration.ResolutionCM = settings.GradientGenerationResolution; } private async void ConnectionThreadMethod() @@ -125,7 +132,15 @@ namespace Tango.PPC.Common.Connection UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, UsbSerialBaudRates.BR_115200); MachineOperator.Adapter = adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; - await MachineOperator.Connect(); + try + { + await MachineOperator.Connect(); + } + catch (Exception) + { + await adapter.Disconnect(); + throw; + } await Task.Delay(1000); await MachineOperator.UploadHardwareConfiguration(Machine.Configuration.HardwareVersion, Machine.Configuration); |
