diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-10-18 11:30:52 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-10-18 11:45:04 +0300 |
| commit | 81875b89c85e0785e4f575a6f24e05435cdec0af (patch) | |
| tree | 915b12c4b861b51ba53478831ced0958a452bd41 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 6633cb47da2bd14a5bbe356a7c4602c6d09462d1 (diff) | |
| download | Tango-81875b89c85e0785e4f575a6f24e05435cdec0af.tar.gz Tango-81875b89c85e0785e4f575a6f24e05435cdec0af.zip | |
Added update version/update db icons to x4
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png | bin | 0 -> 568 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png | bin | 0 -> 457 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 4 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 44 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml | 4 |
5 files changed, 50 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png Binary files differnew file mode 100644 index 000000000..519f570fc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateDB.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.png Binary files differnew file mode 100644 index 000000000..5510f1006 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Menu/updateVersion.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 a0fba3632..8f65f225b 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 @@ -646,6 +646,8 @@ <Resource Include="Images\Overview Icons\temperature.png" /> <Resource Include="Images\screw.png" /> <Resource Include="Images\Menu\AppPower_image.png" /> + <Resource Include="Images\Menu\updateDB.png" /> + <Resource Include="Images\Menu\updateVersion.png" /> <Content Include="Intro.wmv" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> @@ -991,7 +993,7 @@ if $(ConfigurationName) == Eureka copy /Y "$(ProjectDir)Intro.wmv" "$(TargetDir) </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> <Import Project="..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets" Condition="Exists('..\..\packages\WPFMediaKit.2.2.0\build\WPFMediaKit.targets')" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 17b676499..56314414a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -14,8 +14,10 @@ using Tango.Integration.Operation; using Tango.PMR.IFS; using Tango.PPC.Common; using Tango.PPC.Common.Connection; +using Tango.PPC.Common.MachineUpdate; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Web; using Tango.PPC.UI.Dialogs; using Tango.PPC.UI.Views; using Tango.PPC.UI.ViewsContracts; @@ -39,6 +41,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IPPCModuleLoader ModuleLoader { get; set; } + [TangoInject] + public IMachineUpdateManager MachineUpdateManager { get; set; } + #region Classes public class CartridgeModel : ExtendedObject @@ -230,6 +235,26 @@ namespace Tango.PPC.UI.ViewModels set { _currentDateTime = value; RaisePropertyChangedAuto(); } } + private bool _enableDBUpdate; + /// <summary> + /// Gets or sets a value indicating whether to automatically check for new application updates. + /// </summary> + public bool EnableDBUpdate + { + get { return _enableDBUpdate; } + set { _enableDBUpdate = value; RaisePropertyChangedAuto(); } + } + + private bool _enableVersionUpdate; + /// <summary> + /// Gets or sets a value indicating whether to automatically check for new application updates. + /// </summary> + public bool EnableVersionUpdate + { + get { return _enableVersionUpdate; } + set { _enableVersionUpdate = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -327,6 +352,8 @@ namespace Tango.PPC.UI.ViewModels _date_timer.Interval = TimeSpan.FromSeconds(1); _date_timer.Tick += _date_timer_Tick; _date_timer.Start(); + + _enableDBUpdate = _enableVersionUpdate = false; } #endregion @@ -564,6 +591,22 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; } + private void MachineUpdateManager_UpdateAvailable(object sender, CheckForUpdateResponse e) + { + EnableVersionUpdate = false; + EnableDBUpdate = false; + + if(e.IsUpdateAvailable) + { + EnableVersionUpdate = true; + return; + } + else if (e.IsDatabaseUpdateAvailable) + { + EnableDBUpdate = true; + } + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { if (Cartridges == null) @@ -618,6 +661,7 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationReady(); MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; + MachineUpdateManager.UpdateAvailable += MachineUpdateManager_UpdateAvailable; } private void MachineOperator_StatusChanged(object sender, MachineStatuses e) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml index 049f2268d..62538d9d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml @@ -119,7 +119,9 @@ <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="10 0" Height="45" Foreground="{StaticResource TangoDarkForegroundBrush}" Command="{Binding UpdateCommand}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Source="/Images/Menu/update.png" VerticalAlignment="Center" Width="20" Height="20"></Image> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="20 0 20 0" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoDataGridHeaderFontSize}" FontWeight="Light">Update</TextBlock> + <Image Margin="30 0 0 0" Source="/Images/Menu/updateDB.png" VerticalAlignment="Center" Width="16" Height="16" HorizontalAlignment="Right" Visibility="{Binding EnableDBUpdate, Converter={StaticResource BooleanToVisibilityConverter}}" SnapsToDevicePixels="True"></Image> + <Image Margin="30 0 0 0" Source="/Images/Menu/updateVersion.png" VerticalAlignment="Center" Width="16" Height="16" HorizontalAlignment="Right" Visibility="{Binding EnableVersionUpdate, Converter={StaticResource BooleanToVisibilityConverter}}" SnapsToDevicePixels="True"></Image> </StackPanel> </touch:TouchButton> </Border> |
