From 9695aef4cf1ac2d85d6905e73c4f4aa079cc7c1d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 16 Jan 2018 18:23:59 +0200 Subject: Removed Dispensers & Cartridges! Only Dispenser Type & CartridgeType now. --- .../Modules/Tango.MachineStudio.DB/ViewModelLocator.cs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index 3079f8e5f..87ac26c4d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -36,10 +36,8 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); - SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); - SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); @@ -197,14 +195,6 @@ namespace Tango.MachineStudio.DB } } - public static DispensersViewVM DispensersViewVM - { - get - { - return ServiceLocator.Current.GetInstance(); - } - } - public static DispenserTypesViewVM DispenserTypesViewVM { get @@ -221,14 +211,6 @@ namespace Tango.MachineStudio.DB } } - public static CartridgesViewVM CartridgesViewVM - { - get - { - return ServiceLocator.Current.GetInstance(); - } - } - public static CartridgeTypesViewVM CartridgeTypesViewVM { get -- cgit v1.3.1 From df8c13b71a49d757c47a892be01599eefcd36a2f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 16 Jan 2018 19:50:33 +0200 Subject: Added Max_NL_Per_CM to DB Module !! Added Liquid_Types_Rml table to DB module. Added new nl/cm to dispenser. Added capacity to dispenser. --- Software/DB/Tango.db | Bin 602112 -> 602112 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Tango.MachineStudio.DB.csproj | 15 ++++ .../Tango.MachineStudio.DB/ViewModelLocator.cs | 9 +++ .../ViewModels/DispenserTypesViewVM.cs | 1 + .../ViewModels/LiquidTypesRmlsViewVM.cs | 18 +++++ .../Views/DBViews/DispenserTypeView.xaml | 4 ++ .../Views/DBViews/DispenserTypesView.xaml | 2 + .../Views/DBViews/LiquidTypesRmlView.xaml | 31 ++++++++ .../Views/DBViews/LiquidTypesRmlView.xaml.cs | 28 ++++++++ .../Views/DBViews/LiquidTypesRmlsView.xaml | 26 +++++++ .../Views/DBViews/LiquidTypesRmlsView.xaml.cs | 30 ++++++++ .../Tango.DAL.Local/DB/DISPENSER_TYPES.cs | 2 + .../Tango.DAL.Local/DB/LIQUID_TYPES_RMLS.cs | 1 + .../Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx | 9 +++ .../Tango.DAL.Local/DB/LocalADO.edmx.diagram | 36 +++++----- .../Entities/DispenserType.cs | 38 ++++++++++ .../Entities/LiquidTypesRml.cs | 19 +++++ .../ObservablesEntitiesAdapter.cs | 2 + .../Tango.DAL.Remote/DB/DISPENSER_TYPES.cs | 2 + .../Tango.DAL.Remote/DB/LIQUID_TYPES_RMLS.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 9 +++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 78 ++++++++++----------- 24 files changed, 304 insertions(+), 57 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesRmlsViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs') diff --git a/Software/DB/Tango.db b/Software/DB/Tango.db index 074b9f0c0..2aafcab0e 100644 Binary files a/Software/DB/Tango.db and b/Software/DB/Tango.db differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 3a7c3f1ba..a8a07a2f0 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 60e0a3f85..a0a6f87d4 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index b8b9dea44..2bd5bd986 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -116,6 +116,7 @@ + @@ -322,12 +323,18 @@ EventTypesView.xaml + + LiquidTypesRmlsView.xaml + UsersView.xaml EventTypeView.xaml + + LiquidTypesRmlView.xaml + UserView.xaml @@ -601,6 +608,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -609,6 +620,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index 87ac26c4d..ce7eb637b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -54,6 +54,7 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); @@ -330,5 +331,13 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance(); } } + + public static LiquidTypesRmlsViewVM LiquidTypesRmlViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs index 5ffe0d58c..97adfa7d4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DispenserTypesViewVM.cs @@ -12,6 +12,7 @@ namespace Tango.MachineStudio.DB.ViewModels { public DispenserTypesViewVM(INotificationProvider notification) : base(notification) { + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesRmlsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesRmlsViewVM.cs new file mode 100644 index 000000000..5b8e3749f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/LiquidTypesRmlsViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class LiquidTypesRmlsViewVM : DbTableViewModel + { + public LiquidTypesRmlsViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml index b6e3336b3..55c995360 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml @@ -24,6 +24,10 @@ + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml index 874629128..040ac5799 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml @@ -17,6 +17,8 @@ + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml new file mode 100644 index 000000000..a3b3f5eed --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.xaml.cs new file mode 100644 index 000000000..baaac7633 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlView.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.DB.Views.DBViews +{ + /// + /// Interaction logic for UserView.xaml + /// + public partial class LiquidTypesRmlView : UserControl + { + public LiquidTypesRmlView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml new file mode 100644 index 000000000..f96402432 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml.cs new file mode 100644 index 000000000..9bda7a713 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml.cs @@ -0,0 +1,30 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// + /// Interaction logic for UsersView.xaml + /// + [DBView] + public partial class LiquidTypesRmlsView : UserControl + { + public LiquidTypesRmlsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs index 718ab5219..0d8094f81 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs @@ -20,5 +20,7 @@ namespace Tango.DAL.Local.DB public bool DELETED { get; set; } public long CODE { get; set; } public string NAME { get; set; } + public double NL_PER_PULSE { get; set; } + public double CAPACITY { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES_RMLS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES_RMLS.cs index cd8865526..637b61e01 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES_RMLS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES_RMLS.cs @@ -20,5 +20,6 @@ namespace Tango.DAL.Local.DB public bool DELETED { get; set; } public string LIQUID_TYPE_GUID { get; set; } public string RML_GUID { get; set; } + public double MAX_NL_PER_CM { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx index ab77e4b9b..60f35f27c 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx @@ -160,6 +160,8 @@ + + @@ -289,6 +291,7 @@ + @@ -748,6 +751,8 @@ + + @@ -877,6 +882,7 @@ + @@ -1258,6 +1264,8 @@ + + @@ -1398,6 +1406,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram index 9148e84b6..2d0a148ea 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram @@ -23,28 +23,28 @@ - - - + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs index ace6c5d5d..d9e57c7f3 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs @@ -48,6 +48,44 @@ namespace Tango.DAL.Observables } + private Double _nlperpulse; + /// + /// Gets or sets the dispensertype nl per pulse. + /// + [EntityFieldName("NL_PER_PULSE")] + public Double NlPerPulse + { + get + { + return _nlperpulse; + } + + set + { + _nlperpulse = value; RaisePropertyChanged(nameof(NlPerPulse)); + } + + } + + private Double _capacity; + /// + /// Gets or sets the dispensertype capacity. + /// + [EntityFieldName("CAPACITY")] + public Double Capacity + { + get + { + return _capacity; + } + + set + { + _capacity = value; RaisePropertyChanged(nameof(Capacity)); + } + + } + private ObservableCollection _idspacks; /// /// Gets or sets the dispensertype ids packs. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs index 996cd8f5d..f2116bb65 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs @@ -48,6 +48,25 @@ namespace Tango.DAL.Observables } + private Double _maxnlpercm; + /// + /// Gets or sets the liquidtypesrml max nl per cm. + /// + [EntityFieldName("MAX_NL_PER_CM")] + public Double MaxNlPerCm + { + get + { + return _maxnlpercm; + } + + set + { + _maxnlpercm = value; RaisePropertyChanged(nameof(MaxNlPerCm)); + } + + } + private LiquidType _liquidtypes; /// /// Gets or sets the liquidtypesrml liquid types. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index 53f40fd30..384f10dc7 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -241,6 +241,8 @@ namespace Tango.DAL.Observables Rmls = Context.RMLS.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); + LiquidTypesRmls = Context.LIQUID_TYPES_RMLS.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); + Ccts = Context.CCTS.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); Cats = Context.CATS.Where(x => !x.DELETED).ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs index 878d9a14d..1bf5a8e0e 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/DISPENSER_TYPES.cs @@ -26,6 +26,8 @@ namespace Tango.DAL.Remote.DB public bool DELETED { get; set; } public int CODE { get; set; } public string NAME { get; set; } + public double NL_PER_PULSE { get; set; } + public double CAPACITY { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection IDS_PACKS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES_RMLS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES_RMLS.cs index c77b4fa5d..4a521f980 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES_RMLS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/LIQUID_TYPES_RMLS.cs @@ -20,6 +20,7 @@ namespace Tango.DAL.Remote.DB public bool DELETED { get; set; } public string LIQUID_TYPE_GUID { get; set; } public string RML_GUID { get; set; } + public double MAX_NL_PER_CM { get; set; } public virtual LIQUID_TYPES LIQUID_TYPES { get; set; } public virtual RML RML { 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 faa13393b..c1e7d53c4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -160,6 +160,8 @@ + + @@ -289,6 +291,7 @@ + @@ -1664,6 +1667,8 @@ + + @@ -1812,6 +1817,7 @@ + @@ -2778,6 +2784,8 @@ + + @@ -2918,6 +2926,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 7bb2e31b2..60d141af1 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,46 +5,46 @@ - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.3.1 From 215127ecf2b971a7164ab303f09de74e56c970f4 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 18 Jan 2018 19:07:30 +0200 Subject: Added Process Parameters Table. --- Software/DB/Tango.db | Bin 602112 -> 602112 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../ProcessParametersRmlsToStringConverter.cs | 40 ++ .../Tango.MachineStudio.DB.csproj | 16 + .../Tango.MachineStudio.DB/ViewModelLocator.cs | 10 + .../ViewModels/ProcessParametersTablesViewVM.cs | 18 + .../Views/DBViews/ProcessParametersTableView.xaml | 63 ++++ .../DBViews/ProcessParametersTableView.xaml.cs | 28 ++ .../Views/DBViews/ProcessParametersTablesView.xaml | 46 +++ .../DBViews/ProcessParametersTablesView.xaml.cs | 32 ++ .../Entities/ProcessParametersTable.cs | 402 +++++++++++++++++++++ .../Tango.DAL.Observables/Entities/Rml.cs | 40 ++ .../Entities/RmlsProcessParameter.cs | 114 ++++++ .../Tango.DAL.Observables/Enumerations/Rmls.cs | 25 ++ .../ObservablesEntitiesAdapter.cs | 2 + .../ObservablesEntitiesAdapterExtension.cs | 76 ++++ .../Tango.DAL.Observables.csproj | 2 + .../DB/PROCESS_PARAMETERS_TABLES.cs | 48 +++ Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 4 + .../Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs | 26 ++ .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 2 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 201 ++++++++++- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 70 ++-- .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 6 + 25 files changed, 1236 insertions(+), 35 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Rmls.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs') diff --git a/Software/DB/Tango.db b/Software/DB/Tango.db index 147c930c6..0693a2623 100644 Binary files a/Software/DB/Tango.db and b/Software/DB/Tango.db differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 0e29193ec..0d278796c 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 a437a0c1e..ad3b1ba73 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs new file mode 100644 index 000000000..359467e2d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.DAL.Observables; +using Tango.MachineStudio.DB.ViewModels; + +namespace Tango.MachineStudio.DB.Converters +{ + /// + /// Converts a liquid type RML to string. + /// + /// + public class ProcessParametersRmlsToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) return ""; + + if (value is IEnumerable) + { + IEnumerable liquidRmls = value as IEnumerable; + return String.Join(", ", liquidRmls.Select(x => x.Rml.Name)); + } + else + { + IEnumerable> rmls = value as IEnumerable>; + return String.Join(", ", rmls.Where(x => x.IsSelected).Select(x => x.Entity.Name)); + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index 2bd5bd986..42bcb5eac 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -89,6 +89,7 @@ + @@ -128,6 +129,7 @@ + @@ -140,6 +142,12 @@ ActionTypeView.xaml + + ProcessParametersTablesView.xaml + + + ProcessParametersTableView.xaml + MidTankTypesView.xaml @@ -364,6 +372,14 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index ce7eb637b..350bebcc0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -58,6 +58,8 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + + SimpleIoc.Default.Register(); } public static MainViewVM MainViewVM @@ -339,5 +341,13 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance(); } } + + public static ProcessParametersTablesViewVM ProcessParametersTablesViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesViewVM.cs new file mode 100644 index 000000000..965b0e391 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ProcessParametersTablesViewVM : DbTableViewModel + { + public ProcessParametersTablesViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml new file mode 100644 index 000000000..06442196e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml.cs new file mode 100644 index 000000000..1f1b7434b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.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.DB.Views.DBViews +{ + /// + /// Interaction logic for MachineView.xaml + /// + public partial class ProcessParametersTableView : UserControl + { + public ProcessParametersTableView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml new file mode 100644 index 000000000..2648b78a0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml.cs new file mode 100644 index 000000000..518af1485 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml.cs @@ -0,0 +1,32 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; +using Tango.MachineStudio.DB.Managers; +using Tango.SharedUI.Controls; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// + /// Interaction logic for MachinesView.xaml + /// + [DBView] + public partial class ProcessParametersTablesView : UserControl + { + public ProcessParametersTablesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs new file mode 100644 index 000000000..8bc2cff3b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs @@ -0,0 +1,402 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Tango.DAL.Remote.DB; + +namespace Tango.DAL.Observables +{ + [EntityFieldName("PROCESS_PARAMETERS_TABLES")] + public partial class ProcessParametersTable : ObservableEntity + { + + private String _name; + /// + /// Gets or sets the processparameterstable name. + /// + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + private Double _dyeingspeed; + /// + /// Gets or sets the processparameterstable dyeing speed. + /// + [EntityFieldName("DYEING_SPEED")] + public Double DyeingSpeed + { + get + { + return _dyeingspeed; + } + + set + { + _dyeingspeed = value; RaisePropertyChanged(nameof(DyeingSpeed)); + } + + } + + private Double _mininkuptake; + /// + /// Gets or sets the processparameterstable min ink uptake. + /// + [EntityFieldName("MIN_INK_UPTAKE")] + public Double MinInkUptake + { + get + { + return _mininkuptake; + } + + set + { + _mininkuptake = value; RaisePropertyChanged(nameof(MinInkUptake)); + } + + } + + private Double _mixertemp; + /// + /// Gets or sets the processparameterstable mixer temp. + /// + [EntityFieldName("MIXER_TEMP")] + public Double MixerTemp + { + get + { + return _mixertemp; + } + + set + { + _mixertemp = value; RaisePropertyChanged(nameof(MixerTemp)); + } + + } + + private Double _headzone1temp; + /// + /// Gets or sets the processparameterstable head zone1 temp. + /// + [EntityFieldName("HEAD_ZONE1_TEMP")] + public Double HeadZone1Temp + { + get + { + return _headzone1temp; + } + + set + { + _headzone1temp = value; RaisePropertyChanged(nameof(HeadZone1Temp)); + } + + } + + private Double _headzone2temp; + /// + /// Gets or sets the processparameterstable head zone2 temp. + /// + [EntityFieldName("HEAD_ZONE2_TEMP")] + public Double HeadZone2Temp + { + get + { + return _headzone2temp; + } + + set + { + _headzone2temp = value; RaisePropertyChanged(nameof(HeadZone2Temp)); + } + + } + + private Double _headzone3temp; + /// + /// Gets or sets the processparameterstable head zone3 temp. + /// + [EntityFieldName("HEAD_ZONE3_TEMP")] + public Double HeadZone3Temp + { + get + { + return _headzone3temp; + } + + set + { + _headzone3temp = value; RaisePropertyChanged(nameof(HeadZone3Temp)); + } + + } + + private Double _headairflow; + /// + /// Gets or sets the processparameterstable head air flow. + /// + [EntityFieldName("HEAD_AIR_FLOW")] + public Double HeadAirFlow + { + get + { + return _headairflow; + } + + set + { + _headairflow = value; RaisePropertyChanged(nameof(HeadAirFlow)); + } + + } + + private Double _feedertension; + /// + /// Gets or sets the processparameterstable feeder tension. + /// + [EntityFieldName("FEEDER_TENSION")] + public Double FeederTension + { + get + { + return _feedertension; + } + + set + { + _feedertension = value; RaisePropertyChanged(nameof(FeederTension)); + } + + } + + private Double _pullertension; + /// + /// Gets or sets the processparameterstable puller tension. + /// + [EntityFieldName("PULLER_TENSION")] + public Double PullerTension + { + get + { + return _pullertension; + } + + set + { + _pullertension = value; RaisePropertyChanged(nameof(PullerTension)); + } + + } + + private Double _dryerbufferlength; + /// + /// Gets or sets the processparameterstable dryer buffer length. + /// + [EntityFieldName("DRYER_BUFFER_LENGTH")] + public Double DryerBufferLength + { + get + { + return _dryerbufferlength; + } + + set + { + _dryerbufferlength = value; RaisePropertyChanged(nameof(DryerBufferLength)); + } + + } + + private Double _dryerzone1temp; + /// + /// Gets or sets the processparameterstable dryer zone1 temp. + /// + [EntityFieldName("DRYER_ZONE1_TEMP")] + public Double DryerZone1Temp + { + get + { + return _dryerzone1temp; + } + + set + { + _dryerzone1temp = value; RaisePropertyChanged(nameof(DryerZone1Temp)); + } + + } + + private Double _dryerzone2temp; + /// + /// Gets or sets the processparameterstable dryer zone2 temp. + /// + [EntityFieldName("DRYER_ZONE2_TEMP")] + public Double DryerZone2Temp + { + get + { + return _dryerzone2temp; + } + + set + { + _dryerzone2temp = value; RaisePropertyChanged(nameof(DryerZone2Temp)); + } + + } + + private Double _dryerzone3temp; + /// + /// Gets or sets the processparameterstable dryer zone3 temp. + /// + [EntityFieldName("DRYER_ZONE3_TEMP")] + public Double DryerZone3Temp + { + get + { + return _dryerzone3temp; + } + + set + { + _dryerzone3temp = value; RaisePropertyChanged(nameof(DryerZone3Temp)); + } + + } + + private Double _dryerairflow; + /// + /// Gets or sets the processparameterstable dryer air flow. + /// + [EntityFieldName("DRYER_AIR_FLOW")] + public Double DryerAirFlow + { + get + { + return _dryerairflow; + } + + set + { + _dryerairflow = value; RaisePropertyChanged(nameof(DryerAirFlow)); + } + + } + + private Double _windertension; + /// + /// Gets or sets the processparameterstable winder tension. + /// + [EntityFieldName("WINDER_TENSION")] + public Double WinderTension + { + get + { + return _windertension; + } + + set + { + _windertension = value; RaisePropertyChanged(nameof(WinderTension)); + } + + } + + private Boolean _lubrication; + /// + /// Gets or sets the processparameterstable lubrication. + /// + [EntityFieldName("LUBRICATION")] + public Boolean Lubrication + { + get + { + return _lubrication; + } + + set + { + _lubrication = value; RaisePropertyChanged(nameof(Lubrication)); + } + + } + + private Double _lubricationnlpercm; + /// + /// Gets or sets the processparameterstable lubrication nl per cm. + /// + [EntityFieldName("LUBRICATION_NL_PER_CM")] + public Double LubricationNlPerCm + { + get + { + return _lubricationnlpercm; + } + + set + { + _lubricationnlpercm = value; RaisePropertyChanged(nameof(LubricationNlPerCm)); + } + + } + + private ObservableCollection _rmlsprocessparameters; + /// + /// Gets or sets the processparameterstable rmls process parameters. + /// + [EntityFieldName("RMLS_PROCESS_PARAMETERS")] + public ObservableCollection RmlsProcessParameters + { + get + { + return _rmlsprocessparameters; + } + + set + { + _rmlsprocessparameters = value; RaisePropertyChanged(nameof(RmlsProcessParameters)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public ProcessParametersTable() : base() + { + Init(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The entity. + public ProcessParametersTable(PROCESS_PARAMETERS_TABLES entity) : base(entity) + { + Init(); + MapEntityToObservable(entity, this); + } + + /// + /// Initialize complex types. + /// + private void Init() + { + + RmlsProcessParameters = new ObservableCollection(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs index 1ced2ed8c..ab62b578d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs @@ -48,6 +48,25 @@ namespace Tango.DAL.Observables } + private Int32 _code; + /// + /// Gets or sets the rml code. + /// + [EntityFieldName("CODE")] + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + private String _materialguid; /// /// Gets or sets the rml material guid. @@ -542,6 +561,25 @@ namespace Tango.DAL.Observables } + private ObservableCollection _rmlsprocessparameters; + /// + /// Gets or sets the rml rmls process parameters. + /// + [EntityFieldName("RMLS_PROCESS_PARAMETERS")] + public ObservableCollection RmlsProcessParameters + { + get + { + return _rmlsprocessparameters; + } + + set + { + _rmlsprocessparameters = value; RaisePropertyChanged(nameof(RmlsProcessParameters)); + } + + } + /// /// Initializes a new instance of the class. /// @@ -570,6 +608,8 @@ namespace Tango.DAL.Observables LiquidTypesRmls = new ObservableCollection(); + RmlsProcessParameters = new ObservableCollection(); + } } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs new file mode 100644 index 000000000..4dc3a23b4 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Tango.DAL.Remote.DB; + +namespace Tango.DAL.Observables +{ + [EntityFieldName("RMLS_PROCESS_PARAMETERS")] + public partial class RmlsProcessParameter : ObservableEntity + { + + private String _rmlguid; + /// + /// Gets or sets the rmlsprocessparameter rml guid. + /// + [EntityFieldName("RML_GUID")] + public String RmlGuid + { + get + { + return _rmlguid; + } + + set + { + _rmlguid = value; RaisePropertyChanged(nameof(RmlGuid)); + } + + } + + private String _processparametersguid; + /// + /// Gets or sets the rmlsprocessparameter process parameters guid. + /// + [EntityFieldName("PROCESS_PARAMETERS_GUID")] + public String ProcessParametersGuid + { + get + { + return _processparametersguid; + } + + set + { + _processparametersguid = value; RaisePropertyChanged(nameof(ProcessParametersGuid)); + } + + } + + private ProcessParametersTable _processparameterstables; + /// + /// Gets or sets the rmlsprocessparameter process parameters tables. + /// + [EntityFieldName("PROCESS_PARAMETERS_TABLES")] + public ProcessParametersTable ProcessParametersTables + { + get + { + return _processparameterstables; + } + + set + { + _processparameterstables = value; RaisePropertyChanged(nameof(ProcessParametersTables)); + } + + } + + private Rml _rml; + /// + /// Gets or sets the rmlsprocessparameter rml. + /// + [EntityFieldName("RML")] + public Rml Rml + { + get + { + return _rml; + } + + set + { + _rml = value; RaisePropertyChanged(nameof(Rml)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public RmlsProcessParameter() : base() + { + Init(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The entity. + public RmlsProcessParameter(RMLS_PROCESS_PARAMETERS entity) : base(entity) + { + Init(); + MapEntityToObservable(entity, this); + } + + /// + /// Initialize complex types. + /// + private void Init() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Rmls.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Rmls.cs new file mode 100644 index 000000000..5f8bb5eef --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Rmls.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum Rmls + { + + /// + /// (RML 2) + /// + [Description("RML 2")] + RML2 = 0, + + /// + /// (RML 1) + /// + [Description("RML 1")] + RML1 = 0, + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index a5ed56530..b24640c79 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -247,6 +247,8 @@ namespace Tango.DAL.Observables Cats = Context.CATS.ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); + ProcessParametersTables = Context.PROCESS_PARAMETERS_TABLES.ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); + InitCollectionSources(); //BindingOperations.EnableCollectionSynchronization(Machines, _syncLock); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs index ef5309dba..279d170d8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs @@ -1230,6 +1230,42 @@ namespace Tango.DAL.Observables } + private ObservableCollection _processparameterstables; + /// + /// Gets or sets the ProcessParametersTables. + /// + public ObservableCollection ProcessParametersTables + { + get + { + return _processparameterstables; + } + + set + { + _processparameterstables = value; RaisePropertyChanged(nameof(ProcessParametersTables)); + } + + } + + private ICollectionView _processparameterstablesViewSource; + /// + /// Gets or sets the ProcessParametersTables View Source. + /// + public ICollectionView ProcessParametersTablesViewSource + { + get + { + return _processparameterstablesViewSource; + } + + set + { + _processparameterstablesViewSource = value; RaisePropertyChanged(nameof(ProcessParametersTablesViewSource)); + } + + } + private ObservableCollection _rmls; /// /// Gets or sets the Rmls. @@ -1266,6 +1302,42 @@ namespace Tango.DAL.Observables } + private ObservableCollection _rmlsprocessparameters; + /// + /// Gets or sets the RmlsProcessParameters. + /// + public ObservableCollection RmlsProcessParameters + { + get + { + return _rmlsprocessparameters; + } + + set + { + _rmlsprocessparameters = value; RaisePropertyChanged(nameof(RmlsProcessParameters)); + } + + } + + private ICollectionView _rmlsprocessparametersViewSource; + /// + /// Gets or sets the RmlsProcessParameters View Source. + /// + public ICollectionView RmlsProcessParametersViewSource + { + get + { + return _rmlsprocessparametersViewSource; + } + + set + { + _rmlsprocessparametersViewSource = value; RaisePropertyChanged(nameof(RmlsProcessParametersViewSource)); + } + + } + private ObservableCollection _roles; /// /// Gets or sets the Roles. @@ -1520,8 +1592,12 @@ namespace Tango.DAL.Observables PermissionsViewSource = CreateCollectionView(Permissions); + ProcessParametersTablesViewSource = CreateCollectionView(ProcessParametersTables); + RmlsViewSource = CreateCollectionView(Rmls); + RmlsProcessParametersViewSource = CreateCollectionView(RmlsProcessParameters); + RolesViewSource = CreateCollectionView(Roles); RolesPermissionsViewSource = CreateCollectionView(RolesPermissions); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj index 95ed8bc63..40730e3a1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj +++ b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj @@ -68,6 +68,8 @@ + + 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 new file mode 100644 index 000000000..92c11111b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// +// 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 PROCESS_PARAMETERS_TABLES + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public PROCESS_PARAMETERS_TABLES() + { + this.RMLS_PROCESS_PARAMETERS = new HashSet(); + } + + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string NAME { get; set; } + public double DYEING_SPEED { get; set; } + public double MIN_INK_UPTAKE { get; set; } + public double MIXER_TEMP { get; set; } + public double HEAD_ZONE1_TEMP { get; set; } + public double HEAD_ZONE2_TEMP { get; set; } + public double HEAD_ZONE3_TEMP { get; set; } + public double HEAD_AIR_FLOW { get; set; } + public double FEEDER_TENSION { get; set; } + public double PULLER_TENSION { get; set; } + public double DRYER_BUFFER_LENGTH { get; set; } + public double DRYER_ZONE1_TEMP { get; set; } + public double DRYER_ZONE2_TEMP { get; set; } + public double DRYER_ZONE3_TEMP { get; set; } + public double DRYER_AIR_FLOW { get; set; } + public double WINDER_TENSION { get; set; } + public bool LUBRICATION { get; set; } + public double LUBRICATION_NL_PER_CM { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection RMLS_PROCESS_PARAMETERS { 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 6120596e1..1fd04214b 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -19,6 +19,7 @@ namespace Tango.DAL.Remote.DB { this.CCTS = new HashSet(); this.LIQUID_TYPES_RMLS = new HashSet(); + this.RMLS_PROCESS_PARAMETERS = new HashSet(); } public int ID { get; set; } @@ -26,6 +27,7 @@ namespace Tango.DAL.Remote.DB public System.DateTime LAST_UPDATED { get; set; } public string NAME { get; set; } public string MANUFACTURER { get; set; } + public int CODE { get; set; } public string MATERIAL_GUID { get; set; } public string COLOR_GUID { get; set; } public string PURPOSE_GUID { get; set; } @@ -55,5 +57,7 @@ namespace Tango.DAL.Remote.DB 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 RMLS_PROCESS_PARAMETERS { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs new file mode 100644 index 000000000..cfab486af --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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_PROCESS_PARAMETERS + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string RML_GUID { get; set; } + public string PROCESS_PARAMETERS_GUID { get; set; } + + public virtual PROCESS_PARAMETERS_TABLES PROCESS_PARAMETERS_TABLES { get; set; } + public virtual RML RML { 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 fea29bf2d..767f7020b 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -59,7 +59,9 @@ namespace Tango.DAL.Remote.DB public virtual DbSet MID_TANK_TYPES { get; set; } public virtual DbSet ORGANIZATIONS { get; set; } public virtual DbSet PERMISSIONS { get; set; } + public virtual DbSet PROCESS_PARAMETERS_TABLES { get; set; } public virtual DbSet RMLS { get; set; } + public virtual DbSet RMLS_PROCESS_PARAMETERS { get; set; } public virtual DbSet ROLES { get; set; } public virtual DbSet ROLES_PERMISSIONS { get; set; } public virtual DbSet SYNC_CONFIGURATIONS { 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 ea19fea80..714147555 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -392,6 +392,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -401,6 +427,7 @@ + @@ -419,6 +446,16 @@ + + + + + + + + + + @@ -486,7 +523,9 @@ - + + + @@ -931,6 +970,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1052,7 +1119,9 @@ + + @@ -1206,6 +1275,14 @@ + + + + + + + + @@ -1274,7 +1351,9 @@ + + @@ -1444,6 +1523,14 @@ + + + + + + + + @@ -1912,6 +1999,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1921,6 +2035,7 @@ + @@ -1947,6 +2062,19 @@ + + + + + + + + + + + + + @@ -2124,7 +2252,9 @@ - + + + @@ -2521,6 +2651,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2984,6 +3142,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3004,6 +3189,7 @@ + @@ -3012,6 +3198,17 @@ + + + + + + + + + + + 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 8c11eeccc..50edc44ea 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,46 +5,48 @@ - - - - - - - + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - + + + - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -86,6 +88,8 @@ + + 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 fc8d528c1..3ff95ff97 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -167,6 +167,9 @@ RemoteADO.tt + + RemoteADO.tt + True True @@ -185,6 +188,9 @@ RemoteADO.tt + + RemoteADO.tt + RemoteADO.tt -- cgit v1.3.1 From bc2d3eb5ec8c7176627dcb8f5c02cc085b2db584 Mon Sep 17 00:00:00 2001 From: Roy Date: Sat, 20 Jan 2018 21:30:53 +0200 Subject: Implemented new CATS. Implemented Process Parameters View on DB Module. Implemented RML Process Parameters View on DB Module. Modified DB Module table initials letter casing. Moved observables generator to CLI. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Controls/DbTableView.xaml | 2 +- .../ProcessParametersRmlsToStringConverter.cs | 40 --- .../Managers/RegisteredView.cs | 12 + .../Tango.MachineStudio.DB.csproj | 16 +- .../Tango.MachineStudio.DB/ViewModelLocator.cs | 9 + .../ViewModels/CatsViewVM.cs | 1 + .../RmlsProcessParametersTablesViewVM.cs | 18 ++ .../Views/DBViews/CatView.xaml | 7 +- .../Views/DBViews/CatsView.xaml | 3 +- .../Views/DBViews/ProcessParametersTableView.xaml | 2 +- .../DBViews/RmlsProcessParametersTableView.xaml | 31 +++ .../DBViews/RmlsProcessParametersTableView.xaml.cs | 28 +++ .../DBViews/RmlsProcessParametersTablesView.xaml | 26 ++ .../RmlsProcessParametersTablesView.xaml.cs | 30 +++ .../Views/MainDBView.xaml.cs | 2 +- .../ViewModels/MachineVersionDialogVM.cs | 10 +- .../Views/MachineVersionDialog.xaml | 13 +- .../Tango.DAL.Observables/Entities/Cat.cs | 43 +++- .../Tango.DAL.Observables/Entities/Machine.cs | 21 -- .../Entities/ProcessParametersTable.cs | 14 +- .../Tango.DAL.Observables/Entities/Rml.cs | 35 ++- .../Entities/RmlsProcessParameter.cs | 114 --------- .../Entities/RmlsProcessParametersTable.cs | 133 ++++++++++ .../ObservablesEntitiesAdapter.cs | 2 + .../ObservablesEntitiesAdapterExtension.cs | 22 +- .../Tango.DAL.Observables/ObservablesGenerator.cs | 270 -------------------- .../Tango.DAL.Observables.csproj | 9 +- Software/Visual_Studio/Tango.DAL.Remote/DB/CAT.cs | 5 +- .../Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs | 3 - .../DB/PROCESS_PARAMETERS_TABLES.cs | 4 +- Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 7 +- .../Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs | 26 -- .../DB/RMLS_PROCESS_PARAMETERS_TABLES.cs | 27 ++ .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 2 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 112 ++++----- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 88 +++---- .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 2 +- .../Remote/RemoteDBComparer.cs | 14 +- .../Tango.UnitTesting/CodeGeneration_TST.cs | 1 + .../Tango.UnitTesting/Tango.UnitTesting.csproj | 4 + .../ObservablesGenerator.cs | 271 +++++++++++++++++++++ .../Tango.DBObservablesGenerator.CLI/Program.cs | 1 - .../Tango.DBObservablesGenerator.CLI.csproj | 16 ++ .../packages.config | 42 ++++ 46 files changed, 881 insertions(+), 657 deletions(-) delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs delete mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParametersTable.cs delete mode 100644 Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs delete mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS_TABLES.cs create mode 100644 Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 0d278796c..dedfe10f7 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 ad3b1ba73..579e80a02 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml index d1c62ed7e..f3e13e338 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280"> + d:DesignHeight="720" d:DesignWidth="1000" MaxWidth="1000"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs deleted file mode 100644 index 359467e2d..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using Tango.DAL.Observables; -using Tango.MachineStudio.DB.ViewModels; - -namespace Tango.MachineStudio.DB.Converters -{ - /// - /// Converts a liquid type RML to string. - /// - /// - public class ProcessParametersRmlsToStringConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) return ""; - - if (value is IEnumerable) - { - IEnumerable liquidRmls = value as IEnumerable; - return String.Join(", ", liquidRmls.Select(x => x.Rml.Name)); - } - else - { - IEnumerable> rmls = value as IEnumerable>; - return String.Join(", ", rmls.Where(x => x.IsSelected).Select(x => x.Entity.Name)); - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs index cdd32eaa5..cd53ff8d8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs @@ -33,7 +33,14 @@ namespace Tango.MachineStudio.DB.Managers { Location = new Point(rnd.Next(30, 200), rnd.Next(30, 200)); Icon = PackIconKind.Table; + + if (header.Length < 5) + { + header = header.ToUpper(); + } + Header = header; + View = view; if (action != null) @@ -64,6 +71,11 @@ namespace Tango.MachineStudio.DB.Managers /// The view. public RegisteredView(String header, FrameworkElement view) : this(header, view, null) { + if (header.Length < 5) + { + header = header.ToUpper(); + } + Header = header; View = view; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index 42bcb5eac..bb3084207 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -89,7 +89,6 @@ - @@ -130,6 +129,7 @@ + @@ -142,6 +142,12 @@ ActionTypeView.xaml + + RmlsProcessParametersTablesView.xaml + + + RmlsProcessParametersTableView.xaml + ProcessParametersTablesView.xaml @@ -372,6 +378,14 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index 350bebcc0..5fe386749 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -60,6 +60,7 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); } public static MainViewVM MainViewVM @@ -349,5 +350,13 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance(); } } + + public static RmlsProcessParametersTablesViewVM RmlsProcessParametersTablesViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs index 74a7e29eb..a768b3c7c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs @@ -16,6 +16,7 @@ namespace Tango.MachineStudio.DB.ViewModels public CatsViewVM(INotificationProvider notification) : base(notification) { SelectDataFileCommand = new RelayCommand(SelectDataFile); + } public RelayCommand SelectDataFileCommand { get; set; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs new file mode 100644 index 000000000..4ae1f063f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class RmlsProcessParametersTablesViewVM : DbTableViewModel + { + public RmlsProcessParametersTablesViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml index 442f77ae3..9cd01cfc4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml @@ -28,6 +28,9 @@ + + + @@ -44,8 +47,8 @@ - - + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml index d88a2a142..e72146525 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml @@ -22,6 +22,7 @@ + @@ -34,7 +35,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml index 06442196e..e9b7c31af 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml @@ -56,7 +56,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml new file mode 100644 index 000000000..767b39f29 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs new file mode 100644 index 000000000..713a46204 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.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.DB.Views.DBViews +{ + /// + /// Interaction logic for UserView.xaml + /// + public partial class RmlsProcessParametersTableView : UserControl + { + public RmlsProcessParametersTableView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml new file mode 100644 index 000000000..d599c64a3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs new file mode 100644 index 000000000..c4ee7e66d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs @@ -0,0 +1,30 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// + /// Interaction logic for UsersView.xaml + /// + [DBView] + public partial class RmlsProcessParametersTablesView : UserControl + { + public RmlsProcessParametersTablesView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs index 1ffdf7eb0..b769b9bfd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs @@ -58,7 +58,7 @@ namespace Tango.MachineStudio.DB.Views grid.DataContext = message.Context; presenter.Content = view; icon.Kind = (message.DialogOpenMode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); - txtTitle.Text = (message.DialogOpenMode == DialogOpenMode.Editing ? "Edit " : "Add New ") + message.EntityType.Name.ToTitle(); + txtTitle.Text = (message.DialogOpenMode == DialogOpenMode.Editing ? "Edit " : "Add New ") + (message.EntityType.Name.Length < 5 ? message.EntityType.Name.ToUpper() : message.EntityType.Name).ToTitle(); IsEditViewOpen = true; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs index 6854472f1..3776a5e91 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs @@ -12,7 +12,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { public class MachineVersionDialogVM : DialogViewVM { - public MachineVersionsProvider VersionsProvider { get; set; } + public ObservablesEntitiesAdapter Adapter { get; set; } public double Version { get; set; } @@ -44,16 +44,10 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public MachineVersionDialogVM() { - VersionsProvider = new MachineVersionsProvider(); + Adapter = ObservablesEntitiesAdapter.Instance; AcceptCommand = new RelayCommand(() => { - if (SelectedVersion == null) - { - Version = double.Parse(VersionsProvider.Text); - } - Accept(); - }); CancelCommand = new RelayCommand(Cancel); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml index 60aebef7f..f6c39a6cd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml @@ -36,18 +36,9 @@ - + Version - - - - , - - - - - - + Name diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs index 447332aeb..0b1128e51 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs @@ -10,6 +10,25 @@ namespace Tango.DAL.Observables public partial class Cat : ObservableEntity { + private String _name; + /// + /// Gets or sets the cat name. + /// + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private String _liquidtypeguid; /// /// Gets or sets the cat liquid type guid. @@ -29,21 +48,21 @@ namespace Tango.DAL.Observables } - private String _machineguid; + private String _rmlguid; /// - /// Gets or sets the cat machine guid. + /// Gets or sets the cat rml guid. /// - [EntityFieldName("MACHINE_GUID")] - public String MachineGuid + [EntityFieldName("RML_GUID")] + public String RmlGuid { get { - return _machineguid; + return _rmlguid; } set { - _machineguid = value; RaisePropertyChanged(nameof(MachineGuid)); + _rmlguid = value; RaisePropertyChanged(nameof(RmlGuid)); } } @@ -86,21 +105,21 @@ namespace Tango.DAL.Observables } - private Machine _machine; + private Rml _rml; /// - /// Gets or sets the cat machine. + /// Gets or sets the cat rml. /// - [EntityFieldName("MACHINE")] - public Machine Machine + [EntityFieldName("RML")] + public Rml Rml { get { - return _machine; + return _rml; } set { - _machine = value; RaisePropertyChanged(nameof(Machine)); + _rml = value; RaisePropertyChanged(nameof(Rml)); } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs index 44bb84ee4..2f2c8ded4 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs @@ -124,25 +124,6 @@ namespace Tango.DAL.Observables } - private ObservableCollection _cats; - /// - /// Gets or sets the machine cats. - /// - [EntityFieldName("CATS")] - public ObservableCollection Cats - { - get - { - return _cats; - } - - set - { - _cats = value; RaisePropertyChanged(nameof(Cats)); - } - - } - private Configuration _configuration; /// /// Gets or sets the machine configuration. @@ -262,8 +243,6 @@ namespace Tango.DAL.Observables private void Init() { - Cats = new ObservableCollection(); - MachinesConfigurations = new ObservableCollection(); MachinesEvents = new ObservableCollection(); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs index 8bc2cff3b..410ad7b8e 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs @@ -352,21 +352,21 @@ namespace Tango.DAL.Observables } - private ObservableCollection _rmlsprocessparameters; + private ObservableCollection _rmlsprocessparameterstables; /// - /// Gets or sets the processparameterstable rmls process parameters. + /// Gets or sets the processparameterstable rmls process parameters tables. /// - [EntityFieldName("RMLS_PROCESS_PARAMETERS")] - public ObservableCollection RmlsProcessParameters + [EntityFieldName("RMLS_PROCESS_PARAMETERS_TABLES")] + public ObservableCollection RmlsProcessParametersTables { get { - return _rmlsprocessparameters; + return _rmlsprocessparameterstables; } set { - _rmlsprocessparameters = value; RaisePropertyChanged(nameof(RmlsProcessParameters)); + _rmlsprocessparameterstables = value; RaisePropertyChanged(nameof(RmlsProcessParametersTables)); } } @@ -395,7 +395,7 @@ namespace Tango.DAL.Observables private void Init() { - RmlsProcessParameters = new ObservableCollection(); + RmlsProcessParametersTables = new ObservableCollection(); } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs index ab62b578d..8c97df116 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs @@ -390,6 +390,25 @@ namespace Tango.DAL.Observables } + private ObservableCollection _cats; + /// + /// Gets or sets the rml cats. + /// + [EntityFieldName("CATS")] + public ObservableCollection Cats + { + get + { + return _cats; + } + + set + { + _cats = value; RaisePropertyChanged(nameof(Cats)); + } + + } + private ObservableCollection _ccts; /// /// Gets or sets the rml ccts. @@ -561,21 +580,21 @@ namespace Tango.DAL.Observables } - private ObservableCollection _rmlsprocessparameters; + private ObservableCollection _rmlsprocessparameterstables; /// - /// Gets or sets the rml rmls process parameters. + /// Gets or sets the rml rmls process parameters tables. /// - [EntityFieldName("RMLS_PROCESS_PARAMETERS")] - public ObservableCollection RmlsProcessParameters + [EntityFieldName("RMLS_PROCESS_PARAMETERS_TABLES")] + public ObservableCollection RmlsProcessParametersTables { get { - return _rmlsprocessparameters; + return _rmlsprocessparameterstables; } set { - _rmlsprocessparameters = value; RaisePropertyChanged(nameof(RmlsProcessParameters)); + _rmlsprocessparameterstables = value; RaisePropertyChanged(nameof(RmlsProcessParametersTables)); } } @@ -604,11 +623,13 @@ namespace Tango.DAL.Observables private void Init() { + Cats = new ObservableCollection(); + Ccts = new ObservableCollection(); LiquidTypesRmls = new ObservableCollection(); - RmlsProcessParameters = new ObservableCollection(); + RmlsProcessParametersTables = new ObservableCollection(); } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs deleted file mode 100644 index 4dc3a23b4..000000000 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParameter.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using Tango.DAL.Remote.DB; - -namespace Tango.DAL.Observables -{ - [EntityFieldName("RMLS_PROCESS_PARAMETERS")] - public partial class RmlsProcessParameter : ObservableEntity - { - - private String _rmlguid; - /// - /// Gets or sets the rmlsprocessparameter rml guid. - /// - [EntityFieldName("RML_GUID")] - public String RmlGuid - { - get - { - return _rmlguid; - } - - set - { - _rmlguid = value; RaisePropertyChanged(nameof(RmlGuid)); - } - - } - - private String _processparametersguid; - /// - /// Gets or sets the rmlsprocessparameter process parameters guid. - /// - [EntityFieldName("PROCESS_PARAMETERS_GUID")] - public String ProcessParametersGuid - { - get - { - return _processparametersguid; - } - - set - { - _processparametersguid = value; RaisePropertyChanged(nameof(ProcessParametersGuid)); - } - - } - - private ProcessParametersTable _processparameterstables; - /// - /// Gets or sets the rmlsprocessparameter process parameters tables. - /// - [EntityFieldName("PROCESS_PARAMETERS_TABLES")] - public ProcessParametersTable ProcessParametersTables - { - get - { - return _processparameterstables; - } - - set - { - _processparameterstables = value; RaisePropertyChanged(nameof(ProcessParametersTables)); - } - - } - - private Rml _rml; - /// - /// Gets or sets the rmlsprocessparameter rml. - /// - [EntityFieldName("RML")] - public Rml Rml - { - get - { - return _rml; - } - - set - { - _rml = value; RaisePropertyChanged(nameof(Rml)); - } - - } - - /// - /// Initializes a new instance of the class. - /// - public RmlsProcessParameter() : base() - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// The entity. - public RmlsProcessParameter(RMLS_PROCESS_PARAMETERS entity) : base(entity) - { - Init(); - MapEntityToObservable(entity, this); - } - - /// - /// Initialize complex types. - /// - private void Init() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParametersTable.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParametersTable.cs new file mode 100644 index 000000000..5c912f3f0 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParametersTable.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Tango.DAL.Remote.DB; + +namespace Tango.DAL.Observables +{ + [EntityFieldName("RMLS_PROCESS_PARAMETERS_TABLES")] + public partial class RmlsProcessParametersTable : ObservableEntity + { + + private String _rmlguid; + /// + /// Gets or sets the rmlsprocessparameterstable rml guid. + /// + [EntityFieldName("RML_GUID")] + public String RmlGuid + { + get + { + return _rmlguid; + } + + set + { + _rmlguid = value; RaisePropertyChanged(nameof(RmlGuid)); + } + + } + + private String _processparameterstableguid; + /// + /// Gets or sets the rmlsprocessparameterstable process parameters table guid. + /// + [EntityFieldName("PROCESS_PARAMETERS_TABLE_GUID")] + public String ProcessParametersTableGuid + { + get + { + return _processparameterstableguid; + } + + set + { + _processparameterstableguid = value; RaisePropertyChanged(nameof(ProcessParametersTableGuid)); + } + + } + + private Int32 _tableindex; + /// + /// Gets or sets the rmlsprocessparameterstable table index. + /// + [EntityFieldName("TABLE_INDEX")] + public Int32 TableIndex + { + get + { + return _tableindex; + } + + set + { + _tableindex = value; RaisePropertyChanged(nameof(TableIndex)); + } + + } + + private ProcessParametersTable _processparameterstables; + /// + /// Gets or sets the rmlsprocessparameterstable process parameters tables. + /// + [EntityFieldName("PROCESS_PARAMETERS_TABLES")] + public ProcessParametersTable ProcessParametersTables + { + get + { + return _processparameterstables; + } + + set + { + _processparameterstables = value; RaisePropertyChanged(nameof(ProcessParametersTables)); + } + + } + + private Rml _rml; + /// + /// Gets or sets the rmlsprocessparameterstable rml. + /// + [EntityFieldName("RML")] + public Rml Rml + { + get + { + return _rml; + } + + set + { + _rml = value; RaisePropertyChanged(nameof(Rml)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public RmlsProcessParametersTable() : base() + { + Init(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The entity. + public RmlsProcessParametersTable(RMLS_PROCESS_PARAMETERS_TABLES entity) : base(entity) + { + Init(); + MapEntityToObservable(entity, this); + } + + /// + /// Initialize complex types. + /// + private void Init() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index b24640c79..b78ebcdbc 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -249,6 +249,8 @@ namespace Tango.DAL.Observables ProcessParametersTables = Context.PROCESS_PARAMETERS_TABLES.ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); + RmlsProcessParametersTables = Context.RMLS_PROCESS_PARAMETERS_TABLES.ToList().Select(x => ObservableEntity.CreateObservableFromEntity(x)).ToObservableCollection(); + InitCollectionSources(); //BindingOperations.EnableCollectionSynchronization(Machines, _syncLock); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs index 279d170d8..180ac394a 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs @@ -1302,38 +1302,38 @@ namespace Tango.DAL.Observables } - private ObservableCollection _rmlsprocessparameters; + private ObservableCollection _rmlsprocessparameterstables; /// - /// Gets or sets the RmlsProcessParameters. + /// Gets or sets the RmlsProcessParametersTables. /// - public ObservableCollection RmlsProcessParameters + public ObservableCollection RmlsProcessParametersTables { get { - return _rmlsprocessparameters; + return _rmlsprocessparameterstables; } set { - _rmlsprocessparameters = value; RaisePropertyChanged(nameof(RmlsProcessParameters)); + _rmlsprocessparameterstables = value; RaisePropertyChanged(nameof(RmlsProcessParametersTables)); } } - private ICollectionView _rmlsprocessparametersViewSource; + private ICollectionView _rmlsprocessparameterstablesViewSource; /// - /// Gets or sets the RmlsProcessParameters View Source. + /// Gets or sets the RmlsProcessParametersTables View Source. /// - public ICollectionView RmlsProcessParametersViewSource + public ICollectionView RmlsProcessParametersTablesViewSource { get { - return _rmlsprocessparametersViewSource; + return _rmlsprocessparameterstablesViewSource; } set { - _rmlsprocessparametersViewSource = value; RaisePropertyChanged(nameof(RmlsProcessParametersViewSource)); + _rmlsprocessparameterstablesViewSource = value; RaisePropertyChanged(nameof(RmlsProcessParametersTablesViewSource)); } } @@ -1596,7 +1596,7 @@ namespace Tango.DAL.Observables RmlsViewSource = CreateCollectionView(Rmls); - RmlsProcessParametersViewSource = CreateCollectionView(RmlsProcessParameters); + RmlsProcessParametersTablesViewSource = CreateCollectionView(RmlsProcessParametersTables); RolesViewSource = CreateCollectionView(Roles); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs deleted file mode 100644 index 53f27c9ba..000000000 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesGenerator.cs +++ /dev/null @@ -1,270 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data.Entity; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Tango.CodeGeneration; -using Tango.DAL.Remote.DB; -using Tango.Settings; -using Humanizer; - -namespace Tango.DAL.Observables -{ - /// - /// Generates observable entities code files. - /// - public class ObservablesGenerator - { - /// - /// Generates C# code files. - /// - /// The target path. - public void GenerateCSharp(String targetPath) - { - //Generate Entities... - foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) - { - EntityCodeFile codeFile = new EntityCodeFile(ObservableEntity.DalNameToStandardName(table.Name).SingularizeMVC()) - { - EntityName = table.Name.SingularizeMVC(), - TableName = table.Name, - }; - - foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3)) - { - EntityCodeFileField codeField = new EntityCodeFileField(); - codeField.FieldName = field.Name; - codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); - codeField.Description = field.Name.Replace("_", " ").ToLower(); - - - if (field.PropertyType.IsGenericType) - { - codeField.Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); - codeField.Construct = true; - } - else - { - if (field.PropertyType.IsClass && field.PropertyType != typeof(String)) - { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); - } - else - { - codeField.Type = field.PropertyType.Name; - } - } - codeFile.Fields.Add(codeField); - } - - String code = codeFile.GenerateCode(); - - String entitiesPath = Path.Combine(targetPath, "Entities"); - Directory.CreateDirectory(entitiesPath); - File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".cs"), code); - } - //Generate Entities... - - //Generate Enumerations... - using (RemoteDB db = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) - { - foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) - { - try - { - var a = tableProp.PropertyType.GenericTypeArguments.FirstOrDefault(); - var codeProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("CODE"); - var nameProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("NAME"); - var descriptionProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("DESCRIPTION"); - - if (codeProp != null && nameProp != null) - { - EnumerationFile enumFile = new EnumerationFile(); - enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); - - foreach (var row in tableProp.GetValue(db) as IEnumerable) - { - EnumerationField field = new EnumerationField(); - field.Name = nameProp.GetValue(row).ToString().Replace(" ", ""); - field.Value = (int)codeProp.GetValue(row); - - if (descriptionProp != null) - { - field.Description = descriptionProp.GetValue(row).ToString(); - } - else - { - field.Description = nameProp.GetValue(row).ToString(); - } - enumFile.Fields.Add(field); - } - - String enumerationsPath = Path.Combine(targetPath, "Enumerations"); - Directory.CreateDirectory(enumerationsPath); - String code = enumFile.GenerateCode(); - File.WriteAllText(Path.Combine(enumerationsPath, enumFile.Name + ".cs"), code); - } - } - catch { } - } - } - //Generate Enumerations... - - //Generate Observables Adapter Extensions... - ObservablesAdapterFile adapterFile = new ObservablesAdapterFile(); - adapterFile.Name = nameof(ObservablesEntitiesAdapter); - - foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) - { - adapterFile.Properties.Add(new Property() - { - Name = ObservableEntity.DalNameToStandardName(table.Name), - Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), - }); - } - - String adapterCode = adapterFile.GenerateCode(); - File.WriteAllText(Path.Combine(targetPath, "ObservablesEntitiesAdapterExtension.cs"), adapterCode); - //Generate Observables Adapter Extensions... - } - - /// - /// Generates Java code files. - /// - /// The target path. - public void GenerateJava(String targetPath) - { - //Generate Entities... - foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) - { - EntityCodeFileJava codeFile = new EntityCodeFileJava(ObservableEntity.DalNameToStandardName(table.Name).Singularize(false)) - { - EntityName = table.Name.Singularize(false), - TableName = table.Name, - }; - - - - foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => !x.Name.Contains("GUID"))) - { - EntityCodeFileField codeField = new EntityCodeFileField(); - codeField.FieldName = field.Name; - codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); - codeField.Description = FirstCharacterToLower(ObservableEntity.DalNameToStandardName(field.Name)); - - - if (field.PropertyType.IsGenericType) - { - continue; - } - else - { - if (field.PropertyType.IsClass && field.PropertyType != typeof(String) && field.PropertyType != typeof(Byte[])) - { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).Singularize(false); - codeField.Construct = true; - } - else if (field.PropertyType == typeof(Byte[])) - { - codeField.Type = field.PropertyType.Name.ToLower(); - } - else - { - codeField.Type = field.PropertyType.Name == "Int32" ? "int" : field.PropertyType.Name; - } - } - codeFile.Fields.Add(codeField); - } - - codeFile.IndentResult = false; - String code = codeFile.GenerateCode(); - - String entitiesPath = Path.Combine(targetPath, "entities"); - Directory.CreateDirectory(entitiesPath); - File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".java"), code); - } - //Generate Entities... - - //Generate Enumerations... - using (RemoteDB db = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) - { - foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) - { - try - { - var a = tableProp.PropertyType.GenericTypeArguments.FirstOrDefault(); - var codeProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("CODE"); - var nameProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("NAME"); - var descriptionProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("DESCRIPTION"); - - if (codeProp != null && nameProp != null) - { - EnumerationFileJava enumFile = new EnumerationFileJava(); - enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); - - foreach (var row in tableProp.GetValue(db) as IEnumerable) - { - EnumerationField field = new EnumerationField(); - field.Name = nameProp.GetValue(row).ToString().Replace(" ", ""); - field.Value = (int)codeProp.GetValue(row); - - if (descriptionProp != null) - { - field.Description = descriptionProp.GetValue(row).ToString(); - } - else - { - field.Description = nameProp.GetValue(row).ToString(); - } - enumFile.Fields.Add(field); - } - - String enumerationsPath = Path.Combine(targetPath, "enumerations"); - Directory.CreateDirectory(enumerationsPath); - String code = enumFile.GenerateCode(); - File.WriteAllText(Path.Combine(enumerationsPath, enumFile.Name + ".java"), code); - } - } - catch { } - } - } - //Generate Enumerations... - - //Generate DAO... - TangoDAOJavaFile daoFile = new TangoDAOJavaFile(); - daoFile.Name = "TangoDAO"; - - foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) - { - daoFile.Entities.Add(new TangoDAOJavaFile.TangoDAOEntity() - { - Name = ObservableEntity.DalNameToStandardName(table.Name).Singularize(false), - TableName = ObservableEntity.DalNameToStandardName(table.Name), - }); - } - - String daoCode = daoFile.GenerateCode(); - String daoFolder = Path.Combine(targetPath, "dao"); - Directory.CreateDirectory(daoFolder); - File.WriteAllText(Path.Combine(daoFolder, "TangoDAO.java"), daoCode); - //Generate DAO... - } - - /// - /// Lower case the first character of a string. - /// - /// The string. - /// - private static string FirstCharacterToLower(string str) - { - if (String.IsNullOrEmpty(str) || Char.IsLower(str, 0)) - return str; - - return Char.ToLowerInvariant(str[0]) + str.Substring(1); - } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj index 40730e3a1..1918f8551 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj +++ b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj @@ -69,7 +69,7 @@ - + @@ -93,7 +93,6 @@ - @@ -154,10 +153,10 @@ - - + "$(TargetDir)dbobgen.exe" "$(SolutionDir)Tango.DAL.Observables" -csharp - "$(TargetDir)dbobgen.exe" "$(SolutionDir)Tango.DAL.Observables" -csharp + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/CAT.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/CAT.cs index a9dafc33a..f016853a4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/CAT.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/CAT.cs @@ -17,11 +17,12 @@ namespace Tango.DAL.Remote.DB public int ID { get; set; } public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } + public string NAME { get; set; } public string LIQUID_TYPE_GUID { get; set; } - public string MACHINE_GUID { get; set; } + public string RML_GUID { get; set; } public byte[] DATA { get; set; } public virtual LIQUID_TYPES LIQUID_TYPES { get; set; } - public virtual MACHINE MACHINE { get; set; } + public virtual RML RML { 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 8963261a1..367005cf4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs @@ -17,7 +17,6 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public MACHINE() { - this.CATS = new HashSet(); this.MACHINES_CONFIGURATIONS = new HashSet(); this.MACHINES_EVENTS = new HashSet(); } @@ -32,8 +31,6 @@ namespace Tango.DAL.Remote.DB public string MACHINE_VERSION_GUID { get; set; } public string CONFIGURATION_GUID { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection CATS { get; set; } public virtual CONFIGURATION CONFIGURATION { get; set; } public virtual MACHINE_VERSIONS MACHINE_VERSIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 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 92c11111b..edd04034f 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 @@ -17,7 +17,7 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public PROCESS_PARAMETERS_TABLES() { - this.RMLS_PROCESS_PARAMETERS = new HashSet(); + this.RMLS_PROCESS_PARAMETERS_TABLES = new HashSet(); } public int ID { get; set; } @@ -43,6 +43,6 @@ namespace Tango.DAL.Remote.DB public double LUBRICATION_NL_PER_CM { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection RMLS_PROCESS_PARAMETERS { get; set; } + public virtual ICollection RMLS_PROCESS_PARAMETERS_TABLES { 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 1fd04214b..253270c8c 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -17,9 +17,10 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public RML() { + this.CATS = new HashSet(); this.CCTS = new HashSet(); this.LIQUID_TYPES_RMLS = new HashSet(); - this.RMLS_PROCESS_PARAMETERS = new HashSet(); + this.RMLS_PROCESS_PARAMETERS_TABLES = new HashSet(); } public int ID { get; set; } @@ -46,6 +47,8 @@ namespace Tango.DAL.Remote.DB public double ELONGATION_AT_BREAK_PERCENTAGE { get; set; } public double ESTIMATED_THREAD_DIAMETER { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CATS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection CCTS { get; set; } public virtual FIBER_SHAPES FIBER_SHAPES { get; set; } @@ -58,6 +61,6 @@ namespace Tango.DAL.Remote.DB 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 RMLS_PROCESS_PARAMETERS { get; set; } + public virtual ICollection RMLS_PROCESS_PARAMETERS_TABLES { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs deleted file mode 100644 index cfab486af..000000000 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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_PROCESS_PARAMETERS - { - public int ID { get; set; } - public string GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public string RML_GUID { get; set; } - public string PROCESS_PARAMETERS_GUID { get; set; } - - public virtual PROCESS_PARAMETERS_TABLES PROCESS_PARAMETERS_TABLES { get; set; } - public virtual RML RML { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS_TABLES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS_TABLES.cs new file mode 100644 index 000000000..a6582b7f8 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS_TABLES.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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_PROCESS_PARAMETERS_TABLES + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string RML_GUID { get; set; } + public string PROCESS_PARAMETERS_TABLE_GUID { get; set; } + public int TABLE_INDEX { get; set; } + + public virtual PROCESS_PARAMETERS_TABLES PROCESS_PARAMETERS_TABLES { get; set; } + public virtual RML RML { 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 767f7020b..4ba24207f 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -61,7 +61,7 @@ namespace Tango.DAL.Remote.DB public virtual DbSet PERMISSIONS { get; set; } public virtual DbSet PROCESS_PARAMETERS_TABLES { get; set; } public virtual DbSet RMLS { get; set; } - public virtual DbSet RMLS_PROCESS_PARAMETERS { get; set; } + public virtual DbSet RMLS_PROCESS_PARAMETERS_TABLES { get; set; } public virtual DbSet ROLES { get; set; } public virtual DbSet ROLES_PERMISSIONS { get; set; } public virtual DbSet SYNC_CONFIGURATIONS { 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 714147555..8b17998d2 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -89,8 +89,9 @@ + - + @@ -446,7 +447,7 @@ - + @@ -454,7 +455,8 @@ - + + @@ -510,7 +512,7 @@ - + @@ -522,17 +524,15 @@ - - - - + + - + - + @@ -974,13 +974,13 @@ - + - - + + @@ -988,12 +988,12 @@ - + - + @@ -1121,18 +1121,18 @@ - + - + - - + + @@ -1277,11 +1277,11 @@ - + - + @@ -1353,7 +1353,7 @@ - + @@ -1391,12 +1391,12 @@ - + - - + + @@ -1525,11 +1525,11 @@ - + - + @@ -1636,11 +1636,12 @@ + - + - - + + @@ -1839,7 +1840,7 @@ - + @@ -1882,7 +1883,6 @@ - @@ -2024,7 +2024,7 @@ - + @@ -2053,6 +2053,7 @@ + @@ -2062,9 +2063,9 @@ - + - + @@ -2072,9 +2073,10 @@ - - - + + + + @@ -2239,7 +2241,7 @@ - + @@ -2251,17 +2253,15 @@ - - - - + + - + - + @@ -2655,13 +2655,13 @@ - + - - + + @@ -2669,12 +2669,12 @@ - + - + @@ -2809,8 +2809,9 @@ - + + @@ -3198,10 +3199,11 @@ - - - - + + + + + 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 50edc44ea..5b12d9aa8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,48 +5,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -55,8 +55,8 @@ - - + + 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 3ff95ff97..8470d72a4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -188,7 +188,7 @@ RemoteADO.tt - + RemoteADO.tt diff --git a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs index 0b4731ddf..af10f9637 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs +++ b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs @@ -68,8 +68,8 @@ namespace Tango.Synchronization.Remote var local_users = _localDB.USERS.ToList(); LogManager.Log("Querying all local users roles..."); var local_users_roles = _localDB.USERS_ROLES.ToList(); - LogManager.Log("Querying all CATS..."); - var local_cats = _localDB.CATS.ToList(); + //LogManager.Log("Querying all CATS..."); + //var local_cats = _localDB.CATS.ToList(); LogManager.Log("Loading SQL Server database to memory..."); @@ -125,9 +125,9 @@ namespace Tango.Synchronization.Remote guids = remote_ids_packs.Select(x => x.CARTRIDGE_TYPE_GUID).ToList(); var remote_cartridges_types = _remoteDB.CARTRIDGE_TYPES.Where(x => guids.Contains(x.GUID)).ToList(); - LogManager.Log("Querying all remote CATS..."); - guids = remote_machines.Select(x => x.GUID).ToList(); - var remote_cats = _remoteDB.CATS.Where(x => guids.Contains(x.MACHINE_GUID)).ToList(); + //LogManager.Log("Querying all remote CATS..."); + //guids = remote_machines.Select(x => x.GUID).ToList(); + //var remote_cats = _remoteDB.CATS.Where(x => guids.Contains(x.MACHINE_GUID)).ToList(); foreach (var config in _remoteDB.SYNC_CONFIGURATIONS.Where(x => (SyncConfiguration)x.SYNC_TYPE == SyncConfiguration.OverwriteLocal)) @@ -166,8 +166,8 @@ namespace Tango.Synchronization.Remote LogManager.Log("Comparing users roles"); CompareCollections(remote_users_roles, local_users_roles, _remoteDB.USERS_ROLES, _localDB.USERS_ROLES); - LogManager.Log("Comparing cats"); - CompareCollections(remote_cats, local_cats, _remoteDB.CATS, _localDB.CATS); + //LogManager.Log("Comparing cats"); + //CompareCollections(remote_cats, local_cats, _remoteDB.CATS, _localDB.CATS); LogManager.Log("Comparison done!"); diff --git a/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs index a5f62b4a4..159fbc930 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/CodeGeneration_TST.cs @@ -5,6 +5,7 @@ using Tango.DAL.Observables; using Tango.Settings; using System.Linq; using System.Collections.Generic; +using Tango.DBObservablesGenerator.CLI; namespace Tango.UnitTesting { diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index a8274bc5f..0130e3811 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -130,6 +130,10 @@ {7ada4e86-cad7-4968-a210-3a8a9e5153ab} Tango.Synchronization + + {ebb7cb9f-6af2-456b-a5dd-1b136b605d90} + Tango.DBObservablesGenerator.CLI + diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs new file mode 100644 index 000000000..33f2d81ff --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -0,0 +1,271 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data.Entity; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Tango.CodeGeneration; +using Tango.DAL.Remote.DB; +using Tango.Settings; +using Humanizer; +using Tango.DAL.Observables; + +namespace Tango.DBObservablesGenerator.CLI +{ + /// + /// Generates observable entities code files. + /// + public class ObservablesGenerator + { + /// + /// Generates C# code files. + /// + /// The target path. + public void GenerateCSharp(String targetPath) + { + //Generate Entities... + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + EntityCodeFile codeFile = new EntityCodeFile(ObservableEntity.DalNameToStandardName(table.Name).SingularizeMVC()) + { + EntityName = table.Name.SingularizeMVC(), + TableName = table.Name, + }; + + foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3)) + { + EntityCodeFileField codeField = new EntityCodeFileField(); + codeField.FieldName = field.Name; + codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); + codeField.Description = field.Name.Replace("_", " ").ToLower(); + + + if (field.PropertyType.IsGenericType) + { + codeField.Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); + codeField.Construct = true; + } + else + { + if (field.PropertyType.IsClass && field.PropertyType != typeof(String)) + { + codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); + } + else + { + codeField.Type = field.PropertyType.Name; + } + } + codeFile.Fields.Add(codeField); + } + + String code = codeFile.GenerateCode(); + + String entitiesPath = Path.Combine(targetPath, "Entities"); + Directory.CreateDirectory(entitiesPath); + File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".cs"), code); + } + //Generate Entities... + + //Generate Enumerations... + using (RemoteDB db = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) + { + foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) + { + try + { + var a = tableProp.PropertyType.GenericTypeArguments.FirstOrDefault(); + var codeProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("CODE"); + var nameProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("NAME"); + var descriptionProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("DESCRIPTION"); + + if (codeProp != null && nameProp != null) + { + EnumerationFile enumFile = new EnumerationFile(); + enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + + foreach (var row in tableProp.GetValue(db) as IEnumerable) + { + EnumerationField field = new EnumerationField(); + field.Name = nameProp.GetValue(row).ToString().Replace(" ", ""); + field.Value = (int)codeProp.GetValue(row); + + if (descriptionProp != null) + { + field.Description = descriptionProp.GetValue(row).ToString(); + } + else + { + field.Description = nameProp.GetValue(row).ToString(); + } + enumFile.Fields.Add(field); + } + + String enumerationsPath = Path.Combine(targetPath, "Enumerations"); + Directory.CreateDirectory(enumerationsPath); + String code = enumFile.GenerateCode(); + File.WriteAllText(Path.Combine(enumerationsPath, enumFile.Name + ".cs"), code); + } + } + catch { } + } + } + //Generate Enumerations... + + //Generate Observables Adapter Extensions... + ObservablesAdapterFile adapterFile = new ObservablesAdapterFile(); + adapterFile.Name = nameof(ObservablesEntitiesAdapter); + + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + adapterFile.Properties.Add(new Property() + { + Name = ObservableEntity.DalNameToStandardName(table.Name), + Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), + }); + } + + String adapterCode = adapterFile.GenerateCode(); + File.WriteAllText(Path.Combine(targetPath, "ObservablesEntitiesAdapterExtension.cs"), adapterCode); + //Generate Observables Adapter Extensions... + } + + /// + /// Generates Java code files. + /// + /// The target path. + public void GenerateJava(String targetPath) + { + //Generate Entities... + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + EntityCodeFileJava codeFile = new EntityCodeFileJava(ObservableEntity.DalNameToStandardName(table.Name).Singularize(false)) + { + EntityName = table.Name.Singularize(false), + TableName = table.Name, + }; + + + + foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => !x.Name.Contains("GUID"))) + { + EntityCodeFileField codeField = new EntityCodeFileField(); + codeField.FieldName = field.Name; + codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); + codeField.Description = FirstCharacterToLower(ObservableEntity.DalNameToStandardName(field.Name)); + + + if (field.PropertyType.IsGenericType) + { + continue; + } + else + { + if (field.PropertyType.IsClass && field.PropertyType != typeof(String) && field.PropertyType != typeof(Byte[])) + { + codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).Singularize(false); + codeField.Construct = true; + } + else if (field.PropertyType == typeof(Byte[])) + { + codeField.Type = field.PropertyType.Name.ToLower(); + } + else + { + codeField.Type = field.PropertyType.Name == "Int32" ? "int" : field.PropertyType.Name; + } + } + codeFile.Fields.Add(codeField); + } + + codeFile.IndentResult = false; + String code = codeFile.GenerateCode(); + + String entitiesPath = Path.Combine(targetPath, "entities"); + Directory.CreateDirectory(entitiesPath); + File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".java"), code); + } + //Generate Entities... + + //Generate Enumerations... + using (RemoteDB db = new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) + { + foreach (var tableProp in db.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsGenericType)) + { + try + { + var a = tableProp.PropertyType.GenericTypeArguments.FirstOrDefault(); + var codeProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("CODE"); + var nameProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("NAME"); + var descriptionProp = tableProp.PropertyType.GenericTypeArguments.First().GetProperty("DESCRIPTION"); + + if (codeProp != null && nameProp != null) + { + EnumerationFileJava enumFile = new EnumerationFileJava(); + enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + + foreach (var row in tableProp.GetValue(db) as IEnumerable) + { + EnumerationField field = new EnumerationField(); + field.Name = nameProp.GetValue(row).ToString().Replace(" ", ""); + field.Value = (int)codeProp.GetValue(row); + + if (descriptionProp != null) + { + field.Description = descriptionProp.GetValue(row).ToString(); + } + else + { + field.Description = nameProp.GetValue(row).ToString(); + } + enumFile.Fields.Add(field); + } + + String enumerationsPath = Path.Combine(targetPath, "enumerations"); + Directory.CreateDirectory(enumerationsPath); + String code = enumFile.GenerateCode(); + File.WriteAllText(Path.Combine(enumerationsPath, enumFile.Name + ".java"), code); + } + } + catch { } + } + } + //Generate Enumerations... + + //Generate DAO... + TangoDAOJavaFile daoFile = new TangoDAOJavaFile(); + daoFile.Name = "TangoDAO"; + + foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) + { + daoFile.Entities.Add(new TangoDAOJavaFile.TangoDAOEntity() + { + Name = ObservableEntity.DalNameToStandardName(table.Name).Singularize(false), + TableName = ObservableEntity.DalNameToStandardName(table.Name), + }); + } + + String daoCode = daoFile.GenerateCode(); + String daoFolder = Path.Combine(targetPath, "dao"); + Directory.CreateDirectory(daoFolder); + File.WriteAllText(Path.Combine(daoFolder, "TangoDAO.java"), daoCode); + //Generate DAO... + } + + /// + /// Lower case the first character of a string. + /// + /// The string. + /// + private static string FirstCharacterToLower(string str) + { + if (String.IsNullOrEmpty(str) || Char.IsLower(str, 0)) + return str; + + return Char.ToLowerInvariant(str[0]) + str.Substring(1); + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs index 1b9b4c96a..3ec883692 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Program.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Helpers; -using Tango.DAL.Observables; namespace Tango.DBObservablesGenerator.CLI { diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj index f996d017d..fa573208b 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj @@ -38,6 +38,9 @@ ..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + + ..\..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll + @@ -52,6 +55,7 @@ GlobalVersionInfo.cs + @@ -60,6 +64,10 @@ + + {caedae94-11ed-473c-888a-268a6d38cd20} + Tango.CodeGeneration + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core @@ -68,6 +76,14 @@ {0ecd6da8-7aa6-48d9-8b65-279d176ad9af} Tango.DAL.Observables + + {38197109-8610-4d3f-92b9-16d48df94d7c} + Tango.DAL.Remote + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config index 9256e1591..5148e8474 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config @@ -1,4 +1,46 @@  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.3.1 From 8ae0f3da19c537eff30e19a1fe99cce51b3116f1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 23 Jan 2018 17:58:59 +0200 Subject: A lot of work on Developer Module and Jobs related DB tables. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Tango.MachineStudio.DB.csproj | 14 +- .../Tango.MachineStudio.DB/ViewModelLocator.cs | 6 +- .../ProcessParametersTablesGroupsViewVM.cs | 33 + .../RmlsProcessParametersTablesViewVM.cs | 18 - .../Views/DBViews/ProcessParametersTableView.xaml | 8 +- .../DBViews/ProcessParametersTablesGroupView.xaml | 31 + .../ProcessParametersTablesGroupView.xaml.cs | 28 + .../DBViews/ProcessParametersTablesGroupsView.xaml | 32 + .../ProcessParametersTablesGroupsView.xaml.cs | 30 + .../Views/DBViews/ProcessParametersTablesView.xaml | 4 +- .../DBViews/RmlsProcessParametersTableView.xaml | 31 - .../DBViews/RmlsProcessParametersTableView.xaml.cs | 28 - .../DBViews/RmlsProcessParametersTablesView.xaml | 26 - .../RmlsProcessParametersTablesView.xaml.cs | 30 - .../ViewModels/MainViewVM.cs | 120 +++- .../Views/MainView.xaml | 100 +-- .../Notifications/INotificationProvider.cs | 9 + .../Notifications/DefaultNotificationProvider.cs | 33 +- .../Notifications/TextInputBoxWindow.xaml | 44 ++ .../Notifications/TextInputBoxWindow.xaml.cs | 99 +++ .../Tango.MachineStudio.UI.csproj | 7 + .../Tango.DAL.Observables/Entities/BrushStop.cs | 342 ++++++++++ .../Tango.DAL.Observables/Entities/ColorSpace.cs | 117 ++++ .../Tango.DAL.Observables/Entities/Job.cs | 290 +++++++++ .../Tango.DAL.Observables/Entities/JobRun.cs | 133 ++++ .../Tango.DAL.Observables/Entities/Machine.cs | 21 + .../Entities/ProcessParametersTable.cs | 39 +- .../Entities/ProcessParametersTablesGroup.cs | 155 +++++ .../Tango.DAL.Observables/Entities/Rml.cs | 35 +- .../Entities/RmlsProcessParametersTable.cs | 133 ---- .../Tango.DAL.Observables/Entities/Segment.cs | 136 ++++ .../Entities/WindingMethod.cs | 117 ++++ .../Enumerations/ColorSpaces.cs | 12 + .../Enumerations/WindingMethods.cs | 12 + .../ProcessParametersTablesGroupExtensions.cs | 27 + .../ObservablesEntitiesAdapter.cs | 9 +- .../ObservablesEntitiesAdapterExtension.cs | 272 +++++++- .../Tango.DAL.Observables.csproj | 9 +- .../Tango.DAL.Remote/DB/BRUSH_STOPS.cs | 38 ++ .../Tango.DAL.Remote/DB/COLOR_SPACES.cs | 33 + Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs | 44 ++ .../Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs | 27 + .../Visual_Studio/Tango.DAL.Remote/DB/MACHINE.cs | 3 + .../DB/PROCESS_PARAMETERS_TABLES.cs | 13 +- .../DB/PROCESS_PARAMETERS_TABLES_GROUPS.cs | 35 + Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 7 +- .../DB/RMLS_PROCESS_PARAMETERS_TABLES.cs | 27 - .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 8 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 716 ++++++++++++++++++--- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 101 +-- .../Visual_Studio/Tango.DAL.Remote/DB/SEGMENT.cs | 34 + .../Tango.DAL.Remote/DB/WINDING_METHODS.cs | 33 + .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 24 +- 55 files changed, 3162 insertions(+), 571 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesGroupsViewVM.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs delete mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/RmlsProcessParametersTable.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ColorSpaces.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Enumerations/WindingMethods.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ProcessParametersTablesGroupExtensions.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES_GROUPS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/RMLS_PROCESS_PARAMETERS_TABLES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/SEGMENT.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/WINDING_METHODS.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 534511002..8c88f40a2 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 119576f0e..3eb7381ae 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index bb3084207..54c29f7f3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -129,7 +129,7 @@ - + @@ -142,11 +142,11 @@ ActionTypeView.xaml - - RmlsProcessParametersTablesView.xaml + + ProcessParametersTablesGroupsView.xaml - - RmlsProcessParametersTableView.xaml + + ProcessParametersTablesGroupView.xaml ProcessParametersTablesView.xaml @@ -378,11 +378,11 @@ MSBuild:Compile Designer - + MSBuild:Compile Designer - + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs index 5fe386749..8a7afc067 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -60,7 +60,7 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); - SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); } public static MainViewVM MainViewVM @@ -351,11 +351,11 @@ namespace Tango.MachineStudio.DB } } - public static RmlsProcessParametersTablesViewVM RmlsProcessParametersTablesViewVM + public static ProcessParametersTablesGroupsViewVM ProcessParametersTablesGroupsViewVM { get { - return ServiceLocator.Current.GetInstance(); + return ServiceLocator.Current.GetInstance(); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesGroupsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesGroupsViewVM.cs new file mode 100644 index 000000000..620762a6f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ProcessParametersTablesGroupsViewVM.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class ProcessParametersTablesGroupsViewVM : DbTableViewModel + { + public ProcessParametersTablesGroupsViewVM(INotificationProvider notification) : base(notification) + { + + } + + protected override void OnBeforeEntitySave(DialogOpenMode mode, ProcessParametersTablesGroup entity) + { + entity.SaveDate = DateTime.UtcNow; + + if (entity.Rml != null && entity.Active) + { + foreach (var group in entity.Rml.ProcessParametersTablesGroups.Where(x => x != entity)) + { + group.Active = false; + } + } + + base.OnBeforeEntitySave(mode, entity); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs deleted file mode 100644 index 4ae1f063f..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.DAL.Observables; -using Tango.MachineStudio.Common.Notifications; - -namespace Tango.MachineStudio.DB.ViewModels -{ - public class RmlsProcessParametersTablesViewVM : DbTableViewModel - { - public RmlsProcessParametersTablesViewVM(INotificationProvider notification) : base(notification) - { - - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml index e9b7c31af..1e3933ce0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml @@ -22,8 +22,12 @@ + + + + @@ -54,10 +58,6 @@ - - - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml new file mode 100644 index 000000000..135d66eac --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.xaml.cs new file mode 100644 index 000000000..490453f2a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupView.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.DB.Views.DBViews +{ + /// + /// Interaction logic for UserView.xaml + /// + public partial class ProcessParametersTablesGroupView : UserControl + { + public ProcessParametersTablesGroupView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml new file mode 100644 index 000000000..0eee2aa77 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml.cs new file mode 100644 index 000000000..67072d554 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml.cs @@ -0,0 +1,30 @@ +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; +using Tango.MachineStudio.DB.CustomAttributes; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// + /// Interaction logic for UsersView.xaml + /// + [DBView] + public partial class ProcessParametersTablesGroupsView : UserControl + { + public ProcessParametersTablesGroupsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml index 2648b78a0..d9ad83f68 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml @@ -21,7 +21,9 @@ + + @@ -37,8 +39,6 @@ - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml deleted file mode 100644 index 767b39f29..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs deleted file mode 100644 index 713a46204..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.DB.Views.DBViews -{ - /// - /// Interaction logic for UserView.xaml - /// - public partial class RmlsProcessParametersTableView : UserControl - { - public RmlsProcessParametersTableView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml deleted file mode 100644 index d599c64a3..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs deleted file mode 100644 index c4ee7e66d..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs +++ /dev/null @@ -1,30 +0,0 @@ -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; -using Tango.MachineStudio.DB.CustomAttributes; - -namespace Tango.MachineStudio.DB.Views.DBViews -{ - /// - /// Interaction logic for UsersView.xaml - /// - [DBView] - public partial class RmlsProcessParametersTablesView : UserControl - { - public RmlsProcessParametersTablesView() - { - InitializeComponent(); - } - } -} 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 621ce550b..34a4ff470 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 @@ -7,6 +7,7 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.Common.StudioApplication; using Tango.SharedUI; @@ -14,6 +15,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { public class MainViewVM : ViewModel { + private INotificationProvider _notification; + public IStudioApplicationManager ApplicationManager { get; set; } public ObservablesEntitiesAdapter Adapter { get; set; } @@ -34,18 +37,43 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _liquidTypesRmls = value; RaisePropertyChangedAuto(); } } - private ObservableCollection _rmlProcessParametersTables; + private ProcessParametersTablesGroup _rmlProcessParametersTablesGroup; + + public ProcessParametersTablesGroup RmlProcessParametersTableGroup + { + get { return _rmlProcessParametersTablesGroup; } + set { _rmlProcessParametersTablesGroup = value; RaisePropertyChangedAuto(); } + } + + private ProcessParametersTablesGroup _selectedGroupHistory; - public ObservableCollection RmlProcessParametersTables + public ProcessParametersTablesGroup SelectedGroupHistory { - get { return _rmlProcessParametersTables; } - set { _rmlProcessParametersTables = value; RaisePropertyChangedAuto(); } + get { return _selectedGroupHistory; } + set { _selectedGroupHistory = value; RaisePropertyChangedAuto(); OnSelectedGroupHistoryChanged(); } } + private void OnSelectedGroupHistoryChanged() + { + if (SelectedGroupHistory != null) + { + RmlProcessParametersTableGroup = SelectedGroupHistory.CloneGroup(); + } + } - private DBViewContextWrapper _selectedRML; + private ObservableCollection _groupsHistory; - public DBViewContextWrapper SelectedRML + public ObservableCollection GroupsHistory + { + get { return _groupsHistory; } + set { _groupsHistory = value; RaisePropertyChangedAuto(); } + } + + + + private Rml _selectedRML; + + public Rml SelectedRML { get { return _selectedRML; } set { _selectedRML = value; RaisePropertyChangedAuto(); InvalidateLiquidFactorsAndProcessTables(); InvalidateRelayCommands(); } @@ -66,24 +94,48 @@ namespace Tango.MachineStudio.Developer.ViewModels public RelayCommand ToggleSideBarCommand { get; set; } + public RelayCommand SaveProcessParametersCommand { get; set; } + + public RelayCommand SaveLiquidFactorsCommand { get; set; } + public MainViewVM() { IsSideBarOpened = true; } [PreferredConstructor] - public MainViewVM(IStudioApplicationManager applicationManager) + public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider) { + _notification = notificationProvider; Adapter = ObservablesEntitiesAdapter.Instance; EditMachineCommand = new RelayCommand(EditMachine, (x) => SelectedMachine != null); ApplicationManager = applicationManager; EditRMLCommand = new RelayCommand(EditRML, (x) => SelectedRML != null); ToggleSideBarCommand = new RelayCommand(() => IsSideBarOpened = !IsSideBarOpened); + SaveProcessParametersCommand = new RelayCommand(SaveProcessParameters); + SaveLiquidFactorsCommand = new RelayCommand(SaveLiquidFactors); + } + + private async void SaveLiquidFactors() + { + if (SelectedRML != null) + { + using (_notification.PushTaskItem("Saving Liquid Factors...")) + { + String machineGuid = SelectedMachine.Guid; + String rmlGuid = SelectedRML.Guid; + + await SelectedRML.SaveAsync(); + + SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); + SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + } + } } private void EditRML() { - ApplicationManager.RequestModule("Data Base", SelectedRML.EditEntity); + ApplicationManager.RequestModule("Data Base", SelectedRML); } private void EditMachine() @@ -96,12 +148,60 @@ namespace Tango.MachineStudio.Developer.ViewModels InvalidateLiquidFactorsAndProcessTables(); } + private async void SaveProcessParameters() + { + var response = _notification.ShowTextInput("Enter Group Name", "Group Name"); + + if (response == null) return; + + using (_notification.PushTaskItem("Saving Parameters Group...")) + { + ProcessParametersTablesGroup group = new ProcessParametersTablesGroup(); + + List tables = new List(); + foreach (var table in RmlProcessParametersTableGroup.ProcessParametersTables) + { + var newTable = table.CloneEntity(); + newTable.ProcessParametersTablesGroups = group; + tables.Add(newTable); + } + + group.Active = true; + group.ProcessParametersTables = tables.ToObservableCollection(); + group.Rml = SelectedRML; + group.Name = response; + group.SaveDate = DateTime.UtcNow; + + foreach (var g in SelectedRML.ProcessParametersTablesGroups) + { + g.Active = false; + } + + String machineGuid = SelectedMachine.Guid; + String rmlGuid = SelectedRML.Guid; + + SelectedRML.ProcessParametersTablesGroups.Add(group); + await SelectedRML.SaveAsync(); + + SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); + SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + } + } + private void InvalidateLiquidFactorsAndProcessTables() { if (SelectedRML != null && SelectedMachine != null) { - LiquidTypesRmls = SelectedMachine.Configuration.IdsPacks.OrderBy(x => x.PackIndex).Select(x => x.LiquidTypes).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.EditEntity.Guid).ToList(); - RmlProcessParametersTables = SelectedRML.EditEntity.RmlsProcessParametersTables.ToObservableCollection(); + LiquidTypesRmls = SelectedMachine.Configuration.IdsPacks.OrderBy(x => x.PackIndex).Select(x => x.LiquidTypes).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); + RmlProcessParametersTableGroup = SelectedRML.ProcessParametersTablesGroups.SingleOrDefault(x => x.Active); + + if (RmlProcessParametersTableGroup != null) + { + RmlProcessParametersTableGroup = RmlProcessParametersTableGroup.CloneGroup(); + RmlProcessParametersTableGroup.ProcessParametersTables = RmlProcessParametersTableGroup.ProcessParametersTables.OrderBy(x => x.TableIndex).ToObservableCollection(); + } + + GroupsHistory = SelectedRML.ProcessParametersTablesGroups.OrderByDescending(x => x.SaveDate).OrderBy(x => !x.Active).ToObservableCollection(); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index d6cba4914..fa6cbbd76 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -77,18 +77,45 @@ - - + + + + + HISTORY + + + + + + + + + + + + + + + + + - + - + - - + + Dyeing Speed: - + Min Ink Uptake: - + Mixer Temp: - + Head Zone1 Temp: - + Head Zone2 Temp: - + Head Zone3 Temp: - + Head Air Flow: - + Feeder Tension: - + Puller Tension: - + Dryer Buffer Length: - + Dryer Zone1 Temp: - + Dryer Zone2 Temp: - + Dryer Zone3 Temp: - + @@ -204,28 +231,14 @@ Dryer Air Flow: - + Winder Tension: - - - - - - - Lubrication NL/CM: - - - - - - - Lubrication: - + @@ -234,10 +247,14 @@ + + + + - + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs index 6d08a10e0..70e127b6c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs @@ -62,7 +62,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views { SetHighlightRegion(hardwareGrid); } - else if (e.DataContext is ApplicationVersion || e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion) + else if (e.DataContext is ApplicationVersion || e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion || e.DataContext is ApplicationFirmwareVersion) { SetHighlightRegion(gridTablet); } @@ -70,7 +70,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views { SetHighlightRegion(gridEmbedded); } - else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType) + else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType || e.DataContext is IdsPackFormula) { SetHighlightRegion(gridIds); } @@ -102,6 +102,10 @@ namespace Tango.MachineStudio.MachineDesigner.Views { _vm.DropMidTankType(e.Draggable.DataContext as MidTankType, e.Droppable.DataContext as IdsPack); } + else if (e.Draggable.DataContext is IdsPackFormula) + { + _vm.DropIdsFormula(e.Draggable.DataContext as IdsPackFormula, e.Droppable.DataContext as IdsPack); + } else if (e.Draggable.DataContext is IdsPack) { _vm.DropIdsPack(e.Draggable.DataContext as IdsPack, e.Droppable.DataContext as IdsPack); diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index 001a2bb3f..9d5ac4bb1 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("@(Model.TableName)")] - public partial class @(Model.Name) : ObservableEntity + public partial class @(Model.Name) : ObservableEntity<@(Model.Name)> { @foreach (var prop in Model.Fields) { diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs index ffdde45d3..f3b675bbe 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ACTION_TYPES")] - public partial class ActionType : ObservableEntity + public partial class ActionType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs index f2ba8d4e4..cb144e7bf 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ADDRESSES")] - public partial class Address : ObservableEntity + public partial class Address : ObservableEntity
{ private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs index 1f56718d1..8848bb59a 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_DISPLAY_PANEL_VERSIONS")] - public partial class ApplicationDisplayPanelVersion : ObservableEntity + public partial class ApplicationDisplayPanelVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs index 5c5f44205..e85186be2 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_FIRMWARE_VERSIONS")] - public partial class ApplicationFirmwareVersion : ObservableEntity + public partial class ApplicationFirmwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs index b4cff06e9..5c7cd70b5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_OS_VERSIONS")] - public partial class ApplicationOsVersion : ObservableEntity + public partial class ApplicationOsVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs index 98f8a1e7f..885f647f0 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_VERSIONS")] - public partial class ApplicationVersion : ObservableEntity + public partial class ApplicationVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs index 4646f3178..477aa8efb 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("BRUSH_STOPS")] - public partial class BrushStop : ObservableEntity + public partial class BrushStop : ObservableEntity { private String _segmentguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs index 28dab4039..3b1bba423 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CARTRIDGE_TYPES")] - public partial class CartridgeType : ObservableEntity + public partial class CartridgeType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs index 0ffaacfd8..89a00cc85 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CATS")] - public partial class Cat : ObservableEntity + public partial class Cat : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs index 737d3e127..dcca67aab 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CCTS")] - public partial class Cct : ObservableEntity + public partial class Cct : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs index de99fb775..98f745bff 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("COLOR_SPACES")] - public partial class ColorSpace : ObservableEntity + public partial class ColorSpace : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs index 999491915..323fb7b39 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CONFIGURATIONS")] - public partial class Configuration : ObservableEntity + public partial class Configuration : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs index ad95c490d..c310451ac 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CONTACTS")] - public partial class Contact : ObservableEntity + public partial class Contact : ObservableEntity { private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs index 0d464f0bf..04b3258e3 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("DISPENSER_TYPES")] - public partial class DispenserType : ObservableEntity + public partial class DispenserType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs index da4bae985..d10426933 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EMBEDDED_FIRMWARE_VERSIONS")] - public partial class EmbeddedFirmwareVersion : ObservableEntity + public partial class EmbeddedFirmwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs index 2b35dc05d..55a8ca985 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EMBEDDED_SOFTWARE_VERSIONS")] - public partial class EmbeddedSoftwareVersion : ObservableEntity + public partial class EmbeddedSoftwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs index 77b22e35c..a26fe70dc 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EVENT_TYPES")] - public partial class EventType : ObservableEntity + public partial class EventType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs index 46219549c..87f552957 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EVENT_TYPES_ACTIONS")] - public partial class EventTypesAction : ObservableEntity + public partial class EventTypesAction : ObservableEntity { private String _eventtypeguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs index 01abfb0a5..4d91a522b 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("FIBER_SHAPES")] - public partial class FiberShape : ObservableEntity + public partial class FiberShape : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs index 2251bc36f..3b099b4de 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("FIBER_SYNTHS")] - public partial class FiberSynth : ObservableEntity + public partial class FiberSynth : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs index 49ad1220d..bddc684d3 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("HARDWARE_VERSIONS")] - public partial class HardwareVersion : ObservableEntity + public partial class HardwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs index dc55d3612..e3a48c422 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("IDS_PACKS")] - public partial class IdsPack : ObservableEntity + public partial class IdsPack : ObservableEntity { private String _configurationguid; @@ -152,6 +152,26 @@ namespace Tango.DAL.Observables } + private String _idspackformulaguid; + /// + /// Gets or sets the idspack ids pack formula guid. + /// + [Column("IDS_PACK_FORMULA_GUID")] + [ForeignKey("IdsPackFormula")] + public String IdsPackFormulaGuid + { + get + { + return _idspackformulaguid; + } + + set + { + _idspackformulaguid = value; RaisePropertyChanged(nameof(IdsPackFormulaGuid)); + } + + } + private CartridgeType _cartridgetype; /// /// Gets or sets the idspack cartridge types. @@ -209,6 +229,25 @@ namespace Tango.DAL.Observables } + private IdsPackFormula _idspackformula; + /// + /// Gets or sets the idspack ids pack formulas. + /// + + public virtual IdsPackFormula IdsPackFormula + { + get + { + return _idspackformula; + } + + set + { + _idspackformula = value; RaisePropertyChanged(nameof(IdsPackFormula)); + } + + } + private LiquidType _liquidtype; /// /// Gets or sets the idspack liquid types. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs new file mode 100644 index 000000000..0ad754233 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using Tango.DAL.Remote.DB; + +namespace Tango.DAL.Observables +{ + [Table("IDS_PACK_FORMULAS")] + public partial class IdsPackFormula : ObservableEntity + { + + private Int32 _code; + /// + /// Gets or sets the idspackformula code. + /// + [Column("CODE")] + + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + private String _name; + /// + /// Gets or sets the idspackformula name. + /// + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + private String _description; + /// + /// Gets or sets the idspackformula description. + /// + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + _description = value; RaisePropertyChanged(nameof(Description)); + } + + } + + private Boolean _autocalculated; + /// + /// Gets or sets the idspackformula auto calculated. + /// + [Column("AUTO_CALCULATED")] + + public Boolean AutoCalculated + { + get + { + return _autocalculated; + } + + set + { + _autocalculated = value; RaisePropertyChanged(nameof(AutoCalculated)); + } + + } + + private ObservableCollection _idspacks; + /// + /// Gets or sets the idspackformula ids packs. + /// + + public virtual ObservableCollection IdsPacks + { + get + { + return _idspacks; + } + + set + { + _idspacks = value; RaisePropertyChanged(nameof(IdsPacks)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public IdsPackFormula() : base() + { + + IdsPacks = new ObservableCollection(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs index fb3c20032..37c8e6736 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("JOBS")] - public partial class Job : ObservableEntity + public partial class Job : ObservableEntity { private DateTime _creationdate; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs index 3d8c1cb48..b15ca1511 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("JOB_RUNS")] - public partial class JobRun : ObservableEntity + public partial class JobRun : ObservableEntity { private String _jobguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs index 5767c5533..d0740e583 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("LINEAR_MASS_DENSITY_UNITS")] - public partial class LinearMassDensityUnit : ObservableEntity + public partial class LinearMassDensityUnit : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs index b59a1d0c6..a166d8ec4 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("LIQUID_TYPES")] - public partial class LiquidType : ObservableEntity + public partial class LiquidType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs index 4a4136bf9..3f8fb6bad 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("LIQUID_TYPES_RMLS")] - public partial class LiquidTypesRml : ObservableEntity + public partial class LiquidTypesRml : ObservableEntity { private String _liquidtypeguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs index 7328f411c..3b41da138 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINES")] - public partial class Machine : ObservableEntity + public partial class Machine : ObservableEntity { private String _serialnumber; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs index 95dc7d261..a47ee4232 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINE_VERSIONS")] - public partial class MachineVersion : ObservableEntity + public partial class MachineVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs index 9958a0fcd..4ecaa0ad4 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINES_CONFIGURATIONS")] - public partial class MachinesConfiguration : ObservableEntity + public partial class MachinesConfiguration : ObservableEntity { private String _machineguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs index 659c0c0ed..28fac4bbe 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINES_EVENTS")] - public partial class MachinesEvent : ObservableEntity + public partial class MachinesEvent : ObservableEntity { private String _machineguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs index bd9b55b10..158edebc5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_COLORS")] - public partial class MediaColor : ObservableEntity + public partial class MediaColor : ObservableEntity { private Int32 _color; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs index 1ad80393f..105e046f5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_CONDITIONS")] - public partial class MediaCondition : ObservableEntity + public partial class MediaCondition : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs index c27a7a91b..f03d2c7a1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_MATERIALS")] - public partial class MediaMaterial : ObservableEntity + public partial class MediaMaterial : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs index d40a87ae9..a09bdd1b8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_PURPOSES")] - public partial class MediaPurpos : ObservableEntity + public partial class MediaPurpos : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs index 591f8c3ff..5fef06004 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MID_TANK_TYPES")] - public partial class MidTankType : ObservableEntity + public partial class MidTankType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs index 44e4edc4f..28ea5f835 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ORGANIZATIONS")] - public partial class Organization : ObservableEntity + public partial class Organization : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs index 1a3fcd108..9057ecbd5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("PERMISSIONS")] - public partial class Permission : ObservableEntity + public partial class Permission : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs index 167c2ebef..163d3da53 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("PROCESS_PARAMETERS_TABLES")] - public partial class ProcessParametersTable : ObservableEntity + public partial class ProcessParametersTable : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs index 55f5dba33..ab8ae2ed8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("PROCESS_PARAMETERS_TABLES_GROUPS")] - public partial class ProcessParametersTablesGroup : ObservableEntity + public partial class ProcessParametersTablesGroup : ObservableEntity { private String _rmlguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs index 18e04f9b9..429773e0c 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("RMLS")] - public partial class Rml : ObservableEntity + public partial class Rml : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs index e0a183544..b9bb8244c 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ROLES")] - public partial class Role : ObservableEntity + public partial class Role : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs index 8a2195331..3c7d4eb19 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ROLES_PERMISSIONS")] - public partial class RolesPermission : ObservableEntity + public partial class RolesPermission : ObservableEntity { private String _roleguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs index 8fa4bb4f7..b018f2934 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("SEGMENTS")] - public partial class Segment : ObservableEntity + public partial class Segment : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs index 7d09a0cc2..6b581f086 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("SENSORS")] - public partial class Sensor : ObservableEntity + public partial class Sensor : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs index 2aac73502..595757139 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("SYNC_CONFIGURATIONS")] - public partial class SyncConfiguration : ObservableEntity + public partial class SyncConfiguration : ObservableEntity { /// diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs index 9739e5b62..1a73b3750 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("USERS")] - public partial class User : ObservableEntity + public partial class User : ObservableEntity { private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs index e96ea1fe4..934bb8822 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("USERS_ROLES")] - public partial class UsersRole : ObservableEntity + public partial class UsersRole : ObservableEntity { private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs index 296774138..f14cf43cc 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("WINDING_METHODS")] - public partial class WindingMethod : ObservableEntity + public partial class WindingMethod : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs index 3473559e6..ef45931de 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs @@ -19,7 +19,7 @@ namespace Tango.DAL.Observables /// (Some action 2 description) /// [Description("Some action 2 description")] - Action2 = 2, + Action2yesss = 2, } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs new file mode 100644 index 000000000..595cb176b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum IdsPackFormulas + { + + /// + /// (Standard Color IDS Pack Formula) + /// + [Description("Standard Color IDS Pack Formula")] + StandardColor = 0, + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs index 62bfe9e86..a957dacd1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs @@ -44,6 +44,16 @@ namespace Tango.DAL.Observables /// void Save(); + /// + /// Attaches this observable to the proper DbSet. + /// + void Attach(); + + /// + /// Detaches this observable from the proper DbSet. + /// + void Detach(); + /// /// Saves the changes on this entity to database asynchronously. /// diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs index 493939ca4..b36577870 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs @@ -17,6 +17,7 @@ using Tango.Core.Helpers; using Force.DeepCloner; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; +using System.Runtime.CompilerServices; namespace Tango.DAL.Observables { @@ -26,7 +27,7 @@ namespace Tango.DAL.Observables /// /// /// - public abstract class ObservableEntity : ExtendedObject, IObservableEntity + public abstract class ObservableEntity : ExtendedObject, IObservableEntity where T : class, IObservableEntity { private Regex regExDAL; @@ -92,6 +93,22 @@ namespace Tango.DAL.Observables Saved?.Invoke(this, new EventArgs()); } + /// + /// Attaches this entity to the proper DbSet. + /// + public virtual void Attach() + { + GetDbSet().Add(this as T); + } + + /// + /// Detaches this observable from the proper DbSet. + /// + public virtual void Detach() + { + GetDbSet().Remove(this as T); + } + /// /// Saves the changes on this entity to database asynchronously. /// @@ -118,12 +135,8 @@ namespace Tango.DAL.Observables } else { - String tabelName = this.GetType().BaseType.Name.PluralizeMVC(); - var p = typeof(ObservablesContext).GetProperty(tabelName); - var dbSet = p.GetValue(ObservablesEntitiesAdapter.Instance.Context); - var method = dbSet.GetType().GetMethod("Remove"); - method.Invoke(dbSet, new object[] { this }); - ObservablesEntitiesAdapter.Instance.SaveChanges(); + GetDbSet().Remove(this as T); + Save(); } } @@ -132,11 +145,7 @@ namespace Tango.DAL.Observables /// public virtual void DefferedDelete() { - String tabelName = this.GetType().BaseType.Name.PluralizeMVC(); - var p = typeof(ObservablesContext).GetProperty(tabelName); - var dbSet = p.GetValue(ObservablesEntitiesAdapter.Instance.Context); - var method = dbSet.GetType().GetMethod("Remove"); - method.Invoke(dbSet, new object[] { this }); + GetDbSet().Remove(this as T); } /// @@ -151,23 +160,30 @@ namespace Tango.DAL.Observables } /// - /// Converts the specified database conventional name to the observables conventional name. + /// Gets the observable database set. /// - /// DAL name. /// - public static String DalNameToStandardName(String dalName) + public DbSet GetDbSet() { - return String.Join("", dalName.Split('_').Select(x => ToTitleCase(x))); - } + String tabelName = this.GetType().Name.PluralizeMVC(); + var p = typeof(ObservablesContext).GetProperty(tabelName); + if (p != null) + { + var set1 = p.GetValue(ObservablesEntitiesAdapter.Instance.Context) as DbSet; + return set1; + } + else + { + tabelName = this.GetType().BaseType.Name.PluralizeMVC(); + p = typeof(ObservablesContext).GetProperty(tabelName); + if (p != null) + { + var set2 = p.GetValue(ObservablesEntitiesAdapter.Instance.Context) as DbSet; + return set2; + } + } - /// - /// Converts the specified text to title case. - /// - /// The text. - /// - public static string ToTitleCase(string text) - { - return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower()); + return null; } #region Operator Overloading diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs index 52310d446..63dc901ba 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs @@ -215,6 +215,14 @@ namespace Tango.DAL.Observables get; set; } + /// + /// Gets or sets the IdsPackFormulas. + /// + public DbSet IdsPackFormulas + { + get; set; + } + /// /// Gets or sets the IdsPacks. /// diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index eff9e274d..89e43c2a8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -263,6 +263,8 @@ namespace Tango.DAL.Observables Sensors = Context.Sensors.ToObservableCollection(); + IdsPackFormulas = Context.IdsPackFormulas.ToObservableCollection(); + InitCollectionSources(); //var action = ActionTypes.First(); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs index 62c5ef260..3123a453d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs @@ -762,6 +762,42 @@ namespace Tango.DAL.Observables } + private ObservableCollection _idspackformulas; + /// + /// Gets or sets the IdsPackFormulas. + /// + public ObservableCollection IdsPackFormulas + { + get + { + return _idspackformulas; + } + + set + { + _idspackformulas = value; RaisePropertyChanged(nameof(IdsPackFormulas)); + } + + } + + private ICollectionView _idspackformulasViewSource; + /// + /// Gets or sets the IdsPackFormulas View Source. + /// + public ICollectionView IdsPackFormulasViewSource + { + get + { + return _idspackformulasViewSource; + } + + set + { + _idspackformulasViewSource = value; RaisePropertyChanged(nameof(IdsPackFormulasViewSource)); + } + + } + private ObservableCollection _idspacks; /// /// Gets or sets the IdsPacks. @@ -1818,6 +1854,8 @@ namespace Tango.DAL.Observables HardwareVersionsViewSource = CreateCollectionView(HardwareVersions); + IdsPackFormulasViewSource = CreateCollectionView(IdsPackFormulas); + IdsPacksViewSource = CreateCollectionView(IdsPacks); JobRunsViewSource = CreateCollectionView(JobRuns); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj index ed5cadaa8..f9aa7cc5d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj +++ b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj @@ -67,6 +67,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs index cddce2f6d..6275098a8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs @@ -24,10 +24,12 @@ namespace Tango.DAL.Remote.DB public string MID_TANK_TYPE_GUID { get; set; } public string NAME { get; set; } public int PACK_INDEX { get; set; } + public string IDS_PACK_FORMULA_GUID { get; set; } public virtual CARTRIDGE_TYPES CARTRIDGE_TYPES { get; set; } public virtual CONFIGURATION CONFIGURATION { get; set; } public virtual DISPENSER_TYPES DISPENSER_TYPES { get; set; } + public virtual IDS_PACK_FORMULAS IDS_PACK_FORMULAS { get; set; } public virtual LIQUID_TYPES LIQUID_TYPES { get; set; } public virtual MID_TANK_TYPES MID_TANK_TYPES { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs new file mode 100644 index 000000000..e4b4ca1c5 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// 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 IDS_PACK_FORMULAS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public IDS_PACK_FORMULAS() + { + this.IDS_PACKS = new HashSet(); + } + + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public bool AUTO_CALCULATED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection IDS_PACKS { 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 df3d26227..65d93da83 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -46,6 +46,7 @@ namespace Tango.DAL.Remote.DB public virtual DbSet FIBER_SHAPES { get; set; } public virtual DbSet FIBER_SYNTHS { get; set; } public virtual DbSet HARDWARE_VERSIONS { get; set; } + public virtual DbSet IDS_PACK_FORMULAS { get; set; } public virtual DbSet IDS_PACKS { get; set; } public virtual DbSet JOB_RUNS { get; set; } public virtual DbSet JOBS { 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 46919f0ab..191370fdd 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -258,6 +258,18 @@ + + + + + + + + + + + + @@ -272,6 +284,7 @@ + @@ -834,6 +847,18 @@ + + + + + + + + + + + + @@ -1300,6 +1325,7 @@ + @@ -1400,6 +1426,10 @@ + + + + @@ -1567,6 +1597,7 @@ + @@ -1703,6 +1734,10 @@ + + + + @@ -2098,6 +2133,19 @@ + + + + + + + + + + + + + @@ -2112,9 +2160,11 @@ + + @@ -2855,6 +2905,18 @@ + + + + + + + + + + + + @@ -3467,9 +3529,23 @@ + + + + + + + + + + + + + + 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 4c973eb66..f7e4c0cc1 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,55 +5,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -81,6 +82,7 @@ + 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 6228a08fb..8300ed567 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -131,6 +131,9 @@ RemoteADO.tt + + RemoteADO.tt + RemoteADO.tt diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs index af0e1a08d..3973e8ad5 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -11,7 +11,7 @@ using Tango.CodeGeneration; using Tango.DAL.Remote.DB; using Tango.Settings; using Humanizer; -using Tango.DAL.Observables; +using System.Globalization; namespace Tango.DBObservablesGenerator.CLI { @@ -29,32 +29,32 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Entities... foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { - EntityCodeFile codeFile = new EntityCodeFile(ObservableEntity.DalNameToStandardName(table.Name).SingularizeMVC()) + EntityCodeFile codeFile = new EntityCodeFile(DalNameToStandardName(table.Name).SingularizeMVC()) { EntityName = table.Name.SingularizeMVC(), TableName = table.Name, }; - List foreignKeys = table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => x.PropertyType == typeof(String)).Where(x => x.Name.ToLower().Contains("guid")).Select(x => ObservableEntity.DalNameToStandardName(x.Name).SingularizeMVC().Replace("Guid", "")).ToList(); + List foreignKeys = table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => x.PropertyType == typeof(String)).Where(x => x.Name.ToLower().Contains("guid")).Select(x => DalNameToStandardName(x.Name).SingularizeMVC().Replace("Guid", "")).ToList(); foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3)) { EntityCodeFileField codeField = new EntityCodeFileField(); codeField.FieldName = field.Name; - codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); + codeField.Name = DalNameToStandardName(field.Name); codeField.Description = field.Name.Replace("_", " ").ToLower(); if (field.PropertyType.IsGenericType) { - codeField.Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); + codeField.Type = String.Format("ObservableCollection<{0}>", DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); codeField.Construct = true; } else { if (field.PropertyType.IsClass && field.PropertyType != typeof(String) && field.PropertyType != typeof(byte[])) { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); + codeField.Type = DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); codeField.Name = codeField.Type; var fk = foreignKeys.SingleOrDefault(x => x.Contains(codeField.Name)); @@ -103,7 +103,7 @@ namespace Tango.DBObservablesGenerator.CLI if (codeProp != null && nameProp != null) { EnumerationFile enumFile = new EnumerationFile(); - enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + enumFile.Name = DalNameToStandardName(tableProp.Name); foreach (var row in tableProp.GetValue(db) as IEnumerable) { @@ -135,14 +135,14 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Observables Adapter Extensions... ObservablesAdapterFile adapterFile = new ObservablesAdapterFile(); - adapterFile.Name = nameof(ObservablesEntitiesAdapter); + adapterFile.Name = "ObservablesEntitiesAdapter"; foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { adapterFile.Properties.Add(new Property() { - Name = ObservableEntity.DalNameToStandardName(table.Name), - Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), + Name = DalNameToStandardName(table.Name), + Type = String.Format("ObservableCollection<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), }); } @@ -158,8 +158,8 @@ namespace Tango.DBObservablesGenerator.CLI { contextFile.Properties.Add(new Property() { - Name = ObservableEntity.DalNameToStandardName(table.Name), - Type = String.Format("DbSet<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), + Name = DalNameToStandardName(table.Name), + Type = String.Format("DbSet<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), }); } String contextCode = contextFile.GenerateCode(); @@ -176,7 +176,7 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Entities... foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { - EntityCodeFileJava codeFile = new EntityCodeFileJava(ObservableEntity.DalNameToStandardName(table.Name).Singularize(false)) + EntityCodeFileJava codeFile = new EntityCodeFileJava(DalNameToStandardName(table.Name).Singularize(false)) { EntityName = table.Name.Singularize(false), TableName = table.Name, @@ -188,8 +188,8 @@ namespace Tango.DBObservablesGenerator.CLI { EntityCodeFileField codeField = new EntityCodeFileField(); codeField.FieldName = field.Name; - codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); - codeField.Description = FirstCharacterToLower(ObservableEntity.DalNameToStandardName(field.Name)); + codeField.Name = DalNameToStandardName(field.Name); + codeField.Description = FirstCharacterToLower(DalNameToStandardName(field.Name)); if (field.PropertyType.IsGenericType) @@ -200,7 +200,7 @@ namespace Tango.DBObservablesGenerator.CLI { if (field.PropertyType.IsClass && field.PropertyType != typeof(String) && field.PropertyType != typeof(Byte[])) { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).Singularize(false); + codeField.Type = DalNameToStandardName(field.PropertyType.Name).Singularize(false); codeField.Construct = true; } else if (field.PropertyType == typeof(Byte[])) @@ -239,7 +239,7 @@ namespace Tango.DBObservablesGenerator.CLI if (codeProp != null && nameProp != null) { EnumerationFileJava enumFile = new EnumerationFileJava(); - enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + enumFile.Name = DalNameToStandardName(tableProp.Name); foreach (var row in tableProp.GetValue(db) as IEnumerable) { @@ -277,8 +277,8 @@ namespace Tango.DBObservablesGenerator.CLI { daoFile.Entities.Add(new TangoDAOJavaFile.TangoDAOEntity() { - Name = ObservableEntity.DalNameToStandardName(table.Name).Singularize(false), - TableName = ObservableEntity.DalNameToStandardName(table.Name), + Name = DalNameToStandardName(table.Name).Singularize(false), + TableName = DalNameToStandardName(table.Name), }); } @@ -301,5 +301,25 @@ namespace Tango.DBObservablesGenerator.CLI return Char.ToLowerInvariant(str[0]) + str.Substring(1); } + + /// + /// Converts the specified database conventional name to the observables conventional name. + /// + /// DAL name. + /// + private static String DalNameToStandardName(String dalName) + { + return String.Join("", dalName.Split('_').Select(x => ToTitleCase(x))); + } + + /// + /// Converts the specified text to title case. + /// + /// The text. + /// + private static string ToTitleCase(string text) + { + return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower()); + } } } diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj index fa573208b..87baf3a3f 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj @@ -72,10 +72,6 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core - - {0ecd6da8-7aa6-48d9-8b65-279d176ad9af} - Tango.DAL.Observables - {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote -- cgit v1.3.1