diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-07-11 14:01:43 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-07-11 14:01:43 +0300 |
| commit | b2e41ba5213c6a7f08cf8bcb2e4e2654aa6a6224 (patch) | |
| tree | 1b574ea3bf255621bfdd2fde03a93d988ff5a9de /Software/Visual_Studio | |
| parent | c839fa3d339f90f15e0548fc056828c533123bfc (diff) | |
| download | Tango-b2e41ba5213c6a7f08cf8bcb2e4e2654aa6a6224.tar.gz Tango-b2e41ba5213c6a7f08cf8bcb2e4e2654aa6a6224.zip | |
Refactored CCT to single CCT per RML.
Diffstat (limited to 'Software/Visual_Studio')
23 files changed, 336 insertions, 440 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index a106ea184..94fa36e57 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -248,12 +248,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels public RelayCommand ImportForwardDataCommand { get; set; } - public RelayCommand ImportInverseDataCommand { get; set; } - public RelayCommand ExportForwardDataCommand { get; set; } - public RelayCommand ExportInverseDataCommand { get; set; } - public RelayCommand SaveCommand { get; set; } #endregion @@ -274,10 +270,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels SourceColor.ColorChanged += SourceColor_ColorChanged; ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => SelectedRML != null && IsFree); - ImportInverseDataCommand = new RelayCommand(ImportInverseData, () => SelectedRML != null && IsFree); - ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.ForwardFileName != null && IsFree); - ExportInverseDataCommand = new RelayCommand(ExportInverseData, () => SelectedRML != null && CCT != null && CCT.InverseFileName != null && IsFree); + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.FileName != null && IsFree); SaveCommand = new RelayCommand(Save, () => SelectedRML != null && IsFree); } @@ -336,13 +330,13 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { try { - if (LiquidsCalibrationData == null || CCT.ForwardData == null) return; + if (LiquidsCalibrationData == null || CCT.Data == null) return; ConversionInput input = new ConversionInput(); input.ColorSpace = SourceColor.IsLab ? PMR.ColorLab.ColorSpace.Lab : PMR.ColorLab.ColorSpace.Rgb; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(CCT.Data); input.InputCoordinates = new InputCoordinates(); input.InputCoordinates.Red = (int)SourceColor.Red; @@ -455,36 +449,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels String file = GetCCTFileOpen(); if (file != null) { - CCT.ForwardFileName = Path.GetFileName(file); - CCT.ForwardData = File.ReadAllBytes(file); - } - } - - private void ImportInverseData() - { - String file = GetCCTFileOpen(); - if (file != null) - { - CCT.InverseFileName = Path.GetFileName(file); - CCT.InverseData = File.ReadAllBytes(file); + CCT.FileName = Path.GetFileName(file); + CCT.Data = File.ReadAllBytes(file); } } private void ExportForwardData() { - String file = GetCCTFileSave(CCT.ForwardFileName); - if (file != null) - { - File.WriteAllBytes(file, CCT.ForwardData); - } - } - - private void ExportInverseData() - { - String file = GetCCTFileSave(CCT.InverseFileName); + String file = GetCCTFileSave(CCT.FileName); if (file != null) { - File.WriteAllBytes(file, CCT.InverseData); + File.WriteAllBytes(file, CCT.Data); } } @@ -573,7 +548,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(CCT.Data); input.InputCoordinates = new InputCoordinates(); input.ThreadL = 92.1815; //SelectedRML.MediaColor.L; @@ -695,12 +670,12 @@ namespace Tango.MachineStudio.ColorLab.ViewModels } _isNewCCT = false; - CCT = SelectedRML.Ccts.FirstOrDefault(); + CCT = SelectedRML.Cct; if (CCT == null) { CCT = new Cct(); - CCT.Rml = SelectedRML; + SelectedRML.Cct = CCT; _isNewCCT = true; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index d78424d4e..888945579 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -148,7 +148,7 @@ <Image Source="../Images/data-table.png" Height="80" Opacity="0.8"></Image> <StackPanel VerticalAlignment="Center" Width="300" Margin="10 0 0 0"> - <TextBox IsReadOnly="False" Margin="0 5 0 0" Text="{Binding CCT.ForwardFileName}" HorizontalContentAlignment="Center"></TextBox> + <TextBox IsReadOnly="False" Margin="0 5 0 0" Text="{Binding CCT.FileName}" HorizontalContentAlignment="Center"></TextBox> <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Right"> <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs index 58ffddbb0..090d54036 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs @@ -30,8 +30,8 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - EditEntity.InverseData = File.ReadAllBytes(file); - EditEntity.InverseFileName = Path.GetFileName(file); + //EditEntity.InverseData = File.ReadAllBytes(file); + //EditEntity.InverseFileName = Path.GetFileName(file); } catch (Exception ex) { @@ -47,8 +47,8 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - EditEntity.ForwardData = File.ReadAllBytes(file); - EditEntity.ForwardFileName = Path.GetFileName(file); + //EditEntity.ForwardData = File.ReadAllBytes(file); + //EditEntity.ForwardFileName = Path.GetFileName(file); } 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 a865cdc8f..ac5354a74 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 @@ -1537,9 +1537,9 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log("Invalidating liquid factors, process parameters and process group history..."); - _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().Build(); + _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML.Guid).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().Build(); - if (_selectedRML.Ccts.Count == 0) + if (_selectedRML.Cct == null) { InvokeUI(() => { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index ebcfe72fd..7218ef5ea 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -119,7 +120,6 @@ namespace Tango.MachineStudio.RML.ViewModels set { _activeProcessParametersTableView = value; RaisePropertyChangedAuto(); } } - /// <summary> /// Gets or sets the manage RML command. /// </summary> @@ -135,6 +135,10 @@ namespace Tango.MachineStudio.RML.ViewModels /// </summary> public RelayCommand RemoveRmlCommand { get; set; } + public RelayCommand ImportForwardDataCommand { get; set; } + + public RelayCommand ExportForwardDataCommand { get; set; } + public RelayCommand AddProcessParametersTableCommand { get; set; } public RelayCommand<ProcessParametersTable> RemoveProcessParametersTableCommand { get; set; } @@ -165,6 +169,10 @@ namespace Tango.MachineStudio.RML.ViewModels RemoveLiquidFactorCommand = new RelayCommand<LiquidTypesRml>(RemoveLiquidFactor, () => IsFree); CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate); SaveCommand = new RelayCommand(Save, () => IsFree); + + ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => ActiveRML != null && IsFree); + + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => ActiveRML != null && ActiveRML.Cct != null && IsFree); } public override void OnApplicationReady() @@ -199,6 +207,7 @@ namespace Tango.MachineStudio.RML.ViewModels .Set(guid) .WithActiveParametersGroup() .WithLiquidFactors() + .WithCCT() .BuildAsync(); if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) @@ -251,6 +260,8 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlView); + InvalidateRelayCommands(); + IsFree = true; } } @@ -491,5 +502,62 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlsView); LoadRmls(); } + + #region Import / Export Color Conversion Data + + private void ImportForwardData() + { + String file = GetCCTFileOpen(); + if (file != null) + { + if (ActiveRML.Cct == null) + { + Cct cct = new Cct(); + ActiveRML.Cct = cct; + } + + ActiveRML.Cct.FileName = Path.GetFileName(file); + ActiveRML.Cct.Data = File.ReadAllBytes(file); + } + } + + private void ExportForwardData() + { + String file = GetCCTFileSave(ActiveRML.Cct.FileName); + if (file != null) + { + File.WriteAllBytes(file, ActiveRML.Cct.Data); + } + } + + private String GetCCTFileOpen() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + private String GetCCTFileSave(String fileName) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + dlg.FileName = fileName; + dlg.DefaultExt = ".cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index e43c20c3d..962e59291 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -148,7 +148,7 @@ <Image Source="../Images/data-table.png" Height="80" Opacity="0.8"></Image> <StackPanel VerticalAlignment="Center" Width="300" Margin="10 0 0 0"> - <TextBox IsReadOnly="False" Margin="0 5 0 0" Text="{Binding CCT.ForwardFileName}" HorizontalContentAlignment="Center"></TextBox> + <TextBox IsReadOnly="False" Margin="0 5 0 0" Text="{Binding ActiveRML.Cct.FileName}" HorizontalContentAlignment="Center"></TextBox> <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Right"> <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> 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 08a5e1168..8b596a45f 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 @@ -1188,7 +1188,7 @@ namespace Tango.PPC.Jobs.ViewModels { Thread.Sleep(500); - if (Job != null && Job.Rml.Ccts.Count > 0 && IsVisible && (Job.ColorSpace != null && (Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32() || Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.LAB.ToInt32()))) + if (Job != null && Job.Rml.Cct != null && IsVisible && (Job.ColorSpace != null && (Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32() || Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.LAB.ToInt32()))) { var brushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => !x.Corrected && !x.OutOfGamutChecked).ToList(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index a0734ffb8..f9615199a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -258,7 +258,7 @@ namespace Tango.PPC.UI.Printing { throw new InvalidOperationException("Error starting job. Please select a catalog color."); } - if (job.Rml.Ccts.Count == 0) + if (job.Rml.Cct == null) { throw new InvalidOperationException($"Error starting job. No color table found for thread '{job.Rml.Name}'."); } diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs index dd40ceedc..ec777e599 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs @@ -27,6 +27,14 @@ namespace Tango.BL.Builders Include(x => x.FiberSynth); } + public virtual RmlBuilder WithCCT() + { + return AddQueryStep(1, (query) => + { + return query.Include(x => x.Cct); + }); + } + public virtual RmlBuilder WithAllParametersGroup() { return AddStep(1, () => @@ -49,14 +57,6 @@ namespace Tango.BL.Builders }); } - public virtual RmlBuilder WithCCT() - { - return AddStep(3, () => - { - Context.Ccts.FirstOrDefault(x => x.RmlGuid == Entity.Guid); - }); - } - public virtual RmlBuilder WithCAT(String machineGuid) { return AddStep(4, () => diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs index fa0056259..055f02474 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs @@ -14,6 +14,14 @@ namespace Tango.BL.Builders { } + public virtual RmlsCollectionBuilder WithCCT() + { + return AddQueryStep(1, (query) => + { + return query.Include(x => x.Cct); + }); + } + public virtual RmlsCollectionBuilder WithAllParametersGroup() { return AddStep(1, () => @@ -41,17 +49,6 @@ namespace Tango.BL.Builders }); } - public virtual RmlsCollectionBuilder WithCCT() - { - return AddStep(3, () => - { - foreach (var rml in Entities.ToList()) - { - Context.Ccts.FirstOrDefault(x => x.RmlGuid == rml.Guid); - } - }); - } - public virtual RmlsCollectionBuilder WithCAT(String machineGuid) { return AddStep(4, () => diff --git a/Software/Visual_Studio/Tango.BL/DTO/CctDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/CctDTOBase.cs index b0529dd3d..1205a857e 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/CctDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/CctDTOBase.cs @@ -38,33 +38,9 @@ namespace Tango.BL.DTO } /// <summary> - /// forward file name + /// file name /// </summary> - public String ForwardFileName - { - get; set; - } - - /// <summary> - /// inverse file name - /// </summary> - public String InverseFileName - { - get; set; - } - - /// <summary> - /// version - /// </summary> - public Double Version - { - get; set; - } - - /// <summary> - /// rml guid - /// </summary> - public String RmlGuid + public String FileName { get; set; } diff --git a/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs index fe29999ab..537d731bc 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs @@ -205,5 +205,13 @@ namespace Tango.BL.DTO get; set; } + /// <summary> + /// cct guid + /// </summary> + public String CctGuid + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs index 2eacd5057..70cdedadd 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs @@ -29,17 +29,11 @@ namespace Tango.BL.Entities public event EventHandler<String> DescriptionChanged; - public event EventHandler<String> ForwardFileNameChanged; + public event EventHandler<String> FileNameChanged; - public event EventHandler<String> InverseFileNameChanged; + public event EventHandler<Byte[]> DataChanged; - public event EventHandler<Byte[]> ForwardDataChanged; - - public event EventHandler<Byte[]> InverseDataChanged; - - public event EventHandler<Double> VersionChanged; - - public event EventHandler<Rml> RmlChanged; + public event EventHandler<SynchronizedObservableCollection<Rml>> RmlsChanged; protected String _name; @@ -95,194 +89,80 @@ namespace Tango.BL.Entities } } - protected String _forwardfilename; - - /// <summary> - /// Gets or sets the cctbase forward file name. - /// </summary> - - [Column("FORWARD_FILE_NAME")] - - public String ForwardFileName - { - get - { - return _forwardfilename; - } - - set - { - if (_forwardfilename != value) - { - _forwardfilename = value; - - OnForwardFileNameChanged(value); - - } - } - } - - protected String _inversefilename; - - /// <summary> - /// Gets or sets the cctbase inverse file name. - /// </summary> - - [Column("INVERSE_FILE_NAME")] - - public String InverseFileName - { - get - { - return _inversefilename; - } - - set - { - if (_inversefilename != value) - { - _inversefilename = value; - - OnInverseFileNameChanged(value); - - } - } - } - - protected Byte[] _forwarddata; - - /// <summary> - /// Gets or sets the cctbase forward data. - /// </summary> - - [Column("FORWARD_DATA")] - - public Byte[] ForwardData - { - get - { - return _forwarddata; - } - - set - { - if (_forwarddata != value) - { - _forwarddata = value; - - OnForwardDataChanged(value); - - } - } - } - - protected Byte[] _inversedata; + protected String _filename; /// <summary> - /// Gets or sets the cctbase inverse data. + /// Gets or sets the cctbase file name. /// </summary> - [Column("INVERSE_DATA")] + [Column("FILE_NAME")] - public Byte[] InverseData + public String FileName { get { - return _inversedata; + return _filename; } set { - if (_inversedata != value) + if (_filename != value) { - _inversedata = value; + _filename = value; - OnInverseDataChanged(value); + OnFileNameChanged(value); } } } - protected Double _version; + protected Byte[] _data; /// <summary> - /// Gets or sets the cctbase version. + /// Gets or sets the cctbase data. /// </summary> - [Column("VERSION")] + [Column("DATA")] - public Double Version + public Byte[] Data { get { - return _version; + return _data; } set { - if (_version != value) + if (_data != value) { - _version = value; - - OnVersionChanged(value); - - } - } - } - - protected String _rmlguid; - - /// <summary> - /// Gets or sets the cctbase rml guid. - /// </summary> - - [Column("RML_GUID")] - [ForeignKey("Rml")] - - public String RmlGuid - { - get - { - return _rmlguid; - } + _data = value; - set - { - if (_rmlguid != value) - { - _rmlguid = value; + OnDataChanged(value); } } } - protected Rml _rml; + protected SynchronizedObservableCollection<Rml> _rmls; /// <summary> - /// Gets or sets the cctbase rml. + /// Gets or sets the cctbase rmls. /// </summary> - [XmlIgnore] - [JsonIgnore] - public virtual Rml Rml + public virtual SynchronizedObservableCollection<Rml> Rmls { get { - return _rml; + return _rmls; } set { - if (_rml != value) + if (_rmls != value) { - _rml = value; + _rmls = value; - if (Rml != null) - { - RmlGuid = Rml.Guid; - } - - OnRmlChanged(value); + OnRmlsChanged(value); } } @@ -307,57 +187,30 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the ForwardFileName has changed. - /// </summary> - protected virtual void OnForwardFileNameChanged(String forwardfilename) - { - ForwardFileNameChanged?.Invoke(this, forwardfilename); - RaisePropertyChanged(nameof(ForwardFileName)); - } - - /// <summary> - /// Called when the InverseFileName has changed. + /// Called when the FileName has changed. /// </summary> - protected virtual void OnInverseFileNameChanged(String inversefilename) + protected virtual void OnFileNameChanged(String filename) { - InverseFileNameChanged?.Invoke(this, inversefilename); - RaisePropertyChanged(nameof(InverseFileName)); + FileNameChanged?.Invoke(this, filename); + RaisePropertyChanged(nameof(FileName)); } /// <summary> - /// Called when the ForwardData has changed. + /// Called when the Data has changed. /// </summary> - protected virtual void OnForwardDataChanged(Byte[] forwarddata) + protected virtual void OnDataChanged(Byte[] data) { - ForwardDataChanged?.Invoke(this, forwarddata); - RaisePropertyChanged(nameof(ForwardData)); + DataChanged?.Invoke(this, data); + RaisePropertyChanged(nameof(Data)); } /// <summary> - /// Called when the InverseData has changed. + /// Called when the Rmls has changed. /// </summary> - protected virtual void OnInverseDataChanged(Byte[] inversedata) + protected virtual void OnRmlsChanged(SynchronizedObservableCollection<Rml> rmls) { - InverseDataChanged?.Invoke(this, inversedata); - RaisePropertyChanged(nameof(InverseData)); - } - - /// <summary> - /// Called when the Version has changed. - /// </summary> - protected virtual void OnVersionChanged(Double version) - { - VersionChanged?.Invoke(this, version); - RaisePropertyChanged(nameof(Version)); - } - - /// <summary> - /// Called when the Rml has changed. - /// </summary> - protected virtual void OnRmlChanged(Rml rml) - { - RmlChanged?.Invoke(this, rml); - RaisePropertyChanged(nameof(Rml)); + RmlsChanged?.Invoke(this, rmls); + RaisePropertyChanged(nameof(Rmls)); } /// <summary> @@ -365,6 +218,9 @@ namespace Tango.BL.Entities /// </summary> public CctBase() : base() { + + Rmls = new SynchronizedObservableCollection<Rml>(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs index 6ec36b87f..bc97a2618 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs @@ -63,7 +63,7 @@ namespace Tango.BL.Entities public event EventHandler<SynchronizedObservableCollection<Cat>> CatsChanged; - public event EventHandler<SynchronizedObservableCollection<Cct>> CctsChanged; + public event EventHandler<Cct> CctChanged; public event EventHandler<SynchronizedObservableCollection<ColorCatalogsItemsRecipe>> ColorCatalogsItemsRecipesChanged; @@ -729,6 +729,32 @@ namespace Tango.BL.Entities } } + protected String _cctguid; + + /// <summary> + /// Gets or sets the rmlbase cct guid. + /// </summary> + + [Column("CCT_GUID")] + [ForeignKey("Cct")] + + public String CctGuid + { + get + { + return _cctguid; + } + + set + { + if (_cctguid != value) + { + _cctguid = value; + + } + } + } + protected SynchronizedObservableCollection<Cat> _cats; /// <summary> @@ -754,26 +780,33 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<Cct> _ccts; + protected Cct _cct; /// <summary> - /// Gets or sets the rmlbase ccts. + /// Gets or sets the rmlbase cct. /// </summary> - public virtual SynchronizedObservableCollection<Cct> Ccts + [XmlIgnore] + [JsonIgnore] + public virtual Cct Cct { get { - return _ccts; + return _cct; } set { - if (_ccts != value) + if (_cct != value) { - _ccts = value; + _cct = value; + + if (Cct != null) + { + CctGuid = Cct.Guid; + } - OnCctsChanged(value); + OnCctChanged(value); } } @@ -1268,12 +1301,12 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the Ccts has changed. + /// Called when the Cct has changed. /// </summary> - protected virtual void OnCctsChanged(SynchronizedObservableCollection<Cct> ccts) + protected virtual void OnCctChanged(Cct cct) { - CctsChanged?.Invoke(this, ccts); - RaisePropertyChanged(nameof(Ccts)); + CctChanged?.Invoke(this, cct); + RaisePropertyChanged(nameof(Cct)); } /// <summary> @@ -1383,8 +1416,6 @@ namespace Tango.BL.Entities Cats = new SynchronizedObservableCollection<Cat>(); - Ccts = new SynchronizedObservableCollection<Cct>(); - ColorCatalogsItemsRecipes = new SynchronizedObservableCollection<ColorCatalogsItemsRecipe>(); Jobs = new SynchronizedObservableCollection<Job>(); diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/ColorCatalogsItems.cs b/Software/Visual_Studio/Tango.BL/Enumerations/ColorCatalogsItems.cs index 5fae7e974..85cd43b54 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/ColorCatalogsItems.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/ColorCatalogsItems.cs @@ -614,6 +614,12 @@ namespace Tango.BL.Enumerations Green58 = 198, /// <summary> + /// (Roy Color) + /// </summary> + [Description("Roy Color")] + RoyColor = 0, + + /// <summary> /// (Blue56) /// </summary> [Description("Blue56")] diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs index cb9f63938..ec13b0a10 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs @@ -122,16 +122,6 @@ namespace Tango.BL } /// <summary> - /// Gets the RML CCTS. - /// </summary> - /// <param name="rmlGuid">The RML unique identifier.</param> - /// <returns></returns> - public ObservableCollection<Cct> GetRmlCCTs(String rmlGuid) - { - return _db.Ccts.Where(x => x.RmlGuid == rmlGuid).ToObservableCollection(); - } - - /// <summary> /// Gets the RML CATS. /// </summary> /// <param name="rmlGuid">The RML unique identifier.</param> diff --git a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs index cccdc5dca..f6fe9c74e 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs +++ b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs @@ -68,7 +68,7 @@ namespace Tango.ColorConversion throw new ArgumentNullException("Specified RML is a null reference."); } - if (rml.Ccts == null || rml.Ccts.Count == 0) + if (rml.Cct == null) { throw new InvalidOperationException($"No CCT found for RML {rml.Name}. Could not create a conversion input."); } @@ -114,7 +114,7 @@ namespace Tango.ColorConversion conversionInput.ThreadA = rml.WhitePointA; conversionInput.ThreadB = rml.WhitePointB; - conversionInput.ForwardData = ByteString.CopyFrom(rml.Ccts.FirstOrDefault().ForwardData); + conversionInput.ForwardData = ByteString.CopyFrom(rml.Cct.Data); foreach (var processTable in rml.ProcessParametersTablesGroups.First(x => x.Active).ProcessParametersTables) { diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CCT.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CCT.cs index 87c657d50..ac9b95885 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/CCT.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CCT.cs @@ -14,18 +14,21 @@ namespace Tango.DAL.Remote.DB public partial class CCT { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public CCT() + { + this.RMLS = new HashSet<RML>(); + } + public int ID { get; set; } public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public string NAME { get; set; } public string DESCRIPTION { get; set; } - public string FORWARD_FILE_NAME { get; set; } - public string INVERSE_FILE_NAME { get; set; } - public byte[] FORWARD_DATA { get; set; } - public byte[] INVERSE_DATA { get; set; } - public double VERSION { get; set; } - public string RML_GUID { get; set; } + public string FILE_NAME { get; set; } + public byte[] DATA { get; set; } - public virtual RML RML { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<RML> RMLS { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs index 1270e7774..478dffa73 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -18,7 +18,6 @@ namespace Tango.DAL.Remote.DB public RML() { this.CATS = new HashSet<CAT>(); - this.CCTS = new HashSet<CCT>(); this.COLOR_CATALOGS_ITEMS_RECIPES = new HashSet<COLOR_CATALOGS_ITEMS_RECIPES>(); this.JOBS = new HashSet<JOB>(); this.LIQUID_TYPES_RMLS = new HashSet<LIQUID_TYPES_RMLS>(); @@ -53,11 +52,11 @@ namespace Tango.DAL.Remote.DB public double ESTIMATED_THREAD_DIAMETER { get; set; } public int RANK { get; set; } public byte[] THUMBNAIL { get; set; } + public string CCT_GUID { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<CAT> CATS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection<CCT> CCTS { get; set; } + public virtual CCT CCT { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<COLOR_CATALOGS_ITEMS_RECIPES> COLOR_CATALOGS_ITEMS_RECIPES { get; set; } public virtual FIBER_SHAPES FIBER_SHAPES { 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 f1ab52353..2739abd99 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -122,12 +122,8 @@ <Property Name="LAST_UPDATED" Type="datetime2" Precision="3" Nullable="false" /> <Property Name="NAME" Type="nvarchar" MaxLength="100" /> <Property Name="DESCRIPTION" Type="nvarchar" MaxLength="200" /> - <Property Name="FORWARD_FILE_NAME" Type="nvarchar" MaxLength="100" /> - <Property Name="INVERSE_FILE_NAME" Type="nvarchar" MaxLength="100" /> - <Property Name="FORWARD_DATA" Type="image" /> - <Property Name="INVERSE_DATA" Type="image" /> - <Property Name="VERSION" Type="float" Nullable="false" /> - <Property Name="RML_GUID" Type="varchar" MaxLength="36" Nullable="false" /> + <Property Name="FILE_NAME" Type="nvarchar" MaxLength="100" /> + <Property Name="DATA" Type="image" /> </EntityType> <EntityType Name="COLOR_CATALOGS"> <Key> @@ -867,6 +863,7 @@ <Property Name="ESTIMATED_THREAD_DIAMETER" Type="float" Nullable="false" /> <Property Name="RANK" Type="int" Nullable="false" /> <Property Name="THUMBNAIL" Type="image" /> + <Property Name="CCT_GUID" Type="varchar" MaxLength="36" /> </EntityType> <EntityType Name="ROLES"> <Key> @@ -1163,20 +1160,6 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_CCTS_RMLS"> - <End Role="RMLS" Type="Self.RMLS" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Role="CCTS" Type="Self.CCTS" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="RMLS"> - <PropertyRef Name="GUID" /> - </Principal> - <Dependent Role="CCTS"> - <PropertyRef Name="RML_GUID" /> - </Dependent> - </ReferentialConstraint> - </Association> <Association Name="FK_COLOR_CATALOGS_GROUPS_COLOR_CATALOGS"> <End Role="COLOR_CATALOGS" Type="Self.COLOR_CATALOGS" Multiplicity="1"> <OnDelete Action="Cascade" /> @@ -1965,6 +1948,18 @@ </Dependent> </ReferentialConstraint> </Association> + <Association Name="FK_RMLS_CCTS"> + <End Role="CCTS" Type="Self.CCTS" Multiplicity="0..1" /> + <End Role="RMLS" Type="Self.RMLS" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="CCTS"> + <PropertyRef Name="GUID" /> + </Principal> + <Dependent Role="RMLS"> + <PropertyRef Name="CCT_GUID" /> + </Dependent> + </ReferentialConstraint> + </Association> <Association Name="FK_ROLES_PERMISSIONS_PERMISSIONS"> <End Role="PERMISSIONS" Type="Self.PERMISSIONS" Multiplicity="1"> <OnDelete Action="Cascade" /> @@ -2218,10 +2213,6 @@ <End Role="RMLS" EntitySet="RMLS" /> <End Role="CATS" EntitySet="CATS" /> </AssociationSet> - <AssociationSet Name="FK_CCTS_RMLS" Association="Self.FK_CCTS_RMLS"> - <End Role="RMLS" EntitySet="RMLS" /> - <End Role="CCTS" EntitySet="CCTS" /> - </AssociationSet> <AssociationSet Name="FK_COLOR_CATALOGS_GROUPS_COLOR_CATALOGS" Association="Self.FK_COLOR_CATALOGS_GROUPS_COLOR_CATALOGS"> <End Role="COLOR_CATALOGS" EntitySet="COLOR_CATALOGS" /> <End Role="COLOR_CATALOGS_GROUPS" EntitySet="COLOR_CATALOGS_GROUPS" /> @@ -2466,6 +2457,10 @@ <End Role="MEDIA_PURPOSES" EntitySet="MEDIA_PURPOSES" /> <End Role="RMLS" EntitySet="RMLS" /> </AssociationSet> + <AssociationSet Name="FK_RMLS_CCTS" Association="Self.FK_RMLS_CCTS"> + <End Role="CCTS" EntitySet="CCTS" /> + <End Role="RMLS" EntitySet="RMLS" /> + </AssociationSet> <AssociationSet Name="FK_ROLES_PERMISSIONS_PERMISSIONS" Association="Self.FK_ROLES_PERMISSIONS_PERMISSIONS"> <End Role="PERMISSIONS" EntitySet="PERMISSIONS" /> <End Role="ROLES_PERMISSIONS" EntitySet="ROLES_PERMISSIONS" /> @@ -2642,9 +2637,9 @@ <End Role="RML" EntitySet="RMLS" /> <End Role="CAT" EntitySet="CATS" /> </AssociationSet> - <AssociationSet Name="FK_CCTS_RMLS" Association="RemoteModel.FK_CCTS_RMLS"> - <End Role="RML" EntitySet="RMLS" /> + <AssociationSet Name="FK_RMLS_CCTS" Association="RemoteModel.FK_RMLS_CCTS"> <End Role="CCT" EntitySet="CCTS" /> + <End Role="RML" EntitySet="RMLS" /> </AssociationSet> <AssociationSet Name="FK_COLOR_CATALOGS_GROUPS_COLOR_CATALOGS" Association="RemoteModel.FK_COLOR_CATALOGS_GROUPS_COLOR_CATALOGS"> <End Role="COLOR_CATALOGS" EntitySet="COLOR_CATALOGS" /> @@ -3052,13 +3047,9 @@ <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" /> <Property Name="NAME" Type="String" MaxLength="100" FixedLength="false" Unicode="true" /> <Property Name="DESCRIPTION" Type="String" MaxLength="200" FixedLength="false" Unicode="true" /> - <Property Name="FORWARD_FILE_NAME" Type="String" MaxLength="100" FixedLength="false" Unicode="true" /> - <Property Name="INVERSE_FILE_NAME" Type="String" MaxLength="100" FixedLength="false" Unicode="true" /> - <Property Name="FORWARD_DATA" Type="Binary" MaxLength="Max" FixedLength="false" /> - <Property Name="INVERSE_DATA" Type="Binary" MaxLength="Max" FixedLength="false" /> - <Property Name="VERSION" Type="Double" Nullable="false" /> - <Property Name="RML_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" /> - <NavigationProperty Name="RML" Relationship="RemoteModel.FK_CCTS_RMLS" FromRole="CCT" ToRole="RML" /> + <Property Name="FILE_NAME" Type="String" MaxLength="100" FixedLength="false" Unicode="true" /> + <Property Name="DATA" Type="Binary" MaxLength="Max" FixedLength="false" /> + <NavigationProperty Name="RMLS" Relationship="RemoteModel.FK_RMLS_CCTS" FromRole="CCT" ToRole="RML" /> </EntityType> <EntityType Name="COLOR_CATALOGS"> <Key> @@ -3908,8 +3899,9 @@ <Property Name="ESTIMATED_THREAD_DIAMETER" Type="Double" Nullable="false" /> <Property Name="RANK" Type="Int32" Nullable="false" /> <Property Name="THUMBNAIL" Type="Binary" MaxLength="Max" FixedLength="false" /> + <Property Name="CCT_GUID" Type="String" MaxLength="36" FixedLength="false" Unicode="false" /> <NavigationProperty Name="CATS" Relationship="RemoteModel.FK_CATS_RMLS" FromRole="RML" ToRole="CAT" /> - <NavigationProperty Name="CCTS" Relationship="RemoteModel.FK_CCTS_RMLS" FromRole="RML" ToRole="CCT" /> + <NavigationProperty Name="CCT" Relationship="RemoteModel.FK_RMLS_CCTS" FromRole="RML" ToRole="CCT" /> <NavigationProperty Name="COLOR_CATALOGS_ITEMS_RECIPES" Relationship="RemoteModel.FK_COLOR_CATALOGS_ITEMS_RECIPES_RMLS" FromRole="RML" ToRole="COLOR_CATALOGS_ITEMS_RECIPES" /> <NavigationProperty Name="FIBER_SHAPES" Relationship="RemoteModel.FK_RML_FIBER_SHAPES" FromRole="RML" ToRole="FIBER_SHAPES" /> <NavigationProperty Name="FIBER_SYNTHS" Relationship="RemoteModel.FK_RML_FIBER_SYNTHESIS" FromRole="RML" ToRole="FIBER_SYNTHS" /> @@ -4307,17 +4299,15 @@ </Dependent> </ReferentialConstraint> </Association> - <Association Name="FK_CCTS_RMLS"> - <End Type="RemoteModel.RML" Role="RML" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Type="RemoteModel.CCT" Role="CCT" Multiplicity="*" /> + <Association Name="FK_RMLS_CCTS"> + <End Type="RemoteModel.CCT" Role="CCT" Multiplicity="0..1" /> + <End Type="RemoteModel.RML" Role="RML" Multiplicity="*" /> <ReferentialConstraint> - <Principal Role="RML"> + <Principal Role="CCT"> <PropertyRef Name="GUID" /> </Principal> - <Dependent Role="CCT"> - <PropertyRef Name="RML_GUID" /> + <Dependent Role="RML"> + <PropertyRef Name="CCT_GUID" /> </Dependent> </ReferentialConstraint> </Association> @@ -5322,12 +5312,8 @@ <EntitySetMapping Name="CCTS"> <EntityTypeMapping TypeName="RemoteModel.CCT"> <MappingFragment StoreEntitySet="CCTS"> - <ScalarProperty Name="RML_GUID" ColumnName="RML_GUID" /> - <ScalarProperty Name="VERSION" ColumnName="VERSION" /> - <ScalarProperty Name="INVERSE_DATA" ColumnName="INVERSE_DATA" /> - <ScalarProperty Name="FORWARD_DATA" ColumnName="FORWARD_DATA" /> - <ScalarProperty Name="INVERSE_FILE_NAME" ColumnName="INVERSE_FILE_NAME" /> - <ScalarProperty Name="FORWARD_FILE_NAME" ColumnName="FORWARD_FILE_NAME" /> + <ScalarProperty Name="DATA" ColumnName="DATA" /> + <ScalarProperty Name="FILE_NAME" ColumnName="FILE_NAME" /> <ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" /> <ScalarProperty Name="NAME" ColumnName="NAME" /> <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" /> @@ -6094,6 +6080,7 @@ <EntitySetMapping Name="RMLS"> <EntityTypeMapping TypeName="RemoteModel.RML"> <MappingFragment StoreEntitySet="RMLS"> + <ScalarProperty Name="CCT_GUID" ColumnName="CCT_GUID" /> <ScalarProperty Name="THUMBNAIL" ColumnName="THUMBNAIL" /> <ScalarProperty Name="RANK" ColumnName="RANK" /> <ScalarProperty Name="ESTIMATED_THREAD_DIAMETER" ColumnName="ESTIMATED_THREAD_DIAMETER" /> 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 aea8eff7d..ad55214ff 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,79 +5,79 @@ <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1"> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="6.75" PointY="65.75" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="6.75" PointY="44.125" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="6.75" PointY="41.125" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="6.75" PointY="49.875" /> - <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="14.75" PointY="29.375" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="9" PointY="72.5" /> - <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="19.125" /> - <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="57.125" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="7.25" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="0.75" PointY="12.5" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="3" PointY="11.25" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="5.25" PointY="21" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="43.125" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="9" PointY="46.75" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="6.75" PointY="61.75" /> - <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="8" PointY="31" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="6.75" PointY="10.5" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="9" PointY="10" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="6.75" PointY="47" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="14.25" PointY="11" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="20.625" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="32.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="9.75" PointY="79.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="12" PointY="53" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="6.75" PointY="37.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="9" PointY="53.125" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="6.75" PointY="70.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="9" PointY="57.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="12.75" PointY="65.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="15" PointY="51" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="9.75" PointY="68.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="12" PointY="45.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="9.75" PointY="83.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="12" PointY="57.125" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="6.75" PointY="52.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="12.75" PointY="61.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="15" PointY="47.25" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="9" PointY="6.25" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="11.25" PointY="37.25" /> - <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="12.5" PointY="28.5" /> - <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="10.25" PointY="27" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="29.5" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="16" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="10.25" PointY="23.375" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="16.5" PointY="25.75" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="9" PointY="37.875" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="11.25" PointY="13.5" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="16.5" PointY="16" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="17.75" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="26.625" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="23.625" /> - <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="9" PointY="75.5" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="9" PointY="63.875" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="14.25" PointY="2.875" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="23.75" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="25.375" /> - <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="20.375" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="14.25" PointY="6.875" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="16.5" PointY="6.875" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="12.5" PointY="32.125" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="9" PointY="14.75" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="13.5" PointY="16.125" /> - <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="0.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="17.5" PointY="30.125" /> - <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="2.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="4.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="4.75" PointY="3.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="6.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="3.75" PointY="6.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="5.75" PointY="6.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="14.25" PointY="20.875" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="16.5" PointY="21.875" /> - <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="8" PointY="34.125" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="0.75" PointY="7.125" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="0.75" PointY="54.125" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="41.125" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="0.75" PointY="51.25" /> + <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="15.75" PointY="18.125" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6" PointY="38.5" /> + <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="22.625" /> + <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="35.25" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="57.25" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="0.75" PointY="3.625" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="3" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="5.25" PointY="22.5" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="3" PointY="34.125" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3" PointY="46.75" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="0.75" PointY="11.125" /> + <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="35.5" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="3.75" PointY="63.125" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="6" PointY="62.5" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="44" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="8.25" PointY="26.75" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="15.625" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="18.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="0.75" PointY="65.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="3" PointY="52.125" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="3.75" PointY="66.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="6" PointY="47.25" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="8.75" PointY="61.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="11" PointY="39.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="7.75" PointY="67.375" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="10" PointY="45.125" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="7.75" PointY="71.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="10" PointY="53.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="0.75" PointY="61.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="3" PointY="42.25" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="0.75" PointY="47" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="3.75" PointY="57.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="6" PointY="43.375" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6" PointY="35.125" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="8.25" PointY="39.5" /> + <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="13.5" PointY="24.5" /> + <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="19.5" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="29.375" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="30.5" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="26.75" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="10.5" PointY="10.5" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3" PointY="37.75" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="5.25" PointY="13" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="10.5" PointY="14.5" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="32.25" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="26.5" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="23.125" /> + <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6" PointY="59.375" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3" PointY="9.125" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="11.25" PointY="2.625" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="52" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="53.625" /> + <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="19.75" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="11.25" PointY="6.5" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="13.5" PointY="6.625" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="13.5" PointY="21" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="3" PointY="30" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="7.5" PointY="15.625" /> + <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="5.75" PointY="2.5" /> + <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="13.5" PointY="28.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="5.75" PointY="5.5" /> + <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="7.75" PointY="2.5" /> + <EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="7.75" PointY="5.5" /> + <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="12.75" PointY="14.5" /> + <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="13.75" PointY="2.5" /> + <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="14.75" PointY="14.5" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="8.25" PointY="9.5" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="13.5" PointY="10.625" /> + <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="32.5" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_APPLICATION_DISPLAY_PANEL_VERSIONS" /> @@ -90,7 +90,7 @@ <AssociationConnector Association="RemoteModel.FK_CATS_LIQUID_TYPES1" /> <AssociationConnector Association="RemoteModel.FK_CATS_MACHINES" /> <AssociationConnector Association="RemoteModel.FK_CATS_RMLS" /> - <AssociationConnector Association="RemoteModel.FK_CCTS_RMLS" /> + <AssociationConnector Association="RemoteModel.FK_RMLS_CCTS" /> <AssociationConnector Association="RemoteModel.FK_COLOR_CATALOGS_GROUPS_COLOR_CATALOGS" /> <AssociationConnector Association="RemoteModel.FK_COLOR_CATALOGS_ITEMS_COLOR_CATALOGS_GROUPS" /> <AssociationConnector Association="RemoteModel.FK_COLOR_CATALOGS_ITEMS_RECIPES_COLOR_CATALOGS_ITEMS" /> diff --git a/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs b/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs index c44114c94..9f716846b 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs @@ -169,7 +169,7 @@ namespace Tango.Integration.Operation var cmykCollection = brushStopsCollection.Select(x => GetCMYK(x)).ToList(); - var stop = cmykCollection.SingleOrDefault(f => f.OffsetPercent == offset); + var stop = cmykCollection.FirstOrDefault(f => f.OffsetPercent == offset); if (stop != null) return stop; CMYK before = cmykCollection.Where(w => w.OffsetPercent == cmykCollection.Min(m => m.OffsetPercent)).First(); diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index bfc31fc40..ad59ed234 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1316,6 +1316,11 @@ namespace Tango.Integration.Operation RunningJob = null; RunningJobStatus = null; + if (job.NumberOfUnits < 1) + { + job.NumberOfUnits = 1; + } + var originalJob = job; var clonedJob = job.Clone(); clonedJob.Guid = job.Guid; @@ -1324,11 +1329,6 @@ namespace Tango.Integration.Operation JobRequest request = new JobRequest(); - if (job.NumberOfUnits < 1) - { - job.NumberOfUnits = 1; - } - job = job.Clone(); job.Guid = originalJob.Guid; |
