From ec36bdb8a6fb3d460929c7f6f20e695dd98688c4 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 18 Feb 2021 16:57:36 +0200 Subject: Added BTSR Installed to UpdateMachine and ProvisionMachine. UpgradeToGen2. MS. FSE. Thread Loading Wizard BTSR tension.. BTSR Completed for now (except guides images). --- .../Views/SettingsView.xaml | 5 +++ .../Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs | 13 +++++++- .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 14 ++++++++- .../Tango.PPC.Jobs/Views/JobSummeryView.xaml | 10 ++++++ .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 10 ++++++ .../Views/MaintenanceView.xaml | 4 +-- .../Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml | 10 ++++++ .../Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs | 34 +++++++++++++++++++-- .../Tango.BL/Builders/RmlsCollectionBuilder.cs | 2 +- Software/Visual_Studio/Tango.BL/Entities/Rml.cs | 26 +++++++++++++++- .../Visual_Studio/Tango.BL/Entities/SpoolType.cs | 10 ++++++ .../Configurations/ProvisionMachine.xml | Bin 77024 -> 77344 bytes .../SQLExaminer/Configurations/UpdateMachine.xml | Bin 78606 -> 78926 bytes 13 files changed, 130 insertions(+), 8 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml index 2445c5cf1..db7fe7fe8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml @@ -174,6 +174,11 @@ Light Inks Installed + + + + BTSR Installed + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index 078296f27..3dcca8821 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -53,13 +53,19 @@ namespace Tango.PPC.Jobs.ViewModels /// /// Gets or sets the duration of the estimated. /// - public TimeSpan EstimatedDuration { get { return _estimatedDuration; } set { _estimatedDuration = value; RaisePropertyChangedAuto(); } } + private int _btsrSpoolTension; + public int BtsrSpoolTension + { + get { return _btsrSpoolTension; } + set { _btsrSpoolTension = value; RaisePropertyChangedAuto(); } + } + /// /// Gets or sets the dye command. /// @@ -155,6 +161,11 @@ namespace Tango.PPC.Jobs.ViewModels .WithBrushStops() .BuildAsync(); + if (Job.Rml != null && _context != null) + { + BtsrSpoolTension = await Job.Rml.GetRequiredBtsrSpoolTension(_context, Job.SpoolType); + } + await Task.Factory.StartNew(() => { try diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index 3a2d64977..bab4d73ab 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -209,6 +209,13 @@ namespace Tango.PPC.Jobs.ViewModels set { _lubricationLevel = value; RaisePropertyChangedAuto(); } } + private int _btsrSpoolTension; + public int BtsrSpoolTension + { + get { return _btsrSpoolTension; } + set { _btsrSpoolTension = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -673,7 +680,7 @@ namespace Tango.PPC.Jobs.ViewModels #region RML Changed - protected virtual void OnRmlChanged(object sender, Rml rml) + protected async virtual void OnRmlChanged(object sender, Rml rml) { foreach (var segment in Job.Segments) { @@ -682,6 +689,11 @@ namespace Tango.PPC.Jobs.ViewModels GetLubricationLevel(); + if (rml != null && _db != null) + { + BtsrSpoolTension = await rml.GetRequiredBtsrSpoolTension(_db, Job.SpoolType); + } + ResetFineTuning(); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml index ddda98df9..34ddeca8a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml @@ -92,6 +92,16 @@ + + + + + Required tensioner level is + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index e3da251dc..7aef209ec 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -516,6 +516,16 @@ + + + + + Required tensioner level is + + + + + Comment: diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index 5534b1315..bf0128149 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -238,12 +238,12 @@ - + - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml index 9bd8f6f0a..3762ca1c7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml @@ -72,6 +72,16 @@ continue + + + + + + Please set the tensioner level to + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs index bb503e718..c250c561b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -57,7 +58,7 @@ namespace Tango.PPC.UI.Dialogs public Rml SelectedRml { get { return _selectedRml; } - set { _selectedRml = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + set { _selectedRml = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); SetBTSRSpoolTension(); } } private ThreadLoadingStage _stage; @@ -81,6 +82,20 @@ namespace Tango.PPC.UI.Dialogs set { _error = value; RaisePropertyChangedAuto(); } } + private int _btsrSpoolTension; + public int BtsrSpoolTension + { + get { return _btsrSpoolTension; } + set { _btsrSpoolTension = value; RaisePropertyChangedAuto(); } + } + + private bool _btsrInstalled; + public bool BtsrInstalled + { + get { return _btsrInstalled; } + set { _btsrInstalled = value; RaisePropertyChangedAuto(); } + } + public RelayCommand ContinueCommand { get; set; } public RelayCommand AbortCommand { get; set; } @@ -95,6 +110,7 @@ namespace Tango.PPC.UI.Dialogs MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; IsArcHead = MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc; + BtsrInstalled = MachineProvider.Machine.BtsrInstalled; ContinueCommand = new RelayCommand(Continue, CanContinue); AbortCommand = new RelayCommand(Abort); @@ -251,7 +267,7 @@ namespace Tango.PPC.UI.Dialogs using (ObservablesContext db = ObservablesContext.CreateDefault()) { - rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).WithActiveParametersGroup().BuildListAsync(); + rmls = await new RmlsCollectionBuilder(db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).WithActiveParametersGroup().BuildListAsync(); } var selectedRml = rmls.SingleOrDefault(x => x.Guid == _settings.LoadedRmlGuid); @@ -260,6 +276,20 @@ namespace Tango.PPC.UI.Dialogs SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault(); } + private async void SetBTSRSpoolTension() + { + if (BtsrInstalled) + { + if (SelectedRml != null) + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + BtsrSpoolTension = await SelectedRml.GetRequiredBtsrSpoolTension(db); + } + } + } + } + protected override void Cancel() { CleanUp(); diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs index 630f43495..5ea223a73 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs @@ -59,7 +59,7 @@ namespace Tango.BL.Builders { return AddQueryStep(4, (query) => { - return query.Include(x => x.RmlsSpools); + return query.Include(x => x.RmlsSpools).Include(x => x.RmlsSpools.Select(y => y.SpoolType)); }); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index 679226fd2..58b6749cf 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; +using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -121,7 +122,7 @@ namespace Tango.BL.Entities { return Task.Factory.StartNew(() => { - Rml rml = Rml.FromJson(json,new EntitySerializationStrategy(),EntitySerializationFlags.Indented); + Rml rml = Rml.FromJson(json, new EntitySerializationStrategy(), EntitySerializationFlags.Indented); if (context.Rmls.Any(x => x.Guid == rml.Guid || x.Name == rml.Name)) { @@ -142,5 +143,28 @@ namespace Tango.BL.Entities return rml; }); } + + public async Task GetRequiredBtsrSpoolTension(ObservablesContext db, SpoolType jobSpoolType = null) + { + int tension = 0; + + var spoolTypes = await db.SpoolTypes.ToListAsync(); + var spoolType = spoolTypes.FirstOrDefault(x => x.Type == SpoolTypes.StandardSpool); + + if (jobSpoolType != null) + { + spoolType = jobSpoolType; + } + + tension = spoolType != null ? spoolType.BtsrSpoolTension : 0; + + var rml_spool = RmlsSpools.FirstOrDefault(x => x.SpoolType.Type == spoolType.Type); + if (rml_spool != null && rml_spool.BtsrSpoolTension.HasValue) + { + tension = rml_spool.BtsrSpoolTension.Value; + } + + return tension; + } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs index 75f9c785e..25b945049 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs @@ -1,8 +1,11 @@ +using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Enumerations; namespace Tango.BL.Entities { @@ -15,5 +18,12 @@ namespace Tango.BL.Entities { } + + [NotMapped] + [JsonIgnore] + public SpoolTypes Type + { + get { return (SpoolTypes)Code; } + } } } diff --git a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml index 9dcc4a159..7b477f6bb 100644 Binary files a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml and b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml differ diff --git a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml index 03e41b4fb..fde5211de 100644 Binary files a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml and b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml differ -- cgit v1.3.1