From d208f2029740f203ce79c6452432fa083a4c5c07 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 4 Jul 2022 20:08:15 +0300 Subject: RML Extension. New filter to show machines where test were added. Related Work Items: #6803 --- .../ViewModels/MainViewVM.cs | 86 +++++++++++++++++++--- 1 file changed, 75 insertions(+), 11 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs index 164d37b74..820a55558 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs @@ -303,11 +303,66 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels set { - _machines = value; RaisePropertyChanged(nameof(Machines)); + _machines = value; + LoadFilteredMachines(); + RaisePropertyChanged(nameof(Machines)); } } + private ObservableCollection _filteremachines; + /// + /// Gets or sets the Machines. + /// + public ObservableCollection FilteredMachines + { + get + { + return _filteremachines; + } + + set + { + _filteremachines = value; RaisePropertyChanged(nameof(FilteredMachines)); + } + + } + + private bool _showWithData; + /// + /// Gets or sets the bool show with data only. + /// + public bool ShowWithData + { + get { return _showWithData; } + set { + if(_showWithData != value) + { + _showWithData = value; + RaisePropertyChangedAuto(); + LoadFilteredMachines(); + } + } + } + + private void LoadFilteredMachines() + { + if(_showWithData) + FilteredMachines = Machines.Where(x => x.HasRMLTest).OrderBy(x => x.LastUpdated).ToObservableCollection(); + else + { + FilteredMachines = Machines.OrderBy(x=>x.Name).ToObservableCollection(); + } + + } + + private bool _canEdit; + public bool CanEdit + { + get { return _canEdit; } + set { _canEdit = value; + RaisePropertyChangedAuto(); } + } //private MachineTestResultsTabs PreviosSelectedTab { get; set; } //private MachineTestResultsTabs _selectedTab; @@ -792,19 +847,14 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels #endregion - private bool _canEdit; - public bool CanEdit - { - get { return _canEdit; } - set { _canEdit = value; - RaisePropertyChangedAuto(); } - } + public MainViewVM(INotificationProvider notificationProvider, IAuthenticationProvider authentication, IActionLogManager actionLogManager) { _notification = notificationProvider; _authentication = authentication; _actionLogManager = actionLogManager; + _showWithData = false; BackToThreadExtensionViewsCommand = new RelayCommand(BackToThreadExtensionViews, () => IsFree); SaveCommand = new RelayCommand(Save, () => IsFree); @@ -853,7 +903,6 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels AddGlossLevelItemCommand = new RelayCommand(AddGlossLevelItem); EditGlossLevelItemCommand = new RelayCommand(EditGlossLevelItem); - } @@ -947,7 +996,9 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels Guid = x.Guid, Name = x.Name, SerialNumber = x.SerialNumber, - IdsPacks = x.Configuration.IdsPacks.Where(z => !z.IsEmpty) + IdsPacks = x.Configuration.IdsPacks.Where(z => !z.IsEmpty), + LastUpdated = x.LastUpdated, + HasRMLTest = false }).ToObservableCollection(); } @@ -1028,6 +1079,17 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels Manufacturers.Add(ActiveRML.Manufacturer); } + //var colorProcessParameters = _active_context.ColorProcessParameters.Where(x => x.RmlsExtensionsGuid == guid).Select(x=>x.MachineGuid).ToList(); + //var TestResultsCollection = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(guid).BuildAsync(); + //var test1 = TestResultsCollection.Select(x => x.MachineGuid).ToList(); + //var ColorCalibration = await new RMLExtensionColorCalibrationBuilder(_active_context).SetAll().ForRMLExtension(guid).WithTests().BuildAsync(); + //var test12 = ColorCalibration.Where(x=>x.RmlExtensionColorCalibrationsTests!= null && x.RmlExtensionColorCalibrationsTests.Count() > 0).Select(x => x.MachineGuid).ToList(); + //var testResults = await new RMLExtensionColorShadeBuilder(_active_context).SetAll().ForRMLExtension(guid).WithTests().BuildAsync(); + //var test13 = testResults.Where(x => x.RmlExtensionColorShadesTests != null && x.RmlExtensionColorShadesTests.Count() > 0).Select(x => x.MachineGuid).ToList(); + + //var ulist = colorProcessParameters.Union(test1).Union(test12).Union(test13).ToList(); + + var machineIdsHasTest = (from c in _active_context.ColorProcessParameters.Where(x => x.RmlsExtensionsGuid == guid) select new { MichineGUID = c.MachineGuid }). Union(from p in _active_context.RmlExtensionTestResults.Where(x => x.RmlsExtensionsGuid == guid) @@ -1035,9 +1097,11 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels if (machineIdsHasTest.Count > 0) { + ShowWithData = true; var MachineGuid = machineIdsHasTest.First().MichineGUID; Machines.Where(x => machineIdsHasTest.Any(y => y.MichineGUID == x.Guid)).ToList().ForEach(x => x.HasRMLTest = true); - SelectedMachine = Machines.First(x => x.Guid == MachineGuid); + LoadFilteredMachines(); + SelectedMachine = FilteredMachines.First(); } else { -- cgit v1.3.1 From 6e4ddaeef2667e071f7f079876e98bd77ed233f3 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 7 Aug 2022 09:11:33 +0300 Subject: MS . RML Extension --- .../ViewModels/MainViewVM.cs | 6 +- .../ViewModels/TestResultsViewVM.cs | 19 +++++ .../Views/TestResultsView.xaml | 85 +++++++++++++++++----- .../Tango.BL/Builders/machinesCollectionBuilder.cs | 55 ++++++++++++++ 4 files changed, 145 insertions(+), 20 deletions(-) create mode 100644 Software/Visual_Studio/Tango.BL/Builders/machinesCollectionBuilder.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs index 820a55558..d6f3ea418 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs @@ -973,7 +973,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } } - private void LoadRmlProperties() + private async void LoadRmlProperties() { Applications = _active_context.YarnApplications.ToObservableCollection(); Brands = _active_context.YarnBrands.ToObservableCollection(); @@ -991,7 +991,9 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels Texturing = _active_context.YarnTexturings.ToObservableCollection(); YarnTypes = _active_context.YarnTypes.ToObservableCollection(); IndustrySector = _active_context.YarnIndustrysectors.ToObservableCollection(); - Machines = ObservablesStaticCollections.Instance.Machines.Select(x => new MachineModel() + + var machines = await new MachinesCollectionBuilder(_active_context).SetAll().WithConfiguration().BuildAsync(); + Machines = machines.Select(x => new MachineModel() { Guid = x.Guid, Name = x.Name, diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs index 2dd444f0f..03c87a3a6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs @@ -129,6 +129,20 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } } + private ObservableCollection _btsrApplicationTypes; + public ObservableCollection BtsrApplicationTypes + { + get { return _btsrApplicationTypes; } + set { _btsrApplicationTypes = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _btsrYarnTypes; + public ObservableCollection BtsrYarnTypes + { + get { return _btsrYarnTypes; } + set { _btsrYarnTypes = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -281,6 +295,11 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels using (_notification.PushTaskItem("Loading Test Results Parameters ...")) { + + BtsrApplicationTypes = _active_context.BtsrApplicationTypes.ToObservableCollection(); + + BtsrYarnTypes = _active_context.BtsrYarnTypes.ToObservableCollection(); + var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().WithTestResultsFiles().WithWashingTestResults().BuildAsync(); SelectedTestResults = testResults.OrderBy(x => x.ResultIndex).ToSynchronizedObservableCollection(); foreach (var result in SelectedTestResults) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml index 77cac3648..961c6b358 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml @@ -628,80 +628,129 @@ Tension through the thread path - + + + + + + + + + + + + + + + Tension in Zone - + Tensiometer (gr) - + Tension in Zone - - MS + + MS - + + + BTSR options + + + + + Head - + - + BTSR - + - + + Application Type + + + + + + + After dryer - + - + Puller tension - + - + + Yarn Type + + + + + + + + Winder - + - + Winder Exit Tension - + - + + Tension Error + + + + + + + + diff --git a/Software/Visual_Studio/Tango.BL/Builders/machinesCollectionBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/machinesCollectionBuilder.cs new file mode 100644 index 000000000..25ca3e8f3 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Builders/machinesCollectionBuilder.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using System.Data.Entity; + +namespace Tango.BL.Builders +{ + public class MachinesCollectionBuilder : EntityCollectionBuilderBase + { + public MachinesCollectionBuilder(ObservablesContext context) : base(context) + { + + } + + public virtual MachinesCollectionBuilder WithVersion() + { + return AddQueryStep(1, (query) => + { + return query.Include(x => x.MachineVersion); + }); + + } + + public virtual MachinesCollectionBuilder WithOrganization() + { + return AddStep(2, () => + { + foreach (var machine in Entities.ToList()) + { + Context.Organizations.Where(x => x.Guid == machine.OrganizationGuid) + .Include(x => x.Address) + .Include(x => x.Contact).FirstOrDefault(); + } + }); + } + + public virtual MachinesCollectionBuilder WithConfiguration() + { + return AddStep(3, () => + { + foreach (var machine in Entities.ToList()) + { + new ConfigurationBuilder(Context) + .Set(machine.ConfigurationGuid) + .WithIdsPacks() + .WithHardwareVersion() + .Build(); + } + }); + } + } +} -- cgit v1.3.1 From 13e76d80896d61c476ff755a892c795ed4af6de6 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 31 Aug 2022 12:02:47 +0300 Subject: MS. RML Extension. Added Application Type, Yarn Type and Tension Error to Test results table. Changes in database. Related Work Items: #6347 --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../ViewModels/MainViewVM.cs | 13 +- .../ViewModels/TestResultsViewVM.cs | 2 +- .../Views/TestResultsView.xaml | 18 +- .../RMLExtensionTestResultsCollectionBuilder.cs | 24 +++ .../Tango.BL/DTO/RmlExtensionTestResultDTOBase.cs | 24 +++ .../Tango.BL/Entities/BtsrApplicationTypeBase.cs | 38 +++++ .../Tango.BL/Entities/BtsrYarnTypeBase.cs | 38 +++++ .../Entities/RmlExtensionColorCalibrationBase.cs | 76 ++++----- ...xtensionColorCalibrationsTestsLiquidDataBase.cs | 76 ++++----- .../Entities/RmlExtensionColorShadeBase.cs | 76 ++++----- .../Entities/RmlExtensionTestResultBase.cs | 176 +++++++++++++++++++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 3 +- .../Tango.DAL.Remote/DB/BTSR_APPLICATION_TYPES.cs | 3 + .../Tango.DAL.Remote/DB/BTSR_YARN_TYPES.cs | 3 + .../DB/RML_EXTENSION_COLOR_CALIBRATIONS.cs | 2 +- .../DB/RML_EXTENSION_COLOR_SHADES.cs | 2 +- .../DB/RML_EXTENSION_TEST_RESULTS.cs | 5 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 77 +++++++++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 188 ++++++++++----------- 21 files changed, 615 insertions(+), 229 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index e333b6ee5..58379c5c6 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index b5da0b516..447c4cdb7 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs index d6f3ea418..b2f3d99cf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs @@ -973,7 +973,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } } - private async void LoadRmlProperties() + private void LoadRmlProperties() { Applications = _active_context.YarnApplications.ToObservableCollection(); Brands = _active_context.YarnBrands.ToObservableCollection(); @@ -992,7 +992,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels YarnTypes = _active_context.YarnTypes.ToObservableCollection(); IndustrySector = _active_context.YarnIndustrysectors.ToObservableCollection(); - var machines = await new MachinesCollectionBuilder(_active_context).SetAll().WithConfiguration().BuildAsync(); + var machines = new MachinesCollectionBuilder(_active_context).SetAll().WithConfiguration().Build(); Machines = machines.Select(x => new MachineModel() { Guid = x.Guid, @@ -1067,12 +1067,13 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels guid = rml_extention.Guid; } - ActiveRMLExtension = await new RmlExtensionsBuilder(_active_context) - .Set(guid) - .WithUser() - .BuildAsync(); + ActiveRML = new RmlBuilder(_active_context).Set(SelectedRMLExtension.RMLGuid).WithLiquidFactors().Build(); + + ActiveRMLExtension = new RmlExtensionsBuilder(_active_context) + .Set(guid) + .Build(); if (!String.IsNullOrEmpty(ActiveRML.Manufacturer) && false == Manufacturers.Any(x => x == ActiveRML.Manufacturer)) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs index 03c87a3a6..ba7ae7238 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs @@ -300,7 +300,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels BtsrYarnTypes = _active_context.BtsrYarnTypes.ToObservableCollection(); - var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().WithTestResultsFiles().WithWashingTestResults().BuildAsync(); + var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().WithTestResultsFiles().WithWashingTestResults().WithBtsrApplicationTypes().WithBtsrYarnTypes().BuildAsync(); SelectedTestResults = testResults.OrderBy(x => x.ResultIndex).ToSynchronizedObservableCollection(); foreach (var result in SelectedTestResults) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml index 961c6b358..4ebc9077b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml @@ -686,9 +686,9 @@ Application Type - - - + + + After dryer @@ -714,11 +714,9 @@ Yarn Type - - - - + + + Winder @@ -745,9 +743,7 @@ - - + diff --git a/Software/Visual_Studio/Tango.BL/Builders/RMLExtensionTestResultsCollectionBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RMLExtensionTestResultsCollectionBuilder.cs index 19c027976..a9aabdbdd 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RMLExtensionTestResultsCollectionBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RMLExtensionTestResultsCollectionBuilder.cs @@ -80,5 +80,29 @@ namespace Tango.BL.Builders } }); } + + public virtual RMLExtensionTestResultsCollectionBuilder WithBtsrApplicationTypes() + { + return AddStep(5, () => + { + foreach (var result in Entities.ToList()) + { + if(!String.IsNullOrEmpty(result.BtsrApplicationTypeGuid)) + result.BtsrApplicationType = Context.BtsrApplicationTypes.FirstOrDefault(x => x.Guid == result.BtsrApplicationTypeGuid); + } + }); + } + + public virtual RMLExtensionTestResultsCollectionBuilder WithBtsrYarnTypes() + { + return AddStep(6, () => + { + foreach (var result in Entities.ToList()) + { + if (!String.IsNullOrEmpty(result.BtsrYarnTypeGuid)) + result.BtsrYarnType = Context.BtsrYarnTypes.FirstOrDefault(x => x.Guid == result.BtsrYarnTypeGuid); + } + }); + } } } diff --git a/Software/Visual_Studio/Tango.BL/DTO/RmlExtensionTestResultDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/RmlExtensionTestResultDTOBase.cs index d48a36b22..0f2fa1675 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/RmlExtensionTestResultDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/RmlExtensionTestResultDTOBase.cs @@ -277,5 +277,29 @@ namespace Tango.BL.DTO get; set; } + /// + /// btsr application type guid + /// + public String BtsrApplicationTypeGuid + { + get; set; + } + + /// + /// btsr yarn type guid + /// + public String BtsrYarnTypeGuid + { + get; set; + } + + /// + /// btsr tension error + /// + public Double BtsrTensionError + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/BtsrApplicationTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/BtsrApplicationTypeBase.cs index ee1ff6ecc..70fd2c41e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BtsrApplicationTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BtsrApplicationTypeBase.cs @@ -33,6 +33,8 @@ namespace Tango.BL.Entities public event EventHandler DescriptionChanged; + public event EventHandler> RmlExtensionTestResultsChanged; + public event EventHandler> RmlsChanged; protected Int32 _code; @@ -116,6 +118,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection _rmlextensiontestresults; + + /// + /// Gets or sets the btsrapplicationtypebase rml extension test results. + /// + + public virtual SynchronizedObservableCollection RmlExtensionTestResults + { + get + { + return _rmlextensiontestresults; + } + + set + { + if (_rmlextensiontestresults != value) + { + _rmlextensiontestresults = value; + + OnRmlExtensionTestResultsChanged(value); + + } + } + } + protected SynchronizedObservableCollection _rmls; /// @@ -168,6 +195,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Description)); } + /// + /// Called when the RmlExtensionTestResults has changed. + /// + protected virtual void OnRmlExtensionTestResultsChanged(SynchronizedObservableCollection rmlextensiontestresults) + { + RmlExtensionTestResultsChanged?.Invoke(this, rmlextensiontestresults); + RaisePropertyChanged(nameof(RmlExtensionTestResults)); + } + /// /// Called when the Rmls has changed. /// @@ -183,6 +219,8 @@ namespace Tango.BL.Entities public BtsrApplicationTypeBase() : base() { + RmlExtensionTestResults = new SynchronizedObservableCollection(); + Rmls = new SynchronizedObservableCollection(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/BtsrYarnTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/BtsrYarnTypeBase.cs index 608989fab..8128c8998 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BtsrYarnTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BtsrYarnTypeBase.cs @@ -33,6 +33,8 @@ namespace Tango.BL.Entities public event EventHandler DescriptionChanged; + public event EventHandler> RmlExtensionTestResultsChanged; + public event EventHandler> RmlsChanged; protected Int32 _code; @@ -116,6 +118,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection _rmlextensiontestresults; + + /// + /// Gets or sets the btsryarntypebase rml extension test results. + /// + + public virtual SynchronizedObservableCollection RmlExtensionTestResults + { + get + { + return _rmlextensiontestresults; + } + + set + { + if (_rmlextensiontestresults != value) + { + _rmlextensiontestresults = value; + + OnRmlExtensionTestResultsChanged(value); + + } + } + } + protected SynchronizedObservableCollection _rmls; /// @@ -168,6 +195,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Description)); } + /// + /// Called when the RmlExtensionTestResults has changed. + /// + protected virtual void OnRmlExtensionTestResultsChanged(SynchronizedObservableCollection rmlextensiontestresults) + { + RmlExtensionTestResultsChanged?.Invoke(this, rmlextensiontestresults); + RaisePropertyChanged(nameof(RmlExtensionTestResults)); + } + /// /// Called when the Rmls has changed. /// @@ -183,6 +219,8 @@ namespace Tango.BL.Entities public BtsrYarnTypeBase() : base() { + RmlExtensionTestResults = new SynchronizedObservableCollection(); + Rmls = new SynchronizedObservableCollection(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationBase.cs index b858163d2..b2af4322d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationBase.cs @@ -27,12 +27,12 @@ namespace Tango.BL.Entities public abstract class RmlExtensionColorCalibrationBase : ObservableEntity { - public event EventHandler MachineChanged; - public event EventHandler RmlsExtensionsChanged; public event EventHandler> RmlExtensionColorCalibrationsTestsChanged; + public event EventHandler MachineChanged; + protected String _rmlsextensionsguid; /// @@ -85,38 +85,6 @@ namespace Tango.BL.Entities } } - protected Machine _machine; - - /// - /// Gets or sets the rmlextensioncolorcalibrationbase machine. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual Machine Machine - { - get - { - return _machine; - } - - set - { - if (_machine != value) - { - _machine = value; - - if (Machine != null) - { - MachineGuid = Machine.Guid; - } - - OnMachineChanged(value); - - } - } - } - protected RmlsExtension _rmlsextensions; /// @@ -174,13 +142,36 @@ namespace Tango.BL.Entities } } + protected Machine _machine; + /// - /// Called when the Machine has changed. + /// Gets or sets the rmlextensioncolorcalibrationbase machine. /// - protected virtual void OnMachineChanged(Machine machine) + + [XmlIgnore] + [JsonIgnore] + public virtual Machine Machine { - MachineChanged?.Invoke(this, machine); - RaisePropertyChanged(nameof(Machine)); + get + { + return _machine; + } + + set + { + if (_machine != value) + { + _machine = value; + + if (Machine != null) + { + MachineGuid = Machine.Guid; + } + + OnMachineChanged(value); + + } + } } /// @@ -201,6 +192,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(RmlExtensionColorCalibrationsTests)); } + /// + /// Called when the Machine has changed. + /// + protected virtual void OnMachineChanged(Machine machine) + { + MachineChanged?.Invoke(this, machine); + RaisePropertyChanged(nameof(Machine)); + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationsTestsLiquidDataBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationsTestsLiquidDataBase.cs index d55773809..d6ee701ba 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationsTestsLiquidDataBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorCalibrationsTestsLiquidDataBase.cs @@ -27,12 +27,12 @@ namespace Tango.BL.Entities public abstract class RmlExtensionColorCalibrationsTestsLiquidDataBase : ObservableEntity { - public event EventHandler LiquidTypeChanged; - public event EventHandler RmlExtensionColorCalibrationsTestChanged; public event EventHandler> RmlExtensionColorCalibrationsTestsLiquidDataPointsChanged; + public event EventHandler LiquidTypeChanged; + protected String _rmlextensioncolorcalibrationstestguid; /// @@ -85,38 +85,6 @@ namespace Tango.BL.Entities } } - protected LiquidType _liquidtype; - - /// - /// Gets or sets the rmlextensioncolorcalibrationstestsliquiddatabase liquid types. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual LiquidType LiquidType - { - get - { - return _liquidtype; - } - - set - { - if (_liquidtype != value) - { - _liquidtype = value; - - if (LiquidType != null) - { - LiquidTypeGuid = LiquidType.Guid; - } - - OnLiquidTypeChanged(value); - - } - } - } - protected RmlExtensionColorCalibrationsTest _rmlextensioncolorcalibrationstest; /// @@ -174,13 +142,36 @@ namespace Tango.BL.Entities } } + protected LiquidType _liquidtype; + /// - /// Called when the LiquidType has changed. + /// Gets or sets the rmlextensioncolorcalibrationstestsliquiddatabase liquid types. /// - protected virtual void OnLiquidTypeChanged(LiquidType liquidtype) + + [XmlIgnore] + [JsonIgnore] + public virtual LiquidType LiquidType { - LiquidTypeChanged?.Invoke(this, liquidtype); - RaisePropertyChanged(nameof(LiquidType)); + get + { + return _liquidtype; + } + + set + { + if (_liquidtype != value) + { + _liquidtype = value; + + if (LiquidType != null) + { + LiquidTypeGuid = LiquidType.Guid; + } + + OnLiquidTypeChanged(value); + + } + } } /// @@ -201,6 +192,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(RmlExtensionColorCalibrationsTestsLiquidDataPoints)); } + /// + /// Called when the LiquidType has changed. + /// + protected virtual void OnLiquidTypeChanged(LiquidType liquidtype) + { + LiquidTypeChanged?.Invoke(this, liquidtype); + RaisePropertyChanged(nameof(LiquidType)); + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorShadeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorShadeBase.cs index b0386f13b..c0fa2ce5d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorShadeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionColorShadeBase.cs @@ -27,12 +27,12 @@ namespace Tango.BL.Entities public abstract class RmlExtensionColorShadeBase : ObservableEntity { - public event EventHandler MachineChanged; - public event EventHandler RmlsExtensionsChanged; public event EventHandler> RmlExtensionColorShadesTestsChanged; + public event EventHandler MachineChanged; + protected String _rmlsextensionsguid; /// @@ -85,38 +85,6 @@ namespace Tango.BL.Entities } } - protected Machine _machine; - - /// - /// Gets or sets the rmlextensioncolorshadebase machine. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual Machine Machine - { - get - { - return _machine; - } - - set - { - if (_machine != value) - { - _machine = value; - - if (Machine != null) - { - MachineGuid = Machine.Guid; - } - - OnMachineChanged(value); - - } - } - } - protected RmlsExtension _rmlsextensions; /// @@ -174,13 +142,36 @@ namespace Tango.BL.Entities } } + protected Machine _machine; + /// - /// Called when the Machine has changed. + /// Gets or sets the rmlextensioncolorshadebase machine. /// - protected virtual void OnMachineChanged(Machine machine) + + [XmlIgnore] + [JsonIgnore] + public virtual Machine Machine { - MachineChanged?.Invoke(this, machine); - RaisePropertyChanged(nameof(Machine)); + get + { + return _machine; + } + + set + { + if (_machine != value) + { + _machine = value; + + if (Machine != null) + { + MachineGuid = Machine.Guid; + } + + OnMachineChanged(value); + + } + } } /// @@ -201,6 +192,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(RmlExtensionColorShadesTests)); } + /// + /// Called when the Machine has changed. + /// + protected virtual void OnMachineChanged(Machine machine) + { + MachineChanged?.Invoke(this, machine); + RaisePropertyChanged(nameof(Machine)); + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionTestResultBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionTestResultBase.cs index c53b14327..22844741c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionTestResultBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlExtensionTestResultBase.cs @@ -87,12 +87,18 @@ namespace Tango.BL.Entities public event EventHandler> ThreadLubChanged; + public event EventHandler BtsrTensionErrorChanged; + public event EventHandler RmlsExtensionsChanged; public event EventHandler> TensileResultsChanged; public event EventHandler> RmlExtensionTestResultsFilesChanged; + public event EventHandler BtsrApplicationTypeChanged; + + public event EventHandler BtsrYarnTypeChanged; + public event EventHandler MachineChanged; public event EventHandler> RmlExtensionTestWashingResultsChanged; @@ -961,6 +967,85 @@ namespace Tango.BL.Entities } } + protected String _btsrapplicationtypeguid; + + /// + /// Gets or sets the rmlextensiontestresultbase btsr application type guid. + /// + + [Column("BTSR_APPLICATION_TYPE_GUID")] + [ForeignKey("BtsrApplicationType")] + + public String BtsrApplicationTypeGuid + { + get + { + return _btsrapplicationtypeguid; + } + + set + { + if (_btsrapplicationtypeguid != value) + { + _btsrapplicationtypeguid = value; + + } + } + } + + protected String _btsryarntypeguid; + + /// + /// Gets or sets the rmlextensiontestresultbase btsr yarn type guid. + /// + + [Column("BTSR_YARN_TYPE_GUID")] + [ForeignKey("BtsrYarnType")] + + public String BtsrYarnTypeGuid + { + get + { + return _btsryarntypeguid; + } + + set + { + if (_btsryarntypeguid != value) + { + _btsryarntypeguid = value; + + } + } + } + + protected Double _btsrtensionerror; + + /// + /// Gets or sets the rmlextensiontestresultbase btsr tension error. + /// + + [Column("BTSR_TENSION_ERROR")] + + public Double BtsrTensionError + { + get + { + return _btsrtensionerror; + } + + set + { + if (_btsrtensionerror != value) + { + _btsrtensionerror = value; + + OnBtsrTensionErrorChanged(value); + + } + } + } + protected RmlsExtension _rmlsextensions; /// @@ -1043,6 +1128,70 @@ namespace Tango.BL.Entities } } + protected BtsrApplicationType _btsrapplicationtype; + + /// + /// Gets or sets the rmlextensiontestresultbase btsr application types. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual BtsrApplicationType BtsrApplicationType + { + get + { + return _btsrapplicationtype; + } + + set + { + if (_btsrapplicationtype != value) + { + _btsrapplicationtype = value; + + if (BtsrApplicationType != null) + { + BtsrApplicationTypeGuid = BtsrApplicationType.Guid; + } + + OnBtsrApplicationTypeChanged(value); + + } + } + } + + protected BtsrYarnType _btsryarntype; + + /// + /// Gets or sets the rmlextensiontestresultbase btsr yarn types. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual BtsrYarnType BtsrYarnType + { + get + { + return _btsryarntype; + } + + set + { + if (_btsryarntype != value) + { + _btsryarntype = value; + + if (BtsrYarnType != null) + { + BtsrYarnTypeGuid = BtsrYarnType.Guid; + } + + OnBtsrYarnTypeChanged(value); + + } + } + } + protected Machine _machine; /// @@ -1395,6 +1544,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(ThreadLub)); } + /// + /// Called when the BtsrTensionError has changed. + /// + protected virtual void OnBtsrTensionErrorChanged(Double btsrtensionerror) + { + BtsrTensionErrorChanged?.Invoke(this, btsrtensionerror); + RaisePropertyChanged(nameof(BtsrTensionError)); + } + /// /// Called when the RmlsExtensions has changed. /// @@ -1422,6 +1580,24 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(RmlExtensionTestResultsFiles)); } + /// + /// Called when the BtsrApplicationType has changed. + /// + protected virtual void OnBtsrApplicationTypeChanged(BtsrApplicationType btsrapplicationtype) + { + BtsrApplicationTypeChanged?.Invoke(this, btsrapplicationtype); + RaisePropertyChanged(nameof(BtsrApplicationType)); + } + + /// + /// Called when the BtsrYarnType has changed. + /// + protected virtual void OnBtsrYarnTypeChanged(BtsrYarnType btsryarntype) + { + BtsrYarnTypeChanged?.Invoke(this, btsryarntype); + RaisePropertyChanged(nameof(BtsrYarnType)); + } + /// /// Called when the Machine has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 259b2ce6b..ea2315046 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -116,6 +116,7 @@ + @@ -820,7 +821,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_APPLICATION_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_APPLICATION_TYPES.cs index a4ebc4b0f..523980e37 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_APPLICATION_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_APPLICATION_TYPES.cs @@ -17,6 +17,7 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public BTSR_APPLICATION_TYPES() { + this.RML_EXTENSION_TEST_RESULTS = new HashSet(); this.RMLS = new HashSet(); } @@ -27,6 +28,8 @@ namespace Tango.DAL.Remote.DB public string NAME { get; set; } public string DESCRIPTION { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RML_EXTENSION_TEST_RESULTS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RMLS { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_YARN_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_YARN_TYPES.cs index 256af7baf..ef09f7498 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_YARN_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/BTSR_YARN_TYPES.cs @@ -17,6 +17,7 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public BTSR_YARN_TYPES() { + this.RML_EXTENSION_TEST_RESULTS = new HashSet(); this.RMLS = new HashSet(); } @@ -27,6 +28,8 @@ namespace Tango.DAL.Remote.DB public string NAME { get; set; } public string DESCRIPTION { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RML_EXTENSION_TEST_RESULTS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RMLS { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_CALIBRATIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_CALIBRATIONS.cs index 7f25d41a2..1a1416100 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_CALIBRATIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_CALIBRATIONS.cs @@ -26,9 +26,9 @@ namespace Tango.DAL.Remote.DB public string RMLS_EXTENSIONS_GUID { get; set; } public string MACHINE_GUID { get; set; } - public virtual MACHINE MACHINE { get; set; } public virtual RMLS_EXTENSIONS RMLS_EXTENSIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RML_EXTENSION_COLOR_CALIBRATIONS_TESTS { get; set; } + public virtual MACHINE MACHINE { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_SHADES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_SHADES.cs index 55614d7a4..cca943272 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_SHADES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_COLOR_SHADES.cs @@ -26,9 +26,9 @@ namespace Tango.DAL.Remote.DB public string RMLS_EXTENSIONS_GUID { get; set; } public string MACHINE_GUID { get; set; } - public virtual MACHINE MACHINE { get; set; } public virtual RMLS_EXTENSIONS RMLS_EXTENSIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RML_EXTENSION_COLOR_SHADES_TESTS { get; set; } + public virtual MACHINE MACHINE { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_TEST_RESULTS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_TEST_RESULTS.cs index e0543a58c..e4bf0b029 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_TEST_RESULTS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML_EXTENSION_TEST_RESULTS.cs @@ -58,12 +58,17 @@ namespace Tango.DAL.Remote.DB public string THREAD_LUB_VERSION { get; set; } public Nullable THREAD_COF { get; set; } public Nullable THREAD_LUB { get; set; } + public string BTSR_APPLICATION_TYPE_GUID { get; set; } + public string BTSR_YARN_TYPE_GUID { get; set; } + public double BTSR_TENSION_ERROR { get; set; } public virtual RMLS_EXTENSIONS RMLS_EXTENSIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection TENSILE_RESULTS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RML_EXTENSION_TEST_RESULTS_FILES { get; set; } + public virtual BTSR_APPLICATION_TYPES BTSR_APPLICATION_TYPES { get; set; } + public virtual BTSR_YARN_TYPES BTSR_YARN_TYPES { get; set; } public virtual MACHINE MACHINE { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection RML_EXTENSION_TEST_WASHING_RESULTS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index eae61d93a..7f06dbc14 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -1218,6 +1218,9 @@ + + + @@ -2821,6 +2824,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -3902,6 +3929,14 @@ + + + + + + + + @@ -4360,10 +4395,18 @@ + + + + + + + + @@ -4840,6 +4883,11 @@ + + + + + @@ -5579,6 +5627,7 @@ + @@ -5591,6 +5640,7 @@ + @@ -7203,6 +7253,18 @@ + + + + + + + + + + + + @@ -7215,6 +7277,18 @@ + + + + + + + + + + + + @@ -8524,6 +8598,9 @@ + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index f5a974c53..ea228f323 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,100 +5,100 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.3.1 From ea4957385f2d1a3da2a3a6f5e0db95ca624c8173 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 1 Sep 2022 17:01:45 +0300 Subject: MS. RML Extension. Save White point. Related Work Items: #7130 --- .../ViewModels/ColorCalibrationViewVM.cs | 6 ++--- .../ViewModels/ColorCalibrationViewVM.cs | 4 ++-- .../ViewModels/ColorParametersVewVM.cs | 26 +++++++++++++++++----- .../ViewModels/MainViewVM.cs | 6 ++--- .../Views/ColorParametersView.xaml | 6 ++--- 5 files changed, 32 insertions(+), 16 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs index 30e17d6db..feee2637a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs @@ -100,9 +100,9 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels } - private void OnChangeSelectedRML() + private async void OnChangeSelectedRML() { - Invalidate(); + await Invalidate(); } #region RML @@ -113,7 +113,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { IsFree = false; - await Task.Factory.StartNew(() => + await Task.Run(() => { using (_notification.PushTaskItem("Loading RML data...")) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs index 2144d05f5..01c3b2d4f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs @@ -223,7 +223,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels /// /// Applies calibration points to RML. /// - private void ApplyToRML(object obj) + private async void ApplyToRML(object obj) { if(SelectedTab != null && ActiveRML != null) { @@ -232,7 +232,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels { IsFree = false; DateTime lastUpdated = DateTime.UtcNow; - var rml = new RmlBuilder(_active_context).Set(ActiveRML.Guid).WithLiquidFactors().Build(); + var rml = await new RmlBuilder(_active_context).Set(ActiveRML.Guid).WithLiquidFactors().BuildAsync(); if (rml != null) { var liquidTypesRmls = rml.LiquidTypesRmls; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs index 2ab1f81f1..d784c69a9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs @@ -209,7 +209,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels OnRMLExtensionGUIDChanged(); } } - + protected string _selectedMachineGuid; /// /// Gets or sets the selected machine. @@ -431,8 +431,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels _active_context = ObservablesContext.CreateDefault(); - await Task.Factory.StartNew(() => - { + await Task.Run(async () => + { using (_notification.PushTaskItem("Loading Color Process Parameters ...")) { @@ -441,6 +441,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels { SelectedColorProcessParameter = new ColorProcessParametersBuilder(_active_context).Set(currentcolorProcessParameter.Guid).WithColorProcessData().WithColorProcessFactor().WithColorProcessInkUptake().Build(); } + if (SelectedColorProcessParameter == null) { @@ -448,6 +449,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels SelectedColorProcessParameter.WhitePointL = 0.0; SelectedColorProcessParameter.WhitePointA = 0.0; SelectedColorProcessParameter.WhitePointB = 0.0; + + SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.CYAN, FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.MAGENTA, FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.YELLOW, FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); @@ -461,7 +464,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); _active_context.ColorProcessParameters.Add(SelectedColorProcessParameter); - _active_context.SaveChangesAsync(); + await _active_context.SaveChangesAsync(); } else if(SelectedColorProcessParameter.ColorProcessInkUptake.Count == 0) { @@ -470,7 +473,13 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); } - + var rml = await new RmlBuilder(_active_context).Set(RMLGUID).BuildAsync(); + if (rml != null && SelectedColorProcessParameter != null) + { + SelectedColorProcessParameter.WhitePointL = rml.WhitePointL; + SelectedColorProcessParameter.WhitePointA = rml.WhitePointA; + SelectedColorProcessParameter.WhitePointB = rml.WhitePointB; + } } }); @@ -775,6 +784,13 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels IsFree = false; SelectedColorProcessParameter.LastUpdated = DateTime.UtcNow; + var rml = await new RmlBuilder(_active_context).Set(RMLGUID).BuildAsync(); + if (rml != null) + { + rml.WhitePointL = SelectedColorProcessParameter.WhitePointL; + rml.WhitePointA = SelectedColorProcessParameter.WhitePointA; + rml.WhitePointB = SelectedColorProcessParameter.WhitePointB; + } foreach (var item in RemovedColorProcessDataBeforeSave) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs index b2f3d99cf..458bc913a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs @@ -1069,11 +1069,11 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels - ActiveRML = new RmlBuilder(_active_context).Set(SelectedRMLExtension.RMLGuid).WithLiquidFactors().Build(); + ActiveRML = await new RmlBuilder(_active_context).Set(SelectedRMLExtension.RMLGuid).WithLiquidFactors().BuildAsync(); - ActiveRMLExtension = new RmlExtensionsBuilder(_active_context) + ActiveRMLExtension = await new RmlExtensionsBuilder(_active_context) .Set(guid) - .Build(); + .BuildAsync(); if (!String.IsNullOrEmpty(ActiveRML.Manufacturer) && false == Manufacturers.Any(x => x == ActiveRML.Manufacturer)) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml index 504bf0610..376392d89 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml @@ -335,13 +335,13 @@ White point - + - + - + -- cgit v1.3.1