diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-06 15:48:47 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-06 15:48:47 +0200 |
| commit | e47f736bca350350a55fa287093dad560da8f678 (patch) | |
| tree | e74e726fd90cb6e791ecb5872010cb6eb61a13c8 /Software/Visual_Studio/PPC/Tango.PPC.Publisher | |
| parent | 1eb3962e5923cbb398c5ebad505e69f4617f963f (diff) | |
| download | Tango-e47f736bca350350a55fa287093dad560da8f678.tar.gz Tango-e47f736bca350350a55fa287093dad560da8f678.zip | |
Working on PPC firmware upgrade !!!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Publisher')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindow.xaml | 8 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs | 25 |
2 files changed, 30 insertions, 3 deletions
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}"> <Window.Resources> <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> @@ -80,6 +80,12 @@ </DataGrid.Columns> </DataGrid> + <TextBlock Margin="0 20 0 0">Firmware Upgrade Package</TextBlock> + <DockPanel Margin="0 5 0 0"> + <Button DockPanel.Dock="Right" Margin="10 0 0 0" Command="{Binding FirmwareUpgradePackageBrowseCommand}">BROWSE</Button> + <TextBox IsReadOnly="True" Text="{Binding FirmwareUpgradeFilePath}"></TextBox> + </DockPanel> + <StackPanel Margin="0 30 0 0"> <TextBlock>Comments</TextBlock> 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<SequenceItem> _provisionSequenceItems; public ObservableCollection<SequenceItem> 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); |
