From 2ab54573d10ca59351100ab8416178be2223fc91 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 27 Feb 2019 16:49:42 +0200 Subject: Added support for caching on machine studio. --- .../Tango.MachineStudio.Common/MachineStudioSettings.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index f7c05c1a8..e5fe63d87 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using Tango.BL; using Tango.Logging; using Tango.PMR.Printing; using Tango.Settings; @@ -107,6 +108,16 @@ namespace Tango.MachineStudio.Common /// public bool ByPassEnvironmentVersionCheck { get; set; } + /// + /// Gets or sets a value indicating whether to enable database entity caching. + /// + public ObservablesContextInMemoryCachingMode CachingMode { get; set; } + + /// + /// Gets or sets the maximum cache time for a single entity (when CachingMode is set Absolute or Relative). + /// + public TimeSpan MaximumCacheTime { get; set; } + /// /// Gets the machine service address. /// @@ -136,6 +147,8 @@ namespace Tango.MachineStudio.Common Environment = WorkingEnvironment.Remote; DeploymentSlot = DeploymentSlot.DEV; JobUploadStrategy = JobUploadStrategy.Default; + MaximumCacheTime = TimeSpan.FromMinutes(5); + CachingMode = ObservablesContextInMemoryCachingMode.None; } } } -- cgit v1.3.1 From f0a14c671e8611feb3611e7a174fef02ae26632a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 28 Feb 2019 12:55:42 +0200 Subject: Added clear cache custom action to machine studio installer maintenance. Prevent save process parameters and save liquid factors with no researcher role. Fixed issue with brush stop offset meters refresh. Return back to dispensers list after saving dispenser. Fixed issue where brush stop offset sliders are not visible. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes .../Machine Studio Installer.aip | 100 +++++++++++++++++-- .../ViewModels/MainViewVM.cs | 2 + .../ViewModels/MainViewVM.cs | 9 +- .../Views/JobView.xaml | 109 ++++++++++----------- .../Converters/UserRoleToBooleanConverter.cs | 41 ++++++++ .../Converters/UserRoleToVisibilityConverter.cs | 41 ++++++++ .../Resources/GradientOffsetSlider.xaml | 2 +- .../Tango.MachineStudio.Common.csproj | 4 +- .../Visual_Studio/Tango.BL/Entities/BrushStop.cs | 1 + 11 files changed, 239 insertions(+), 70 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/UserRoleToBooleanConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/UserRoleToVisibilityConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index e0c1be12f..d68ce42c5 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index f0a53795a..406196edf 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip index 3ee4d0f15..831f15ff5 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -66,9 +66,17 @@ + + + + + + + + @@ -98,6 +106,7 @@ + @@ -114,7 +123,9 @@ + + @@ -123,6 +134,7 @@ + @@ -130,8 +142,11 @@ + + + @@ -143,13 +158,18 @@ + + + + + @@ -176,6 +196,7 @@ + @@ -192,15 +213,23 @@ + + + + + + + + @@ -208,19 +237,25 @@ + + + + + + @@ -274,19 +309,23 @@ + + + + - + - + @@ -329,12 +368,21 @@ + + + + + + + + + @@ -381,6 +429,7 @@ + @@ -389,6 +438,7 @@ + @@ -413,7 +463,9 @@ + + @@ -422,6 +474,7 @@ + @@ -431,8 +484,11 @@ + + + @@ -444,13 +500,18 @@ + + + + + @@ -485,6 +546,7 @@ + @@ -501,16 +563,24 @@ + + + + + + + + @@ -518,10 +588,12 @@ + + @@ -530,13 +602,17 @@ + + + + - + @@ -670,11 +746,19 @@ + + + + + + + + @@ -682,6 +766,9 @@ + + + @@ -776,7 +863,6 @@ - @@ -809,7 +895,7 @@ - + @@ -835,8 +921,8 @@ - - + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/ViewModels/MainViewVM.cs index 2bd7e16a0..4042f84ad 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/ViewModels/MainViewVM.cs @@ -180,6 +180,8 @@ namespace Tango.MachineStudio.Dispensers.ViewModels { await SelectedDispenser.Reload(_dbContext); } + + View.NavigateTo(DispensersNavigationView.DispensersView); } catch (Exception ex) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 8ac8e6acd..35aca807c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -65,7 +65,6 @@ namespace Tango.MachineStudio.Developer.ViewModels private DeveloperNavigationManager _navigation; private INavigationManager _msNavigation; private bool _blockInvalidateCommands; - private IAuthenticationProvider _authentication; private ObservablesContext _machineDbContext; private ObservablesContext _activeJobDbContext; private IEventLogger _eventLogger; @@ -549,6 +548,8 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _enableColorConversion = value; RaisePropertyChangedAuto(); } } + public IAuthenticationProvider AuthenticationProvider { get; set; } + #endregion #region Commands @@ -707,7 +708,7 @@ namespace Tango.MachineStudio.Developer.ViewModels CanWork = true; EnableColorConversion = true; - _authentication = authentication; + AuthenticationProvider = authentication; _notification = notificationProvider; _speech = speech; @@ -2052,7 +2053,7 @@ namespace Tango.MachineStudio.Developer.ViewModels Job newJob = new Job(); newJob.Name = jobName; newJob.CreationDate = DateTime.UtcNow; - newJob.UserGuid = _authentication.CurrentUser.Guid; + newJob.UserGuid = AuthenticationProvider.CurrentUser.Guid; if (String.IsNullOrWhiteSpace(settings.DefaultJobRmlGuid)) { @@ -2255,7 +2256,7 @@ namespace Tango.MachineStudio.Developer.ViewModels job.Name = jobName; job.Name = jobName; job.CreationDate = DateTime.UtcNow; - job.UserGuid = _authentication.CurrentUser.Guid; + job.UserGuid = AuthenticationProvider.CurrentUser.Guid; job.Rml = _machineDbContext.Rmls.FirstOrDefault(); job.WindingMethod = _machineDbContext.WindingMethods.FirstOrDefault(); job.SpoolType = _machineDbContext.SpoolTypes.FirstOrDefault(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 4fba0cc0b..1057f7c84 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -20,6 +20,7 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common" xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" xmlns:video="clr-namespace:Tango.Video.DirectCapture;assembly=Tango.Video" @@ -73,6 +74,8 @@ + + @@ -321,7 +324,7 @@ - + @@ -426,7 +429,7 @@ - + @@ -496,7 +499,7 @@ - + + + - + + + + - +