From 09c1e15643f82b2187019025682b5da0bfbe1c1d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 21 Nov 2019 09:20:44 +0200 Subject: Fixed issue with machine clone and device registration. Implemented device registration details and reset in Machine Designer. --- .../Views/MachineSettingsView.xaml | 176 ++++++++++++--------- .../Views/MachinesView.xaml | 4 +- 2 files changed, 101 insertions(+), 79 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml index 40ce9ea08..5e3f170dd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml @@ -27,84 +27,104 @@ - - - - - - - - - Serial Number - - - Name - - - Machine Version - - - Organization - - - Default RML - - - Loaded RML - - - Default Color Space - - - Default Segment Length - - - Default Spool Type - - - OS Key - - - Device COM Port - - - - - Auto Login - - - Auto Check For Updates - - - Setup Activation - - - Setup Remote Assistance - - - Setup UWF - - - Setup Firmware - - - Setup FPGA - - - Is Demo Machine - - - Suspend Version Update - - - Force Version Update - - - Update Schema on Update - - - - + + + + + + + + + + Serial Number + + + Name + + + Machine Version + + + Organization + + + Default RML + + + Loaded RML + + + Default Color Space + + + Default Segment Length + + + Default Spool Type + + + OS Key + + + Device COM Port + + + + + Auto Login + + + Auto Check For Updates + + + Setup Activation + + + Setup Remote Assistance + + + Setup UWF + + + Setup Firmware + + + Setup FPGA + + + Is Demo Machine + + + Suspend Version Update + + + Force Version Update + + + Update Schema on Update + + + + + + + + + Device Registration + + Device ID: + + + + Device Name: + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml index 35b578b6a..a231e92a3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml @@ -15,6 +15,7 @@ d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + @@ -73,7 +74,8 @@ - + + -- cgit v1.3.1 From cc407822ab637108a1b7868c3dd6f2f27b2ee5f8 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 28 Nov 2019 14:00:29 +0200 Subject: Deprecated the use of loaded rml, default rml, default spool type, target color spaces, target job types and implemented through settings on PPC. Related Work Items: #1499 --- .../Views/MachineSettingsView.xaml | 15 ---------- .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 4 +-- .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 22 +++++++------- .../ViewModels/MainViewVM.cs | 27 ++++++++++++++--- .../Tango.PPC.MachineSettings/Views/MainView.xaml | 10 +++---- .../PPC/Tango.PPC.Common/PPCSettings.cs | 34 ++++++++++++++++++++++ 6 files changed, 75 insertions(+), 37 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml index 5e3f170dd..b6c1ba974 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml @@ -48,21 +48,6 @@ Organization - Default RML - - - Loaded RML - - - Default Color Space - - - Default Segment Length - - - Default Spool Type - - OS Key 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 d60956b1c..a097084f7 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 @@ -709,7 +709,7 @@ namespace Tango.PPC.Jobs.ViewModels try { LogManager.Log("Adding new solid segment..."); - var s = Job.AddSolidSegment(MachineProvider.Machine.DefaultSegmentLength > 0 ? MachineProvider.Machine.DefaultSegmentLength : 10); + var s = Job.AddSolidSegment(Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 10); SetSegmentLiquidVolumesIfVolume(s); return s; } @@ -729,7 +729,7 @@ namespace Tango.PPC.Jobs.ViewModels try { LogManager.Log("Adding new gradient segment..."); - var s = Job.AddGradientSegment(MachineProvider.Machine.DefaultSegmentLength > 0 ? MachineProvider.Machine.DefaultSegmentLength : 10); + var s = Job.AddGradientSegment(Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 10); SetSegmentLiquidVolumesIfVolume(s); return s; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index a7b06f6eb..34d7e32cd 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -407,8 +407,8 @@ namespace Tango.PPC.Jobs.ViewModels var machine = MachineProvider.Machine; JobCreationViewVM vm = new JobCreationViewVM( - machine.SupportedJobTypes.Count > 0 ? machine.SupportedJobTypes : Enum.GetValues(typeof(JobTypes)).Cast().ToList(), - machine.SupportedColorSpaces.Count > 0 ? machine.SupportedColorSpaces : Enum.GetValues(typeof(ColorSpaces)).Cast().Where(x => x.IsUserSpace() || (ApplicationManager.IsInTechnicianMode && x == ColorSpaces.Volume)).ToList() + Settings.SupportedJobTypes.Count > 0 ? Settings.SupportedJobTypes : Enum.GetValues(typeof(JobTypes)).Cast().ToList(), + Settings.SupportedColorSpaces.Count > 0 ? Settings.SupportedColorSpaces : Enum.GetValues(typeof(ColorSpaces)).Cast().Where(x => x.IsUserSpace() || (ApplicationManager.IsInTechnicianMode && x == ColorSpaces.Volume)).ToList() ); CatalogSelectionViewVM catalogVM = new CatalogSelectionViewVM(_catalogs.ToList(), _catalogs.ToList().SingleOrDefault(x => x.Guid == settings.LastSelectedCatalogGuid)); @@ -419,7 +419,7 @@ namespace Tango.PPC.Jobs.ViewModels } else { - vm.SelectedJobType = machine.SupportedJobTypes.FirstOrDefault(); + vm.SelectedJobType = Settings.SupportedJobTypes.FirstOrDefault(); } if (settings.LastJobColorSpace != null) @@ -428,7 +428,7 @@ namespace Tango.PPC.Jobs.ViewModels } else { - var space = machine.SupportedColorSpaces.FirstOrDefault(); + var space = Settings.SupportedColorSpaces.FirstOrDefault(); vm.SelectedColorSpace = space.IsUserSpace() ? space : ColorSpaces.Catalog; } @@ -446,7 +446,7 @@ namespace Tango.PPC.Jobs.ViewModels if (twnFile == null) { - if (machine.SupportedJobTypes.Count != 1 || machine.SupportedColorSpaces.Count != 1) + if (Settings.SupportedJobTypes.Count != 1 || Settings.SupportedColorSpaces.Count != 1) { vm = await NotificationProvider.ShowDialog(vm); if (!vm.DialogResult) return; @@ -476,8 +476,8 @@ namespace Tango.PPC.Jobs.ViewModels } else { - vm.SelectedJobType = machine.SupportedJobTypes.First(); - vm.SelectedColorSpace = machine.SupportedColorSpaces.First(); + vm.SelectedJobType = Settings.SupportedJobTypes.First(); + vm.SelectedColorSpace = Settings.SupportedColorSpaces.First(); } } @@ -503,9 +503,9 @@ namespace Tango.PPC.Jobs.ViewModels job.ColorSpaceGuid = Adapter.ColorSpaces.FirstOrDefault(x => x.Code == vm.SelectedColorSpace.ToInt32()).Guid; job.MachineGuid = MachineProvider.Machine.Guid; job.UserGuid = AuthenticationProvider.CurrentUser.Guid; - job.RmlGuid = machine.DefaultRml != null ? machine.DefaultRmlGuid : Adapter.Rmls.FirstOrDefault().Guid; + job.RmlGuid = Settings.DefaultRmlGuid != null ? Settings.DefaultRmlGuid : Adapter.Rmls.FirstOrDefault().Guid; job.WindingMethodGuid = Adapter.WindingMethods.FirstOrDefault().Guid; - job.SpoolTypeGuid = machine.DefaultSpoolType != null ? machine.DefaultSpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid; + job.SpoolTypeGuid = Settings.DefaultSpoolTypeGuid != null ? Settings.DefaultSpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid; if (vm.SelectedColorSpace == ColorSpaces.Catalog) { @@ -519,11 +519,11 @@ namespace Tango.PPC.Jobs.ViewModels if (colorProfile == null) { - job.AddSolidSegment(machine.DefaultSegmentLength > 0 ? machine.DefaultSegmentLength : 100); + job.AddSolidSegment(Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 100); } else { - job.AddSolidSegment(colorProfile.Value, machine.DefaultSegmentLength > 0 ? machine.DefaultSegmentLength : 100); + job.AddSolidSegment(colorProfile.Value, Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 100); job.Name = $"SnapMatch {colorProfile.Value.R}, {colorProfile.Value.G}, {colorProfile.Value.B}"; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index 8ed512670..598b1a194 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -108,6 +108,20 @@ namespace Tango.PPC.MachineSettings.ViewModels set { _lockScreenPassword = value; RaisePropertyChangedAuto(); } } + private Rml _defaultRML; + public Rml DefaultRML + { + get { return _defaultRML; } + set { _defaultRML = value; RaisePropertyChangedAuto(); } + } + + private SpoolType _defaultSpoolType; + public SpoolType DefaultSpoolType + { + get { return _defaultSpoolType; } + set { _defaultSpoolType = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -139,8 +153,8 @@ namespace Tango.PPC.MachineSettings.ViewModels { if (Validate()) { - Machine.SupportedJobTypes = SelectedJobTypes.SynchedSource.ToList(); - Machine.SupportedColorSpaces = SelectedColorSpaces.SynchedSource.ToList(); + Settings.SupportedJobTypes = SelectedJobTypes.SynchedSource.ToList(); + Settings.SupportedColorSpaces = SelectedColorSpaces.SynchedSource.ToList(); Machine.MapPrimitivesWithStrings(MachineProvider.Machine); Settings.EnableHotSpot = EnableHotSpot; @@ -150,6 +164,8 @@ namespace Tango.PPC.MachineSettings.ViewModels Settings.EnableLockScreen = EnableLockScreen; Settings.LockScreenTimeout = TimeSpan.FromMinutes(LockScreenTimeoutMinutes); Settings.LockScreenPassword = LockScreenPassword; + Settings.DefaultRmlGuid = DefaultRML?.Guid; + Settings.DefaultSpoolTypeGuid = DefaultSpoolType?.Guid; Settings.Save(); await MachineProvider.SaveMachine(); @@ -195,8 +211,11 @@ namespace Tango.PPC.MachineSettings.ViewModels LockScreenTimeoutMinutes = (int)Settings.LockScreenTimeout.TotalMinutes; LockScreenPassword = Settings.LockScreenPassword; - SelectedJobTypes = new SelectedObjectCollection(Enum.GetValues(typeof(JobTypes)).Cast().ToObservableCollection(), Machine.SupportedJobTypes.ToObservableCollection()); - SelectedColorSpaces = new SelectedObjectCollection(Enum.GetValues(typeof(ColorSpaces)).Cast().Where(x => x.IsUserSpace()).ToObservableCollection(), Machine.SupportedColorSpaces.ToObservableCollection()); + SelectedJobTypes = new SelectedObjectCollection(Enum.GetValues(typeof(JobTypes)).Cast().ToObservableCollection(), Settings.SupportedJobTypes.ToObservableCollection()); + SelectedColorSpaces = new SelectedObjectCollection(Enum.GetValues(typeof(ColorSpaces)).Cast().Where(x => x.IsUserSpace()).ToObservableCollection(), Settings.SupportedColorSpaces.ToObservableCollection()); + + DefaultRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid); + DefaultSpoolType = Adapter.SpoolTypes.SingleOrDefault(x => x.Guid == Settings.DefaultSpoolTypeGuid); } private async void OnEnableRemoteAssistanceChanged() diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index dd5f89bb2..0d9a3cea1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -136,14 +136,14 @@ - Default Thread Type - + Default Thread + - + Default Spool + Default Segment Length - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 7ed172219..1b41b065b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -4,6 +4,7 @@ using System.Linq; using System.ServiceModel; using System.Text; using System.Threading.Tasks; +using Tango.BL.Enumerations; using Tango.Integration.Operation; using Tango.Logging; using Tango.PMR.Printing; @@ -143,6 +144,36 @@ namespace Tango.PPC.Common /// public JobUnitsMethods JobUnitsMethod { get; set; } + /// + /// Gets or sets the loaded RML unique identifier. + /// + public String LoadedRmlGuid { get; set; } + + /// + /// Gets or sets the default RML unique identifier. + /// + public String DefaultRmlGuid { get; set; } + + /// + /// Gets or sets the default color space unique identifier. + /// + public List SupportedColorSpaces { get; set; } + + /// + /// Gets or sets the target job types. + /// + public List SupportedJobTypes { get; set; } + + /// + /// Gets or sets the default spool type unique identifier. + /// + public String DefaultSpoolTypeGuid { get; set; } + + /// + /// Gets or sets the default length of the segment. + /// + public int DefaultSegmentLength { get; set; } + /// /// Gets the machine service address. /// @@ -174,6 +205,9 @@ namespace Tango.PPC.Common EmergencyComPort = "COM2"; EnableJobLiquidQuantityValidation = true; JobUnitsMethod = JobUnitsMethods.Device; + DefaultSegmentLength = 100; + SupportedColorSpaces = new List(); + SupportedJobTypes = new List(); } } } -- cgit v1.3.1