aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Firmware
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-14 18:50:59 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-14 18:50:59 +0200
commit73196dd48da9d16b6949ab9dec0ae0a5d63accfe (patch)
tree04bbaade70fb016423d7cd43161f4cbc8bc04b79 /Software/Visual_Studio/Firmware
parentb6283ab40fafa8e738e8e3fec260777a4d250597 (diff)
downloadTango-73196dd48da9d16b6949ab9dec0ae0a5d63accfe.tar.gz
Tango-73196dd48da9d16b6949ab9dec0ae0a5d63accfe.zip
Working on DFU firmware upgrade...
Diffstat (limited to 'Software/Visual_Studio/Firmware')
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManager.cs329
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManagerState.cs35
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeProgressEventArgs.cs15
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressAnimator.cs93
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressDispatcher.cs80
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/AssemblyInfo.cs22
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.Designer.cs62
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.resx117
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.Designer.cs30
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.settings7
-rw-r--r--Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Tango.FirmwareUpdateLib.WPF.csproj93
11 files changed, 883 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManager.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManager.cs
new file mode 100644
index 000000000..d79989ecb
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManager.cs
@@ -0,0 +1,329 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+using Tango.Core;
+
+namespace Tango.FirmwareUpdateLib.WPF
+{
+ public class FirmwareUpgradeManager : ExtendedObject
+ {
+ private FirmwareUpdateManager _updater;
+ private List<DFUDevice> _current_devices;
+
+ #region Events
+
+ /// <summary>
+ /// Reports about the progress of an on-going firmware upgrade.
+ /// </summary>
+ public event EventHandler<FirmwareUpgradeProgressEventArgs> UpgradeProgress;
+
+ #endregion
+
+ #region Properties
+
+ private FirmwareUpgradeManagerState _state;
+ /// <summary>
+ /// Gets or sets the current manager state.
+ /// </summary>
+ public FirmwareUpgradeManagerState State
+ {
+ get { return _state; }
+ private set { _state = value; RaisePropertyChangedAuto(); }
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="FirmwareUpgradeManager"/> class.
+ /// </summary>
+ public FirmwareUpgradeManager()
+ {
+ _current_devices = new List<DFUDevice>();
+ }
+
+ /// <summary>
+ /// Performs a full automatic upgrade by getting the first DFU device switching to DFU mode if necessary.
+ /// Uploading, verifying, resetting the device, then checking device existence.
+ /// </summary>
+ /// <param name="mcuFilePath">The MCU bin file path.</param>
+ /// <returns></returns>
+ public Task PerformUpgrade(byte[] mcuData)
+ {
+ EnsureStateIdle();
+
+ State = FirmwareUpgradeManagerState.Busy;
+
+ TaskCompletionSource<object> taskSource = new TaskCompletionSource<object>();
+
+ ProgressDispatcher progressDispatcher = new ProgressDispatcher();
+
+ Task.Factory.StartNew(() =>
+ {
+ try
+ {
+ OnUpgradeProgressChanged(100, 0, FirmwareUpgradeManagerState.Initializing);
+ Initialize();
+ Thread.Sleep(1000);
+
+ LogManager.Log("Initializing progress dispatcher...");
+
+ OnUpgradeProgressChanged(100, 10, State);
+
+ LogManager.Log("Starting automatic full upgrade...");
+
+ OnUpgradeProgressChanged(100, 20, FirmwareUpgradeManagerState.EnumeratingDevices);
+ var device = GetAvailableDevices().FirstOrDefault();
+ Thread.Sleep(1000);
+
+ State = FirmwareUpgradeManagerState.Busy;
+
+ OnUpgradeProgressChanged(100, 30, State);
+
+ Thread.Sleep(1000);
+
+ if (device == null)
+ {
+ throw LogManager.Log(new NullReferenceException("No DFU device found on the system."));
+ }
+
+ LogManager.Log("Found DFU device...");
+ LogManager.Log($"Name: {device.DeviceName}");
+ LogManager.Log($"Mode: {device.Mode}");
+
+ if (device.Mode == DFUMode.RunTime)
+ {
+ State = FirmwareUpgradeManagerState.SwitchingToDFU;
+ LogManager.Log("Switching to DFU mode...");
+ OnUpgradeProgressChanged(100, 40, State);
+ Thread.Sleep(1000);
+
+ device.SwitchToDFUMode();
+ LogManager.Log("Waiting for the device to comeback (3 sec)...");
+
+ State = FirmwareUpgradeManagerState.Waiting;
+ OnUpgradeProgressChanged(100, 50, State);
+ Thread.Sleep(3000);
+
+ LogManager.Log("Looking for the modified DFU device...");
+ OnUpgradeProgressChanged(100, 60, FirmwareUpgradeManagerState.EnumeratingDevices);
+ Thread.Sleep(1000);
+
+ device = GetAvailableDevices().FirstOrDefault();
+
+ State = FirmwareUpgradeManagerState.SwitchingToDFU;
+ OnUpgradeProgressChanged(100, 60, State);
+
+ if (device == null)
+ {
+ throw LogManager.Log(new NullReferenceException("Could not locate the modified DFU device."));
+ }
+
+ if (device.Mode == DFUMode.RunTime)
+ {
+ throw LogManager.Log(new InvalidOperationException("The DFU device was found but has failed to switch into DFU mode."));
+ }
+
+ LogManager.Log("DFU device successfully switched to DFU mode.");
+ LogManager.Log($"Name: {device.DeviceName}");
+ LogManager.Log($"Mode: {device.Mode}");
+ }
+ else
+ {
+ LogManager.Log("Device is in DFU mode. Skipping DFU switching...");
+ }
+
+ State = FirmwareUpgradeManagerState.StartingUpload;
+ OnUpgradeProgressChanged(100, 100, State);
+
+ LogManager.Log("Starting DFU upload...");
+
+ ProgressMode current_mode = ProgressMode.Verifying;
+
+ progressDispatcher.Initialize();
+
+ progressDispatcher.Invoke(() =>
+ {
+ device.Upload(mcuData, (mode, current, total) =>
+ {
+ try
+ {
+ if (current_mode != mode)
+ {
+ current_mode = mode;
+ LogManager.Log($"DFU Upload Status: {current_mode}");
+ }
+
+ if (mode == ProgressMode.Uploading)
+ {
+ OnUpgradeProgressChanged(total, current, FirmwareUpgradeManagerState.Uploading);
+ }
+ else if (mode == ProgressMode.Verifying)
+ {
+ OnUpgradeProgressChanged(total, current, FirmwareUpgradeManagerState.Verifying);
+ }
+
+ if (mode == ProgressMode.Error)
+ {
+ throw LogManager.Log(new ApplicationException("DFU upload got an error notification!"));
+ }
+ else if (mode == ProgressMode.Completed)
+ {
+ LogManager.Log("DFU upload completed successfully.");
+ LogManager.Log("Resetting the device...");
+ State = FirmwareUpgradeManagerState.Resetting;
+ OnUpgradeProgressChanged(100, 0, State);
+ device.Reset();
+ LogManager.Log("Waiting for the device to comeback (3 sec)...");
+
+ State = FirmwareUpgradeManagerState.Waiting;
+ OnUpgradeProgressChanged(100, 30, State);
+ Thread.Sleep(3000);
+
+ LogManager.Log("Looking for the modified DFU device...");
+ OnUpgradeProgressChanged(100, 70, FirmwareUpgradeManagerState.EnumeratingDevices);
+ device = GetAvailableDevices().FirstOrDefault();
+ Thread.Sleep(1000);
+
+ State = FirmwareUpgradeManagerState.Busy;
+ OnUpgradeProgressChanged(100, 90, State);
+ Thread.Sleep(1000);
+
+ if (device == null)
+ {
+ throw LogManager.Log(new NullReferenceException("Could not locate the modified DFU device."));
+ }
+
+ if (device.Mode == DFUMode.DFU)
+ {
+ throw LogManager.Log(new InvalidOperationException("The DFU device was found but has failed to switch back into RunTime mode."));
+ }
+
+ LogManager.Log("DFU device successfully upgraded!");
+ LogManager.Log($"Name: {device.DeviceName}");
+ LogManager.Log($"Mode: {device.Mode}");
+
+ State = FirmwareUpgradeManagerState.Completed;
+ OnUpgradeProgressChanged(100, 100, State);
+
+ taskSource.SetResult(true);
+
+ progressDispatcher.Close();
+ }
+
+
+ DoEvents();
+ }
+ catch (Exception ex)
+ {
+ taskSource.SetException(ex);
+ progressDispatcher.Close();
+ }
+ finally
+ {
+ State = FirmwareUpgradeManagerState.Idle;
+ }
+ });
+ });
+ }
+ catch (Exception ex)
+ {
+ taskSource.SetException(ex);
+ }
+ finally
+ {
+ State = FirmwareUpgradeManagerState.Idle;
+ }
+ });
+
+ return taskSource.Task;
+ }
+
+ /// <summary>
+ /// Ensures the state idle.
+ /// </summary>
+ /// <exception cref="System.InvalidOperationException"></exception>
+ private void EnsureStateIdle()
+ {
+ if (State != FirmwareUpgradeManagerState.Idle) throw new InvalidOperationException($"Operation can be performed only on {FirmwareUpgradeManagerState.Idle} state.");
+ }
+
+ /// <summary>
+ /// Gets the available devices.
+ /// </summary>
+ /// <returns></returns>
+ private List<DFUDevice> GetAvailableDevices()
+ {
+ State = FirmwareUpgradeManagerState.EnumeratingDevices;
+
+ LogManager.Log("Disposing previous devices...");
+ foreach (var device in _current_devices)
+ {
+ try
+ {
+ LogManager.Log($"Disposing previous device {device.DeviceName}...");
+ device.Dispose();
+ }
+ catch { }
+ }
+
+ try
+ {
+ LogManager.Log("Enumerating available DFU devices...");
+ _current_devices = _updater.GetAvailableDevices(false).Where(x => !x.DeviceName.Contains("In-Circuit Debug Interface")).ToList();
+ }
+ catch (Exception ex)
+ {
+ throw LogManager.Log(ex, "Error enumerating available DFU devices.");
+ }
+
+ return _current_devices;
+ }
+
+ /// <summary>
+ /// Initializes this instance.
+ /// </summary>
+ public void Initialize()
+ {
+ State = FirmwareUpgradeManagerState.Initializing;
+ try
+ {
+ LogManager.Log("Initializing firmware upgrade API...");
+ _updater = new FirmwareUpdateManager();
+ _updater.Initialize();
+ }
+ catch (Exception ex)
+ {
+ throw LogManager.Log(ex, "Error initializing firmware upgrade API.");
+ }
+ }
+
+ private void DoEvents()
+ {
+ Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
+ new Action(delegate { }));
+ }
+
+ /// <summary>
+ /// Raises the <see cref="UpgradeProgress"/> event.
+ /// </summary>
+ /// <param name="total">The total.</param>
+ /// <param name="progress">The progress.</param>
+ /// <param name="state">The state.</param>
+ protected virtual void OnUpgradeProgressChanged(double total, double progress, FirmwareUpgradeManagerState state)
+ {
+ UpgradeProgress?.Invoke(this, new FirmwareUpgradeProgressEventArgs()
+ {
+ Progress = progress,
+ Total = total,
+ State = state,
+ });
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManagerState.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManagerState.cs
new file mode 100644
index 000000000..bcd9f69c2
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeManagerState.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.FirmwareUpdateLib.WPF
+{
+ public enum FirmwareUpgradeManagerState
+ {
+ [Description("")]
+ Idle,
+ [Description("Working...")]
+ Busy,
+ [Description("Initializing...")]
+ Initializing,
+ [Description("Locating DFU devices...")]
+ EnumeratingDevices,
+ [Description("Switching to DFU mode...")]
+ SwitchingToDFU,
+ [Description("Initializing upload sequence...")]
+ StartingUpload,
+ [Description("Uploading...")]
+ Uploading,
+ [Description("Verifying...")]
+ Verifying,
+ [Description("Resetting the device...")]
+ Resetting,
+ [Description("Waiting for the device...")]
+ Waiting,
+ [Description("Firmware upgrade completed.")]
+ Completed,
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeProgressEventArgs.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeProgressEventArgs.cs
new file mode 100644
index 000000000..bb7ddfa17
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/FirmwareUpgradeProgressEventArgs.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.FirmwareUpdateLib.WPF
+{
+ public class FirmwareUpgradeProgressEventArgs : EventArgs
+ {
+ public FirmwareUpgradeManagerState State { get; set; }
+ public double Total { get; set; }
+ public double Progress { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressAnimator.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressAnimator.cs
new file mode 100644
index 000000000..755df4dcb
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressAnimator.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media.Animation;
+
+namespace Tango.FirmwareUpdateLib.WPF
+{
+ /// <summary>
+ /// Represents a progress animation component capable of exposing a current and total progress with animations.
+ /// </summary>
+ /// <seealso cref="System.Windows.FrameworkElement" />
+ public class ProgressAnimator : FrameworkElement
+ {
+ /// <summary>
+ /// Gets or sets the animation duration between each update (Default 2 seconds).
+ /// </summary>
+ public TimeSpan Duration
+ {
+ get { return (TimeSpan)GetValue(DurationProperty); }
+ set { SetValue(DurationProperty, value); }
+ }
+ public static readonly DependencyProperty DurationProperty =
+ DependencyProperty.Register("Duration", typeof(TimeSpan), typeof(ProgressAnimator), new PropertyMetadata(TimeSpan.FromSeconds(1)));
+
+ /// <summary>
+ /// Gets or sets the current progress. (Use the ApplyProgress method instead of updating this directly).
+ /// </summary>
+ public double Current
+ {
+ get { return (double)GetValue(CurrentProperty); }
+ set { SetValue(CurrentProperty, value); }
+ }
+ public static readonly DependencyProperty CurrentProperty =
+ DependencyProperty.Register("Current", typeof(double), typeof(ProgressAnimator), new PropertyMetadata(0.0));
+
+ /// <summary>
+ /// Gets or sets the total expected progress. (Use the ApplyProgress method instead of updating this directly).
+ /// </summary>
+ public double Total
+ {
+ get { return (double)GetValue(TotalProperty); }
+ set { SetValue(TotalProperty, value); }
+ }
+ public static readonly DependencyProperty TotalProperty =
+ DependencyProperty.Register("Total", typeof(double), typeof(ProgressAnimator), new PropertyMetadata(100.0));
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is intermediate.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is intermediate; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsIntermediate
+ {
+ get { return (bool)GetValue(IsIntermediateProperty); }
+ set { SetValue(IsIntermediateProperty, value); }
+ }
+ public static readonly DependencyProperty IsIntermediateProperty =
+ DependencyProperty.Register("IsIntermediate", typeof(bool), typeof(ProgressAnimator), new PropertyMetadata(true));
+
+ /// <summary>
+ /// Applies the progress properties animation.
+ /// </summary>
+ /// <param name="current">The current.</param>
+ /// <param name="total">The total.</param>
+ /// <param name="duration">Will override the default duration for the next progress animation.</param>
+ public void ApplyProgress(double current, double total, TimeSpan? duration = null)
+ {
+ Total = total;
+ IsIntermediate = false;
+
+ DoubleAnimation ani = new DoubleAnimation();
+ ani.To = current;
+
+ ani.Duration = duration != null ? duration.Value : Duration;
+
+ this.BeginAnimation(CurrentProperty, ani, HandoffBehavior.SnapshotAndReplace);
+ }
+
+ /// <summary>
+ /// Resets the progress properties.
+ /// </summary>
+ public void ResetProgress()
+ {
+ this.BeginAnimation(CurrentProperty, null, HandoffBehavior.SnapshotAndReplace);
+ Current = 0;
+ IsIntermediate = true;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressDispatcher.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressDispatcher.cs
new file mode 100644
index 000000000..448e27f55
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/ProgressDispatcher.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+
+namespace Tango.FirmwareUpdateLib.WPF
+{
+ public class ProgressDispatcher
+ {
+ private Dispatcher _dispatcher;
+ private Window _dummyWindow; //Dummy window for the video dispatcher.
+ private Thread _windowThread; //The video dispatcher thread.
+ private bool _initialized;
+
+ public void Initialize()
+ {
+ if (!_initialized)
+ {
+ _windowThread = new Thread(VideoThreadMethod);
+ _windowThread.Name = "Progress Thread";
+ _windowThread.SetApartmentState(ApartmentState.STA);
+ _windowThread.Start();
+
+ while (!_initialized)
+ {
+ Thread.Sleep(10);
+ }
+ }
+ }
+
+ private void VideoThreadMethod()
+ {
+ _dummyWindow = new Window();
+ _dummyWindow.Width = 0;
+ _dummyWindow.Height = 0;
+ _dummyWindow.WindowStyle = WindowStyle.None;
+ _dummyWindow.ShowInTaskbar = false;
+ _dummyWindow.ShowActivated = false;
+ _dummyWindow.ResizeMode = ResizeMode.NoResize;
+ _dummyWindow.Visibility = Visibility.Hidden;
+ _dummyWindow.Opacity = 0;
+
+ _dummyWindow.Closed += (x, y) => _dummyWindow.Dispatcher.InvokeShutdown();
+ _dummyWindow.Loaded += (x, y) =>
+ {
+ _dummyWindow.Width = 0;
+ _dummyWindow.Height = 0;
+ _dummyWindow.WindowStyle = WindowStyle.None;
+ _dummyWindow.ShowInTaskbar = false;
+ _dummyWindow.ShowActivated = false;
+ _dummyWindow.ResizeMode = ResizeMode.NoResize;
+ _dummyWindow.Visibility = Visibility.Hidden;
+ _dummyWindow.Opacity = 0;
+
+ _dispatcher = _dummyWindow.Dispatcher;
+ _initialized = true;
+ };
+
+ Debug.WriteLine("Progress Dispatcher Initialized!");
+ _dummyWindow.Show();
+ Dispatcher.Run();
+
+ }
+
+ public void Invoke(Action action)
+ {
+ _dispatcher.BeginInvoke(action);
+ }
+
+ public void Close()
+ {
+ _dispatcher.InvokeShutdown();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..31aea93a0
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/AssemblyInfo.cs
@@ -0,0 +1,22 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tango.FirmwareUpdateLib.WPF")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Tango.FirmwareUpdateLib.WPF")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.Designer.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.Designer.cs
new file mode 100644
index 000000000..019d81974
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.Designer.cs
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.FirmwareUpdateLib.WPF.Properties {
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if ((resourceMan == null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.FirmwareUpdateLib.WPF.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.resx b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.resx
new file mode 100644
index 000000000..af7dbebba
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.Designer.cs b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.Designer.cs
new file mode 100644
index 000000000..37290bd82
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.FirmwareUpdateLib.WPF.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.settings b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.settings
new file mode 100644
index 000000000..033d7a5e9
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile> \ No newline at end of file
diff --git a/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Tango.FirmwareUpdateLib.WPF.csproj b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Tango.FirmwareUpdateLib.WPF.csproj
new file mode 100644
index 000000000..2b58b0e55
--- /dev/null
+++ b/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib.WPF/Tango.FirmwareUpdateLib.WPF.csproj
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{25D7CC4D-A11C-4065-A797-4A1944F636C0}</ProjectGuid>
+ <OutputType>library</OutputType>
+ <RootNamespace>Tango.FirmwareUpdateLib.WPF</RootNamespace>
+ <AssemblyName>Tango.FirmwareUpdateLib.WPF</AssemblyName>
+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <WarningLevel>4</WarningLevel>
+ <Deterministic>true</Deterministic>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\Build\Core\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\Build\Core\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xaml">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FirmwareUpgradeManager.cs" />
+ <Compile Include="FirmwareUpgradeManagerState.cs" />
+ <Compile Include="FirmwareUpgradeProgressEventArgs.cs" />
+ <Compile Include="ProgressAnimator.cs" />
+ <Compile Include="ProgressDispatcher.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj">
+ <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
+ <Name>Tango.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.Logging\Tango.Logging.csproj">
+ <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project>
+ <Name>Tango.Logging</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Tango.FirmwareUpdateLib\Tango.FirmwareUpdateLib.vcxproj">
+ <Project>{db79fb33-ce7a-49cf-aa89-f697e5cdb0f6}</Project>
+ <Name>Tango.FirmwareUpdateLib</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file