aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index de8e118e9..57ba6e727 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -3371,8 +3371,10 @@ namespace Tango.Integration.Operation
/// Upgrades the firmware.
/// </summary>
/// <param name="tfpStream">The TFP stream (Tango Firmware Package File).</param>
+ /// <param name="isEmulated">Specify whether the connected machine is emulated and to skip the actual DFU interface.</param>
/// <returns></returns>
- public virtual async Task<FirmwareUpgradeHandler> UpgradeFirmware(Stream tfpStream)
+ /// <exception cref="InvalidOperationException"></exception>
+ public virtual async Task<FirmwareUpgradeHandler> UpgradeFirmware(Stream tfpStream, bool isEmulated = false)
{
bool cancel = false;
ZipFile zip = null;
@@ -3493,8 +3495,16 @@ namespace Tango.Integration.Operation
try
{
- LogManager.Log("Upgrading...");
- upgradeManager.PerformUpgrade(data).Wait();
+ if (!isEmulated)
+ {
+ LogManager.Log("Upgrading...");
+ upgradeManager.PerformUpgrade(data).Wait();
+ }
+ else
+ {
+ LogManager.Log("Upgrading (emulated)...");
+ Thread.Sleep(3000);
+ }
}
catch (Exception ex)
{
@@ -3512,6 +3522,7 @@ namespace Tango.Integration.Operation
LogManager.Log("Reconnecting adapter...");
upgradeHandler.RaiseProgress(100, FirmwareUpgradeStatus.Upgrading, "Connecting...");
Adapter.Connect().Wait();
+
Connect().Wait();
LogManager.Log("Connected...");