From 09686240419bf92d2963564fb4a56f6e566468ce Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 24 Feb 2020 18:53:10 +0200 Subject: Added RmlQualification and HeadType enums to machine and RML. Filtered RML by head type on PPC. Updated SQLExaminer configurations.. Added all new rml and machine parameters to machine designer and RML modules. --- .../Views/MachineSettingsView.xaml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner') 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 499d6dc89..954ac5f0e 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 @@ -6,6 +6,7 @@ xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" @@ -13,6 +14,11 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + + + + @@ -44,6 +50,9 @@ Name + Head Type + + Machine Version -- cgit v1.3.1 From afb6bbb2123932b3562e1af993eb847d8147bf58 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 26 Feb 2020 18:25:52 +0200 Subject: Major Changes Regarding RML & SPOOL parameters changes! --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes Software/PMR/Messages/Printing/JobSpool.proto | 2 + .../PMR/Messages/Printing/ProcessParameters.proto | 12 +- .../ViewModels/MainViewVM.cs | 2 +- .../ViewModels/MainViewVM.cs | 2 +- .../ViewModels/MainViewVM.cs | 4 +- .../Views/MachinesView.xaml | 2 +- .../Views/SpoolsView.xaml | 11 +- .../Tango.MachineStudio.RML.csproj | 7 + .../ViewModels/MainViewVM.cs | 74 ++++- .../Views/ProcessParametersView.xaml | 2 +- .../Tango.MachineStudio.RML/Views/RmlView.xaml | 9 +- .../Tango.MachineStudio.RML/Views/SpoolsView.xaml | 85 ++++++ .../Views/SpoolsView.xaml.cs | 28 ++ .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 2 +- .../Connection/DefaultMachineProvider.cs | 2 +- .../PPCApplication/DefaultPPCApplicationManager.cs | 2 +- .../ActionLogs/DefaultActionLogComparer.cs | 4 +- .../Visual_Studio/Tango.BL/Builders/JobBuilder.cs | 1 + .../Tango.BL/Builders/MachineBuilder.cs | 10 +- .../Visual_Studio/Tango.BL/Builders/RmlBuilder.cs | 8 + .../Tango.BL/Builders/RmlsCollectionBuilder.cs | 8 + .../Tango.BL/DTO/ProcessParametersTableDTOBase.cs | 16 - .../Visual_Studio/Tango.BL/DTO/RmlsSpoolDTO.cs | 14 + .../Visual_Studio/Tango.BL/DTO/RmlsSpoolDTOBase.cs | 73 +++++ .../Visual_Studio/Tango.BL/DTO/SpoolDTOBase.cs | 16 +- .../Visual_Studio/Tango.BL/DTO/SpoolTypeDTOBase.cs | 40 +++ .../Tango.BL/Entities/ColorSpaceBase.cs | 38 --- .../Visual_Studio/Tango.BL/Entities/MachineBase.cs | 132 --------- .../Tango.BL/Entities/MachineVersion.cs | 6 +- .../Tango.BL/Entities/ProcessParametersTable.cs | 4 +- .../Entities/ProcessParametersTableBase.cs | 84 ------ Software/Visual_Studio/Tango.BL/Entities/Rml.cs | 3 +- .../Visual_Studio/Tango.BL/Entities/RmlBase.cs | 76 ++--- .../Visual_Studio/Tango.BL/Entities/RmlsSpool.cs | 13 + .../Tango.BL/Entities/RmlsSpoolBase.cs | 327 +++++++++++++++++++++ .../Visual_Studio/Tango.BL/Entities/SpoolBase.cs | 70 ++++- .../Tango.BL/Entities/SpoolTypeBase.cs | 216 +++++++++++++- .../Tango.BL/Entities/SysdiagramBase.cs | 13 +- .../Visual_Studio/Tango.BL/ObservableEntity.cs | 6 +- .../Visual_Studio/Tango.BL/ObservableEntityDTO.cs | 6 +- .../Visual_Studio/Tango.BL/ObservablesContext.cs | 8 + .../ObservablesEntitiesAdapterExtension.cs | 38 +++ .../ObservablesStaticCollectionsExtension.cs | 38 +++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 6 +- .../ExtensionMethods/ObjectExtensions.cs | 12 +- .../Tango.Core/ExtensionMethods/TypeExtensions.cs | 15 + .../Visual_Studio/Tango.Core/Tango.Core.csproj | 2 +- .../Tango.DAL.Remote/DB/COLOR_SPACES.cs | 3 - .../Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs | 3 - .../DB/PROCESS_PARAMETERS_TABLES.cs | 2 - Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 6 +- .../Tango.DAL.Remote/DB/RMLS_SPOOLS.cs | 30 ++ .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 263 +++++++++-------- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 162 +++++----- .../Visual_Studio/Tango.DAL.Remote/DB/SPOOL.cs | 9 +- .../Tango.DAL.Remote/DB/SPOOL_TYPES.cs | 9 +- .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 5 +- .../Tango.Integration/Operation/MachineOperator.cs | 25 +- .../Visual_Studio/Tango.PMR/Printing/JobSpool.cs | 37 ++- .../Tango.PMR/Printing/ProcessParameters.cs | 91 ++---- .../SQLExaminer/Configurations/OverrideData.xml | Bin 81980 -> 83216 bytes .../Configurations/ProvisionMachine.xml | Bin 87736 -> 88158 bytes .../Converters/EmptyStringToNullConverter.cs | 31 ++ .../Tango.SharedUI/Tango.SharedUI.csproj | 3 +- .../ObservablesGenerator.cs | 14 +- 70 files changed, 1528 insertions(+), 715 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml.cs create mode 100644 Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTO.cs create mode 100644 Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTOBase.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_SPOOLS.cs create mode 100644 Software/Visual_Studio/Tango.SharedUI/Converters/EmptyStringToNullConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index 22d662d7a..217886508 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index e887b17f9..f378adf0c 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index cbb2bf172..acb091ff8 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 662770d36..85ba181a9 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/PMR/Messages/Printing/JobSpool.proto b/Software/PMR/Messages/Printing/JobSpool.proto index a1d6b65ab..e9fa8ae5f 100644 --- a/Software/PMR/Messages/Printing/JobSpool.proto +++ b/Software/PMR/Messages/Printing/JobSpool.proto @@ -36,4 +36,6 @@ message JobSpool int32 BottomBackingRate = 9; + int32 LimitSwitchStartPointOffset = 10; + } diff --git a/Software/PMR/Messages/Printing/ProcessParameters.proto b/Software/PMR/Messages/Printing/ProcessParameters.proto index b4b334788..9dbc0e78b 100644 --- a/Software/PMR/Messages/Printing/ProcessParameters.proto +++ b/Software/PMR/Messages/Printing/ProcessParameters.proto @@ -68,16 +68,12 @@ message ProcessParameters double HeadZone12Temp = 26; - double StSpZone1Temp = 27; + double RBlowerFlow = 27; - double StSpZone2Temp = 28; + double RBlowerTemp = 28; - double RBlowerFlow = 29; + double LBlowerFlow = 29; - double RBlowerTemp = 30; - - double LBlowerFlow = 31; - - double LBlowerTemp = 32; + double LBlowerTemp = 30; } 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 efbcaf5ad..c5df65f59 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 @@ -1622,7 +1622,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log("Invalidating liquid factors, process parameters and process group history..."); - _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML.Guid).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().Build(); + _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML.Guid).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().WithSpools().Build(); _selectedRMLBeforeLiquidFactorsSaves = RmlDTO.FromObservable(_selectedRML); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs index 0a8780346..cf66c1a34 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs @@ -233,7 +233,7 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels private void CopyParameters(object obj) { - obj.MapPropertiesTo(SelectedHardwareObject, MappingFlags.PrimitivesOnly, + obj.MapPropertiesTo(SelectedHardwareObject, MappingFlags.ValueTypesOnly, (prop) => !prop.PropertyType.IsEnum && diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index e0d99d0f0..ed93b4308 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -523,7 +523,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels try { initHwConfig = false; - ActiveMachine = machineCreationDialogVM.SelectedMachineVersion.CreatePrototypeMachine(ActiveMachineAdapter.Context); + ActiveMachine = await machineCreationDialogVM.SelectedMachineVersion.CreatePrototypeMachine(ActiveMachineAdapter.Context); ActiveMachine.SerialNumber = machineCreationDialogVM.SerialNumber; ActiveMachine.Name = machineCreationDialogVM.Name; ActiveMachineAdapter.Context.Machines.Add(ActiveMachine); @@ -547,7 +547,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { var serial = machineCreationDialogVM.SerialNumber + "-" + (i + 1); - var existingDispenser = await ActiveMachineAdapter.Context.Dispensers.Include(x => x.IdsPacks).SingleAsync(x => x.SerialNumber == serial); + var existingDispenser = await ActiveMachineAdapter.Context.Dispensers.Include(x => x.IdsPacks).SingleOrDefaultAsync(x => x.SerialNumber == serial); if (existingDispenser != null) { 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 446303aa2..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 @@ -26,7 +26,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml index 3663f72f8..f08da88d1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml @@ -9,8 +9,14 @@ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="1280" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + + + + @@ -67,10 +73,7 @@ - - - - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj index 2ff9ab0a3..9f3a95e0b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj @@ -118,6 +118,9 @@ RmlView.xaml + + SpoolsView.xaml + ResXFileCodeGenerator Resources.Designer.cs @@ -223,6 +226,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + 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 3b3a307ad..b75d65fe0 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 @@ -87,6 +87,13 @@ namespace Tango.MachineStudio.RML.ViewModels set { _fiberSynths = value; RaisePropertyChangedAuto(); } } + private ObservableCollection _spoolTypes; + public ObservableCollection SpoolTypes + { + get { return _spoolTypes; } + set { _spoolTypes = value; RaisePropertyChangedAuto(); } + } + private Rml _selectedRML; public Rml SelectedRML { @@ -150,6 +157,14 @@ namespace Tango.MachineStudio.RML.ViewModels set { _colorConversionViewVM = value; RaisePropertyChangedAuto(); } } + private RmlsSpool _selectedSpool; + public RmlsSpool SelectedSpool + { + get { return _selectedSpool; } + set { _selectedSpool = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + /// /// Gets or sets the manage RML command. /// @@ -192,6 +207,16 @@ namespace Tango.MachineStudio.RML.ViewModels public RelayCommand ImportRMLFileCommand { get; set; } + /// + /// Gets or sets the add spool command. + /// + public RelayCommand AddSpoolCommand { get; set; } + + /// + /// Gets or sets the remove spool command. + /// + public RelayCommand RemoveSpoolCommand { get; set; } + public MainViewVM(INotificationProvider notificationProvider, IAuthenticationProvider authentication, IActionLogManager actionLogManager) { _notification = notificationProvider; @@ -215,6 +240,9 @@ namespace Tango.MachineStudio.RML.ViewModels ExportRMLFileCommand = new RelayCommand(ExportRmlFile, () => SelectedRML != null && IsFree); ImportRMLFileCommand = new RelayCommand(ImportRmlFile, () => IsFree); + + AddSpoolCommand = new RelayCommand(AddNewSpool); + RemoveSpoolCommand = new RelayCommand(RemoveSpool, () => SelectedSpool != null); } public override void OnApplicationReady() @@ -281,6 +309,7 @@ namespace Tango.MachineStudio.RML.ViewModels .WithActiveParametersGroup() .WithLiquidFactors() .WithCCT() + .WithSpools() .BuildAsync(); if (ActiveRML.Cct != null) @@ -382,6 +411,7 @@ namespace Tango.MachineStudio.RML.ViewModels LinearMassDensityUnits = _active_context.LinearMassDensityUnits.ToObservableCollection(); FiberShapes = _active_context.FiberShapes.ToObservableCollection(); FiberSynths = _active_context.FiberSynths.ToObservableCollection(); + SpoolTypes = _active_context.SpoolTypes.ToObservableCollection(); } private async void AddNewRml() @@ -495,7 +525,7 @@ namespace Tango.MachineStudio.RML.ViewModels using (var context = ObservablesContext.CreateDefault()) { - var rml = await new RmlBuilder(context).Set(SelectedRML.Guid).WithActiveParametersGroup().WithLiquidFactors().BuildAsync(); + var rml = await new RmlBuilder(context).Set(SelectedRML.Guid).WithActiveParametersGroup().WithLiquidFactors().WithSpools().BuildAsync(); Rml cloned = new Rml(); rml.MapPropertiesTo(cloned, MappingFlags.NoReferenceTypes); @@ -532,6 +562,15 @@ namespace Tango.MachineStudio.RML.ViewModels cloned.LiquidTypesRmls.Add(l); } + foreach (var spool in rml.RmlsSpools) + { + RmlsSpool s = new RmlsSpool(); + spool.MapPropertiesTo(s, MappingFlags.ValueTypesOnly); + s.RmlGuid = cloned.Guid; + s.SpoolTypeGuid = spool.SpoolTypeGuid; + cloned.RmlsSpools.Add(s); + } + context.Rmls.Add(cloned); await context.SaveChangesAsync(); @@ -709,17 +748,19 @@ namespace Tango.MachineStudio.RML.ViewModels _actionLogManager.InsertLog(BL.Enumerations.ActionLogType.RmlSaved, _authentication.CurrentUser, _rmlBeforeSave.Name, _rmlBeforeSave, rmlAfter, "RML saved using Machine Studio."); _rmlBeforeSave = rmlAfter; + + LoadActiveRML(ActiveRML.Guid); } } catch (Exception ex) { LogManager.Log(ex, $"Error saving RML {ActiveRML.Name}"); - _notification.ShowError($"An error occurred while trying to save the current RML.\n{ex.Message}"); + _notification.ShowError($"An error occurred while trying to save the current RML.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; } - - LoadActiveRML(ActiveRML.Guid); - - IsFree = true; } private void BackToRmls() @@ -905,5 +946,26 @@ namespace Tango.MachineStudio.RML.ViewModels } #endregion + + #region Spools + + private void AddNewSpool() + { + _active_context.RmlsSpools.Add(new RmlsSpool() + { + Rml = ActiveRML, + }); + } + + private void RemoveSpool() + { + if (SelectedSpool != null) + { + _active_context.RmlsSpools.Remove(SelectedSpool); + ActiveRML.RmlsSpools.Remove(SelectedSpool); + } + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml index cae614aeb..03bf65522 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml @@ -32,7 +32,7 @@ - ACTIVE PROCESS GROUP + ACTIVE PROCESS GROUP 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 2c8d538d0..6ee41ac38 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 @@ -159,18 +159,18 @@ - + - COLOR CONVERSION + COLOR CONVERSION - + @@ -211,6 +211,9 @@ + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml new file mode 100644 index 000000000..6eae05c76 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + SPOOLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml.cs new file mode 100644 index 000000000..6e363681c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/SpoolsView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.RML.Views +{ + /// + /// Interaction logic for SpoolsView.xaml + /// + public partial class SpoolsView : UserControl + { + public SpoolsView() + { + InitializeComponent(); + } + } +} 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 18ca6bd1f..efaf98966 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 @@ -468,7 +468,7 @@ namespace Tango.PPC.Jobs.ViewModels Job.ValidateOnPropertyChanged = true; LogManager.Log("Loading RMLS..."); - Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithActiveParametersGroup().WithCAT(Job.MachineGuid).WithCCT().WithLiquidFactors().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).ToList(); + Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithActiveParametersGroup().WithCAT(Job.MachineGuid).WithCCT().WithLiquidFactors().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).ToList(); LogManager.Log("Loading Color Spaces..."); ColorSpaces = await _db.ColorSpaces.ToListAsync(); LogManager.Log("Loading Spool Types..."); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 0475f43ac..acdf20fa8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -276,7 +276,7 @@ namespace Tango.PPC.Common.Connection public async Task SaveMachine() { await _context.SaveChangesAsync(); - Machine = await new MachineBuilder(_context).SetFirst().WithSettings().BuildAsync(); + Machine = await new MachineBuilder(_context).SetFirst().BuildAsync(); TangoMessenger.Default.Send(new MachineSettingsSavedMessage() { Machine = Machine }); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 003938303..62799c09c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -268,7 +268,7 @@ namespace Tango.PPC.UI.PPCApplication ObservablesStaticCollections.Instance.Initialize(); LogManager.Log("Loading machine from database..."); _machineContext = ObservablesContext.CreateDefault(); - _machine = new MachineBuilder(_machineContext).SetFirst().WithVersion().WithSettings().WithOrganization().WithConfiguration().WithSpools().WithCats().Build(); + _machine = new MachineBuilder(_machineContext).SetFirst().WithVersion().WithOrganization().WithConfiguration().WithSpools().WithCats().Build(); } diff --git a/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs b/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs index 0b29dcc8c..1504bab2d 100644 --- a/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs +++ b/Software/Visual_Studio/Tango.BL/ActionLogs/DefaultActionLogComparer.cs @@ -57,11 +57,11 @@ namespace Tango.BL.ActionLogs scannedObjects.Add(after); } - foreach (var prop in GetProperties(before, after).OrderByDescending(x => x.PropertyType.IsPrimitive || x.PropertyType.IsValueType || x.PropertyType == typeof(String))) + foreach (var prop in GetProperties(before, after).OrderByDescending(x => x.PropertyType.IsValueTypeOrString())) { if (prop.PropertyType == typeof(byte[]) || GetShouldIgnore(prop, before, after)) continue; - if (prop.PropertyType.IsPrimitive || prop.PropertyType.IsValueType || prop.PropertyType == typeof(String)) + if (prop.PropertyType.IsValueTypeOrString()) { object beforeValue = null; object afterValue = null; diff --git a/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs index e64ad3fd5..c74a5af3d 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs @@ -64,6 +64,7 @@ namespace Tango.BL.Builders WithActiveParametersGroup(). WithCCT(). WithCAT(Entity.MachineGuid). + WithSpools(). WithLiquidFactors().Build(); }); } diff --git a/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs index e3bf4f98c..fd9d14baa 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/MachineBuilder.cs @@ -15,17 +15,9 @@ namespace Tango.BL.Builders } - public virtual MachineBuilder WithSettings() - { - return AddQueryStep(1, (query) => - { - return query.Include(x => x.DefaultColorSpace).Include(x => x.DefaultRml).Include(x => x.DefaultSpoolType); - }); - } - public virtual MachineBuilder WithVersion() { - return AddQueryStep(2, (query) => + return AddQueryStep(1, (query) => { return query.Include(x => x.MachineVersion); }); diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs index ec777e599..d71f50f7a 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs @@ -35,6 +35,14 @@ namespace Tango.BL.Builders }); } + public virtual RmlBuilder WithSpools() + { + return AddQueryStep(2, (query) => + { + return query.Include(x => x.RmlsSpools); + }); + } + public virtual RmlBuilder WithAllParametersGroup() { return AddStep(1, () => diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs index 8a5b4b00c..630f43495 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlsCollectionBuilder.cs @@ -55,6 +55,14 @@ namespace Tango.BL.Builders }); } + public virtual RmlsCollectionBuilder WithSpools() + { + return AddQueryStep(4, (query) => + { + return query.Include(x => x.RmlsSpools); + }); + } + public virtual RmlsCollectionBuilder WithAllParametersGroup() { return AddStep(1, () => diff --git a/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs index 060aa8889..2d431b9df 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs @@ -245,22 +245,6 @@ namespace Tango.BL.DTO get; set; } - /// - /// st sp zone1 temp - /// - public Double StSpZone1Temp - { - get; set; - } - - /// - /// st sp zone2 temp - /// - public Double StSpZone2Temp - { - get; set; - } - /// /// r blower flow /// diff --git a/Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTO.cs b/Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTO.cs new file mode 100644 index 000000000..c2839f8a0 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTO.cs @@ -0,0 +1,14 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.DTO +{ + public class RmlsSpoolDTO : RmlsSpoolDTOBase + { + + } +} diff --git a/Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTOBase.cs new file mode 100644 index 000000000..1598a321f --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/DTO/RmlsSpoolDTOBase.cs @@ -0,0 +1,73 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; + +namespace Tango.BL.DTO +{ + public abstract class RmlsSpoolDTOBase : ObservableEntityDTO + { + + /// + /// spool type guid + /// + public String SpoolTypeGuid + { + get; set; + } + + /// + /// rml guid + /// + public String RmlGuid + { + get; set; + } + + /// + /// rotations per passage + /// + public Nullable RotationsPerPassage + { + get; set; + } + + /// + /// length + /// + public Nullable Length + { + get; set; + } + + /// + /// backing rate + /// + public Nullable BackingRate + { + get; set; + } + + /// + /// bottom backing rate + /// + public Nullable BottomBackingRate + { + get; set; + } + + } +} diff --git a/Software/Visual_Studio/Tango.BL/DTO/SpoolDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/SpoolDTOBase.cs index 346fc4e6d..c25b254da 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/SpoolDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/SpoolDTOBase.cs @@ -40,7 +40,7 @@ namespace Tango.BL.DTO /// /// start offset pulses /// - public Int32 StartOffsetPulses + public Nullable StartOffsetPulses { get; set; } @@ -48,7 +48,7 @@ namespace Tango.BL.DTO /// /// backing rate /// - public Int32 BackingRate + public Nullable BackingRate { get; set; } @@ -56,7 +56,7 @@ namespace Tango.BL.DTO /// /// segment offset pulses /// - public Int32 SegmentOffsetPulses + public Nullable SegmentOffsetPulses { get; set; } @@ -64,7 +64,15 @@ namespace Tango.BL.DTO /// /// bottom backing rate /// - public Int32 BottomBackingRate + public Nullable BottomBackingRate + { + get; set; + } + + /// + /// limit switch start point offset + /// + public Nullable LimitSwitchStartPointOffset { get; set; } diff --git a/Software/Visual_Studio/Tango.BL/DTO/SpoolTypeDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/SpoolTypeDTOBase.cs index 6edd26e22..5b02cb536 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/SpoolTypeDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/SpoolTypeDTOBase.cs @@ -69,5 +69,45 @@ namespace Tango.BL.DTO get; set; } + /// + /// start offset pulses + /// + public Int32 StartOffsetPulses + { + get; set; + } + + /// + /// backing rate + /// + public Int32 BackingRate + { + get; set; + } + + /// + /// segment offset pulses + /// + public Int32 SegmentOffsetPulses + { + get; set; + } + + /// + /// bottom backing rate + /// + public Int32 BottomBackingRate + { + get; set; + } + + /// + /// limit switch start point offset + /// + public Int32 LimitSwitchStartPointOffset + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs index b35ca0431..b21332829 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs @@ -39,8 +39,6 @@ namespace Tango.BL.Entities public event EventHandler> JobsChanged; - public event EventHandler> MachinesChanged; - protected Int32 _code; /// @@ -199,31 +197,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection _machines; - - /// - /// Gets or sets the colorspacebase machines. - /// - - public virtual SynchronizedObservableCollection Machines - { - get - { - return _machines; - } - - set - { - if (_machines != value) - { - _machines = value; - - OnMachinesChanged(value); - - } - } - } - /// /// Called when the Code has changed. /// @@ -278,15 +251,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Jobs)); } - /// - /// Called when the Machines has changed. - /// - protected virtual void OnMachinesChanged(SynchronizedObservableCollection machines) - { - MachinesChanged?.Invoke(this, machines); - RaisePropertyChanged(nameof(Machines)); - } - /// /// Initializes a new instance of the class. /// @@ -297,8 +261,6 @@ namespace Tango.BL.Entities Jobs = new SynchronizedObservableCollection(); - Machines = new SynchronizedObservableCollection(); - } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs index 56e6ebe24..a80e78fec 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs @@ -75,8 +75,6 @@ namespace Tango.BL.Entities public event EventHandler> CatsChanged; - public event EventHandler DefaultColorSpaceChanged; - public event EventHandler ConfigurationChanged; public event EventHandler> JobsChanged; @@ -87,10 +85,6 @@ namespace Tango.BL.Entities public event EventHandler OrganizationChanged; - public event EventHandler DefaultRmlChanged; - - public event EventHandler DefaultSpoolTypeChanged; - public event EventHandler> SpoolsChanged; protected String _serialnumber; @@ -284,7 +278,6 @@ namespace Tango.BL.Entities /// [Column("DEFAULT_RML_GUID")] - [ForeignKey("DefaultRml")] public String DefaultRmlGuid { @@ -389,7 +382,6 @@ namespace Tango.BL.Entities /// [Column("DEFAULT_COLOR_SPACE_GUID")] - [ForeignKey("DefaultColorSpace")] public String DefaultColorSpaceGuid { @@ -442,7 +434,6 @@ namespace Tango.BL.Entities /// [Column("DEFAULT_SPOOL_TYPE_GUID")] - [ForeignKey("DefaultSpoolType")] public String DefaultSpoolTypeGuid { @@ -945,38 +936,6 @@ namespace Tango.BL.Entities } } - protected ColorSpace _defaultcolorspace; - - /// - /// Gets or sets the machinebase color spaces. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual ColorSpace DefaultColorSpace - { - get - { - return _defaultcolorspace; - } - - set - { - if (_defaultcolorspace != value) - { - _defaultcolorspace = value; - - if (DefaultColorSpace != null) - { - DefaultColorSpaceGuid = DefaultColorSpace.Guid; - } - - OnDefaultColorSpaceChanged(value); - - } - } - } - protected Configuration _configuration; /// @@ -1123,70 +1082,6 @@ namespace Tango.BL.Entities } } - protected Rml _defaultrml; - - /// - /// Gets or sets the machinebase rml. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual Rml DefaultRml - { - get - { - return _defaultrml; - } - - set - { - if (_defaultrml != value) - { - _defaultrml = value; - - if (DefaultRml != null) - { - DefaultRmlGuid = DefaultRml.Guid; - } - - OnDefaultRmlChanged(value); - - } - } - } - - protected SpoolType _defaultspooltype; - - /// - /// Gets or sets the machinebase spool types. - /// - - [XmlIgnore] - [JsonIgnore] - public virtual SpoolType DefaultSpoolType - { - get - { - return _defaultspooltype; - } - - set - { - if (_defaultspooltype != value) - { - _defaultspooltype = value; - - if (DefaultSpoolType != null) - { - DefaultSpoolTypeGuid = DefaultSpoolType.Guid; - } - - OnDefaultSpoolTypeChanged(value); - - } - } - } - protected SynchronizedObservableCollection _spools; /// @@ -1428,15 +1323,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Cats)); } - /// - /// Called when the DefaultColorSpace has changed. - /// - protected virtual void OnDefaultColorSpaceChanged(ColorSpace defaultcolorspace) - { - DefaultColorSpaceChanged?.Invoke(this, defaultcolorspace); - RaisePropertyChanged(nameof(DefaultColorSpace)); - } - /// /// Called when the Configuration has changed. /// @@ -1482,24 +1368,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Organization)); } - /// - /// Called when the DefaultRml has changed. - /// - protected virtual void OnDefaultRmlChanged(Rml defaultrml) - { - DefaultRmlChanged?.Invoke(this, defaultrml); - RaisePropertyChanged(nameof(DefaultRml)); - } - - /// - /// Called when the DefaultSpoolType has changed. - /// - protected virtual void OnDefaultSpoolTypeChanged(SpoolType defaultspooltype) - { - DefaultSpoolTypeChanged?.Invoke(this, defaultspooltype); - RaisePropertyChanged(nameof(DefaultSpoolType)); - } - /// /// Called when the Spools has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs index 3f386beb2..7b90623d8 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs @@ -40,11 +40,13 @@ namespace Tango.BL.Entities EntitySerializationFlags.IgnoreGuids | EntitySerializationFlags.IgnoreReferenceTypes); } - public Machine CreatePrototypeMachine(ObservablesContext context) + public async Task CreatePrototypeMachine(ObservablesContext context) { Machine m = new Machine(); - Machine machine = Machine.FromJson(PrototypeMachineData, new EntitySerializationStrategy() + String protoTypeData = (await context.MachineVersions.SingleOrDefaultAsync(x => x.Guid == Guid)).PrototypeMachineData; + + Machine machine = Machine.FromJson(protoTypeData, new EntitySerializationStrategy() .Include(() => m.Configuration) .Ignore(() => m.Name) .Ignore(() => m.MachinesEvents) diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs index f8d39862d..0a78dbc93 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs @@ -62,8 +62,8 @@ namespace Tango.BL.Entities heaters.Add(HeadZone10Temp); heaters.Add(HeadZone11Temp); heaters.Add(HeadZone12Temp); - heaters.Add(StSpZone1Temp); - heaters.Add(StSpZone2Temp); + heaters.Add(LBlowerTemp); + heaters.Add(RBlowerTemp); return heaters.Average(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs index 1d70aee98..2d9f1e4fb 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs @@ -81,10 +81,6 @@ namespace Tango.BL.Entities public event EventHandler HeadZone12TempChanged; - public event EventHandler StSpZone1TempChanged; - - public event EventHandler StSpZone2TempChanged; - public event EventHandler RBlowerFlowChanged; public event EventHandler RBlowerTempChanged; @@ -954,68 +950,6 @@ namespace Tango.BL.Entities } } - protected Double _stspzone1temp; - - /// - /// Gets or sets the processparameterstablebase st sp zone1 temp. - /// - - [Column("ST_SP_ZONE1_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(21)] - - public Double StSpZone1Temp - { - get - { - return _stspzone1temp; - } - - set - { - if (_stspzone1temp != value) - { - _stspzone1temp = value; - - OnStSpZone1TempChanged(value); - - } - } - } - - protected Double _stspzone2temp; - - /// - /// Gets or sets the processparameterstablebase st sp zone2 temp. - /// - - [Column("ST_SP_ZONE2_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(22)] - - public Double StSpZone2Temp - { - get - { - return _stspzone2temp; - } - - set - { - if (_stspzone2temp != value) - { - _stspzone2temp = value; - - OnStSpZone2TempChanged(value); - - } - } - } - protected Double _rblowerflow; /// @@ -1415,24 +1349,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(HeadZone12Temp)); } - /// - /// Called when the StSpZone1Temp has changed. - /// - protected virtual void OnStSpZone1TempChanged(Double stspzone1temp) - { - StSpZone1TempChanged?.Invoke(this, stspzone1temp); - RaisePropertyChanged(nameof(StSpZone1Temp)); - } - - /// - /// Called when the StSpZone2Temp has changed. - /// - protected virtual void OnStSpZone2TempChanged(Double stspzone2temp) - { - StSpZone2TempChanged?.Invoke(this, stspzone2temp); - RaisePropertyChanged(nameof(StSpZone2Temp)); - } - /// /// Called when the RBlowerFlow has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index ddaacfbd0..679226fd2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -103,12 +103,13 @@ namespace Tango.BL.Entities { return Task.Factory.StartNew(() => { - var rml = new RmlBuilder(context).Set(Guid).WithActiveParametersGroup().WithCCT().WithLiquidFactors().Build(); + var rml = new RmlBuilder(context).Set(Guid).WithActiveParametersGroup().WithCCT().WithLiquidFactors().WithSpools().Build(); String result = rml.ToJson(new EntitySerializationStrategy() .Include(() => rml.Cct) .Include(() => rml.LiquidTypesRmls) .Include(() => rml.ProcessParametersTablesGroups) + .Include(() => rml.RmlsSpools) .Include(typeof(ProcessParametersTablesGroup).GetProperty(nameof(ProcessParametersTablesGroup.ProcessParametersTables))), EntitySerializationFlags.IgnoreCollections | EntitySerializationFlags.IgnoreReferenceTypes | EntitySerializationFlags.Indented); diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs index 41ae660ee..a592fc694 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs @@ -91,8 +91,6 @@ namespace Tango.BL.Entities public event EventHandler> LiquidTypesRmlsChanged; - public event EventHandler> MachinesChanged; - public event EventHandler MediaConditionChanged; public event EventHandler MediaMaterialChanged; @@ -101,6 +99,8 @@ namespace Tango.BL.Entities public event EventHandler> ProcessParametersTablesGroupsChanged; + public event EventHandler> RmlsSpoolsChanged; + public event EventHandler> SitesRmlsChanged; protected String _name; @@ -1161,31 +1161,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection _machines; - - /// - /// Gets or sets the rmlbase machines. - /// - - public virtual SynchronizedObservableCollection Machines - { - get - { - return _machines; - } - - set - { - if (_machines != value) - { - _machines = value; - - OnMachinesChanged(value); - - } - } - } - protected MediaCondition _mediacondition; /// @@ -1307,6 +1282,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection _rmlsspools; + + /// + /// Gets or sets the rmlbase rmls spools. + /// + + public virtual SynchronizedObservableCollection RmlsSpools + { + get + { + return _rmlsspools; + } + + set + { + if (_rmlsspools != value) + { + _rmlsspools = value; + + OnRmlsSpoolsChanged(value); + + } + } + } + protected SynchronizedObservableCollection _sitesrmls; /// @@ -1620,15 +1620,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(LiquidTypesRmls)); } - /// - /// Called when the Machines has changed. - /// - protected virtual void OnMachinesChanged(SynchronizedObservableCollection machines) - { - MachinesChanged?.Invoke(this, machines); - RaisePropertyChanged(nameof(Machines)); - } - /// /// Called when the MediaCondition has changed. /// @@ -1665,6 +1656,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(ProcessParametersTablesGroups)); } + /// + /// Called when the RmlsSpools has changed. + /// + protected virtual void OnRmlsSpoolsChanged(SynchronizedObservableCollection rmlsspools) + { + RmlsSpoolsChanged?.Invoke(this, rmlsspools); + RaisePropertyChanged(nameof(RmlsSpools)); + } + /// /// Called when the SitesRmls has changed. /// @@ -1688,10 +1688,10 @@ namespace Tango.BL.Entities LiquidTypesRmls = new SynchronizedObservableCollection(); - Machines = new SynchronizedObservableCollection(); - ProcessParametersTablesGroups = new SynchronizedObservableCollection(); + RmlsSpools = new SynchronizedObservableCollection(); + SitesRmls = new SynchronizedObservableCollection(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs new file mode 100644 index 000000000..633180541 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Entities +{ + public class RmlsSpool : RmlsSpoolBase + { + + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs new file mode 100644 index 000000000..fee4ef6b4 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs @@ -0,0 +1,327 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; +using System.Linq; +using Tango.DAL.Remote.DB; +using Tango.Core; +using System.ComponentModel; +using Tango.Core.CustomAttributes; + +namespace Tango.BL.Entities +{ + [Table("RMLS_SPOOLS")] + public abstract class RmlsSpoolBase : ObservableEntity + { + + public event EventHandler> RotationsPerPassageChanged; + + public event EventHandler> LengthChanged; + + public event EventHandler> BackingRateChanged; + + public event EventHandler> BottomBackingRateChanged; + + public event EventHandler RmlChanged; + + public event EventHandler SpoolTypeChanged; + + protected String _spooltypeguid; + + /// + /// Gets or sets the rmlsspoolbase spool type guid. + /// + + [Column("SPOOL_TYPE_GUID")] + [ForeignKey("SpoolType")] + + public String SpoolTypeGuid + { + get + { + return _spooltypeguid; + } + + set + { + if (_spooltypeguid != value) + { + _spooltypeguid = value; + + } + } + } + + protected String _rmlguid; + + /// + /// Gets or sets the rmlsspoolbase rml guid. + /// + + [Column("RML_GUID")] + [ForeignKey("Rml")] + + public String RmlGuid + { + get + { + return _rmlguid; + } + + set + { + if (_rmlguid != value) + { + _rmlguid = value; + + } + } + } + + protected Nullable _rotationsperpassage; + + /// + /// Gets or sets the rmlsspoolbase rotations per passage. + /// + + [Column("ROTATIONS_PER_PASSAGE")] + + public Nullable RotationsPerPassage + { + get + { + return _rotationsperpassage; + } + + set + { + if (_rotationsperpassage != value) + { + _rotationsperpassage = value; + + OnRotationsPerPassageChanged(value); + + } + } + } + + protected Nullable _length; + + /// + /// Gets or sets the rmlsspoolbase length. + /// + + [Column("LENGTH")] + + public Nullable Length + { + get + { + return _length; + } + + set + { + if (_length != value) + { + _length = value; + + OnLengthChanged(value); + + } + } + } + + protected Nullable _backingrate; + + /// + /// Gets or sets the rmlsspoolbase backing rate. + /// + + [Column("BACKING_RATE")] + + public Nullable BackingRate + { + get + { + return _backingrate; + } + + set + { + if (_backingrate != value) + { + _backingrate = value; + + OnBackingRateChanged(value); + + } + } + } + + protected Nullable _bottombackingrate; + + /// + /// Gets or sets the rmlsspoolbase bottom backing rate. + /// + + [Column("BOTTOM_BACKING_RATE")] + + public Nullable BottomBackingRate + { + get + { + return _bottombackingrate; + } + + set + { + if (_bottombackingrate != value) + { + _bottombackingrate = value; + + OnBottomBackingRateChanged(value); + + } + } + } + + protected Rml _rml; + + /// + /// Gets or sets the rmlsspoolbase rml. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual Rml Rml + { + get + { + return _rml; + } + + set + { + if (_rml != value) + { + _rml = value; + + if (Rml != null) + { + RmlGuid = Rml.Guid; + } + + OnRmlChanged(value); + + } + } + } + + protected SpoolType _spooltype; + + /// + /// Gets or sets the rmlsspoolbase spool types. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual SpoolType SpoolType + { + get + { + return _spooltype; + } + + set + { + if (_spooltype != value) + { + _spooltype = value; + + if (SpoolType != null) + { + SpoolTypeGuid = SpoolType.Guid; + } + + OnSpoolTypeChanged(value); + + } + } + } + + /// + /// Called when the RotationsPerPassage has changed. + /// + protected virtual void OnRotationsPerPassageChanged(Nullable rotationsperpassage) + { + RotationsPerPassageChanged?.Invoke(this, rotationsperpassage); + RaisePropertyChanged(nameof(RotationsPerPassage)); + } + + /// + /// Called when the Length has changed. + /// + protected virtual void OnLengthChanged(Nullable length) + { + LengthChanged?.Invoke(this, length); + RaisePropertyChanged(nameof(Length)); + } + + /// + /// Called when the BackingRate has changed. + /// + protected virtual void OnBackingRateChanged(Nullable backingrate) + { + BackingRateChanged?.Invoke(this, backingrate); + RaisePropertyChanged(nameof(BackingRate)); + } + + /// + /// Called when the BottomBackingRate has changed. + /// + protected virtual void OnBottomBackingRateChanged(Nullable bottombackingrate) + { + BottomBackingRateChanged?.Invoke(this, bottombackingrate); + RaisePropertyChanged(nameof(BottomBackingRate)); + } + + /// + /// Called when the Rml has changed. + /// + protected virtual void OnRmlChanged(Rml rml) + { + RmlChanged?.Invoke(this, rml); + RaisePropertyChanged(nameof(Rml)); + } + + /// + /// Called when the SpoolType has changed. + /// + protected virtual void OnSpoolTypeChanged(SpoolType spooltype) + { + SpoolTypeChanged?.Invoke(this, spooltype); + RaisePropertyChanged(nameof(SpoolType)); + } + + /// + /// Initializes a new instance of the class. + /// + public RmlsSpoolBase() : base() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs index 303f2ecbb..b1ac62815 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs @@ -27,13 +27,15 @@ namespace Tango.BL.Entities public abstract class SpoolBase : ObservableEntity { - public event EventHandler StartOffsetPulsesChanged; + public event EventHandler> StartOffsetPulsesChanged; - public event EventHandler BackingRateChanged; + public event EventHandler> BackingRateChanged; - public event EventHandler SegmentOffsetPulsesChanged; + public event EventHandler> SegmentOffsetPulsesChanged; - public event EventHandler BottomBackingRateChanged; + public event EventHandler> BottomBackingRateChanged; + + public event EventHandler> LimitSwitchStartPointOffsetChanged; public event EventHandler MachineChanged; @@ -91,7 +93,7 @@ namespace Tango.BL.Entities } } - protected Int32 _startoffsetpulses; + protected Nullable _startoffsetpulses; /// /// Gets or sets the spoolbase start offset pulses. @@ -99,7 +101,7 @@ namespace Tango.BL.Entities [Column("START_OFFSET_PULSES")] - public Int32 StartOffsetPulses + public Nullable StartOffsetPulses { get { @@ -118,7 +120,7 @@ namespace Tango.BL.Entities } } - protected Int32 _backingrate; + protected Nullable _backingrate; /// /// Gets or sets the spoolbase backing rate. @@ -126,7 +128,7 @@ namespace Tango.BL.Entities [Column("BACKING_RATE")] - public Int32 BackingRate + public Nullable BackingRate { get { @@ -145,7 +147,7 @@ namespace Tango.BL.Entities } } - protected Int32 _segmentoffsetpulses; + protected Nullable _segmentoffsetpulses; /// /// Gets or sets the spoolbase segment offset pulses. @@ -153,7 +155,7 @@ namespace Tango.BL.Entities [Column("SEGMENT_OFFSET_PULSES")] - public Int32 SegmentOffsetPulses + public Nullable SegmentOffsetPulses { get { @@ -172,7 +174,7 @@ namespace Tango.BL.Entities } } - protected Int32 _bottombackingrate; + protected Nullable _bottombackingrate; /// /// Gets or sets the spoolbase bottom backing rate. @@ -180,7 +182,7 @@ namespace Tango.BL.Entities [Column("BOTTOM_BACKING_RATE")] - public Int32 BottomBackingRate + public Nullable BottomBackingRate { get { @@ -199,6 +201,33 @@ namespace Tango.BL.Entities } } + protected Nullable _limitswitchstartpointoffset; + + /// + /// Gets or sets the spoolbase limit switch start point offset. + /// + + [Column("LIMIT_SWITCH_START_POINT_OFFSET")] + + public Nullable LimitSwitchStartPointOffset + { + get + { + return _limitswitchstartpointoffset; + } + + set + { + if (_limitswitchstartpointoffset != value) + { + _limitswitchstartpointoffset = value; + + OnLimitSwitchStartPointOffsetChanged(value); + + } + } + } + protected Machine _machine; /// @@ -266,7 +295,7 @@ namespace Tango.BL.Entities /// /// Called when the StartOffsetPulses has changed. /// - protected virtual void OnStartOffsetPulsesChanged(Int32 startoffsetpulses) + protected virtual void OnStartOffsetPulsesChanged(Nullable startoffsetpulses) { StartOffsetPulsesChanged?.Invoke(this, startoffsetpulses); RaisePropertyChanged(nameof(StartOffsetPulses)); @@ -275,7 +304,7 @@ namespace Tango.BL.Entities /// /// Called when the BackingRate has changed. /// - protected virtual void OnBackingRateChanged(Int32 backingrate) + protected virtual void OnBackingRateChanged(Nullable backingrate) { BackingRateChanged?.Invoke(this, backingrate); RaisePropertyChanged(nameof(BackingRate)); @@ -284,7 +313,7 @@ namespace Tango.BL.Entities /// /// Called when the SegmentOffsetPulses has changed. /// - protected virtual void OnSegmentOffsetPulsesChanged(Int32 segmentoffsetpulses) + protected virtual void OnSegmentOffsetPulsesChanged(Nullable segmentoffsetpulses) { SegmentOffsetPulsesChanged?.Invoke(this, segmentoffsetpulses); RaisePropertyChanged(nameof(SegmentOffsetPulses)); @@ -293,12 +322,21 @@ namespace Tango.BL.Entities /// /// Called when the BottomBackingRate has changed. /// - protected virtual void OnBottomBackingRateChanged(Int32 bottombackingrate) + protected virtual void OnBottomBackingRateChanged(Nullable bottombackingrate) { BottomBackingRateChanged?.Invoke(this, bottombackingrate); RaisePropertyChanged(nameof(BottomBackingRate)); } + /// + /// Called when the LimitSwitchStartPointOffset has changed. + /// + protected virtual void OnLimitSwitchStartPointOffsetChanged(Nullable limitswitchstartpointoffset) + { + LimitSwitchStartPointOffsetChanged?.Invoke(this, limitswitchstartpointoffset); + RaisePropertyChanged(nameof(LimitSwitchStartPointOffset)); + } + /// /// Called when the Machine has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs index 778369948..a3e59bbc7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs @@ -39,9 +39,19 @@ namespace Tango.BL.Entities public event EventHandler RotationsPerPassageChanged; + public event EventHandler StartOffsetPulsesChanged; + + public event EventHandler BackingRateChanged; + + public event EventHandler SegmentOffsetPulsesChanged; + + public event EventHandler BottomBackingRateChanged; + + public event EventHandler LimitSwitchStartPointOffsetChanged; + public event EventHandler> JobsChanged; - public event EventHandler> MachinesChanged; + public event EventHandler> RmlsSpoolsChanged; public event EventHandler> SpoolsChanged; @@ -207,6 +217,141 @@ namespace Tango.BL.Entities } } + protected Int32 _startoffsetpulses; + + /// + /// Gets or sets the spooltypebase start offset pulses. + /// + + [Column("START_OFFSET_PULSES")] + + public Int32 StartOffsetPulses + { + get + { + return _startoffsetpulses; + } + + set + { + if (_startoffsetpulses != value) + { + _startoffsetpulses = value; + + OnStartOffsetPulsesChanged(value); + + } + } + } + + protected Int32 _backingrate; + + /// + /// Gets or sets the spooltypebase backing rate. + /// + + [Column("BACKING_RATE")] + + public Int32 BackingRate + { + get + { + return _backingrate; + } + + set + { + if (_backingrate != value) + { + _backingrate = value; + + OnBackingRateChanged(value); + + } + } + } + + protected Int32 _segmentoffsetpulses; + + /// + /// Gets or sets the spooltypebase segment offset pulses. + /// + + [Column("SEGMENT_OFFSET_PULSES")] + + public Int32 SegmentOffsetPulses + { + get + { + return _segmentoffsetpulses; + } + + set + { + if (_segmentoffsetpulses != value) + { + _segmentoffsetpulses = value; + + OnSegmentOffsetPulsesChanged(value); + + } + } + } + + protected Int32 _bottombackingrate; + + /// + /// Gets or sets the spooltypebase bottom backing rate. + /// + + [Column("BOTTOM_BACKING_RATE")] + + public Int32 BottomBackingRate + { + get + { + return _bottombackingrate; + } + + set + { + if (_bottombackingrate != value) + { + _bottombackingrate = value; + + OnBottomBackingRateChanged(value); + + } + } + } + + protected Int32 _limitswitchstartpointoffset; + + /// + /// Gets or sets the spooltypebase limit switch start point offset. + /// + + [Column("LIMIT_SWITCH_START_POINT_OFFSET")] + + public Int32 LimitSwitchStartPointOffset + { + get + { + return _limitswitchstartpointoffset; + } + + set + { + if (_limitswitchstartpointoffset != value) + { + _limitswitchstartpointoffset = value; + + OnLimitSwitchStartPointOffsetChanged(value); + + } + } + } + protected SynchronizedObservableCollection _jobs; /// @@ -232,26 +377,26 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection _machines; + protected SynchronizedObservableCollection _rmlsspools; /// - /// Gets or sets the spooltypebase machines. + /// Gets or sets the spooltypebase rmls spools. /// - public virtual SynchronizedObservableCollection Machines + public virtual SynchronizedObservableCollection RmlsSpools { get { - return _machines; + return _rmlsspools; } set { - if (_machines != value) + if (_rmlsspools != value) { - _machines = value; + _rmlsspools = value; - OnMachinesChanged(value); + OnRmlsSpoolsChanged(value); } } @@ -336,6 +481,51 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(RotationsPerPassage)); } + /// + /// Called when the StartOffsetPulses has changed. + /// + protected virtual void OnStartOffsetPulsesChanged(Int32 startoffsetpulses) + { + StartOffsetPulsesChanged?.Invoke(this, startoffsetpulses); + RaisePropertyChanged(nameof(StartOffsetPulses)); + } + + /// + /// Called when the BackingRate has changed. + /// + protected virtual void OnBackingRateChanged(Int32 backingrate) + { + BackingRateChanged?.Invoke(this, backingrate); + RaisePropertyChanged(nameof(BackingRate)); + } + + /// + /// Called when the SegmentOffsetPulses has changed. + /// + protected virtual void OnSegmentOffsetPulsesChanged(Int32 segmentoffsetpulses) + { + SegmentOffsetPulsesChanged?.Invoke(this, segmentoffsetpulses); + RaisePropertyChanged(nameof(SegmentOffsetPulses)); + } + + /// + /// Called when the BottomBackingRate has changed. + /// + protected virtual void OnBottomBackingRateChanged(Int32 bottombackingrate) + { + BottomBackingRateChanged?.Invoke(this, bottombackingrate); + RaisePropertyChanged(nameof(BottomBackingRate)); + } + + /// + /// Called when the LimitSwitchStartPointOffset has changed. + /// + protected virtual void OnLimitSwitchStartPointOffsetChanged(Int32 limitswitchstartpointoffset) + { + LimitSwitchStartPointOffsetChanged?.Invoke(this, limitswitchstartpointoffset); + RaisePropertyChanged(nameof(LimitSwitchStartPointOffset)); + } + /// /// Called when the Jobs has changed. /// @@ -346,12 +536,12 @@ namespace Tango.BL.Entities } /// - /// Called when the Machines has changed. + /// Called when the RmlsSpools has changed. /// - protected virtual void OnMachinesChanged(SynchronizedObservableCollection machines) + protected virtual void OnRmlsSpoolsChanged(SynchronizedObservableCollection rmlsspools) { - MachinesChanged?.Invoke(this, machines); - RaisePropertyChanged(nameof(Machines)); + RmlsSpoolsChanged?.Invoke(this, rmlsspools); + RaisePropertyChanged(nameof(RmlsSpools)); } /// @@ -371,7 +561,7 @@ namespace Tango.BL.Entities Jobs = new SynchronizedObservableCollection(); - Machines = new SynchronizedObservableCollection(); + RmlsSpools = new SynchronizedObservableCollection(); Spools = new SynchronizedObservableCollection(); diff --git a/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs index 6be908bb4..5480d47f1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs @@ -27,17 +27,19 @@ namespace Tango.BL.Entities public abstract class SysdiagramBase : ObservableEntity { - public event EventHandler> VersionChanged; + public event EventHandler> VersionChanged; public event EventHandler DefinitionChanged; - protected SynchronizedObservableCollection _version; + protected Nullable _version; /// /// Gets or sets the sysdiagrambase version. /// - public virtual SynchronizedObservableCollection Version + [Column("version")] + + public Nullable Version { get { @@ -86,7 +88,7 @@ namespace Tango.BL.Entities /// /// Called when the Version has changed. /// - protected virtual void OnVersionChanged(SynchronizedObservableCollection version) + protected virtual void OnVersionChanged(Nullable version) { VersionChanged?.Invoke(this, version); RaisePropertyChanged(nameof(Version)); @@ -106,9 +108,6 @@ namespace Tango.BL.Entities /// public SysdiagramBase() : base() { - - Version = new SynchronizedObservableCollection(); - } } } diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs index e3bba77bd..a6dcdbbec 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs @@ -283,7 +283,7 @@ namespace Tango.BL foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) { - if (!prop.PropertyType.IsGenericType) + if (!prop.PropertyType.IsGenericTypeAndNotNullable()) { prop.SetValue(cloned, prop.GetValue(this)); } @@ -378,7 +378,7 @@ namespace Tango.BL if (flags.HasFlag(EntitySerializationFlags.IgnoreReferenceTypes)) { - var props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsPrimitive && !x.PropertyType.IsGenericType && x.PropertyType != typeof(byte[]) && x.PropertyType != typeof(String) && x.PropertyType != typeof(DateTime)).ToList(); + var props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsPrimitive && !x.PropertyType.IsGenericType && !x.PropertyType.IsNullable() && x.PropertyType != typeof(byte[]) && x.PropertyType != typeof(String) && x.PropertyType != typeof(DateTime)).ToList(); foreach (var prop in props) { @@ -388,7 +388,7 @@ namespace Tango.BL if (flags.HasFlag(EntitySerializationFlags.IgnoreCollections)) { - var props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType).ToList(); + var props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericTypeAndNotNullable()).ToList(); foreach (var prop in props) { diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs b/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs index 4c5ca6ae4..ce4cb3550 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs @@ -53,7 +53,7 @@ namespace Tango.BL var observableProp = typeof(T).GetProperty(prop.Name); if (observableProp != null) { - if (prop.PropertyType.IsPrimitive || prop.PropertyType.IsValueType || prop.PropertyType == typeof(String) || prop.PropertyType == typeof(byte[])) + if (prop.PropertyType.IsValueTypeOrString() || prop.PropertyType == typeof(byte[])) { prop.SetValue(dto, observableProp.GetValue(observable)); } @@ -114,7 +114,7 @@ namespace Tango.BL var observableProp = typeof(T).GetProperty(prop.Name); if (observableProp != null) { - if (prop.PropertyType.IsPrimitive || prop.PropertyType.IsValueType || prop.PropertyType == typeof(String) || prop.PropertyType == typeof(byte[])) + if (prop.PropertyType.IsValueTypeOrString() || prop.PropertyType == typeof(byte[])) { observableProp.SetValue(observable, prop.GetValue(this)); } @@ -189,7 +189,7 @@ namespace Tango.BL var observableProp = typeof(T).GetProperty(prop.Name); if (observableProp != null) { - if (prop.PropertyType.IsPrimitive || prop.PropertyType.IsValueType || prop.PropertyType == typeof(String) || prop.PropertyType == typeof(byte[])) + if (prop.PropertyType.IsValueTypeOrString() || prop.PropertyType == typeof(byte[])) { var observableValue = observableProp.GetValue(observable); var dtoValue = prop.GetValue(this); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs index 3511a7624..b2881c741 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs @@ -494,6 +494,14 @@ namespace Tango.BL get; set; } + /// + /// Gets or sets the RmlsSpools. + /// + public DbSet RmlsSpools + { + get; set; + } + /// /// Gets or sets the Roles. /// diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs index cccc2fcae..59b5253bc 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs @@ -2141,6 +2141,42 @@ namespace Tango.BL } + private ObservableCollection _rmlsspools; + /// + /// Gets or sets the RmlsSpools. + /// + public ObservableCollection RmlsSpools + { + get + { + return _rmlsspools; + } + + set + { + _rmlsspools = value; RaisePropertyChanged(nameof(RmlsSpools)); + } + + } + + private ICollectionView _rmlsspoolsViewSource; + /// + /// Gets or sets the RmlsSpools View Source. + /// + public ICollectionView RmlsSpoolsViewSource + { + get + { + return _rmlsspoolsViewSource; + } + + set + { + _rmlsspoolsViewSource = value; RaisePropertyChanged(nameof(RmlsSpoolsViewSource)); + } + + } + private ObservableCollection _roles; /// /// Gets or sets the Roles. @@ -2985,6 +3021,8 @@ namespace Tango.BL RmlsViewSource = CreateCollectionView(Rmls); + RmlsSpoolsViewSource = CreateCollectionView(RmlsSpools); + RolesViewSource = CreateCollectionView(Roles); RolesPermissionsViewSource = CreateCollectionView(RolesPermissions); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs index 4e108deb2..178a62595 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs @@ -2141,6 +2141,42 @@ namespace Tango.BL } + private ObservableCollection _rmlsspools; + /// + /// Gets or sets the RmlsSpools. + /// + public ObservableCollection RmlsSpools + { + get + { + return _rmlsspools; + } + + set + { + _rmlsspools = value; RaisePropertyChanged(nameof(RmlsSpools)); + } + + } + + private ICollectionView _rmlsspoolsViewSource; + /// + /// Gets or sets the RmlsSpools View Source. + /// + public ICollectionView RmlsSpoolsViewSource + { + get + { + return _rmlsspoolsViewSource; + } + + set + { + _rmlsspoolsViewSource = value; RaisePropertyChanged(nameof(RmlsSpoolsViewSource)); + } + + } + private ObservableCollection _roles; /// /// Gets or sets the Roles. @@ -2985,6 +3021,8 @@ namespace Tango.BL RmlsViewSource = CreateCollectionView(Rmls); + RmlsSpoolsViewSource = CreateCollectionView(RmlsSpools); + RolesViewSource = CreateCollectionView(Roles); RolesPermissionsViewSource = CreateCollectionView(RolesPermissions); diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 2a5090c2e..f222f8ff6 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -248,6 +248,8 @@ + + @@ -358,6 +360,8 @@ + + @@ -610,7 +614,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index e8ef9addd..cee991507 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -35,9 +35,9 @@ namespace Tango.Core.ExtensionMethods NoReferenceTypes = 8, /// - /// Map only primitive values. + /// Map only value types. /// - PrimitivesOnly, + ValueTypesOnly, } /// @@ -59,7 +59,7 @@ namespace Tango.Core.ExtensionMethods foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) { - if (!prop.PropertyType.IsGenericType) + if (!prop.PropertyType.IsGenericTypeAndNotNullable()) { prop.SetValue(cloned, prop.GetValue(obj)); } @@ -78,7 +78,7 @@ namespace Tango.Core.ExtensionMethods { foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) { - if (!prop.PropertyType.IsGenericType) + if (!prop.PropertyType.IsGenericTypeAndNotNullable()) { prop.SetValue(destination, prop.GetValue(source)); } @@ -104,7 +104,7 @@ namespace Tango.Core.ExtensionMethods if (!condition(prop)) continue; } - if (!propType.IsPrimitive && flags.HasFlag(MappingFlags.PrimitivesOnly)) + if (!propType.IsValueType && flags.HasFlag(MappingFlags.ValueTypesOnly)) { continue; } @@ -141,7 +141,7 @@ namespace Tango.Core.ExtensionMethods /// The destination. public static void MapPrimitivesTo(this object source, object destination) { - source.MapPropertiesTo(destination, MappingFlags.PrimitivesOnly); + source.MapPropertiesTo(destination, MappingFlags.ValueTypesOnly); } /// diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/TypeExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/TypeExtensions.cs index c6fd3d811..66978ec19 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/TypeExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/TypeExtensions.cs @@ -122,4 +122,19 @@ public static class TypeExtensions { return type.GetProperties().Where(x => x.GetCustomAttribute() != null); } + + public static bool IsGenericTypeAndNotNullable(this Type type) + { + return type.IsGenericType && Nullable.GetUnderlyingType(type) == null; + } + + public static bool IsNullable(this Type type) + { + return Nullable.GetUnderlyingType(type) != null; + } + + public static bool IsValueTypeOrString(this Type type) + { + return type.IsValueType || type == typeof(String); + } } diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj index 891c5e58f..7c794c276 100644 --- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj +++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj @@ -205,7 +205,7 @@ - + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs index d2a9c4479..e1a81b759 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs @@ -19,7 +19,6 @@ namespace Tango.DAL.Remote.DB { this.BRUSH_STOPS = new HashSet(); this.JOBS = new HashSet(); - this.MACHINES = new HashSet(); } public int ID { get; set; } @@ -34,7 +33,5 @@ namespace Tango.DAL.Remote.DB public virtual ICollection BRUSH_STOPS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection JOBS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs index 7f4aa62a9..d4bf7c867 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs @@ -60,7 +60,6 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection CATS { get; set; } - public virtual COLOR_SPACES COLOR_SPACES { get; set; } public virtual CONFIGURATION CONFIGURATION { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection JOBS { get; set; } @@ -68,8 +67,6 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection MACHINES_EVENTS { get; set; } public virtual ORGANIZATION ORGANIZATION { get; set; } - public virtual RML RML { get; set; } - public virtual SPOOL_TYPES SPOOL_TYPES { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection SPOOLS { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs index bfa6bbe58..2a04633bf 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs @@ -45,8 +45,6 @@ namespace Tango.DAL.Remote.DB public double HEAD_ZONE10_TEMP { get; set; } public double HEAD_ZONE11_TEMP { get; set; } public double HEAD_ZONE12_TEMP { get; set; } - public double ST_SP_ZONE1_TEMP { get; set; } - public double ST_SP_ZONE2_TEMP { get; set; } public double R_BLOWER_FLOW { get; set; } public double R_BLOWER_TEMP { get; set; } public double L_BLOWER_FLOW { 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 2c0ac2a33..2772e1958 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -21,8 +21,8 @@ namespace Tango.DAL.Remote.DB this.COLOR_CATALOGS_ITEMS_RECIPES = new HashSet(); this.JOBS = new HashSet(); this.LIQUID_TYPES_RMLS = new HashSet(); - this.MACHINES = new HashSet(); this.PROCESS_PARAMETERS_TABLES_GROUPS = new HashSet(); + this.RMLS_SPOOLS = new HashSet(); this.SITES_RMLS = new HashSet(); } @@ -73,14 +73,14 @@ namespace Tango.DAL.Remote.DB public virtual LINEAR_MASS_DENSITY_UNITS LINEAR_MASS_DENSITY_UNITS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection LIQUID_TYPES_RMLS { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES { get; set; } public virtual MEDIA_CONDITIONS MEDIA_CONDITIONS { get; set; } public virtual MEDIA_MATERIALS MEDIA_MATERIALS { get; set; } public virtual MEDIA_PURPOSES MEDIA_PURPOSES { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection PROCESS_PARAMETERS_TABLES_GROUPS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLS_SPOOLS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection SITES_RMLS { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_SPOOLS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_SPOOLS.cs new file mode 100644 index 000000000..a314530ec --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_SPOOLS.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class RMLS_SPOOLS + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string SPOOL_TYPE_GUID { get; set; } + public string RML_GUID { get; set; } + public Nullable ROTATIONS_PER_PASSAGE { get; set; } + public Nullable LENGTH { get; set; } + public Nullable BACKING_RATE { get; set; } + public Nullable BOTTOM_BACKING_RATE { get; set; } + + public virtual RML RML { get; set; } + public virtual SPOOL_TYPES SPOOL_TYPES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs index 2a158ad49..62ae00ce7 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -84,6 +84,7 @@ namespace Tango.DAL.Remote.DB public virtual DbSet PROCESS_PARAMETERS_TABLES { get; set; } public virtual DbSet PROCESS_PARAMETERS_TABLES_GROUPS { get; set; } public virtual DbSet RMLS { get; set; } + public virtual DbSet RMLS_SPOOLS { get; set; } public virtual DbSet ROLES { get; set; } public virtual DbSet ROLES_PERMISSIONS { get; set; } public virtual DbSet SEGMENTS { 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 bed5ba7eb..4bccfc804 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -878,8 +878,6 @@ - - @@ -936,6 +934,20 @@ + + + + + + + + + + + + + + @@ -1013,6 +1025,11 @@ + + + + + @@ -1023,10 +1040,11 @@ - - - - + + + + + @@ -1851,18 +1869,6 @@ - - - - - - - - - - - - @@ -1943,30 +1949,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2107,6 +2089,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2390,6 +2400,7 @@ + @@ -2611,10 +2622,6 @@ - - - - @@ -2639,14 +2646,6 @@ - - - - - - - - @@ -2691,6 +2690,14 @@ + + + + + + + + @@ -2824,6 +2831,7 @@ + @@ -2932,10 +2940,6 @@ - - - - @@ -3112,14 +3116,6 @@ - - - - - - - - @@ -3160,10 +3156,18 @@ + + + + + + + + @@ -3439,7 +3443,6 @@ - @@ -4062,14 +4065,11 @@ - - - @@ -4199,8 +4199,6 @@ - - @@ -4267,13 +4265,29 @@ - + + + + + + + + + + + + + + + + + @@ -4364,8 +4378,13 @@ + + + + + - + @@ -4377,10 +4396,11 @@ - - - - + + + + + @@ -4847,18 +4867,6 @@ - - - - - - - - - - - - @@ -5433,30 +5441,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -5585,6 +5569,20 @@ + + + + + + + + + + + + + + @@ -5599,6 +5597,20 @@ + + + + + + + + + + + + + + @@ -6608,8 +6620,6 @@ - - @@ -6697,6 +6707,21 @@ + + + + + + + + + + + + + + + @@ -6770,6 +6795,11 @@ + + + + + @@ -6785,6 +6815,7 @@ + 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 b7e5e116a..354839477 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,84 +5,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -105,7 +106,6 @@ - @@ -150,8 +150,6 @@ - - @@ -162,7 +160,9 @@ + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL.cs index 74996acd0..d983a5d69 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL.cs @@ -19,10 +19,11 @@ namespace Tango.DAL.Remote.DB public System.DateTime LAST_UPDATED { get; set; } public string SPOOL_TYPE_GUID { get; set; } public string MACHINE_GUID { get; set; } - public int START_OFFSET_PULSES { get; set; } - public int BACKING_RATE { get; set; } - public int SEGMENT_OFFSET_PULSES { get; set; } - public int BOTTOM_BACKING_RATE { get; set; } + public Nullable START_OFFSET_PULSES { get; set; } + public Nullable BACKING_RATE { get; set; } + public Nullable SEGMENT_OFFSET_PULSES { get; set; } + public Nullable BOTTOM_BACKING_RATE { get; set; } + public Nullable LIMIT_SWITCH_START_POINT_OFFSET { get; set; } public virtual MACHINE MACHINE { get; set; } public virtual SPOOL_TYPES SPOOL_TYPES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL_TYPES.cs index 1d8b75f90..af2355553 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/SPOOL_TYPES.cs @@ -18,7 +18,7 @@ namespace Tango.DAL.Remote.DB public SPOOL_TYPES() { this.JOBS = new HashSet(); - this.MACHINES = new HashSet(); + this.RMLS_SPOOLS = new HashSet(); this.SPOOLS = new HashSet(); } @@ -31,11 +31,16 @@ namespace Tango.DAL.Remote.DB public double WEIGHT { get; set; } public double DIAMETER { get; set; } public double ROTATIONS_PER_PASSAGE { get; set; } + public int START_OFFSET_PULSES { get; set; } + public int BACKING_RATE { get; set; } + public int SEGMENT_OFFSET_PULSES { get; set; } + public int BOTTOM_BACKING_RATE { get; set; } + public int LIMIT_SWITCH_START_POINT_OFFSET { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection JOBS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection MACHINES { get; set; } + public virtual ICollection RMLS_SPOOLS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection SPOOLS { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj index 0a0cad6e2..7ea9a77a7 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -255,6 +255,9 @@ RemoteADO.tt + + RemoteADO.tt + RemoteADO.tt @@ -368,7 +371,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 5711882a3..4084e4ee7 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2189,8 +2189,8 @@ namespace Tango.Integration.Operation tiLiquid.Volume = 100; } } - //Modify transparent brush stops. + //Modify transparent brush stops. if (EnableJobLiquidQuantityValidation) { ValidateJobLiquidQuantity(job, processParameters, job.Machine.Configuration); @@ -2236,23 +2236,28 @@ namespace Tango.Integration.Operation ticket.NumberOfUnits = (uint)Math.Max(job.NumberOfUnits, 1); } + //Spool parameters ticket.Spool = new JobSpool(); - job.SpoolType.MapPrimitivesTo(ticket.Spool); + ticket.Spool.JobSpoolType = (JobSpoolType)job.SpoolType.Code; - var spool = job.Machine.Spools.SingleOrDefault(x => x.SpoolType == job.SpoolType); - - if (spool == null) + //Override spool parameters from RML Spool calibration + var rmlSpool = job.Rml.RmlsSpools.FirstOrDefault(x => x.SpoolType.Guid == job.SpoolType.Guid); + if (rmlSpool != null) { - throw new InvalidOperationException("Job spool type is not registered with this machine."); + ticket.Spool.RotationsPerPassage = rmlSpool.RotationsPerPassage != null ? rmlSpool.RotationsPerPassage.Value : ticket.Spool.RotationsPerPassage; + ticket.Spool.Length = rmlSpool.Length != null ? rmlSpool.Length.Value : ticket.Spool.Length; + ticket.Spool.BackingRate = rmlSpool.BackingRate != null ? rmlSpool.BackingRate.Value : ticket.Spool.BackingRate; + ticket.Spool.BottomBackingRate = rmlSpool.BottomBackingRate != null ? rmlSpool.BottomBackingRate.Value : ticket.Spool.BottomBackingRate; } - else + + //Override spool parameters from Machine Spool calibration + var machineSpool = job.Machine.Spools.FirstOrDefault(x => x.SpoolType.Guid == job.SpoolType.Guid); + if (machineSpool != null) { - spool.MapPrimitivesTo(ticket.Spool); + ticket.Spool.LimitSwitchStartPointOffset = machineSpool.LimitSwitchStartPointOffset != null ? machineSpool.LimitSwitchStartPointOffset.Value : ticket.Spool.LimitSwitchStartPointOffset; } - ticket.Spool.JobSpoolType = (JobSpoolType)job.SpoolType.Code; - ProcessParameters process = new ProcessParameters(); processParameters.MapPrimitivesTo(process); ticket.ProcessParameters = process; diff --git a/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs b/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs index 7261ba19b..c716906e6 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs @@ -23,17 +23,18 @@ namespace Tango.PMR.Printing { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Cg5Kb2JTcG9vbC5wcm90bxISVGFuZ28uUE1SLlByaW50aW5nGhJKb2JTcG9v", - "bFR5cGUucHJvdG8i+QEKCEpvYlNwb29sEjYKDEpvYlNwb29sVHlwZRgBIAEo", + "bFR5cGUucHJvdG8ingIKCEpvYlNwb29sEjYKDEpvYlNwb29sVHlwZRgBIAEo", "DjIgLlRhbmdvLlBNUi5QcmludGluZy5Kb2JTcG9vbFR5cGUSDgoGTGVuZ3Ro", "GAIgASgBEg4KBldlaWdodBgDIAEoARIQCghEaWFtZXRlchgEIAEoARIbChNS", "b3RhdGlvbnNQZXJQYXNzYWdlGAUgASgBEhkKEVN0YXJ0T2Zmc2V0UHVsc2Vz", "GAYgASgFEhMKC0JhY2tpbmdSYXRlGAcgASgFEhsKE1NlZ21lbnRPZmZzZXRQ", - "dWxzZXMYCCABKAUSGQoRQm90dG9tQmFja2luZ1JhdGUYCSABKAVCHgocY29t", - "LnR3aW5lLnRhbmdvLnBtci5wcmludGluZ2IGcHJvdG8z")); + "dWxzZXMYCCABKAUSGQoRQm90dG9tQmFja2luZ1JhdGUYCSABKAUSIwobTGlt", + "aXRTd2l0Y2hTdGFydFBvaW50T2Zmc2V0GAogASgFQh4KHGNvbS50d2luZS50", + "YW5nby5wbXIucHJpbnRpbmdiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSpoolTypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobSpool), global::Tango.PMR.Printing.JobSpool.Parser, new[]{ "JobSpoolType", "Length", "Weight", "Diameter", "RotationsPerPassage", "StartOffsetPulses", "BackingRate", "SegmentOffsetPulses", "BottomBackingRate" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobSpool), global::Tango.PMR.Printing.JobSpool.Parser, new[]{ "JobSpoolType", "Length", "Weight", "Diameter", "RotationsPerPassage", "StartOffsetPulses", "BackingRate", "SegmentOffsetPulses", "BottomBackingRate", "LimitSwitchStartPointOffset" }, null, null, null) })); } #endregion @@ -73,6 +74,7 @@ namespace Tango.PMR.Printing { backingRate_ = other.backingRate_; segmentOffsetPulses_ = other.segmentOffsetPulses_; bottomBackingRate_ = other.bottomBackingRate_; + limitSwitchStartPointOffset_ = other.limitSwitchStartPointOffset_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -179,6 +181,17 @@ namespace Tango.PMR.Printing { } } + /// Field number for the "LimitSwitchStartPointOffset" field. + public const int LimitSwitchStartPointOffsetFieldNumber = 10; + private int limitSwitchStartPointOffset_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int LimitSwitchStartPointOffset { + get { return limitSwitchStartPointOffset_; } + set { + limitSwitchStartPointOffset_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as JobSpool); @@ -201,6 +214,7 @@ namespace Tango.PMR.Printing { if (BackingRate != other.BackingRate) return false; if (SegmentOffsetPulses != other.SegmentOffsetPulses) return false; if (BottomBackingRate != other.BottomBackingRate) return false; + if (LimitSwitchStartPointOffset != other.LimitSwitchStartPointOffset) return false; return true; } @@ -216,6 +230,7 @@ namespace Tango.PMR.Printing { if (BackingRate != 0) hash ^= BackingRate.GetHashCode(); if (SegmentOffsetPulses != 0) hash ^= SegmentOffsetPulses.GetHashCode(); if (BottomBackingRate != 0) hash ^= BottomBackingRate.GetHashCode(); + if (LimitSwitchStartPointOffset != 0) hash ^= LimitSwitchStartPointOffset.GetHashCode(); return hash; } @@ -262,6 +277,10 @@ namespace Tango.PMR.Printing { output.WriteRawTag(72); output.WriteInt32(BottomBackingRate); } + if (LimitSwitchStartPointOffset != 0) { + output.WriteRawTag(80); + output.WriteInt32(LimitSwitchStartPointOffset); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -294,6 +313,9 @@ namespace Tango.PMR.Printing { if (BottomBackingRate != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(BottomBackingRate); } + if (LimitSwitchStartPointOffset != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LimitSwitchStartPointOffset); + } return size; } @@ -329,6 +351,9 @@ namespace Tango.PMR.Printing { if (other.BottomBackingRate != 0) { BottomBackingRate = other.BottomBackingRate; } + if (other.LimitSwitchStartPointOffset != 0) { + LimitSwitchStartPointOffset = other.LimitSwitchStartPointOffset; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -375,6 +400,10 @@ namespace Tango.PMR.Printing { BottomBackingRate = input.ReadInt32(); break; } + case 80: { + LimitSwitchStartPointOffset = input.ReadInt32(); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs b/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs index 33521d40b..ef290e431 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs @@ -23,7 +23,7 @@ namespace Tango.PMR.Printing { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChdQcm9jZXNzUGFyYW1ldGVycy5wcm90bxISVGFuZ28uUE1SLlByaW50aW5n", - "IucFChFQcm9jZXNzUGFyYW1ldGVycxITCgtEeWVpbmdTcGVlZBgBIAEoARIU", + "IrkFChFQcm9jZXNzUGFyYW1ldGVycxITCgtEeWVpbmdTcGVlZBgBIAEoARIU", "CgxNaW5JbmtVcHRha2UYAiABKAESFAoMTWF4SW5rVXB0YWtlGAMgASgBEhUK", "DUZlZWRlclRlbnNpb24YBCABKAESFQoNUHVsbGVyVGVuc2lvbhgFIAEoARIV", "Cg1XaW5kZXJUZW5zaW9uGAYgASgBEhEKCU1peGVyVGVtcBgHIAEoARIVCg1I", @@ -36,15 +36,14 @@ namespace Tango.PMR.Printing { "EyABKAESEgoKVGFibGVJbmRleBgUIAEoBRIVCg1IZWFkWm9uZTdUZW1wGBUg", "ASgBEhUKDUhlYWRab25lOFRlbXAYFiABKAESFQoNSGVhZFpvbmU5VGVtcBgX", "IAEoARIWCg5IZWFkWm9uZTEwVGVtcBgYIAEoARIWCg5IZWFkWm9uZTExVGVt", - "cBgZIAEoARIWCg5IZWFkWm9uZTEyVGVtcBgaIAEoARIVCg1TdFNwWm9uZTFU", - "ZW1wGBsgASgBEhUKDVN0U3Bab25lMlRlbXAYHCABKAESEwoLUkJsb3dlckZs", - "b3cYHSABKAESEwoLUkJsb3dlclRlbXAYHiABKAESEwoLTEJsb3dlckZsb3cY", - "HyABKAESEwoLTEJsb3dlclRlbXAYICABKAFCHgocY29tLnR3aW5lLnRhbmdv", - "LnBtci5wcmludGluZ2IGcHJvdG8z")); + "cBgZIAEoARIWCg5IZWFkWm9uZTEyVGVtcBgaIAEoARITCgtSQmxvd2VyRmxv", + "dxgbIAEoARITCgtSQmxvd2VyVGVtcBgcIAEoARITCgtMQmxvd2VyRmxvdxgd", + "IAEoARITCgtMQmxvd2VyVGVtcBgeIAEoAUIeChxjb20udHdpbmUudGFuZ28u", + "cG1yLnByaW50aW5nYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.ProcessParameters), global::Tango.PMR.Printing.ProcessParameters.Parser, new[]{ "DyeingSpeed", "MinInkUptake", "MaxInkUptake", "FeederTension", "PullerTension", "WinderTension", "MixerTemp", "HeadZone1Temp", "HeadZone2Temp", "HeadZone3Temp", "HeadZone4Temp", "HeadZone5Temp", "HeadZone6Temp", "DryerAirFlow", "DryerZone1Temp", "DryerZone2Temp", "DryerZone3Temp", "DryerBufferLength", "HeadAirFlow", "TableIndex", "HeadZone7Temp", "HeadZone8Temp", "HeadZone9Temp", "HeadZone10Temp", "HeadZone11Temp", "HeadZone12Temp", "StSpZone1Temp", "StSpZone2Temp", "RBlowerFlow", "RBlowerTemp", "LBlowerFlow", "LBlowerTemp" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.ProcessParameters), global::Tango.PMR.Printing.ProcessParameters.Parser, new[]{ "DyeingSpeed", "MinInkUptake", "MaxInkUptake", "FeederTension", "PullerTension", "WinderTension", "MixerTemp", "HeadZone1Temp", "HeadZone2Temp", "HeadZone3Temp", "HeadZone4Temp", "HeadZone5Temp", "HeadZone6Temp", "DryerAirFlow", "DryerZone1Temp", "DryerZone2Temp", "DryerZone3Temp", "DryerBufferLength", "HeadAirFlow", "TableIndex", "HeadZone7Temp", "HeadZone8Temp", "HeadZone9Temp", "HeadZone10Temp", "HeadZone11Temp", "HeadZone12Temp", "RBlowerFlow", "RBlowerTemp", "LBlowerFlow", "LBlowerTemp" }, null, null, null) })); } #endregion @@ -101,8 +100,6 @@ namespace Tango.PMR.Printing { headZone10Temp_ = other.headZone10Temp_; headZone11Temp_ = other.headZone11Temp_; headZone12Temp_ = other.headZone12Temp_; - stSpZone1Temp_ = other.stSpZone1Temp_; - stSpZone2Temp_ = other.stSpZone2Temp_; rBlowerFlow_ = other.rBlowerFlow_; rBlowerTemp_ = other.rBlowerTemp_; lBlowerFlow_ = other.lBlowerFlow_; @@ -400,30 +397,8 @@ namespace Tango.PMR.Printing { } } - /// Field number for the "StSpZone1Temp" field. - public const int StSpZone1TempFieldNumber = 27; - private double stSpZone1Temp_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double StSpZone1Temp { - get { return stSpZone1Temp_; } - set { - stSpZone1Temp_ = value; - } - } - - /// Field number for the "StSpZone2Temp" field. - public const int StSpZone2TempFieldNumber = 28; - private double stSpZone2Temp_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double StSpZone2Temp { - get { return stSpZone2Temp_; } - set { - stSpZone2Temp_ = value; - } - } - /// Field number for the "RBlowerFlow" field. - public const int RBlowerFlowFieldNumber = 29; + public const int RBlowerFlowFieldNumber = 27; private double rBlowerFlow_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double RBlowerFlow { @@ -434,7 +409,7 @@ namespace Tango.PMR.Printing { } /// Field number for the "RBlowerTemp" field. - public const int RBlowerTempFieldNumber = 30; + public const int RBlowerTempFieldNumber = 28; private double rBlowerTemp_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double RBlowerTemp { @@ -445,7 +420,7 @@ namespace Tango.PMR.Printing { } /// Field number for the "LBlowerFlow" field. - public const int LBlowerFlowFieldNumber = 31; + public const int LBlowerFlowFieldNumber = 29; private double lBlowerFlow_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double LBlowerFlow { @@ -456,7 +431,7 @@ namespace Tango.PMR.Printing { } /// Field number for the "LBlowerTemp" field. - public const int LBlowerTempFieldNumber = 32; + public const int LBlowerTempFieldNumber = 30; private double lBlowerTemp_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double LBlowerTemp { @@ -505,8 +480,6 @@ namespace Tango.PMR.Printing { if (HeadZone10Temp != other.HeadZone10Temp) return false; if (HeadZone11Temp != other.HeadZone11Temp) return false; if (HeadZone12Temp != other.HeadZone12Temp) return false; - if (StSpZone1Temp != other.StSpZone1Temp) return false; - if (StSpZone2Temp != other.StSpZone2Temp) return false; if (RBlowerFlow != other.RBlowerFlow) return false; if (RBlowerTemp != other.RBlowerTemp) return false; if (LBlowerFlow != other.LBlowerFlow) return false; @@ -543,8 +516,6 @@ namespace Tango.PMR.Printing { if (HeadZone10Temp != 0D) hash ^= HeadZone10Temp.GetHashCode(); if (HeadZone11Temp != 0D) hash ^= HeadZone11Temp.GetHashCode(); if (HeadZone12Temp != 0D) hash ^= HeadZone12Temp.GetHashCode(); - if (StSpZone1Temp != 0D) hash ^= StSpZone1Temp.GetHashCode(); - if (StSpZone2Temp != 0D) hash ^= StSpZone2Temp.GetHashCode(); if (RBlowerFlow != 0D) hash ^= RBlowerFlow.GetHashCode(); if (RBlowerTemp != 0D) hash ^= RBlowerTemp.GetHashCode(); if (LBlowerFlow != 0D) hash ^= LBlowerFlow.GetHashCode(); @@ -663,28 +634,20 @@ namespace Tango.PMR.Printing { output.WriteRawTag(209, 1); output.WriteDouble(HeadZone12Temp); } - if (StSpZone1Temp != 0D) { - output.WriteRawTag(217, 1); - output.WriteDouble(StSpZone1Temp); - } - if (StSpZone2Temp != 0D) { - output.WriteRawTag(225, 1); - output.WriteDouble(StSpZone2Temp); - } if (RBlowerFlow != 0D) { - output.WriteRawTag(233, 1); + output.WriteRawTag(217, 1); output.WriteDouble(RBlowerFlow); } if (RBlowerTemp != 0D) { - output.WriteRawTag(241, 1); + output.WriteRawTag(225, 1); output.WriteDouble(RBlowerTemp); } if (LBlowerFlow != 0D) { - output.WriteRawTag(249, 1); + output.WriteRawTag(233, 1); output.WriteDouble(LBlowerFlow); } if (LBlowerTemp != 0D) { - output.WriteRawTag(129, 2); + output.WriteRawTag(241, 1); output.WriteDouble(LBlowerTemp); } } @@ -770,12 +733,6 @@ namespace Tango.PMR.Printing { if (HeadZone12Temp != 0D) { size += 2 + 8; } - if (StSpZone1Temp != 0D) { - size += 2 + 8; - } - if (StSpZone2Temp != 0D) { - size += 2 + 8; - } if (RBlowerFlow != 0D) { size += 2 + 8; } @@ -874,12 +831,6 @@ namespace Tango.PMR.Printing { if (other.HeadZone12Temp != 0D) { HeadZone12Temp = other.HeadZone12Temp; } - if (other.StSpZone1Temp != 0D) { - StSpZone1Temp = other.StSpZone1Temp; - } - if (other.StSpZone2Temp != 0D) { - StSpZone2Temp = other.StSpZone2Temp; - } if (other.RBlowerFlow != 0D) { RBlowerFlow = other.RBlowerFlow; } @@ -1007,26 +958,18 @@ namespace Tango.PMR.Printing { break; } case 217: { - StSpZone1Temp = input.ReadDouble(); - break; - } - case 225: { - StSpZone2Temp = input.ReadDouble(); - break; - } - case 233: { RBlowerFlow = input.ReadDouble(); break; } - case 241: { + case 225: { RBlowerTemp = input.ReadDouble(); break; } - case 249: { + case 233: { LBlowerFlow = input.ReadDouble(); break; } - case 257: { + case 241: { LBlowerTemp = input.ReadDouble(); break; } diff --git a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/OverrideData.xml b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/OverrideData.xml index c0d3aa837..e340a65ca 100644 Binary files a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/OverrideData.xml and b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/OverrideData.xml differ diff --git a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml index d33b19137..b8c949c2a 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.SharedUI/Converters/EmptyStringToNullConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/EmptyStringToNullConverter.cs new file mode 100644 index 000000000..8d62178c7 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/EmptyStringToNullConverter.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class EmptyStringToNullConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + if (String.IsNullOrWhiteSpace(value.ToString())) + { + return null; + } + } + + return value; + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index dddaa750c..092afd777 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -100,6 +100,7 @@ + @@ -243,7 +244,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs index ac20feb04..208adf63f 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -154,6 +154,14 @@ namespace Tango.DBObservablesGenerator.CLI { codeField.Type = String.Format("Nullable<{0}>", "DateTime"); } + else if (field.PropertyType == typeof(Nullable)) + { + codeField.Type = String.Format("Nullable<{0}>", "Int32"); + } + else if (field.PropertyType == typeof(Nullable)) + { + codeField.Type = String.Format("Nullable<{0}>", "Double"); + } else { codeField.Type = String.Format("SynchronizedObservableCollection<{0}>", DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); @@ -237,7 +245,7 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Enumerations... using (RemoteDB db = new RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { - foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) + foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericTypeAndNotNullable())) { try { @@ -387,7 +395,7 @@ namespace Tango.DBObservablesGenerator.CLI codeField.Description = FirstCharacterToLower(DalNameToStandardName(name)); - if (field.PropertyType.IsGenericType) + if (field.PropertyType.IsGenericTypeAndNotNullable()) { continue; } @@ -435,7 +443,7 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Enumerations... using (RemoteDB db = new RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { - foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) + foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericTypeAndNotNullable())) { try { -- cgit v1.3.1