diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 9db3f17e2..80ba87ce1 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1893,7 +1893,7 @@ namespace Tango.Integration.Operation { liquidQuantities.Add(pack.PackIndex, 0); } - + bool stop_calc = false; for (int segmentIndex = 0; segmentIndex < effectiveSegments.Count && !stop_calc; segmentIndex++) @@ -1945,7 +1945,8 @@ namespace Tango.Integration.Operation { brush_length_centimeters = position_cm - total_length; stop_calc = true; - } } + } + } prev_offset_cm = brush_offset_cm; @@ -3424,8 +3425,19 @@ namespace Tango.Integration.Operation MachineEventsStateProvider.Reset(); } - LogManager.Log("Upgrading..."); - upgradeManager.PerformUpgrade(data).Wait(); + try + { + LogManager.Log("Upgrading..."); + upgradeManager.PerformUpgrade(data).Wait(); + } + catch (Exception ex) + { + LogManager.Log("Firmware upgrade failed while doing DFU upload. We need to destroy the whole transport layer.", LogCategory.Error); + Status = MachineStatuses.Disconnected; + upgradeHandler.RaiseFailed(ex); + OnFailed(ex); + return; + } LogManager.Log("Waiting for the device..."); upgradeHandler.RaiseProgress(100, FirmwareUpgradeStatus.Upgrading, "Waiting for the device..."); |
