From e47f736bca350350a55fa287093dad560da8f678 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 6 Dec 2018 15:48:47 +0200 Subject: Working on PPC firmware upgrade !!! --- .../PPC/Tango.PPC.Publisher/MainWindow.xaml | 8 ++++++- .../PPC/Tango.PPC.Publisher/MainWindowVM.cs | 25 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Publisher') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindow.xaml index 327cab826..b347ce2c1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindow.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindow.xaml @@ -8,7 +8,7 @@ xmlns:examiner="clr-namespace:Tango.SQLExaminer;assembly=Tango.SQLExaminer" xmlns:local="clr-namespace:Tango.PPC.Publisher" mc:Ignorable="d" - Title="Tango PPC Publisher" Height="980" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"> + Title="Tango PPC Publisher" Height="1000" Width="500" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"> @@ -80,6 +80,12 @@ + Firmware Upgrade Package + + + + + Comments diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs index 081aeba22..881403ea8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs @@ -70,6 +70,13 @@ namespace Tango.PPC.Publisher set { _currentVersion = value; RaisePropertyChangedAuto(); } } + private String _firmwareUpgradeFilePath; + public String FirmwareUpgradeFilePath + { + get { return _firmwareUpgradeFilePath; } + set { _firmwareUpgradeFilePath = value; RaisePropertyChangedAuto(); } + } + private ObservableCollection _provisionSequenceItems; public ObservableCollection ProvisionSequenceItems { @@ -145,6 +152,8 @@ namespace Tango.PPC.Publisher public RelayCommand CreateTupCommand { get; set; } + public RelayCommand FirmwareUpgradePackageBrowseCommand { get; set; } + public MainWindowVM() { SelectedBuildConfiguration = "Release"; @@ -174,6 +183,7 @@ namespace Tango.PPC.Publisher PublishCommand = new RelayCommand(Publish); CreateTupCommand = new RelayCommand(PublishTupFile); + FirmwareUpgradePackageBrowseCommand = new RelayCommand(BrowseFirmwareUpgradePackage); } private async void OnSelectedMachineVersionChanged() @@ -288,6 +298,17 @@ namespace Tango.PPC.Publisher } } + private void BrowseFirmwareUpgradePackage() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Title = "Select Tango Firmware Package"; + dlg.Filter = "Tango Firmware Package Files|*.tfp"; + if (dlg.ShowDialog().Value) + { + FirmwareUpgradeFilePath = dlg.FileName; + } + } + private void ShowError(String error) { MessageBox.Show(error, "PPC Publisher", MessageBoxButton.OK, MessageBoxImage.Error); @@ -303,8 +324,6 @@ namespace Tango.PPC.Publisher return MessageBox.Show(message, "PPC Publisher", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes; } - - private void CreateTupPackage(String filePath) { String _appPath = String.Format(AppDomain.CurrentDomain.BaseDirectory + "..\\{0}", SelectedBuildConfiguration); @@ -312,6 +331,8 @@ namespace Tango.PPC.Publisher using (ZipFile zip = new ZipFile()) { + zip.AddFile(FirmwareUpgradeFilePath, "/"); + String provision_dir = "Provision Scripts"; zip.AddDirectoryByName(provision_dir); -- cgit v1.3.1