diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-27 17:34:54 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-27 17:34:54 +0200 |
| commit | 00de504d4d276063ec6b732cc95e476c89182df2 (patch) | |
| tree | 49bd12dc86ae6c05286b135fe6d4ed0990323144 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 50bfdf5d76ddd3796c6c54153e9af4244119a548 (diff) | |
| download | Tango-00de504d4d276063ec6b732cc95e476c89182df2.tar.gz Tango-00de504d4d276063ec6b732cc95e476c89182df2.zip | |
Worked on PPC publisher.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
5 files changed, 44 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/environment.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/environment.png Binary files differnew file mode 100644 index 000000000..6a9486556 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/environment.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 5fe3ae2bb..2c2ab061e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -409,6 +409,7 @@ <Link>Tango.ColorLib.dll</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> + <Resource Include="Images\environment.png" /> <Resource Include="Images\time-zone.png" /> <Resource Include="Images\no-permissions.png" /> <Resource Include="Images\GlobalStatus\machine-off.png" /> @@ -486,7 +487,7 @@ del "$(TargetDir)firmware_package.tfp"</PostBuildEvent> </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs index 7b8d4dbe6..6cf08a43a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs @@ -49,6 +49,7 @@ namespace Tango.PPC.UI.ViewModels WiFiSelectionView, WiFiTestView, TimeZoneView, + EnvironmentView, SetupWelcomeView, SetupProgressView, SetupCompletedView, @@ -130,6 +131,15 @@ namespace Tango.PPC.UI.ViewModels set { _selectedTimeZone = value; RaisePropertyChangedAuto(); } } + private DeploymentSlots _deploymentSlot; + /// <summary> + /// Gets or sets the deployment slot. + /// </summary> + public DeploymentSlots DeploymentSlot + { + get { return _deploymentSlot; } + set { _deploymentSlot = value; RaisePropertyChangedAuto(); } + } #endregion @@ -159,6 +169,11 @@ namespace Tango.PPC.UI.ViewModels /// Gets or sets the time zone selected command. /// </summary> public RelayCommand TimeZoneSelectedCommand { get; set; } + + /// <summary> + /// Gets or sets the environment selected command. + /// </summary> + public RelayCommand EnvironmentSelectedCommand { get; set; } #endregion #region Constructors @@ -172,7 +187,8 @@ namespace Tango.PPC.UI.ViewModels { MachineSetupManager = machineSetupManager; - HostAddress = Settings.MachineServiceAddress; + DeploymentSlot = Settings.DeploymentSlot; + SerialNumber = ""; CompleteCommand = new RelayCommand(CompleteSetup, () => State == MachineSetupStates.Completed); @@ -183,7 +199,13 @@ namespace Tango.PPC.UI.ViewModels InstallCommand = new RelayCommand(Install); RestartCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.WelcomeView); }); - TimeZoneSelectedCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.SetupWelcomeView); }); + TimeZoneSelectedCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.EnvironmentView); }); + EnvironmentSelectedCommand = new RelayCommand(() => + { + NavigateTo(MachineSetupView.SetupWelcomeView); + Settings.DeploymentSlot = DeploymentSlot; + HostAddress = Settings.GetMachineServiceAddress(); + }); _operationSystemManager = operationSystemManager; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index 79974bff4..a553f3a18 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -136,7 +136,7 @@ namespace Tango.PPC.UI.ViewModels { IsDbUpdate = false; - var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber, Settings.MachineServiceAddress); + var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber, Settings.GetMachineServiceAddress()); if (response.IsUpdateAvailable) { @@ -145,7 +145,7 @@ namespace Tango.PPC.UI.ViewModels } else { - _db_compare_result = await MachineUpdateManager.UpdateDBCheck(MachineProvider.Machine.SerialNumber, Settings.MachineServiceAddress); + _db_compare_result = await MachineUpdateManager.UpdateDBCheck(MachineProvider.Machine.SerialNumber, Settings.GetMachineServiceAddress()); if (_db_compare_result.RequiresUpdate) { @@ -176,7 +176,7 @@ namespace Tango.PPC.UI.ViewModels try { - _update_result = await MachineUpdateManager.Update(MachineProvider.Machine.SerialNumber, Settings.MachineServiceAddress); + _update_result = await MachineUpdateManager.Update(MachineProvider.Machine.SerialNumber, Settings.GetMachineServiceAddress()); LogManager.Log("Machine update completed."); await NavigateTo(MachineUpdateView.UpdateCompletedView); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml index 4832eea01..df50133fd 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml @@ -10,6 +10,7 @@ xmlns:connectivity="clr-namespace:Tango.PPC.Common.Connectivity;assembly=Tango.PPC.Common" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.UI.Views" + xmlns:common="clr-namespace:Tango.PPC.Common;assembly=Tango.PPC.Common" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineSetupViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineSetupViewVM}"> <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}"> @@ -18,7 +19,7 @@ <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 100 0 0"> <Image Source="/Images/package.png" Width="180" Height="180" /> - <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="30">MACHINE SETUP WIZARD</TextBlock> + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="30">Machine Setup Wizard</TextBlock> </StackPanel> <Grid DockPanel.Dock="Bottom" Height="200" Background="{StaticResource TangoMidBackgroundBrush}"> @@ -80,6 +81,19 @@ </StackPanel> </Grid> + <Grid controls:NavigationControl.NavigationName="EnvironmentView"> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="500"> + + <Image Source="/Images/environment.png" Width="128" /> + <TextBlock Margin="0 20 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please select the machine working environment</TextBlock> + <touch:TouchComboBox Margin="0 80 0 0" ItemsSource="{Binding Source={x:Type common:DeploymentSlots},Converter={StaticResource EnumToItemsSourceConverter},ConverterParameter='false'}" SelectedItem="{Binding DeploymentSlot}"> + + </touch:TouchComboBox> + + <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding EnvironmentSelectedCommand}">CONTINUE</touch:TouchButton> + </StackPanel> + </Grid> + <Grid controls:NavigationControl.NavigationName="SetupWelcomeView"> <StackPanel> <TextBlock TextAlignment="Center" LineHeight="40" FontSize="{StaticResource TangoTitleFontSize}" Margin="40 0" TextWrapping="Wrap"> |
