From 73196dd48da9d16b6949ab9dec0ae0a5d63accfe Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 14 Feb 2019 18:50:59 +0200 Subject: Working on DFU firmware upgrade... --- .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 4 +- .../Tango.PPC.Common/WatchDog/WatchDogClient.cs | 12 +++ .../Tango.PPC.Common/WatchDog/WatchDogServer.cs | 55 ++++++++++ .../PPC/Tango.PPC.WatchDog/App.config | 6 ++ .../Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml | 9 ++ .../PPC/Tango.PPC.WatchDog/App.xaml.cs | 17 +++ .../PPC/Tango.PPC.WatchDog/MainWindow.xaml | 35 ++++++ .../PPC/Tango.PPC.WatchDog/MainWindow.xaml.cs | 29 +++++ .../PPC/Tango.PPC.WatchDog/MainWindowVM.cs | 14 +++ .../Tango.PPC.WatchDog/Properties/AssemblyInfo.cs | 11 ++ .../Properties/Resources.Designer.cs | 71 +++++++++++++ .../Tango.PPC.WatchDog/Properties/Resources.resx | 117 ++++++++++++++++++++ .../Properties/Settings.Designer.cs | 30 ++++++ .../Properties/Settings.settings | 7 ++ .../Tango.PPC.WatchDog/Tango.PPC.WatchDog.csproj | 118 +++++++++++++++++++++ .../Visual_Studio/PPC/Tango.PPC.WatchDog/cat.png | Bin 0 -> 5429 bytes .../Visual_Studio/PPC/Tango.PPC.WatchDog/close.png | Bin 0 -> 651 bytes 17 files changed, 534 insertions(+), 1 deletion(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogClient.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogServer.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindowVM.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Tango.PPC.WatchDog.csproj create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/cat.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.WatchDog/close.png (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index 1b51876d7..124e6e276 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -193,6 +193,8 @@ + + MSBuild:Compile Designer @@ -353,7 +355,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogClient.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogClient.cs new file mode 100644 index 000000000..47a24ea85 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogClient.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.WatchDog +{ + public class WatchDogClient + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogServer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogServer.cs new file mode 100644 index 000000000..77bca2e30 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/WatchDog/WatchDogServer.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Pipes; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.WatchDog +{ + public class WatchDogServer + { + private NamedPipeServerStream _server; + private Thread _thread; + + public bool IsStarted { get; private set; } + + public void Start() + { + _thread = new Thread(ThreadMethod); + _thread.IsBackground = true; + _thread.Start(); + } + + private void ThreadMethod() + { + IsStarted = true; + + try + { + _server = new NamedPipeServerStream("Tango_Watch_Dog_Pipe"); + _server.WaitForConnection(); + StreamReader reader = new StreamReader(_server); + StreamWriter writer = new StreamWriter(_server); + + while (IsStarted) + { + var line = reader.ReadLine(); + writer.WriteLine(line); + writer.Flush(); + } + } + catch + { + IsStarted = false; + } + } + + public void Stop() + { + _server.Dispose(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config new file mode 100644 index 000000000..731f6de6c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml new file mode 100644 index 000000000..a78cd685d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml.cs new file mode 100644 index 000000000..3e39963bd --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace Tango.PPC.WatchDog +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml new file mode 100644 index 000000000..4e772e774 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + Tango Watch Dog + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml.cs new file mode 100644 index 000000000..585fc3510 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindow.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.WatchDog +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + DataContext = new MainWindowVM(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindowVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindowVM.cs new file mode 100644 index 000000000..a95a9503c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/MainWindowVM.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.WatchDog +{ + public class MainWindowVM : ViewModel + { + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..254eb3416 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +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 PPC Watch Dog")] +[assembly: AssemblyVersion("1.0.2.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.Designer.cs new file mode 100644 index 000000000..44abe9d05 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.WatchDog.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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.PPC.WatchDog.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [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/PPC/Tango.PPC.WatchDog/Properties/Resources.resx b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.Designer.cs new file mode 100644 index 000000000..3bf29275f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.WatchDog.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/PPC/Tango.PPC.WatchDog/Properties/Settings.settings b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Tango.PPC.WatchDog.csproj b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Tango.PPC.WatchDog.csproj new file mode 100644 index 000000000..b9429e044 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/Tango.PPC.WatchDog.csproj @@ -0,0 +1,118 @@ + + + + + Debug + AnyCPU + {280267F5-A19E-4B96-999D-C13D293ECA45} + WinExe + Tango.PPC.WatchDog + Tango.PPC.WatchDog + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + AnyCPU + true + full + false + ..\..\Build\PPC\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + ..\..\Build\PPC\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + GlobalVersionInfo.cs + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/cat.png b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/cat.png new file mode 100644 index 000000000..b5020c106 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/cat.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/close.png b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/close.png new file mode 100644 index 000000000..3a040a008 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/close.png differ -- cgit v1.3.1