diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-02 16:37:25 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-02 16:37:25 +0200 |
| commit | a2d959a7777bf2387d0f50dbc1ecf69f53e2253d (patch) | |
| tree | 8c6367189294d96ae074f386cdb4139dfeacb84a /Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator | |
| parent | ae614a63f593122cd28c644625db179f298dd640 (diff) | |
| download | Tango-a2d959a7777bf2387d0f50dbc1ecf69f53e2253d.tar.gz Tango-a2d959a7777bf2387d0f50dbc1ecf69f53e2253d.zip | |
Implemented machine studio storage module. firmware upgrade version/validate/activate.
Implemented firmware package generator utility.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator')
15 files changed, 695 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.config b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.config new file mode 100644 index 000000000..be3d2b956 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.config @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.xaml b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.xaml new file mode 100644 index 000000000..acec406cb --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.xaml @@ -0,0 +1,25 @@ +<Application x:Class="Tango.FirmwarePackageGenerator.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.FirmwarePackageGenerator" + StartupUri="MainWindow.xaml"> + <Application.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! --> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> + <!-- Accent and AppTheme setting --> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Red.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" /> + + <!--View Models--> + <ResourceDictionary> + <local:MainWindowVM x:Key="MainWindowVM" /> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> +</Application> diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.xaml.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/App.xaml.cs new file mode 100644 index 000000000..39bd940b8 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/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.FirmwarePackageGenerator +{ + /// <summary> + /// Interaction logic for App.xaml + /// </summary> + public partial class App : Application + { + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Images/firmware_upgrade.png b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Images/firmware_upgrade.png Binary files differnew file mode 100644 index 000000000..fc0799143 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Images/firmware_upgrade.png diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindow.xaml new file mode 100644 index 000000000..76b6f8aa4 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindow.xaml @@ -0,0 +1,41 @@ +<mahApps:MetroWindow x:Class="Tango.FirmwarePackageGenerator.MainWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:pmr="clr-namespace:Tango.PMR.IO;assembly=Tango.PMR" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:Tango.FirmwarePackageGenerator" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + mc:Ignorable="d" + Title="Tango - Firmware Package Generator" Height="700" Width="378.772" TitleCaps="False" BorderBrush="Gray" BorderThickness="1" WindowStartupLocation="CenterScreen" Background="#202020" Foreground="Gainsboro" d:DataContext="{d:DesignInstance Type={x:Type local:MainWindowVM},IsDesignTimeCreatable=False}" EnableDWMDropShadow="True"> + + <Window.Resources> + <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> + </Window.Resources> + + <Grid> + <DockPanel Margin="10"> + <Grid DockPanel.Dock="Bottom"> + <Button Command="{Binding GenerateCommand}" Height="60" Style="{StaticResource AccentedSquareButtonStyle}" mahApps:ButtonHelper.PreserveTextCase="True" BorderThickness="0">GENERATE</Button> + </Grid> + + <StackPanel DockPanel.Dock="Top"> + <Image Source="/Images/firmware_upgrade.png" Height="150" RenderOptions.BitmapScalingMode="Fant" /> + <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0"> + <Run>Fill the grid below to add firmware version files.</Run> + </TextBlock> + </StackPanel> + + <Grid> + <DataGrid Margin="0 20" SelectionMode="Single" SelectionUnit="FullRow" HorizontalScrollBarVisibility="Disabled" AutoGenerateColumns="False" ItemsSource="{Binding VersionFiles}" CanUserAddRows="True" CanUserReorderColumns="False" CanUserDeleteRows="True" CanUserSortColumns="False" AddingNewItem="DataGrid_AddingNewItem"> + <DataGrid.Columns> + <DataGridTextColumn IsReadOnly="True" Width="1*" Header="File Name" Binding="{Binding FileName}" /> + <DataGridComboBoxColumn Width="100" Header="DESTINATION" ItemsSource="{Binding Source={x:Type pmr:VersionFileDestination},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValueBinding="{Binding Destination}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" /> + <DataGridTextColumn Width="70" Header="VERSION" Binding="{Binding Version}" /> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </Grid> +</mahApps:MetroWindow> diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindow.xaml.cs new file mode 100644 index 000000000..9aa79f469 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindow.xaml.cs @@ -0,0 +1,43 @@ +using MahApps.Metro.Controls; +using Microsoft.Win32; +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.FirmwarePackageGenerator +{ + /// <summary> + /// Interaction logic for MainWindow.xaml + /// </summary> + public partial class MainWindow : MetroWindow + { + public MainWindow() + { + InitializeComponent(); + DataContext = new MainWindowVM(); + } + + private void DataGrid_AddingNewItem(object sender, AddingNewItemEventArgs e) + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Firmware Package Files|*.bin;*.fpga"; + if (dlg.ShowDialog().Value) + { + VersionFileModel item = new VersionFileModel(); + item.Path = dlg.FileName; + e.NewItem = item; + } + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindowVM.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindowVM.cs new file mode 100644 index 000000000..718aa3aac --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/MainWindowVM.cs @@ -0,0 +1,103 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.PMR.IO; +using Tango.SharedUI; +using Google.Protobuf; +using Ionic.Zip; +using System.Windows; + +namespace Tango.FirmwarePackageGenerator +{ + public class MainWindowVM : ViewModel + { + private ObservableCollection<VersionFileModel> _versionFiles; + public ObservableCollection<VersionFileModel> VersionFiles + { + get { return _versionFiles; } + set { _versionFiles = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand GenerateCommand { get; set; } + + public MainWindowVM() + { + VersionFiles = new ObservableCollection<VersionFileModel>(); + GenerateCommand = new RelayCommand(Generate); + } + + private void Generate() + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Save Firmware Package File"; + dlg.Filter = "Tango Firmware Package|*.tfp"; + dlg.DefaultExt = ".tfp"; + dlg.FileName = "firmware_package.tfp"; + if (dlg.ShowDialog().Value) + { + try + { + VersionPackageDescriptor descriptor = new VersionPackageDescriptor(); + foreach (var item in VersionFiles) + { + descriptor.FileDescriptors.Add(new VersionFileDescriptor() + { + Destination = item.Destination, + FileName = item.FileName, + Version = item.Version, + }); + } + + using (MemoryStream ms = new MemoryStream()) + { + descriptor.WriteTo(ms); + + using (var zip = new ZipFile()) + { + zip.AddEntry("package.cfg", ms.ToArray()); + foreach (var item in VersionFiles) + { + zip.AddFile(item.Path, "/"); + } + + zip.Save(dlg.FileName); + } + } + + //Validate + using (ZipFile zip = ZipFile.Read(dlg.FileName)) + { + var reader = zip.Entries.SingleOrDefault(x => x.FileName == "package.cfg").OpenReader(); + var descriptor2 = VersionPackageDescriptor.Parser.ParseFrom(reader); + if (descriptor.ToString() != descriptor2.ToString()) + { + throw new IOException("The generated package does not match the source package."); + } + } + + ShowInfo("Package generated successfully."); + } + catch (Exception ex) + { + ShowError($"Error while trying to generate the package.\n{ex.Message}"); + } + } + } + + private void ShowError(String error) + { + MessageBox.Show(error, "PPC Publisher", MessageBoxButton.OK, MessageBoxImage.Error); + } + + private void ShowInfo(String message) + { + MessageBox.Show(message, "PPC Publisher", MessageBoxButton.OK, MessageBoxImage.Information); + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..b9727e630 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Firmware Package Generator Utility")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/Resources.Designer.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/Resources.Designer.cs new file mode 100644 index 000000000..30d0ee544 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <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.FirmwarePackageGenerator.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.FirmwarePackageGenerator.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/Utilities/Tango.FirmwarePackageGenerator/Properties/Resources.resx b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/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/Utilities/Tango.FirmwarePackageGenerator/Properties/Settings.Designer.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/Settings.Designer.cs new file mode 100644 index 000000000..c3d44ce2c --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/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.FirmwarePackageGenerator.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/Utilities/Tango.FirmwarePackageGenerator/Properties/Settings.settings b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/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/Utilities/Tango.FirmwarePackageGenerator/Tango.FirmwarePackageGenerator.csproj b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Tango.FirmwarePackageGenerator.csproj new file mode 100644 index 000000000..4ca1eb322 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/Tango.FirmwarePackageGenerator.csproj @@ -0,0 +1,134 @@ +<?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>{43135FB9-41DB-4F87-9771-CF2C762027C0}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>Tango.FirmwarePackageGenerator</RootNamespace> + <AssemblyName>fpgen</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\Build\Utilities\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>..\..\Build\Utilities\Debug\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> + </Reference> + <Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <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> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Compile Include="VersionFileModel.cs" /> + <Page Include="MainWindow.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="..\..\Versioning\GlobalVersionInfo.cs"> + <Link>GlobalVersionInfo.cs</Link> + </Compile> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Compile Include="MainWindow.xaml.cs"> + <DependentUpon>MainWindow.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <Compile Include="MainWindowVM.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="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.PMR\Tango.PMR.csproj"> + <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> + <Name>Tango.PMR</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> + <Name>Tango.SharedUI</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup /> + <ItemGroup> + <Resource Include="Images\firmware_upgrade.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/VersionFileModel.cs b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/VersionFileModel.cs new file mode 100644 index 000000000..1431fa74d --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/VersionFileModel.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.PMR.IO; + +namespace Tango.FirmwarePackageGenerator +{ + public class VersionFileModel : ExtendedObject + { + public VersionFileModel() + { + Version = "1.0.0.0"; + } + + private String _path; + public String Path + { + get { return _path; } + set { _path = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(FileName)); } + } + + public String FileName + { + get { return System.IO.Path.GetFileName(Path); } + } + + private String _version; + public String Version + { + get { return _version; } + set { _version = value; RaisePropertyChangedAuto(); } + } + + private VersionFileDestination _destination; + public VersionFileDestination Destination + { + get { return _destination; } + set { _destination = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/packages.config b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/packages.config new file mode 100644 index 000000000..5521d9817 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.FirmwarePackageGenerator/packages.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Google.Protobuf" version="3.4.1" targetFramework="net461" /> + <package id="Ionic.Zip" version="1.9.1.8" targetFramework="net461" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net461" /> +</packages>
\ No newline at end of file |
