aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-05-13 14:24:00 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-05-13 14:24:00 +0300
commit9aca4b69b22a08d01b12e358eb198f3fbe92ff2a (patch)
tree1d02a8bbcf091f3e6514feb223e34a84983b4107 /Software
parent4cc4089f36b0a9b9d754e33acb49da930f846699 (diff)
downloadTango-9aca4b69b22a08d01b12e358eb198f3fbe92ff2a.tar.gz
Tango-9aca4b69b22a08d01b12e358eb198f3fbe92ff2a.zip
Added DFU reset to PPC.
Diffstat (limited to 'Software')
-rw-r--r--Software/DB/PPC/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/PPC/Tango_log.ldfbin53673984 -> 53673984 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml8
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs25
5 files changed, 28 insertions, 7 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf
index 6751ca940..53b2eff86 100644
--- a/Software/DB/PPC/Tango.mdf
+++ b/Software/DB/PPC/Tango.mdf
Binary files differ
diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf
index 0f6384349..c3aa83372 100644
--- a/Software/DB/PPC/Tango_log.ldf
+++ b/Software/DB/PPC/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs
index b2f93c29d..c368e77e2 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs
@@ -138,7 +138,7 @@ namespace Tango.PPC.Technician.ViewModels
{
CPU = GetAppCPU();
RAM = GetAppRam();
- Temperature = GetTemperature();
+ //Temperature = GetTemperature();
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml
index d96da4f93..f6e6370c1 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml
@@ -50,7 +50,13 @@
</UniformGrid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" TextElement.FontSize="{StaticResource TangoTitleFontSize}">
- <touch:TouchButton Command="{Binding ResetDeviceCommand}" Height="60" Background="{StaticResource TangoErrorBrush}">Reset Machine</touch:TouchButton>
+ <touch:TouchButton Command="{Binding ResetDeviceCommand}" Height="60" Content="Reset Machine">
+ <touch:TouchButton.Style>
+ <Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
+ <Setter Property="Background" Value="{StaticResource TangoErrorBrush}"></Setter>
+ </Style>
+ </touch:TouchButton.Style>
+ </touch:TouchButton>
<touch:TouchButton Command="{Binding RestartCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Restart Device</touch:TouchButton>
<touch:TouchButton Command="{Binding ShutdownCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Shutdown Device</touch:TouchButton>
<touch:TouchButton Command="{Binding FactoryResetCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Factory Reset</touch:TouchButton>
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 1f01c8873..f8e632fa5 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -2277,6 +2277,10 @@ namespace Tango.Integration.Operation
{
LogManager.Log("Performing device reset through DFU...");
+ //LogManager.Log("Disconnecting Operator...");
+ //Disconnect().Wait();
+ //LogManager.Log("Operator disconnected.");
+
FirmwareUpdateManager updateManager = new FirmwareUpdateManager();
LogManager.Log("Initializing DFU API...");
@@ -2289,11 +2293,22 @@ namespace Tango.Integration.Operation
LogManager.Log($"DFU device found: '{device.DeviceName}'.");
LogManager.Log("Switching to DFU mode...");
device.SwitchToDFUMode();
- Thread.Sleep(3000);
- LogManager.Log("Resetting device...");
- device.Reset();
- Thread.Sleep(1000);
- LogManager.Log("Reset completed.");
+ Thread.Sleep(6000);
+
+ LogManager.Log("Reattaching to DFU device...");
+ device = updateManager.GetAvailableDevices(false).Where(x => !x.DeviceName.Contains("In-Circuit Debug Interface")).FirstOrDefault();
+
+ if (device != null)
+ {
+ LogManager.Log("Resetting device...");
+ device.Reset();
+ Thread.Sleep(1000);
+ LogManager.Log("Reset completed.");
+ }
+ else
+ {
+ throw LogManager.Log(new Exception("DFU device not found."));
+ }
}
else
{