diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-10 12:59:22 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-10 12:59:22 +0200 |
| commit | 6240aad18f5dc54d4e29bf2d39f49ef1ba39742f (patch) | |
| tree | 8899a6345ec0f2ac105d10536a8b33ecacdaf2da /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | |
| parent | ee0f4151c329542c30041ff1da91d25e8d8e2575 (diff) | |
| download | Tango-6240aad18f5dc54d4e29bf2d39f49ef1ba39742f.tar.gz Tango-6240aad18f5dc54d4e29bf2d39f49ef1ba39742f.zip | |
Added array support for stubsexec.
Improved PPC update & setup.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 4932d1e72..9ae77df6f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -13,6 +13,7 @@ using Tango.Core; using Tango.Core.DB; using Tango.Core.Helpers; using Tango.Core.IO; +using Tango.Integration.Operation; using Tango.PMR.Synchronization; using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; @@ -83,6 +84,23 @@ namespace Tango.PPC.Common.MachineUpdate { LogManager.Log($"Starting machine update for serial number {serialNumber}..."); + //Connecting to machine... + LogManager.Log("Verifying machine connection and state..."); + + UpdateProgress("Verifying machine state", "Initializing..."); + + await Task.Delay(1000); + + IMachineOperator op = _machineProvider.MachineOperator; + if (op.State != Transport.TransportComponentState.Connected) + { + throw new InvalidOperationException("Could not perform an update while the machine is not connected."); + } + if (op.Status != MachineStatuses.ReadyToDye) + { + throw new InvalidOperationException($"Could not perform an update while the machine is in a {op.Status} status."); + } + //Connect to machine service and get matching packages for this machine. UpdateProgress("Downloading software package", "Connecting to machine service..."); @@ -217,7 +235,6 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log(""); LogManager.Log("-------------------------------------------------------------------------"); LogManager.Log("Updating Firmware..."); - var op = _machineProvider.MachineOperator; UpdateProgress("Updating Firmware", "Loading firmware package..."); var tfpPath = Path.Combine(_newPackageTempFolder, "firmware_package.tfp"); |
