diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/Entities')
110 files changed, 399 insertions, 6836 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/ActionLog.cs b/Software/Visual_Studio/Tango.BL/Entities/ActionLog.cs deleted file mode 100644 index fa34caac8..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/ActionLog.cs +++ /dev/null @@ -1,76 +0,0 @@ -using LiteDB; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Enumerations; -using Tango.BL.ValueObjects; - -namespace Tango.BL.Entities -{ - public class ActionLog : ActionLogBase - { - private ActionLogDifference _differenceObject; - private static JsonSerializerSettings _settings; - - static ActionLog() - { - _settings = new JsonSerializerSettings() - { - TypeNameHandling = TypeNameHandling.All, - }; - } - - [NotMapped] - [JsonIgnore] - [BsonIgnore] - public ActionLogType ActionType - { - get { return (ActionLogType)Type; } - set { Type = value.ToInt32(); RaisePropertyChanged(nameof(ActionType)); } - } - - [NotMapped] - [JsonIgnore] - [BsonIgnore] - public ActionLogDifference DifferenceObject - { - get - { - if (_differenceObject == null ) - { - if (Difference != null) - { - try - { - _differenceObject = JsonConvert.DeserializeObject<ActionLogDifference>(Difference, _settings); - } - catch - { - _differenceObject = new ActionLogDifference(); - } - } - else - { - _differenceObject = new ActionLogDifference(); - } - - } - - return _differenceObject; - } - set - { - _differenceObject = value; - - if (_differenceObject != null) - { - Difference = JsonConvert.SerializeObject(_differenceObject, _settings); - } - } - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/ActionLogBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ActionLogBase.cs deleted file mode 100644 index 060d81f8b..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/ActionLogBase.cs +++ /dev/null @@ -1,283 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("ACTION_LOGS")] - public abstract class ActionLogBase : ObservableEntity<ActionLog> - { - - public event EventHandler<Int32> TypeChanged; - - public event EventHandler<String> RelatedObjectNameChanged; - - public event EventHandler<String> MessageChanged; - - public event EventHandler<String> DifferenceChanged; - - public event EventHandler<User> UserChanged; - - protected Int32 _type; - - /// <summary> - /// Gets or sets the actionlogbase type. - /// </summary> - - [Column("TYPE")] - - public Int32 Type - { - get - { - return _type; - } - - set - { - if (_type != value) - { - _type = value; - - OnTypeChanged(value); - - } - } - } - - protected String _userguid; - - /// <summary> - /// Gets or sets the actionlogbase user guid. - /// </summary> - - [Column("USER_GUID")] - [ForeignKey("User")] - - public String UserGuid - { - get - { - return _userguid; - } - - set - { - if (_userguid != value) - { - _userguid = value; - - } - } - } - - protected String _relatedobjectname; - - /// <summary> - /// Gets or sets the actionlogbase related object name. - /// </summary> - - [Column("RELATED_OBJECT_NAME")] - - public String RelatedObjectName - { - get - { - return _relatedobjectname; - } - - set - { - if (_relatedobjectname != value) - { - _relatedobjectname = value; - - OnRelatedObjectNameChanged(value); - - } - } - } - - protected String _relatedobjectguid; - - /// <summary> - /// Gets or sets the actionlogbase related object guid. - /// </summary> - - [Column("RELATED_OBJECT_GUID")] - - public String RelatedObjectGuid - { - get - { - return _relatedobjectguid; - } - - set - { - if (_relatedobjectguid != value) - { - _relatedobjectguid = value; - - } - } - } - - protected String _message; - - /// <summary> - /// Gets or sets the actionlogbase message. - /// </summary> - - [Column("MESSAGE")] - - public String Message - { - get - { - return _message; - } - - set - { - if (_message != value) - { - _message = value; - - OnMessageChanged(value); - - } - } - } - - protected String _difference; - - /// <summary> - /// Gets or sets the actionlogbase difference. - /// </summary> - - [Column("DIFFERENCE")] - - public String Difference - { - get - { - return _difference; - } - - set - { - if (_difference != value) - { - _difference = value; - - OnDifferenceChanged(value); - - } - } - } - - protected User _user; - - /// <summary> - /// Gets or sets the actionlogbase user. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual User User - { - get - { - return _user; - } - - set - { - if (_user != value) - { - _user = value; - - if (User != null) - { - UserGuid = User.Guid; - } - - OnUserChanged(value); - - } - } - } - - /// <summary> - /// Called when the Type has changed. - /// </summary> - protected virtual void OnTypeChanged(Int32 type) - { - TypeChanged?.Invoke(this, type); - RaisePropertyChanged(nameof(Type)); - } - - /// <summary> - /// Called when the RelatedObjectName has changed. - /// </summary> - protected virtual void OnRelatedObjectNameChanged(String relatedobjectname) - { - RelatedObjectNameChanged?.Invoke(this, relatedobjectname); - RaisePropertyChanged(nameof(RelatedObjectName)); - } - - /// <summary> - /// Called when the Message has changed. - /// </summary> - protected virtual void OnMessageChanged(String message) - { - MessageChanged?.Invoke(this, message); - RaisePropertyChanged(nameof(Message)); - } - - /// <summary> - /// Called when the Difference has changed. - /// </summary> - protected virtual void OnDifferenceChanged(String difference) - { - DifferenceChanged?.Invoke(this, difference); - RaisePropertyChanged(nameof(Difference)); - } - - /// <summary> - /// Called when the User has changed. - /// </summary> - protected virtual void OnUserChanged(User user) - { - UserChanged?.Invoke(this, user); - RaisePropertyChanged(nameof(User)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="ActionLogBase" /> class. - /// </summary> - public ActionLogBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs b/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs index 7e1229b98..f88efdb71 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs index 82a5ea94b..1671069b3 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs index a816c7ad3..c54fe23d6 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs index 20b58dbf2..0e06e48db 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs index 4ad21d4cd..d23e9b1f2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs @@ -28,7 +28,7 @@ namespace Tango.BL.Entities private bool _ignorePropChanged; private ActionTimer _syncTimer; private static List<String> _colorPropertyNames; - public const double MAX_INK_UPTAKE = 400; + public const double MAX_TOTAL_LIQUID_VOLUME = 200; #region Enums @@ -79,7 +79,6 @@ namespace Tango.BL.Entities _colorPropertyNames.Add(nameof(Color)); _colorPropertyNames.Add(nameof(ColorCatalogsItem)); - _colorPropertyNames.Add(nameof(IsTransparent)); } /// <summary> @@ -104,7 +103,7 @@ namespace Tango.BL.Entities #region Properties /// <summary> - /// Gets or sets a value indicating whether the total value of liquid volumes has exceeded the maximum range of <see cref="MAX_INK_UPTAKE"/>. + /// Gets or sets a value indicating whether the total value of liquid volumes has exceeded the maximum range of <see cref="MAX_TOTAL_LIQUID_VOLUME"/>. /// </summary> [NotMapped] [JsonIgnore] @@ -112,7 +111,7 @@ namespace Tango.BL.Entities { get { - return LiquidVolumes != null ? LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.NanoliterPerCentimeter) > GetTotalMaximumLiquidNlPerCMLimit() : false; + return LiquidVolumes != null ? LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > MAX_TOTAL_LIQUID_VOLUME : false; } } @@ -284,7 +283,7 @@ namespace Tango.BL.Entities [JsonIgnore] public bool IsOutOfGamut { - get { return _isOutOfGamut && !IsTransparent; } + get { return _isOutOfGamut; } set { if (_isOutOfGamut != value) @@ -348,62 +347,6 @@ namespace Tango.BL.Entities get { return (ColorSpaces)ColorSpace.Code; } } - [NotMapped] - [JsonIgnore] - public bool IsWhite - { - get - { - try - { - if (ColorSpace != null) - { - if (BrushColorSpace == ColorSpaces.RGB) - { - if (Red == 255 && Green == 255 && Blue == 255) - { - return true; - } - } - else if (BrushColorSpace == ColorSpaces.LAB) - { - if (L == 100 && A == 0 && B == 0) - { - return true; - } - } - } - } - catch { } - - return false; - } - } - - [NotMapped] - [JsonIgnore] - public String LiquidVolumesOrderedPigmentedString - { - get - { - if (LiquidVolumes != null) - { - try - { - return String.Join(", ", LiquidVolumesOrderedPigmented.Select(x => x.Volume.ToString("0.0"))); - } - catch - { - return String.Empty; - } - } - else - { - return String.Empty; - } - } - } - #endregion #region Public Methods @@ -678,17 +621,6 @@ namespace Tango.BL.Entities PerformColorSynchronization(propName); } - protected override void OnIsTransparentChanged(bool istransparent) - { - base.OnIsTransparentChanged(istransparent); - RaisePropertyChanged(nameof(IsOutOfGamut)); - OutOfGamutChecked = false; - if (Segment != null) - { - Segment.RaiseHasOutOfGamutBrushStop(); - } - } - #endregion #region Properties Changed @@ -777,30 +709,5 @@ namespace Tango.BL.Entities } #endregion - - #region Private Methods - - private double GetTotalMaximumLiquidNlPerCMLimit() - { - try - { - var tables = Segment.Job.Rml.GetActiveProcessGroup().ProcessParametersTables.OrderBy(x => x.TableIndex).ToList(); - - if (tables.Count > 0) - { - return tables.Max(x => x.MaxInkUptake); - } - else - { - return MAX_INK_UPTAKE; - } - } - catch - { - return MAX_INK_UPTAKE; - } - } - - #endregion } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs index 89114f2c3..e02d3f613 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -85,8 +84,6 @@ namespace Tango.BL.Entities public event EventHandler<Boolean> CorrectedChanged; - public event EventHandler<Boolean> IsTransparentChanged; - public event EventHandler<ColorCatalog> ColorCatalogChanged; public event EventHandler<ColorCatalogsItem> ColorCatalogsItemChanged; @@ -982,33 +979,6 @@ namespace Tango.BL.Entities } } - protected Boolean _istransparent; - - /// <summary> - /// Gets or sets the brushstopbase is transparent. - /// </summary> - - [Column("IS_TRANSPARENT")] - - public Boolean IsTransparent - { - get - { - return _istransparent; - } - - set - { - if (_istransparent != value) - { - _istransparent = value; - - OnIsTransparentChanged(value); - - } - } - } - protected ColorCatalog _colorcatalog; /// <summary> @@ -1399,15 +1369,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the IsTransparent has changed. - /// </summary> - protected virtual void OnIsTransparentChanged(Boolean istransparent) - { - IsTransparentChanged?.Invoke(this, istransparent); - RaisePropertyChanged(nameof(IsTransparent)); - } - - /// <summary> /// Called when the ColorCatalog has changed. /// </summary> protected virtual void OnColorCatalogChanged(ColorCatalog colorcatalog) diff --git a/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs index e0684e304..6281c7606 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs index 0c73be9ab..17bfd3f87 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs index 158615777..92f4f17b9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs index df1056469..da3c15c5c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -45,8 +44,6 @@ namespace Tango.BL.Entities public event EventHandler<SynchronizedObservableCollection<Job>> JobsChanged; - public event EventHandler<SynchronizedObservableCollection<SitesCatalog>> SitesCatalogsChanged; - protected String _company; /// <summary> @@ -284,31 +281,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<SitesCatalog> _sitescatalogs; - - /// <summary> - /// Gets or sets the colorcatalogbase sites catalogs. - /// </summary> - - public virtual SynchronizedObservableCollection<SitesCatalog> SitesCatalogs - { - get - { - return _sitescatalogs; - } - - set - { - if (_sitescatalogs != value) - { - _sitescatalogs = value; - - OnSitesCatalogsChanged(value); - - } - } - } - /// <summary> /// Called when the Company has changed. /// </summary> @@ -391,15 +363,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the SitesCatalogs has changed. - /// </summary> - protected virtual void OnSitesCatalogsChanged(SynchronizedObservableCollection<SitesCatalog> sitescatalogs) - { - SitesCatalogsChanged?.Invoke(this, sitescatalogs); - RaisePropertyChanged(nameof(SitesCatalogs)); - } - - /// <summary> /// Initializes a new instance of the <see cref="ColorCatalogBase" /> class. /// </summary> public ColorCatalogBase() : base() @@ -411,8 +374,6 @@ namespace Tango.BL.Entities Jobs = new SynchronizedObservableCollection<Job>(); - SitesCatalogs = new SynchronizedObservableCollection<SitesCatalog>(); - } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs index bc20a0c2e..3e0491ec5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs index 30d77a051..fe026fc32 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs index 19b3aed14..a0a324b9f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs index b21332829..9098a2eab 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -39,6 +38,8 @@ namespace Tango.BL.Entities public event EventHandler<SynchronizedObservableCollection<Job>> JobsChanged; + public event EventHandler<SynchronizedObservableCollection<Machine>> MachinesChanged; + protected Int32 _code; /// <summary> @@ -197,6 +198,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection<Machine> _machines; + + /// <summary> + /// Gets or sets the colorspacebase machines. + /// </summary> + + public virtual SynchronizedObservableCollection<Machine> Machines + { + get + { + return _machines; + } + + set + { + if (_machines != value) + { + _machines = value; + + OnMachinesChanged(value); + + } + } + } + /// <summary> /// Called when the Code has changed. /// </summary> @@ -252,6 +278,15 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the Machines has changed. + /// </summary> + protected virtual void OnMachinesChanged(SynchronizedObservableCollection<Machine> machines) + { + MachinesChanged?.Invoke(this, machines); + RaisePropertyChanged(nameof(Machines)); + } + + /// <summary> /// Initializes a new instance of the <see cref="ColorSpaceBase" /> class. /// </summary> public ColorSpaceBase() : base() @@ -261,6 +296,8 @@ namespace Tango.BL.Entities Jobs = new SynchronizedObservableCollection<Job>(); + Machines = new SynchronizedObservableCollection<Machine>(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs index d7a90bcfd..6b19ebb7f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs index 6fd8c9f4c..610fcc27b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs index 68e6b2df1..1d3dd576c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/DataStoreItem.cs b/Software/Visual_Studio/Tango.BL/Entities/DataStoreItem.cs deleted file mode 100644 index ce9f3c9e8..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/DataStoreItem.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class DataStoreItem : DataStoreItemBase - { - - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/DataStoreItemBase.cs b/Software/Visual_Studio/Tango.BL/Entities/DataStoreItemBase.cs deleted file mode 100644 index 6d393f6a2..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/DataStoreItemBase.cs +++ /dev/null @@ -1,334 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("DATA_STORE_ITEMS")] - public abstract class DataStoreItemBase : ObservableEntity<DataStoreItem> - { - - public event EventHandler<String> CollectionNameChanged; - - public event EventHandler<String> KeyChanged; - - public event EventHandler<Int32> DataTypeChanged; - - public event EventHandler<Byte[]> ValueChanged; - - public event EventHandler<Boolean> IsDeletedChanged; - - public event EventHandler<Boolean> IsSynchronizedChanged; - - public event EventHandler<Machine> MachineChanged; - - protected String _machineguid; - - /// <summary> - /// Gets or sets the datastoreitembase machine guid. - /// </summary> - - [Column("MACHINE_GUID")] - [ForeignKey("Machine")] - - public String MachineGuid - { - get - { - return _machineguid; - } - - set - { - if (_machineguid != value) - { - _machineguid = value; - - } - } - } - - protected String _collectionname; - - /// <summary> - /// Gets or sets the datastoreitembase collection name. - /// </summary> - - [Column("COLLECTION_NAME")] - - public String CollectionName - { - get - { - return _collectionname; - } - - set - { - if (_collectionname != value) - { - _collectionname = value; - - OnCollectionNameChanged(value); - - } - } - } - - protected String _key; - - /// <summary> - /// Gets or sets the datastoreitembase key. - /// </summary> - - [Column("KEY")] - - public String Key - { - get - { - return _key; - } - - set - { - if (_key != value) - { - _key = value; - - OnKeyChanged(value); - - } - } - } - - protected Int32 _datatype; - - /// <summary> - /// Gets or sets the datastoreitembase data type. - /// </summary> - - [Column("DATA_TYPE")] - - public Int32 DataType - { - get - { - return _datatype; - } - - set - { - if (_datatype != value) - { - _datatype = value; - - OnDataTypeChanged(value); - - } - } - } - - protected Byte[] _value; - - /// <summary> - /// Gets or sets the datastoreitembase value. - /// </summary> - - [Column("VALUE")] - - public Byte[] Value - { - get - { - return _value; - } - - set - { - if (_value != value) - { - _value = value; - - OnValueChanged(value); - - } - } - } - - protected Boolean _isdeleted; - - /// <summary> - /// Gets or sets the datastoreitembase is deleted. - /// </summary> - - [Column("IS_DELETED")] - - public Boolean IsDeleted - { - get - { - return _isdeleted; - } - - set - { - if (_isdeleted != value) - { - _isdeleted = value; - - OnIsDeletedChanged(value); - - } - } - } - - protected Boolean _issynchronized; - - /// <summary> - /// Gets or sets the datastoreitembase is synchronized. - /// </summary> - - [Column("IS_SYNCHRONIZED")] - - public Boolean IsSynchronized - { - get - { - return _issynchronized; - } - - set - { - if (_issynchronized != value) - { - _issynchronized = value; - - OnIsSynchronizedChanged(value); - - } - } - } - - protected Machine _machine; - - /// <summary> - /// Gets or sets the datastoreitembase machine. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual Machine Machine - { - get - { - return _machine; - } - - set - { - if (_machine != value) - { - _machine = value; - - if (Machine != null) - { - MachineGuid = Machine.Guid; - } - - OnMachineChanged(value); - - } - } - } - - /// <summary> - /// Called when the CollectionName has changed. - /// </summary> - protected virtual void OnCollectionNameChanged(String collectionname) - { - CollectionNameChanged?.Invoke(this, collectionname); - RaisePropertyChanged(nameof(CollectionName)); - } - - /// <summary> - /// Called when the Key has changed. - /// </summary> - protected virtual void OnKeyChanged(String key) - { - KeyChanged?.Invoke(this, key); - RaisePropertyChanged(nameof(Key)); - } - - /// <summary> - /// Called when the DataType has changed. - /// </summary> - protected virtual void OnDataTypeChanged(Int32 datatype) - { - DataTypeChanged?.Invoke(this, datatype); - RaisePropertyChanged(nameof(DataType)); - } - - /// <summary> - /// Called when the Value has changed. - /// </summary> - protected virtual void OnValueChanged(Byte[] value) - { - ValueChanged?.Invoke(this, value); - RaisePropertyChanged(nameof(Value)); - } - - /// <summary> - /// Called when the IsDeleted has changed. - /// </summary> - protected virtual void OnIsDeletedChanged(Boolean isdeleted) - { - IsDeletedChanged?.Invoke(this, isdeleted); - RaisePropertyChanged(nameof(IsDeleted)); - } - - /// <summary> - /// Called when the IsSynchronized has changed. - /// </summary> - protected virtual void OnIsSynchronizedChanged(Boolean issynchronized) - { - IsSynchronizedChanged?.Invoke(this, issynchronized); - RaisePropertyChanged(nameof(IsSynchronized)); - } - - /// <summary> - /// Called when the Machine has changed. - /// </summary> - protected virtual void OnMachineChanged(Machine machine) - { - MachineChanged?.Invoke(this, machine); - RaisePropertyChanged(nameof(Machine)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="DataStoreItemBase" /> class. - /// </summary> - public DataStoreItemBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs b/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs index 8343fdb65..a908da29c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs index 829ea0cba..04f4dc261 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs index 25c7df99f..148d53c6c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs index 8cbf615e8..f0100fe06 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs @@ -19,10 +19,14 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("EVENT_TYPES")] public abstract class EventTypeBase : ObservableEntity<EventType> { @@ -51,8 +55,6 @@ namespace Tango.BL.Entities public event EventHandler<String> GuidanceChanged; - public event EventHandler<Boolean> PersistentChanged; - public event EventHandler<SynchronizedObservableCollection<MachinesEvent>> MachinesEventsChanged; protected Int32 _code; @@ -400,33 +402,6 @@ namespace Tango.BL.Entities } } - protected Boolean _persistent; - - /// <summary> - /// Gets or sets the eventtypebase persistent. - /// </summary> - - [Column("PERSISTENT")] - - public Boolean Persistent - { - get - { - return _persistent; - } - - set - { - if (_persistent != value) - { - _persistent = value; - - OnPersistentChanged(value); - - } - } - } - protected SynchronizedObservableCollection<MachinesEvent> _machinesevents; /// <summary> @@ -561,15 +536,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the Persistent has changed. - /// </summary> - protected virtual void OnPersistentChanged(Boolean persistent) - { - PersistentChanged?.Invoke(this, persistent); - RaisePropertyChanged(nameof(Persistent)); - } - - /// <summary> /// Called when the MachinesEvents has changed. /// </summary> protected virtual void OnMachinesEventsChanged(SynchronizedObservableCollection<MachinesEvent> machinesevents) diff --git a/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs index cfb335f62..cdc9bb76c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs b/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs index dfb34224b..d04050c4a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/FseVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/FseVersion.cs deleted file mode 100644 index 2ce48470d..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/FseVersion.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class FseVersion : FseVersionBase - { - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/FseVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/FseVersionBase.cs deleted file mode 100644 index 4baaf0557..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/FseVersionBase.cs +++ /dev/null @@ -1,258 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("FSE_VERSIONS")] - public abstract class FseVersionBase : ObservableEntity<FseVersion> - { - - public event EventHandler<String> VersionChanged; - - public event EventHandler<String> BlobNameChanged; - - public event EventHandler<String> InstallerBlobNameChanged; - - public event EventHandler<String> CommentsChanged; - - public event EventHandler<User> UserChanged; - - protected String _version; - - /// <summary> - /// Gets or sets the fseversionbase version. - /// </summary> - - [Column("VERSION")] - - public String Version - { - get - { - return _version; - } - - set - { - if (_version != value) - { - _version = value; - - OnVersionChanged(value); - - } - } - } - - protected String _blobname; - - /// <summary> - /// Gets or sets the fseversionbase blob name. - /// </summary> - - [Column("BLOB_NAME")] - - public String BlobName - { - get - { - return _blobname; - } - - set - { - if (_blobname != value) - { - _blobname = value; - - OnBlobNameChanged(value); - - } - } - } - - protected String _installerblobname; - - /// <summary> - /// Gets or sets the fseversionbase installer blob name. - /// </summary> - - [Column("INSTALLER_BLOB_NAME")] - - public String InstallerBlobName - { - get - { - return _installerblobname; - } - - set - { - if (_installerblobname != value) - { - _installerblobname = value; - - OnInstallerBlobNameChanged(value); - - } - } - } - - protected String _comments; - - /// <summary> - /// Gets or sets the fseversionbase comments. - /// </summary> - - [Column("COMMENTS")] - - public String Comments - { - get - { - return _comments; - } - - set - { - if (_comments != value) - { - _comments = value; - - OnCommentsChanged(value); - - } - } - } - - protected String _userguid; - - /// <summary> - /// Gets or sets the fseversionbase user guid. - /// </summary> - - [Column("USER_GUID")] - [ForeignKey("User")] - - public String UserGuid - { - get - { - return _userguid; - } - - set - { - if (_userguid != value) - { - _userguid = value; - - } - } - } - - protected User _user; - - /// <summary> - /// Gets or sets the fseversionbase user. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual User User - { - get - { - return _user; - } - - set - { - if (_user != value) - { - _user = value; - - if (User != null) - { - UserGuid = User.Guid; - } - - OnUserChanged(value); - - } - } - } - - /// <summary> - /// Called when the Version has changed. - /// </summary> - protected virtual void OnVersionChanged(String version) - { - VersionChanged?.Invoke(this, version); - RaisePropertyChanged(nameof(Version)); - } - - /// <summary> - /// Called when the BlobName has changed. - /// </summary> - protected virtual void OnBlobNameChanged(String blobname) - { - BlobNameChanged?.Invoke(this, blobname); - RaisePropertyChanged(nameof(BlobName)); - } - - /// <summary> - /// Called when the InstallerBlobName has changed. - /// </summary> - protected virtual void OnInstallerBlobNameChanged(String installerblobname) - { - InstallerBlobNameChanged?.Invoke(this, installerblobname); - RaisePropertyChanged(nameof(InstallerBlobName)); - } - - /// <summary> - /// Called when the Comments has changed. - /// </summary> - protected virtual void OnCommentsChanged(String comments) - { - CommentsChanged?.Invoke(this, comments); - RaisePropertyChanged(nameof(Comments)); - } - - /// <summary> - /// Called when the User has changed. - /// </summary> - protected virtual void OnUserChanged(User user) - { - UserChanged?.Invoke(this, user); - RaisePropertyChanged(nameof(User)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="FseVersionBase" /> class. - /// </summary> - public FseVersionBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/GlobalDataStoreItem.cs b/Software/Visual_Studio/Tango.BL/Entities/GlobalDataStoreItem.cs deleted file mode 100644 index e99552477..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/GlobalDataStoreItem.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class GlobalDataStoreItem : GlobalDataStoreItemBase - { - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/GlobalDataStoreItemBase.cs b/Software/Visual_Studio/Tango.BL/Entities/GlobalDataStoreItemBase.cs deleted file mode 100644 index 22acb12cb..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/GlobalDataStoreItemBase.cs +++ /dev/null @@ -1,189 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("GLOBAL_DATA_STORE_ITEMS")] - public abstract class GlobalDataStoreItemBase : ObservableEntity<GlobalDataStoreItem> - { - - public event EventHandler<String> CollectionNameChanged; - - public event EventHandler<String> KeyChanged; - - public event EventHandler<Int32> DataTypeChanged; - - public event EventHandler<Byte[]> ValueChanged; - - protected String _collectionname; - - /// <summary> - /// Gets or sets the globaldatastoreitembase collection name. - /// </summary> - - [Column("COLLECTION_NAME")] - - public String CollectionName - { - get - { - return _collectionname; - } - - set - { - if (_collectionname != value) - { - _collectionname = value; - - OnCollectionNameChanged(value); - - } - } - } - - protected String _key; - - /// <summary> - /// Gets or sets the globaldatastoreitembase key. - /// </summary> - - [Column("KEY")] - - public String Key - { - get - { - return _key; - } - - set - { - if (_key != value) - { - _key = value; - - OnKeyChanged(value); - - } - } - } - - protected Int32 _datatype; - - /// <summary> - /// Gets or sets the globaldatastoreitembase data type. - /// </summary> - - [Column("DATA_TYPE")] - - public Int32 DataType - { - get - { - return _datatype; - } - - set - { - if (_datatype != value) - { - _datatype = value; - - OnDataTypeChanged(value); - - } - } - } - - protected Byte[] _value; - - /// <summary> - /// Gets or sets the globaldatastoreitembase value. - /// </summary> - - [Column("VALUE")] - - public Byte[] Value - { - get - { - return _value; - } - - set - { - if (_value != value) - { - _value = value; - - OnValueChanged(value); - - } - } - } - - /// <summary> - /// Called when the CollectionName has changed. - /// </summary> - protected virtual void OnCollectionNameChanged(String collectionname) - { - CollectionNameChanged?.Invoke(this, collectionname); - RaisePropertyChanged(nameof(CollectionName)); - } - - /// <summary> - /// Called when the Key has changed. - /// </summary> - protected virtual void OnKeyChanged(String key) - { - KeyChanged?.Invoke(this, key); - RaisePropertyChanged(nameof(Key)); - } - - /// <summary> - /// Called when the DataType has changed. - /// </summary> - protected virtual void OnDataTypeChanged(Int32 datatype) - { - DataTypeChanged?.Invoke(this, datatype); - RaisePropertyChanged(nameof(DataType)); - } - - /// <summary> - /// Called when the Value has changed. - /// </summary> - protected virtual void OnValueChanged(Byte[] value) - { - ValueChanged?.Invoke(this, value); - RaisePropertyChanged(nameof(Value)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="GlobalDataStoreItemBase" /> class. - /// </summary> - public GlobalDataStoreItemBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs index 5cc6c4931..de376da41 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs @@ -19,10 +19,14 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("HARDWARE_BLOWERS")] public abstract class HardwareBlowerBase : ObservableEntity<HardwareBlower> { @@ -127,11 +131,6 @@ namespace Tango.BL.Entities [Column("VOLTAGE")] [Description("Voltage Description")] - - [Range(-10000,1000000)] - - [StringFormat("0.0")] - public Double Voltage { get diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs index 99dadd1f5..dc614bd0c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs index 1ca65ab51..9cbaac688 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs index 77a53c9a0..5d69f19b5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs index 65d60714a..a3fa5c1aa 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs index 7bff7c035..3cd885790 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs index 58118869c..e08a2b5b0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs @@ -19,10 +19,14 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("HARDWARE_MOTORS")] public abstract class HardwareMotorBase : ObservableEntity<HardwareMotor> { @@ -95,8 +99,6 @@ namespace Tango.BL.Entities public event EventHandler<Boolean> ActiveChanged; - public event EventHandler<Int32> P01ConfigWordChanged; - public event EventHandler<HardwareMotorType> HardwareMotorTypeChanged; public event EventHandler<HardwareVersion> HardwareVersionChanged; @@ -1071,33 +1073,6 @@ namespace Tango.BL.Entities } } - protected Int32 _p01configword; - - /// <summary> - /// Gets or sets the hardwaremotorbase p01 config word. - /// </summary> - - [Column("P01_CONFIG_WORD")] - - public Int32 P01ConfigWord - { - get - { - return _p01configword; - } - - set - { - if (_p01configword != value) - { - _p01configword = value; - - OnP01ConfigWordChanged(value); - - } - } - } - protected HardwareMotorType _hardwaremotortype; /// <summary> @@ -1469,15 +1444,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the P01ConfigWord has changed. - /// </summary> - protected virtual void OnP01ConfigWordChanged(Int32 p01configword) - { - P01ConfigWordChanged?.Invoke(this, p01configword); - RaisePropertyChanged(nameof(P01ConfigWord)); - } - - /// <summary> /// Called when the HardwareMotorType has changed. /// </summary> protected virtual void OnHardwareMotorTypeChanged(HardwareMotorType hardwaremotortype) diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs index 59ceeada9..a63a148da 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs index ccd56bca3..e12e40f32 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs index d148ea177..dbb8d2a1d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs index 5661225cb..3b7bb1e72 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs index 384462516..74ff9761d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs index bc65c33ce..ed8596192 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -95,13 +93,6 @@ namespace Tango.BL.Entities }); } - [NotMapped] - [JsonIgnore] - public String FullName - { - get { return $"{Name} v{Version}"; } - } - /// <summary> /// Initializes a new instance of the <see cref="HardwareVersion" /> class. /// </summary> @@ -109,16 +100,5 @@ namespace Tango.BL.Entities { } - - /// <summary> - /// Returns a <see cref="System.String" /> that represents this instance. - /// </summary> - /// <returns> - /// A <see cref="System.String" /> that represents this instance. - /// </returns> - public override string ToString() - { - return FullName; - } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs index 3d7d555dc..c3bc80696 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs index 8bcc5bb14..4c2808581 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs index 340748f97..8c8055c1e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs b/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs index 650d93098..b3e62f1fe 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs b/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs index 62d88bc77..0108dc3f5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 5cd756f27..52101c1b5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -10,10 +10,8 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; -using Tango.BL.ActionLogs; using Tango.BL.Builders; using Tango.BL.Enumerations; -using Tango.BL.ValueObjects; using Tango.Core; using Tango.Core.ExtensionMethods; using Tango.Logging; @@ -80,7 +78,7 @@ namespace Tango.BL.Entities get { _lastLength = GetLength(); - var l = _lastLength * Math.Max(NumberOfUnits, 1); + var l = _lastLength * NumberOfUnits; if (EnableInterSegment && NumberOfUnits > 1) { @@ -103,17 +101,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Gets or sets the origin of the job. - /// </summary> - [NotMapped] - [JsonIgnore] - public JobSource JobSource - { - get { return (JobSource)Source; } - set { Source = value.ToInt32(); RaisePropertyChangedAuto(); } - } - - /// <summary> /// Gets or sets the job <see cref="Type"/> property as <see cref="JobType"/> enum instead of int. /// </summary> [NotMapped] @@ -348,7 +335,6 @@ namespace Tango.BL.Entities cloned.Name = Name + " - Copy"; cloned.CreationDate = DateTime.UtcNow; - cloned.IsSynchronized = false; cloned.LastRun = null; cloned.ColorSpace = ColorSpace; cloned.Customer = Customer; @@ -389,42 +375,34 @@ namespace Tango.BL.Entities public BitmapSource CreateSegmentsPie(double width, double height) { - try - { - Bitmap bmp = new Bitmap((int)width, (int)height); + Bitmap bmp = new Bitmap((int)width, (int)height); - using (Graphics g = Graphics.FromImage(bmp)) - { - g.Clear(Color.Transparent); - g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; - g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; - g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + using (Graphics g = Graphics.FromImage(bmp)) + { + g.Clear(Color.Transparent); + g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; + g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - int fromAngle = -90; - double totalLength = Segments.Sum(x => x.Length); //Excluding inter segment. + int fromAngle = -90; + double totalLength = Segments.Sum(x => x.Length); //Excluding inter segment. - foreach (var segment in OrderedSegments) - { - int toAngle = (int)((segment.Length / totalLength) * 360d); - Rectangle rect = new Rectangle(0, 0, bmp.Width - 2, bmp.Height - 2); - g.FillPie(segment.CreateGdiBrush(bmp.Width - 2, bmp.Height - 2), rect, fromAngle, toAngle); + foreach (var segment in OrderedSegments) + { + int toAngle = (int)((segment.Length / totalLength) * 360d); + Rectangle rect = new Rectangle(0, 0, bmp.Width - 2, bmp.Height - 2); + g.FillPie(segment.CreateGdiBrush(bmp.Width - 2, bmp.Height - 2), rect, fromAngle, toAngle); - Pen pen = new Pen(Color.Gainsboro); - g.DrawEllipse(pen, rect); - pen.Dispose(); - fromAngle += toAngle; - } + Pen pen = new Pen(Color.Gainsboro); + g.DrawEllipse(pen, rect); + pen.Dispose(); + fromAngle += toAngle; } - - var source = bmp.ToBitmapSource(); - bmp.Dispose(); - return source; - } - catch (Exception ex) - { - LogManager.Log(ex, $"Error occurred while trying to create job pie image for job '{Name}'."); - return null; } + + var source = bmp.ToBitmapSource(); + bmp.Dispose(); + return source; } /// <summary> @@ -432,13 +410,13 @@ namespace Tango.BL.Entities /// </summary> public Segment AddSolidSegment() { - return AddSolidSegment(null); + return AddSolidSegment(System.Windows.Media.Colors.Black); } /// <summary> /// Adds a new solid segment. /// </summary> - public Segment AddSolidSegment(System.Windows.Media.Color? color) + public Segment AddSolidSegment(System.Windows.Media.Color color) { return AddSolidSegment(color, 10); } @@ -448,13 +426,13 @@ namespace Tango.BL.Entities /// </summary> public Segment AddSolidSegment(double length) { - return AddSolidSegment(null, length); + return AddSolidSegment(System.Windows.Media.Colors.White, length); } /// <summary> /// Adds a new solid segment. /// </summary> - public Segment AddSolidSegment(System.Windows.Media.Color? color, double length) + public Segment AddSolidSegment(System.Windows.Media.Color color, double length) { Segment segment = new Segment(); segment.Name = "Standard Segment"; @@ -473,12 +451,7 @@ namespace Tango.BL.Entities segment.Job = this; var stop = segment.AddBrushStop(); - - if (color != null) - { - stop.Color = color.Value; - } - + stop.Color = color; Segments.Add(segment); return segment; @@ -498,9 +471,9 @@ namespace Tango.BL.Entities public Segment AddGradientSegment(double length) { var segment = AddSolidSegment(length); - //segment.BrushStops.Last().Color = System.Windows.Media.Colors.White; + segment.BrushStops.Last().Color = System.Windows.Media.Colors.White; segment.AddBrushStop(); - //segment.BrushStops.Last().Color = System.Windows.Media.Colors.White; + segment.BrushStops.Last().Color = System.Windows.Media.Colors.White; return segment; } @@ -655,7 +628,7 @@ namespace Tango.BL.Entities foreach (var stop in segment.BrushStops.OrderBy(x => x.StopIndex)) { JobFileBrushStop st = new JobFileBrushStop(); - stop.MapPropertiesTo(st, MappingFlags.NoReferenceTypes | MappingFlags.NoNullStrings); + stop.MapPrimitivesWithStringsNoNullsTo(st); st.ColorCatalogItemGuid = stop.ColorCatalogsItemGuid.ToStringOrEmpty(); foreach (var idsPack in machine.Configuration.NoneEmptyIdsPacks) @@ -782,7 +755,7 @@ namespace Tango.BL.Entities BrushStop st = new BrushStop(); st.StopIndex = j + 1; st.SegmentGuid = s.Guid; - stop.MapPropertiesTo(st, MappingFlags.NoReferenceTypes | MappingFlags.NoNullStrings); + stop.MapPrimitivesWithStringsNoNullsTo(st); foreach (var volume in stop.LiquidVolumes) { @@ -847,11 +820,6 @@ namespace Tango.BL.Entities { InsertError(nameof(Name), "Job name is required"); } - - if (Name != null && Name.Length > 100) - { - InsertError(nameof(Name), "The job name exceeds the maximum allowed characters."); - } } #endregion diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs index a535a78bd..c5354f2c7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs @@ -19,10 +19,14 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("JOBS")] public abstract class JobBase : ObservableEntity<Job> { @@ -77,16 +81,14 @@ namespace Tango.BL.Entities public event EventHandler<Double> LengthPercentageFactorChanged; - public event EventHandler<Boolean> IsSynchronizedChanged; - - public event EventHandler<Int32> SourceChanged; - public event EventHandler<ColorCatalog> ColorCatalogChanged; public event EventHandler<ColorSpace> ColorSpaceChanged; public event EventHandler<Customer> CustomerChanged; + public event EventHandler<SynchronizedObservableCollection<JobRun>> JobRunsChanged; + public event EventHandler<Machine> MachineChanged; public event EventHandler<Rml> RmlChanged; @@ -993,61 +995,6 @@ namespace Tango.BL.Entities } } - protected Boolean _issynchronized; - - /// <summary> - /// Gets or sets the jobbase is synchronized. - /// </summary> - - [Column("IS_SYNCHRONIZED")] - - public Boolean IsSynchronized - { - get - { - return _issynchronized; - } - - set - { - if (_issynchronized != value) - { - _issynchronized = value; - - OnIsSynchronizedChanged(value); - - } - } - } - - protected Int32 _source; - - /// <summary> - /// 0 = Remote - /// 1 = Local - /// </summary> - - [Column("SOURCE")] - - public Int32 Source - { - get - { - return _source; - } - - set - { - if (_source != value) - { - _source = value; - - OnSourceChanged(value); - - } - } - } - protected ColorCatalog _colorcatalog; /// <summary> @@ -1144,6 +1091,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection<JobRun> _jobruns; + + /// <summary> + /// Gets or sets the jobbase job runs. + /// </summary> + + public virtual SynchronizedObservableCollection<JobRun> JobRuns + { + get + { + return _jobruns; + } + + set + { + if (_jobruns != value) + { + _jobruns = value; + + OnJobRunsChanged(value); + + } + } + } + protected Machine _machine; /// <summary> @@ -1555,24 +1527,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the IsSynchronized has changed. - /// </summary> - protected virtual void OnIsSynchronizedChanged(Boolean issynchronized) - { - IsSynchronizedChanged?.Invoke(this, issynchronized); - RaisePropertyChanged(nameof(IsSynchronized)); - } - - /// <summary> - /// Called when the Source has changed. - /// </summary> - protected virtual void OnSourceChanged(Int32 source) - { - SourceChanged?.Invoke(this, source); - RaisePropertyChanged(nameof(Source)); - } - - /// <summary> /// Called when the ColorCatalog has changed. /// </summary> protected virtual void OnColorCatalogChanged(ColorCatalog colorcatalog) @@ -1600,6 +1554,15 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the JobRuns has changed. + /// </summary> + protected virtual void OnJobRunsChanged(SynchronizedObservableCollection<JobRun> jobruns) + { + JobRunsChanged?.Invoke(this, jobruns); + RaisePropertyChanged(nameof(JobRuns)); + } + + /// <summary> /// Called when the Machine has changed. /// </summary> protected virtual void OnMachineChanged(Machine machine) @@ -1659,6 +1622,8 @@ namespace Tango.BL.Entities public JobBase() : base() { + JobRuns = new SynchronizedObservableCollection<JobRun>(); + Segments = new SynchronizedObservableCollection<Segment>(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs index 468af8043..30f28f9f4 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs @@ -6,15 +6,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Enumerations; -using Tango.BL.ValueObjects; -using Tango.PMR.Exports; namespace Tango.BL.Entities { public partial class JobRun : JobRunBase { - private List<JobRunLiquidQuantity> _liquidQuantities; - [NotMapped] [JsonIgnore] public JobRunStatus JobRunStatus @@ -23,113 +19,6 @@ namespace Tango.BL.Entities set { Status = (int)value; } } - /// <summary> - /// Gets or sets the job designation. - /// </summary> - [NotMapped] - [JsonIgnore] - public JobDesignations Designation - { - get { return (JobDesignations)JobDesignation; } - set { JobDesignation = value.ToInt32(); RaisePropertyChangedAuto(); } - } - - /// <summary> - /// Gets or sets the job designation. - /// </summary> - [NotMapped] - [JsonIgnore] - public JobSource Source - { - get { return (JobSource)JobSource; } - set { JobSource = value.ToInt32(); RaisePropertyChangedAuto(); } - } - - [NotMapped] - [JsonIgnore] - public List<JobRunLiquidQuantity> LiquidQuantities - { - get - { - if (_liquidQuantities == null) - { - if (LiquidQuantityString != null) - { - try - { - _liquidQuantities = JsonConvert.DeserializeObject<List<JobRunLiquidQuantity>>(LiquidQuantityString); - } - catch - { - _liquidQuantities = new List<JobRunLiquidQuantity>(); - } - } - else - { - _liquidQuantities = new List<JobRunLiquidQuantity>(); - } - } - - return _liquidQuantities; - } - set - { - _liquidQuantities = value; - - if (_liquidQuantities != null) - { - LiquidQuantityString = JsonConvert.SerializeObject(_liquidQuantities); - } - } - } - - - private List<JobRunLiquidQuantity> _liquidQuantitiesFast; - [NotMapped] - [JsonIgnore] - public List<JobRunLiquidQuantity> LiquidQuantitiesFast - { - get - { - if (_liquidQuantitiesFast == null) - { - _liquidQuantitiesFast = new List<JobRunLiquidQuantity>(); - - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.Cyan, Quantity = CyanQuantity }); - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.Magenta, Quantity = MagentaQuantity }); - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.Yellow, Quantity = YellowQuantity }); - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.Black, Quantity = BlackQuantity }); - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.TransparentInk, Quantity = TransparentQuantity }); - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.Lubricant, Quantity = LubricantQuantity }); - _liquidQuantitiesFast.Add(new JobRunLiquidQuantity() { LiquidType = LiquidTypes.Cleaner, Quantity = CleanerQuantity }); - } - - return _liquidQuantitiesFast; - } - } - - private JobFile _jobFile; - [NotMapped] - [JsonIgnore] - public JobFile JobFile - { - get - { - if (_jobFile == null && JobString != null) - { - _jobFile = JobFile.Parser.ParseJson(JobString); - } - - return _jobFile; - } - set { _jobFile = value; } - } - - public Task<Job> CreateAssociatedJob() - { - return Job.FromJobFile(JobFile, MachineGuid, UserGuid); - } - protected override void RaisePropertyChanged(string propName) { base.RaisePropertyChanged(propName); diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index 58f429448..4d53a6d66 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -19,88 +19,29 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("JOB_RUNS")] public abstract class JobRunBase : ObservableEntity<JobRun> { - public event EventHandler<String> JobNameChanged; - - public event EventHandler<Int32> JobDesignationChanged; - - public event EventHandler<Int32> JobSourceChanged; - - public event EventHandler<String> JobStringChanged; - public event EventHandler<DateTime> StartDateChanged; - public event EventHandler<Nullable<DateTime>> UploadingStartDateChanged; - - public event EventHandler<Nullable<DateTime>> HeatingStartDateChanged; - - public event EventHandler<Nullable<DateTime>> ActualStartDateChanged; - public event EventHandler<DateTime> EndDateChanged; public event EventHandler<Int32> StatusChanged; - public event EventHandler<Double> JobLengthChanged; - - public event EventHandler<Boolean> IsGradientChanged; - - public event EventHandler<Int32> GradientResolutionCmChanged; - - public event EventHandler<String> LiquidQuantityStringChanged; - - public event EventHandler<Int32> CyanQuantityChanged; - - public event EventHandler<Int32> MagentaQuantityChanged; - - public event EventHandler<Int32> YellowQuantityChanged; - - public event EventHandler<Int32> BlackQuantityChanged; - - public event EventHandler<Int32> TransparentQuantityChanged; - - public event EventHandler<Int32> LubricantQuantityChanged; - - public event EventHandler<Int32> CleanerQuantityChanged; - public event EventHandler<Double> EndPositionChanged; public event EventHandler<String> FailedMessageChanged; - public event EventHandler<Boolean> IsHeadCleaningChanged; - - public event EventHandler<Boolean> IsSynchronizedChanged; - - protected String _machineguid; - - /// <summary> - /// Gets or sets the jobrunbase machine guid. - /// </summary> - - [Column("MACHINE_GUID")] - - public String MachineGuid - { - get - { - return _machineguid; - } - - set - { - if (_machineguid != value) - { - _machineguid = value; - - } - } - } + public event EventHandler<Job> JobChanged; protected String _jobguid; @@ -109,6 +50,7 @@ namespace Tango.BL.Entities /// </summary> [Column("JOB_GUID")] + [ForeignKey("Job")] public String JobGuid { @@ -127,164 +69,6 @@ namespace Tango.BL.Entities } } - protected String _rmlguid; - - /// <summary> - /// Gets or sets the jobrunbase rml guid. - /// </summary> - - [Column("RML_GUID")] - - public String RmlGuid - { - get - { - return _rmlguid; - } - - set - { - if (_rmlguid != value) - { - _rmlguid = value; - - } - } - } - - protected String _userguid; - - /// <summary> - /// Gets or sets the jobrunbase user guid. - /// </summary> - - [Column("USER_GUID")] - - public String UserGuid - { - get - { - return _userguid; - } - - set - { - if (_userguid != value) - { - _userguid = value; - - } - } - } - - protected String _jobname; - - /// <summary> - /// Gets or sets the jobrunbase job name. - /// </summary> - - [Column("JOB_NAME")] - - public String JobName - { - get - { - return _jobname; - } - - set - { - if (_jobname != value) - { - _jobname = value; - - OnJobNameChanged(value); - - } - } - } - - protected Int32 _jobdesignation; - - /// <summary> - /// Gets or sets the jobrunbase job designation. - /// </summary> - - [Column("JOB_DESIGNATION")] - - public Int32 JobDesignation - { - get - { - return _jobdesignation; - } - - set - { - if (_jobdesignation != value) - { - _jobdesignation = value; - - OnJobDesignationChanged(value); - - } - } - } - - protected Int32 _jobsource; - - /// <summary> - /// Gets or sets the jobrunbase job source. - /// </summary> - - [Column("JOB_SOURCE")] - - public Int32 JobSource - { - get - { - return _jobsource; - } - - set - { - if (_jobsource != value) - { - _jobsource = value; - - OnJobSourceChanged(value); - - } - } - } - - protected String _jobstring; - - /// <summary> - /// Gets or sets the jobrunbase job string. - /// </summary> - - [Column("JOB_STRING")] - - public String JobString - { - get - { - return _jobstring; - } - - set - { - if (_jobstring != value) - { - _jobstring = value; - - OnJobStringChanged(value); - - } - } - } - protected DateTime _startdate; /// <summary> @@ -312,87 +96,6 @@ namespace Tango.BL.Entities } } - protected Nullable<DateTime> _uploadingstartdate; - - /// <summary> - /// Gets or sets the jobrunbase uploading start date. - /// </summary> - - [Column("UPLOADING_START_DATE")] - - public Nullable<DateTime> UploadingStartDate - { - get - { - return _uploadingstartdate; - } - - set - { - if (_uploadingstartdate != value) - { - _uploadingstartdate = value; - - OnUploadingStartDateChanged(value); - - } - } - } - - protected Nullable<DateTime> _heatingstartdate; - - /// <summary> - /// Gets or sets the jobrunbase heating start date. - /// </summary> - - [Column("HEATING_START_DATE")] - - public Nullable<DateTime> HeatingStartDate - { - get - { - return _heatingstartdate; - } - - set - { - if (_heatingstartdate != value) - { - _heatingstartdate = value; - - OnHeatingStartDateChanged(value); - - } - } - } - - protected Nullable<DateTime> _actualstartdate; - - /// <summary> - /// Gets or sets the jobrunbase actual start date. - /// </summary> - - [Column("ACTUAL_START_DATE")] - - public Nullable<DateTime> ActualStartDate - { - get - { - return _actualstartdate; - } - - set - { - if (_actualstartdate != value) - { - _actualstartdate = value; - - OnActualStartDateChanged(value); - - } - } - } - protected DateTime _enddate; /// <summary> @@ -449,303 +152,6 @@ namespace Tango.BL.Entities } } - protected Double _joblength; - - /// <summary> - /// Gets or sets the jobrunbase job length. - /// </summary> - - [Column("JOB_LENGTH")] - - public Double JobLength - { - get - { - return _joblength; - } - - set - { - if (_joblength != value) - { - _joblength = value; - - OnJobLengthChanged(value); - - } - } - } - - protected Boolean _isgradient; - - /// <summary> - /// Gets or sets the jobrunbase is gradient. - /// </summary> - - [Column("IS_GRADIENT")] - - public Boolean IsGradient - { - get - { - return _isgradient; - } - - set - { - if (_isgradient != value) - { - _isgradient = value; - - OnIsGradientChanged(value); - - } - } - } - - protected Int32 _gradientresolutioncm; - - /// <summary> - /// Gets or sets the jobrunbase gradient resolution cm. - /// </summary> - - [Column("GRADIENT_RESOLUTION_CM")] - - public Int32 GradientResolutionCm - { - get - { - return _gradientresolutioncm; - } - - set - { - if (_gradientresolutioncm != value) - { - _gradientresolutioncm = value; - - OnGradientResolutionCmChanged(value); - - } - } - } - - protected String _liquidquantitystring; - - /// <summary> - /// Gets or sets the jobrunbase liquid quantity string. - /// </summary> - - [Column("LIQUID_QUANTITY_STRING")] - - public String LiquidQuantityString - { - get - { - return _liquidquantitystring; - } - - set - { - if (_liquidquantitystring != value) - { - _liquidquantitystring = value; - - OnLiquidQuantityStringChanged(value); - - } - } - } - - protected Int32 _cyanquantity; - - /// <summary> - /// Gets or sets the jobrunbase cyan quantity. - /// </summary> - - [Column("CYAN_QUANTITY")] - - public Int32 CyanQuantity - { - get - { - return _cyanquantity; - } - - set - { - if (_cyanquantity != value) - { - _cyanquantity = value; - - OnCyanQuantityChanged(value); - - } - } - } - - protected Int32 _magentaquantity; - - /// <summary> - /// Gets or sets the jobrunbase magenta quantity. - /// </summary> - - [Column("MAGENTA_QUANTITY")] - - public Int32 MagentaQuantity - { - get - { - return _magentaquantity; - } - - set - { - if (_magentaquantity != value) - { - _magentaquantity = value; - - OnMagentaQuantityChanged(value); - - } - } - } - - protected Int32 _yellowquantity; - - /// <summary> - /// Gets or sets the jobrunbase yellow quantity. - /// </summary> - - [Column("YELLOW_QUANTITY")] - - public Int32 YellowQuantity - { - get - { - return _yellowquantity; - } - - set - { - if (_yellowquantity != value) - { - _yellowquantity = value; - - OnYellowQuantityChanged(value); - - } - } - } - - protected Int32 _blackquantity; - - /// <summary> - /// Gets or sets the jobrunbase black quantity. - /// </summary> - - [Column("BLACK_QUANTITY")] - - public Int32 BlackQuantity - { - get - { - return _blackquantity; - } - - set - { - if (_blackquantity != value) - { - _blackquantity = value; - - OnBlackQuantityChanged(value); - - } - } - } - - protected Int32 _transparentquantity; - - /// <summary> - /// Gets or sets the jobrunbase transparent quantity. - /// </summary> - - [Column("TRANSPARENT_QUANTITY")] - - public Int32 TransparentQuantity - { - get - { - return _transparentquantity; - } - - set - { - if (_transparentquantity != value) - { - _transparentquantity = value; - - OnTransparentQuantityChanged(value); - - } - } - } - - protected Int32 _lubricantquantity; - - /// <summary> - /// Gets or sets the jobrunbase lubricant quantity. - /// </summary> - - [Column("LUBRICANT_QUANTITY")] - - public Int32 LubricantQuantity - { - get - { - return _lubricantquantity; - } - - set - { - if (_lubricantquantity != value) - { - _lubricantquantity = value; - - OnLubricantQuantityChanged(value); - - } - } - } - - protected Int32 _cleanerquantity; - - /// <summary> - /// Gets or sets the jobrunbase cleaner quantity. - /// </summary> - - [Column("CLEANER_QUANTITY")] - - public Int32 CleanerQuantity - { - get - { - return _cleanerquantity; - } - - set - { - if (_cleanerquantity != value) - { - _cleanerquantity = value; - - OnCleanerQuantityChanged(value); - - } - } - } - protected Double _endposition; /// <summary> @@ -800,97 +206,39 @@ namespace Tango.BL.Entities } } - protected Boolean _isheadcleaning; + protected Job _job; /// <summary> - /// Gets or sets the jobrunbase is head cleaning. + /// Gets or sets the jobrunbase job. /// </summary> - [Column("IS_HEAD_CLEANING")] - - public Boolean IsHeadCleaning + [XmlIgnore] + [JsonIgnore] + public virtual Job Job { get { - return _isheadcleaning; + return _job; } set { - if (_isheadcleaning != value) + if (_job != value) { - _isheadcleaning = value; - - OnIsHeadCleaningChanged(value); - - } - } - } - - protected Boolean _issynchronized; - - /// <summary> - /// Gets or sets the jobrunbase is synchronized. - /// </summary> - - [Column("IS_SYNCHRONIZED")] - - public Boolean IsSynchronized - { - get - { - return _issynchronized; - } + _job = value; - set - { - if (_issynchronized != value) - { - _issynchronized = value; + if (Job != null) + { + JobGuid = Job.Guid; + } - OnIsSynchronizedChanged(value); + OnJobChanged(value); } } } /// <summary> - /// Called when the JobName has changed. - /// </summary> - protected virtual void OnJobNameChanged(String jobname) - { - JobNameChanged?.Invoke(this, jobname); - RaisePropertyChanged(nameof(JobName)); - } - - /// <summary> - /// Called when the JobDesignation has changed. - /// </summary> - protected virtual void OnJobDesignationChanged(Int32 jobdesignation) - { - JobDesignationChanged?.Invoke(this, jobdesignation); - RaisePropertyChanged(nameof(JobDesignation)); - } - - /// <summary> - /// Called when the JobSource has changed. - /// </summary> - protected virtual void OnJobSourceChanged(Int32 jobsource) - { - JobSourceChanged?.Invoke(this, jobsource); - RaisePropertyChanged(nameof(JobSource)); - } - - /// <summary> - /// Called when the JobString has changed. - /// </summary> - protected virtual void OnJobStringChanged(String jobstring) - { - JobStringChanged?.Invoke(this, jobstring); - RaisePropertyChanged(nameof(JobString)); - } - - /// <summary> /// Called when the StartDate has changed. /// </summary> protected virtual void OnStartDateChanged(DateTime startdate) @@ -900,33 +248,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the UploadingStartDate has changed. - /// </summary> - protected virtual void OnUploadingStartDateChanged(Nullable<DateTime> uploadingstartdate) - { - UploadingStartDateChanged?.Invoke(this, uploadingstartdate); - RaisePropertyChanged(nameof(UploadingStartDate)); - } - - /// <summary> - /// Called when the HeatingStartDate has changed. - /// </summary> - protected virtual void OnHeatingStartDateChanged(Nullable<DateTime> heatingstartdate) - { - HeatingStartDateChanged?.Invoke(this, heatingstartdate); - RaisePropertyChanged(nameof(HeatingStartDate)); - } - - /// <summary> - /// Called when the ActualStartDate has changed. - /// </summary> - protected virtual void OnActualStartDateChanged(Nullable<DateTime> actualstartdate) - { - ActualStartDateChanged?.Invoke(this, actualstartdate); - RaisePropertyChanged(nameof(ActualStartDate)); - } - - /// <summary> /// Called when the EndDate has changed. /// </summary> protected virtual void OnEndDateChanged(DateTime enddate) @@ -945,105 +266,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the JobLength has changed. - /// </summary> - protected virtual void OnJobLengthChanged(Double joblength) - { - JobLengthChanged?.Invoke(this, joblength); - RaisePropertyChanged(nameof(JobLength)); - } - - /// <summary> - /// Called when the IsGradient has changed. - /// </summary> - protected virtual void OnIsGradientChanged(Boolean isgradient) - { - IsGradientChanged?.Invoke(this, isgradient); - RaisePropertyChanged(nameof(IsGradient)); - } - - /// <summary> - /// Called when the GradientResolutionCm has changed. - /// </summary> - protected virtual void OnGradientResolutionCmChanged(Int32 gradientresolutioncm) - { - GradientResolutionCmChanged?.Invoke(this, gradientresolutioncm); - RaisePropertyChanged(nameof(GradientResolutionCm)); - } - - /// <summary> - /// Called when the LiquidQuantityString has changed. - /// </summary> - protected virtual void OnLiquidQuantityStringChanged(String liquidquantitystring) - { - LiquidQuantityStringChanged?.Invoke(this, liquidquantitystring); - RaisePropertyChanged(nameof(LiquidQuantityString)); - } - - /// <summary> - /// Called when the CyanQuantity has changed. - /// </summary> - protected virtual void OnCyanQuantityChanged(Int32 cyanquantity) - { - CyanQuantityChanged?.Invoke(this, cyanquantity); - RaisePropertyChanged(nameof(CyanQuantity)); - } - - /// <summary> - /// Called when the MagentaQuantity has changed. - /// </summary> - protected virtual void OnMagentaQuantityChanged(Int32 magentaquantity) - { - MagentaQuantityChanged?.Invoke(this, magentaquantity); - RaisePropertyChanged(nameof(MagentaQuantity)); - } - - /// <summary> - /// Called when the YellowQuantity has changed. - /// </summary> - protected virtual void OnYellowQuantityChanged(Int32 yellowquantity) - { - YellowQuantityChanged?.Invoke(this, yellowquantity); - RaisePropertyChanged(nameof(YellowQuantity)); - } - - /// <summary> - /// Called when the BlackQuantity has changed. - /// </summary> - protected virtual void OnBlackQuantityChanged(Int32 blackquantity) - { - BlackQuantityChanged?.Invoke(this, blackquantity); - RaisePropertyChanged(nameof(BlackQuantity)); - } - - /// <summary> - /// Called when the TransparentQuantity has changed. - /// </summary> - protected virtual void OnTransparentQuantityChanged(Int32 transparentquantity) - { - TransparentQuantityChanged?.Invoke(this, transparentquantity); - RaisePropertyChanged(nameof(TransparentQuantity)); - } - - /// <summary> - /// Called when the LubricantQuantity has changed. - /// </summary> - protected virtual void OnLubricantQuantityChanged(Int32 lubricantquantity) - { - LubricantQuantityChanged?.Invoke(this, lubricantquantity); - RaisePropertyChanged(nameof(LubricantQuantity)); - } - - /// <summary> - /// Called when the CleanerQuantity has changed. - /// </summary> - protected virtual void OnCleanerQuantityChanged(Int32 cleanerquantity) - { - CleanerQuantityChanged?.Invoke(this, cleanerquantity); - RaisePropertyChanged(nameof(CleanerQuantity)); - } - - /// <summary> /// Called when the EndPosition has changed. /// </summary> protected virtual void OnEndPositionChanged(Double endposition) @@ -1062,21 +284,12 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the IsHeadCleaning has changed. - /// </summary> - protected virtual void OnIsHeadCleaningChanged(Boolean isheadcleaning) - { - IsHeadCleaningChanged?.Invoke(this, isheadcleaning); - RaisePropertyChanged(nameof(IsHeadCleaning)); - } - - /// <summary> - /// Called when the IsSynchronized has changed. + /// Called when the Job has changed. /// </summary> - protected virtual void OnIsSynchronizedChanged(Boolean issynchronized) + protected virtual void OnJobChanged(Job job) { - IsSynchronizedChanged?.Invoke(this, issynchronized); - RaisePropertyChanged(nameof(IsSynchronized)); + JobChanged?.Invoke(this, job); + RaisePropertyChanged(nameof(Job)); } /// <summary> diff --git a/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs index 8f3ca38e8..ccd78a60b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs index ce09d72ac..60fdc6707 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; -using Tango.BL.Enumerations; namespace Tango.BL.Entities { @@ -25,13 +24,6 @@ namespace Tango.BL.Entities get { return Core.Helpers.ColorHelper.IntegerToColor(Color); } } - [NotMapped] - [JsonIgnore] - public LiquidTypes Type - { - get { return (LiquidTypes)Code; } - } - /// <summary> /// Initializes a new instance of the <see cref="LiquidType" /> class. /// </summary> diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs index 75260e58c..7683eadbc 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -39,8 +38,6 @@ namespace Tango.BL.Entities public event EventHandler<Boolean> HasPigmentChanged; - public event EventHandler<String> ShortNameChanged; - public event EventHandler<SynchronizedObservableCollection<Cat>> CatsChanged; public event EventHandler<SynchronizedObservableCollection<IdsPack>> IdsPacksChanged; @@ -209,33 +206,6 @@ namespace Tango.BL.Entities } } - protected String _shortname; - - /// <summary> - /// Gets or sets the liquidtypebase short name. - /// </summary> - - [Column("SHORT_NAME")] - - public String ShortName - { - get - { - return _shortname; - } - - set - { - if (_shortname != value) - { - _shortname = value; - - OnShortNameChanged(value); - - } - } - } - protected SynchronizedObservableCollection<Cat> _cats; /// <summary> @@ -366,15 +336,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the ShortName has changed. - /// </summary> - protected virtual void OnShortNameChanged(String shortname) - { - ShortNameChanged?.Invoke(this, shortname); - RaisePropertyChanged(nameof(ShortName)); - } - - /// <summary> /// Called when the Cats has changed. /// </summary> protected virtual void OnCatsChanged(SynchronizedObservableCollection<Cat> cats) diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs index ef9e80cb9..5aad28034 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/Machine.cs b/Software/Visual_Studio/Tango.BL/Entities/Machine.cs index 2070c68b3..a7ba29c2a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Machine.cs @@ -73,23 +73,6 @@ namespace Tango.BL.Entities } } - /// <summary> - /// Gets or sets the installed head on this machine. - /// </summary> - [NotMapped] - [JsonIgnore] - public HeadTypes MachineHeadType - { - get - { - return (HeadTypes)HeadType; - } - set - { - HeadType = value.ToInt32(); - } - } - #endregion protected override void RaisePropertyChanged(string propName) diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs index cbfd43789..4f989aeb2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -71,15 +70,11 @@ namespace Tango.BL.Entities public event EventHandler<String> DeviceNameChanged; - public event EventHandler<Int32> HeadTypeChanged; - - public event EventHandler<String> ActivationKeyChanged; - public event EventHandler<SynchronizedObservableCollection<Cat>> CatsChanged; - public event EventHandler<Configuration> ConfigurationChanged; + public event EventHandler<ColorSpace> DefaultColorSpaceChanged; - public event EventHandler<SynchronizedObservableCollection<DataStoreItem>> DataStoreItemsChanged; + public event EventHandler<Configuration> ConfigurationChanged; public event EventHandler<SynchronizedObservableCollection<Job>> JobsChanged; @@ -89,6 +84,10 @@ namespace Tango.BL.Entities public event EventHandler<Organization> OrganizationChanged; + public event EventHandler<Rml> DefaultRmlChanged; + + public event EventHandler<SpoolType> DefaultSpoolTypeChanged; + public event EventHandler<SynchronizedObservableCollection<Spool>> SpoolsChanged; protected String _serialnumber; @@ -198,31 +197,6 @@ namespace Tango.BL.Entities } } - protected String _siteguid; - - /// <summary> - /// Gets or sets the machinebase site guid. - /// </summary> - - [Column("SITE_GUID")] - - public String SiteGuid - { - get - { - return _siteguid; - } - - set - { - if (_siteguid != value) - { - _siteguid = value; - - } - } - } - protected String _machineversionguid; /// <summary> @@ -282,6 +256,7 @@ namespace Tango.BL.Entities /// </summary> [Column("DEFAULT_RML_GUID")] + [ForeignKey("DefaultRml")] public String DefaultRmlGuid { @@ -386,6 +361,7 @@ namespace Tango.BL.Entities /// </summary> [Column("DEFAULT_COLOR_SPACE_GUID")] + [ForeignKey("DefaultColorSpace")] public String DefaultColorSpaceGuid { @@ -438,6 +414,7 @@ namespace Tango.BL.Entities /// </summary> [Column("DEFAULT_SPOOL_TYPE_GUID")] + [ForeignKey("DefaultSpoolType")] public String DefaultSpoolTypeGuid { @@ -888,80 +865,58 @@ namespace Tango.BL.Entities } } - protected Int32 _headtype; + protected SynchronizedObservableCollection<Cat> _cats; /// <summary> - /// Gets or sets the machinebase head type. + /// Gets or sets the machinebase cats. /// </summary> - [Column("HEAD_TYPE")] - - public Int32 HeadType + public virtual SynchronizedObservableCollection<Cat> Cats { get { - return _headtype; + return _cats; } set { - if (_headtype != value) + if (_cats != value) { - _headtype = value; + _cats = value; - OnHeadTypeChanged(value); + OnCatsChanged(value); } } } - protected String _activationkey; + protected ColorSpace _defaultcolorspace; /// <summary> - /// Gets or sets the machinebase activation key. + /// Gets or sets the machinebase color spaces. /// </summary> - [Column("ACTIVATION_KEY")] - - public String ActivationKey + [XmlIgnore] + [JsonIgnore] + public virtual ColorSpace DefaultColorSpace { get { - return _activationkey; + return _defaultcolorspace; } set { - if (_activationkey != value) + if (_defaultcolorspace != value) { - _activationkey = value; + _defaultcolorspace = value; - OnActivationKeyChanged(value); - - } - } - } - - protected SynchronizedObservableCollection<Cat> _cats; - - /// <summary> - /// Gets or sets the machinebase cats. - /// </summary> - - public virtual SynchronizedObservableCollection<Cat> Cats - { - get - { - return _cats; - } - - set - { - if (_cats != value) - { - _cats = value; + if (DefaultColorSpace != null) + { + DefaultColorSpaceGuid = DefaultColorSpace.Guid; + } - OnCatsChanged(value); + OnDefaultColorSpaceChanged(value); } } @@ -999,31 +954,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<DataStoreItem> _datastoreitems; - - /// <summary> - /// Gets or sets the machinebase data store items. - /// </summary> - - public virtual SynchronizedObservableCollection<DataStoreItem> DataStoreItems - { - get - { - return _datastoreitems; - } - - set - { - if (_datastoreitems != value) - { - _datastoreitems = value; - - OnDataStoreItemsChanged(value); - - } - } - } - protected SynchronizedObservableCollection<Job> _jobs; /// <summary> @@ -1138,6 +1068,70 @@ namespace Tango.BL.Entities } } + protected Rml _defaultrml; + + /// <summary> + /// Gets or sets the machinebase rml. + /// </summary> + + [XmlIgnore] + [JsonIgnore] + public virtual Rml DefaultRml + { + get + { + return _defaultrml; + } + + set + { + if (_defaultrml != value) + { + _defaultrml = value; + + if (DefaultRml != null) + { + DefaultRmlGuid = DefaultRml.Guid; + } + + OnDefaultRmlChanged(value); + + } + } + } + + protected SpoolType _defaultspooltype; + + /// <summary> + /// Gets or sets the machinebase spool types. + /// </summary> + + [XmlIgnore] + [JsonIgnore] + public virtual SpoolType DefaultSpoolType + { + get + { + return _defaultspooltype; + } + + set + { + if (_defaultspooltype != value) + { + _defaultspooltype = value; + + if (DefaultSpoolType != null) + { + DefaultSpoolTypeGuid = DefaultSpoolType.Guid; + } + + OnDefaultSpoolTypeChanged(value); + + } + } + } + protected SynchronizedObservableCollection<Spool> _spools; /// <summary> @@ -1362,24 +1356,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the HeadType has changed. - /// </summary> - protected virtual void OnHeadTypeChanged(Int32 headtype) - { - HeadTypeChanged?.Invoke(this, headtype); - RaisePropertyChanged(nameof(HeadType)); - } - - /// <summary> - /// Called when the ActivationKey has changed. - /// </summary> - protected virtual void OnActivationKeyChanged(String activationkey) - { - ActivationKeyChanged?.Invoke(this, activationkey); - RaisePropertyChanged(nameof(ActivationKey)); - } - - /// <summary> /// Called when the Cats has changed. /// </summary> protected virtual void OnCatsChanged(SynchronizedObservableCollection<Cat> cats) @@ -1389,21 +1365,21 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the Configuration has changed. + /// Called when the DefaultColorSpace has changed. /// </summary> - protected virtual void OnConfigurationChanged(Configuration configuration) + protected virtual void OnDefaultColorSpaceChanged(ColorSpace defaultcolorspace) { - ConfigurationChanged?.Invoke(this, configuration); - RaisePropertyChanged(nameof(Configuration)); + DefaultColorSpaceChanged?.Invoke(this, defaultcolorspace); + RaisePropertyChanged(nameof(DefaultColorSpace)); } /// <summary> - /// Called when the DataStoreItems has changed. + /// Called when the Configuration has changed. /// </summary> - protected virtual void OnDataStoreItemsChanged(SynchronizedObservableCollection<DataStoreItem> datastoreitems) + protected virtual void OnConfigurationChanged(Configuration configuration) { - DataStoreItemsChanged?.Invoke(this, datastoreitems); - RaisePropertyChanged(nameof(DataStoreItems)); + ConfigurationChanged?.Invoke(this, configuration); + RaisePropertyChanged(nameof(Configuration)); } /// <summary> @@ -1443,6 +1419,24 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the DefaultRml has changed. + /// </summary> + protected virtual void OnDefaultRmlChanged(Rml defaultrml) + { + DefaultRmlChanged?.Invoke(this, defaultrml); + RaisePropertyChanged(nameof(DefaultRml)); + } + + /// <summary> + /// Called when the DefaultSpoolType has changed. + /// </summary> + protected virtual void OnDefaultSpoolTypeChanged(SpoolType defaultspooltype) + { + DefaultSpoolTypeChanged?.Invoke(this, defaultspooltype); + RaisePropertyChanged(nameof(DefaultSpoolType)); + } + + /// <summary> /// Called when the Spools has changed. /// </summary> protected virtual void OnSpoolsChanged(SynchronizedObservableCollection<Spool> spools) @@ -1459,8 +1453,6 @@ namespace Tango.BL.Entities Cats = new SynchronizedObservableCollection<Cat>(); - DataStoreItems = new SynchronizedObservableCollection<DataStoreItem>(); - Jobs = new SynchronizedObservableCollection<Job>(); MachinesEvents = new SynchronizedObservableCollection<MachinesEvent>(); diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs index 65630a630..83bf72451 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs index 7b90623d8..a94ed85a0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs @@ -27,40 +27,22 @@ namespace Tango.BL.Entities .Ignore(() => machine.MachinesEvents) .Ignore(() => machine.Configuration.Machines) .Ignore(() => machine.Jobs) - .Ignore(() => machine.SerialNumber) - .Ignore(() => machine.DefaultRmlGuid) - .Ignore(() => machine.DefaultColorSpaceGuid) - .Ignore(() => machine.DefaultSpoolTypeGuid) - .Ignore(() => machine.LoadedRmlGuid) - .Ignore(() => machine.DeviceId) - .Ignore(() => machine.DeviceName) - .Ignore(() => machine.IsDeviceRegistered) - .Ignore(() => machine.SiteGuid), + .Ignore(() => machine.SerialNumber), EntitySerializationFlags.IgnoreGuids | EntitySerializationFlags.IgnoreReferenceTypes); } - public async Task<Machine> CreatePrototypeMachine(ObservablesContext context) + public Machine CreatePrototypeMachine(ObservablesContext context) { Machine m = new Machine(); - String protoTypeData = (await context.MachineVersions.SingleOrDefaultAsync(x => x.Guid == Guid)).PrototypeMachineData; - - Machine machine = Machine.FromJson(protoTypeData, new EntitySerializationStrategy() + Machine machine = Machine.FromJson(PrototypeMachineData, new EntitySerializationStrategy() .Include(() => m.Configuration) .Ignore(() => m.Name) .Ignore(() => m.MachinesEvents) .Ignore(() => m.Configuration.Machines) .Ignore(() => m.Jobs) - .Ignore(() => m.SerialNumber) - .Ignore(() => m.DefaultRmlGuid) - .Ignore(() => m.DefaultColorSpaceGuid) - .Ignore(() => m.DefaultSpoolTypeGuid) - .Ignore(() => m.LoadedRmlGuid) - .Ignore(() => m.DeviceId) - .Ignore(() => m.DeviceName) - .Ignore(() => m.IsDeviceRegistered) - .Ignore(() => m.SiteGuid), + .Ignore(() => m.SerialNumber), EntitySerializationFlags.IgnoreGuids | EntitySerializationFlags.IgnoreReferenceTypes); @@ -69,7 +51,6 @@ namespace Tango.BL.Entities machine.ConfigurationGuid = null; machine.ConfigurationGuid = machine.Configuration.Guid; - foreach (var cat in machine.Cats) { cat.MachineGuid = machine.Guid; @@ -89,10 +70,6 @@ namespace Tango.BL.Entities spool.MachineGuid = machine.Guid; } - machine.DefaultColorSpaceGuid = null; - machine.DefaultRmlGuid = null; - machine.DefaultSpoolTypeGuid = null; - return machine; } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs index 440eaf723..30602025e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs b/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs index 4572fe5ae..2738e0f08 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs @@ -90,15 +90,6 @@ namespace Tango.BL.Entities get { return EventType.Actions; } } - [NotMapped] - public DateTime ResolvedDateTime { get; set; } - - [NotMapped] - public TimeSpan Duration - { - get { return ResolvedDateTime - DateTime; } - } - private User _eventUser; [NotMapped] [JsonIgnore] diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs index 161e25d77..5091267e8 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -33,8 +32,6 @@ namespace Tango.BL.Entities public event EventHandler<String> DescriptionChanged; - public event EventHandler<Boolean> IsSynchronizedChanged; - public event EventHandler<EventType> EventTypeChanged; public event EventHandler<Machine> MachineChanged; @@ -200,33 +197,6 @@ namespace Tango.BL.Entities } } - protected Boolean _issynchronized; - - /// <summary> - /// Gets or sets the machineseventbase is synchronized. - /// </summary> - - [Column("IS_SYNCHRONIZED")] - - public Boolean IsSynchronized - { - get - { - return _issynchronized; - } - - set - { - if (_issynchronized != value) - { - _issynchronized = value; - - OnIsSynchronizedChanged(value); - - } - } - } - protected EventType _eventtype; /// <summary> @@ -351,15 +321,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the IsSynchronized has changed. - /// </summary> - protected virtual void OnIsSynchronizedChanged(Boolean issynchronized) - { - IsSynchronizedChanged?.Invoke(this, issynchronized); - RaisePropertyChanged(nameof(IsSynchronized)); - } - - /// <summary> /// Called when the EventType has changed. /// </summary> protected virtual void OnEventTypeChanged(EventType eventtype) diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs index ec7501ba4..12405642a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs index 860337fae..2d0529506 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs index 7a099ebeb..91fd93bd4 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs index 34c40f2a0..2467bcd8c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/Organization.cs b/Software/Visual_Studio/Tango.BL/Entities/Organization.cs index 7580c6fd1..738c77efb 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Organization.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Organization.cs @@ -15,10 +15,5 @@ namespace Tango.BL.Entities { } - - public override string ToString() - { - return Name; - } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs index 7fb8699af..b19cb6fc1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -37,8 +36,6 @@ namespace Tango.BL.Entities public event EventHandler<SynchronizedObservableCollection<Machine>> MachinesChanged; - public event EventHandler<SynchronizedObservableCollection<Site>> SitesChanged; - public event EventHandler<SynchronizedObservableCollection<User>> UsersChanged; protected String _name; @@ -234,31 +231,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<Site> _sites; - - /// <summary> - /// Gets or sets the organizationbase sites. - /// </summary> - - public virtual SynchronizedObservableCollection<Site> Sites - { - get - { - return _sites; - } - - set - { - if (_sites != value) - { - _sites = value; - - OnSitesChanged(value); - - } - } - } - protected SynchronizedObservableCollection<User> _users; /// <summary> @@ -330,15 +302,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the Sites has changed. - /// </summary> - protected virtual void OnSitesChanged(SynchronizedObservableCollection<Site> sites) - { - SitesChanged?.Invoke(this, sites); - RaisePropertyChanged(nameof(Sites)); - } - - /// <summary> /// Called when the Users has changed. /// </summary> protected virtual void OnUsersChanged(SynchronizedObservableCollection<User> users) @@ -357,8 +320,6 @@ namespace Tango.BL.Entities Machines = new SynchronizedObservableCollection<Machine>(); - Sites = new SynchronizedObservableCollection<Site>(); - Users = new SynchronizedObservableCollection<User>(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs index d86097af1..7f6ba7499 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs index 0a78dbc93..2cef9ba4c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs @@ -5,7 +5,6 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.Core.ExtensionMethods; namespace Tango.BL.Entities { @@ -14,7 +13,6 @@ namespace Tango.BL.Entities public event EventHandler DyeingSpeedMinInkUptakeChanged; public const double DRYER_METERS_PER_CYCLE = 0.76; - public const double DRYER_TO_SPOOL_LENGTH_METERS = 0.9; protected override void RaisePropertyChanged(string propName) { @@ -35,7 +33,7 @@ namespace Tango.BL.Entities [JsonIgnore] public double DryerBufferLengthMeters { - get { return (DryerBufferLength * DRYER_METERS_PER_CYCLE) + DRYER_TO_SPOOL_LENGTH_METERS; } + get { return DryerBufferLength * DRYER_METERS_PER_CYCLE; } } /// <summary> @@ -45,34 +43,5 @@ namespace Tango.BL.Entities { } - - public double GetAverageTemperature() - { - List<double> heaters = new List<double>(); - - heaters.Add(HeadZone1Temp); - heaters.Add(HeadZone2Temp); - heaters.Add(HeadZone3Temp); - heaters.Add(HeadZone4Temp); - heaters.Add(HeadZone5Temp); - heaters.Add(HeadZone6Temp); - heaters.Add(HeadZone7Temp); - heaters.Add(HeadZone8Temp); - heaters.Add(HeadZone9Temp); - heaters.Add(HeadZone10Temp); - heaters.Add(HeadZone11Temp); - heaters.Add(HeadZone12Temp); - heaters.Add(LBlowerTemp); - heaters.Add(RBlowerTemp); - - return heaters.Average(); - } - - public PMR.Printing.ProcessParameters ToProcessParametersPMR() - { - PMR.Printing.ProcessParameters p = new PMR.Printing.ProcessParameters(); - this.MapPrimitivesTo(p); - return p; - } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs index 498bafc85..2757b0625 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -69,28 +68,6 @@ namespace Tango.BL.Entities public event EventHandler<Int32> TableIndexChanged; - public event EventHandler<Double> HeadZone7TempChanged; - - public event EventHandler<Double> HeadZone8TempChanged; - - public event EventHandler<Double> HeadZone9TempChanged; - - public event EventHandler<Double> HeadZone10TempChanged; - - public event EventHandler<Double> HeadZone11TempChanged; - - public event EventHandler<Double> HeadZone12TempChanged; - - public event EventHandler<Double> RBlowerFlowChanged; - - public event EventHandler<Double> RBlowerTempChanged; - - public event EventHandler<Double> LBlowerFlowChanged; - - public event EventHandler<Double> LBlowerTempChanged; - - public event EventHandler<Double> PressureBuildUpChanged; - public event EventHandler<ProcessParametersTablesGroup> ProcessParametersTablesGroupChanged; protected String _name; @@ -101,10 +78,6 @@ namespace Tango.BL.Entities [Column("NAME")] - [StringFormat("0.0")] - - [PropertyIndex(1)] - public String Name { get @@ -132,10 +105,6 @@ namespace Tango.BL.Entities [Column("DYEING_SPEED")] - [StringFormat("0.0")] - - [PropertyIndex(2)] - public Double DyeingSpeed { get @@ -163,10 +132,6 @@ namespace Tango.BL.Entities [Column("MIN_INK_UPTAKE")] - [StringFormat("0.0")] - - [PropertyIndex(3)] - public Double MinInkUptake { get @@ -194,10 +159,6 @@ namespace Tango.BL.Entities [Column("MAX_INK_UPTAKE")] - [StringFormat("0.0")] - - [PropertyIndex(4)] - public Double MaxInkUptake { get @@ -225,10 +186,6 @@ namespace Tango.BL.Entities [Column("FEEDER_TENSION")] - [StringFormat("0.000")] - - [PropertyIndex(5)] - public Double FeederTension { get @@ -256,10 +213,6 @@ namespace Tango.BL.Entities [Column("PULLER_TENSION")] - [StringFormat("0.0")] - - [PropertyIndex(6)] - public Double PullerTension { get @@ -287,10 +240,6 @@ namespace Tango.BL.Entities [Column("WINDER_TENSION")] - [StringFormat("0.0")] - - [PropertyIndex(7)] - public Double WinderTension { get @@ -318,10 +267,6 @@ namespace Tango.BL.Entities [Column("MIXER_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(8)] - public Double MixerTemp { get @@ -349,10 +294,6 @@ namespace Tango.BL.Entities [Column("HEAD_ZONE1_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(9)] - public Double HeadZone1Temp { get @@ -380,10 +321,6 @@ namespace Tango.BL.Entities [Column("HEAD_ZONE2_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(10)] - public Double HeadZone2Temp { get @@ -411,10 +348,6 @@ namespace Tango.BL.Entities [Column("HEAD_ZONE3_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(11)] - public Double HeadZone3Temp { get @@ -442,10 +375,6 @@ namespace Tango.BL.Entities [Column("HEAD_ZONE4_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(12)] - public Double HeadZone4Temp { get @@ -473,10 +402,6 @@ namespace Tango.BL.Entities [Column("HEAD_ZONE5_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(13)] - public Double HeadZone5Temp { get @@ -504,10 +429,6 @@ namespace Tango.BL.Entities [Column("HEAD_ZONE6_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(14)] - public Double HeadZone6Temp { get @@ -535,10 +456,6 @@ namespace Tango.BL.Entities [Column("DRYER_AIR_FLOW")] - [StringFormat("0.0")] - - [PropertyIndex(26)] - public Double DryerAirFlow { get @@ -566,10 +483,6 @@ namespace Tango.BL.Entities [Column("DRYER_ZONE1_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(23)] - public Double DryerZone1Temp { get @@ -597,10 +510,6 @@ namespace Tango.BL.Entities [Column("DRYER_ZONE2_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(24)] - public Double DryerZone2Temp { get @@ -628,10 +537,6 @@ namespace Tango.BL.Entities [Column("DRYER_ZONE3_TEMP")] - [StringFormat("0.0")] - - [PropertyIndex(25)] - public Double DryerZone3Temp { get @@ -659,10 +564,6 @@ namespace Tango.BL.Entities [Column("DRYER_BUFFER_LENGTH")] - [StringFormat("0.0")] - - [PropertyIndex(28)] - public Double DryerBufferLength { get @@ -690,10 +591,6 @@ namespace Tango.BL.Entities [Column("HEAD_AIR_FLOW")] - [StringFormat("0.0")] - - [PropertyIndex(27)] - public Double HeadAirFlow { get @@ -766,347 +663,6 @@ namespace Tango.BL.Entities } } - protected Double _headzone7temp; - - /// <summary> - /// Gets or sets the processparameterstablebase head zone7 temp. - /// </summary> - - [Column("HEAD_ZONE7_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(15)] - - public Double HeadZone7Temp - { - get - { - return _headzone7temp; - } - - set - { - if (_headzone7temp != value) - { - _headzone7temp = value; - - OnHeadZone7TempChanged(value); - - } - } - } - - protected Double _headzone8temp; - - /// <summary> - /// Gets or sets the processparameterstablebase head zone8 temp. - /// </summary> - - [Column("HEAD_ZONE8_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(16)] - - public Double HeadZone8Temp - { - get - { - return _headzone8temp; - } - - set - { - if (_headzone8temp != value) - { - _headzone8temp = value; - - OnHeadZone8TempChanged(value); - - } - } - } - - protected Double _headzone9temp; - - /// <summary> - /// Gets or sets the processparameterstablebase head zone9 temp. - /// </summary> - - [Column("HEAD_ZONE9_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(17)] - - public Double HeadZone9Temp - { - get - { - return _headzone9temp; - } - - set - { - if (_headzone9temp != value) - { - _headzone9temp = value; - - OnHeadZone9TempChanged(value); - - } - } - } - - protected Double _headzone10temp; - - /// <summary> - /// Gets or sets the processparameterstablebase head zone10 temp. - /// </summary> - - [Column("HEAD_ZONE10_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(18)] - - public Double HeadZone10Temp - { - get - { - return _headzone10temp; - } - - set - { - if (_headzone10temp != value) - { - _headzone10temp = value; - - OnHeadZone10TempChanged(value); - - } - } - } - - protected Double _headzone11temp; - - /// <summary> - /// Gets or sets the processparameterstablebase head zone11 temp. - /// </summary> - - [Column("HEAD_ZONE11_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(19)] - - public Double HeadZone11Temp - { - get - { - return _headzone11temp; - } - - set - { - if (_headzone11temp != value) - { - _headzone11temp = value; - - OnHeadZone11TempChanged(value); - - } - } - } - - protected Double _headzone12temp; - - /// <summary> - /// Gets or sets the processparameterstablebase head zone12 temp. - /// </summary> - - [Column("HEAD_ZONE12_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(20)] - - public Double HeadZone12Temp - { - get - { - return _headzone12temp; - } - - set - { - if (_headzone12temp != value) - { - _headzone12temp = value; - - OnHeadZone12TempChanged(value); - - } - } - } - - protected Double _rblowerflow; - - /// <summary> - /// Gets or sets the processparameterstablebase r blower flow. - /// </summary> - - [Column("R_BLOWER_FLOW")] - - [StringFormat("0.0")] - - [PropertyIndex(22)] - - public Double RBlowerFlow - { - get - { - return _rblowerflow; - } - - set - { - if (_rblowerflow != value) - { - _rblowerflow = value; - - OnRBlowerFlowChanged(value); - - } - } - } - - protected Double _rblowertemp; - - /// <summary> - /// Gets or sets the processparameterstablebase r blower temp. - /// </summary> - - [Column("R_BLOWER_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(22)] - - public Double RBlowerTemp - { - get - { - return _rblowertemp; - } - - set - { - if (_rblowertemp != value) - { - _rblowertemp = value; - - OnRBlowerTempChanged(value); - - } - } - } - - protected Double _lblowerflow; - - /// <summary> - /// Gets or sets the processparameterstablebase l blower flow. - /// </summary> - - [Column("L_BLOWER_FLOW")] - - [StringFormat("0.0")] - - [PropertyIndex(22)] - - public Double LBlowerFlow - { - get - { - return _lblowerflow; - } - - set - { - if (_lblowerflow != value) - { - _lblowerflow = value; - - OnLBlowerFlowChanged(value); - - } - } - } - - protected Double _lblowertemp; - - /// <summary> - /// Gets or sets the processparameterstablebase l blower temp. - /// </summary> - - [Column("L_BLOWER_TEMP")] - - [StringFormat("0.0")] - - [PropertyIndex(22)] - - public Double LBlowerTemp - { - get - { - return _lblowertemp; - } - - set - { - if (_lblowertemp != value) - { - _lblowertemp = value; - - OnLBlowerTempChanged(value); - - } - } - } - - protected Double _pressurebuildup; - - /// <summary> - /// Gets or sets the processparameterstablebase pressure build up. - /// </summary> - - [Column("PRESSURE_BUILD_UP")] - - [StringFormat("0.0")] - - [PropertyIndex(29)] - - public Double PressureBuildUp - { - get - { - return _pressurebuildup; - } - - set - { - if (_pressurebuildup != value) - { - _pressurebuildup = value; - - OnPressureBuildUpChanged(value); - - } - } - } - protected ProcessParametersTablesGroup _processparameterstablesgroup; /// <summary> @@ -1329,105 +885,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the HeadZone7Temp has changed. - /// </summary> - protected virtual void OnHeadZone7TempChanged(Double headzone7temp) - { - HeadZone7TempChanged?.Invoke(this, headzone7temp); - RaisePropertyChanged(nameof(HeadZone7Temp)); - } - - /// <summary> - /// Called when the HeadZone8Temp has changed. - /// </summary> - protected virtual void OnHeadZone8TempChanged(Double headzone8temp) - { - HeadZone8TempChanged?.Invoke(this, headzone8temp); - RaisePropertyChanged(nameof(HeadZone8Temp)); - } - - /// <summary> - /// Called when the HeadZone9Temp has changed. - /// </summary> - protected virtual void OnHeadZone9TempChanged(Double headzone9temp) - { - HeadZone9TempChanged?.Invoke(this, headzone9temp); - RaisePropertyChanged(nameof(HeadZone9Temp)); - } - - /// <summary> - /// Called when the HeadZone10Temp has changed. - /// </summary> - protected virtual void OnHeadZone10TempChanged(Double headzone10temp) - { - HeadZone10TempChanged?.Invoke(this, headzone10temp); - RaisePropertyChanged(nameof(HeadZone10Temp)); - } - - /// <summary> - /// Called when the HeadZone11Temp has changed. - /// </summary> - protected virtual void OnHeadZone11TempChanged(Double headzone11temp) - { - HeadZone11TempChanged?.Invoke(this, headzone11temp); - RaisePropertyChanged(nameof(HeadZone11Temp)); - } - - /// <summary> - /// Called when the HeadZone12Temp has changed. - /// </summary> - protected virtual void OnHeadZone12TempChanged(Double headzone12temp) - { - HeadZone12TempChanged?.Invoke(this, headzone12temp); - RaisePropertyChanged(nameof(HeadZone12Temp)); - } - - /// <summary> - /// Called when the RBlowerFlow has changed. - /// </summary> - protected virtual void OnRBlowerFlowChanged(Double rblowerflow) - { - RBlowerFlowChanged?.Invoke(this, rblowerflow); - RaisePropertyChanged(nameof(RBlowerFlow)); - } - - /// <summary> - /// Called when the RBlowerTemp has changed. - /// </summary> - protected virtual void OnRBlowerTempChanged(Double rblowertemp) - { - RBlowerTempChanged?.Invoke(this, rblowertemp); - RaisePropertyChanged(nameof(RBlowerTemp)); - } - - /// <summary> - /// Called when the LBlowerFlow has changed. - /// </summary> - protected virtual void OnLBlowerFlowChanged(Double lblowerflow) - { - LBlowerFlowChanged?.Invoke(this, lblowerflow); - RaisePropertyChanged(nameof(LBlowerFlow)); - } - - /// <summary> - /// Called when the LBlowerTemp has changed. - /// </summary> - protected virtual void OnLBlowerTempChanged(Double lblowertemp) - { - LBlowerTempChanged?.Invoke(this, lblowertemp); - RaisePropertyChanged(nameof(LBlowerTemp)); - } - - /// <summary> - /// Called when the PressureBuildUp has changed. - /// </summary> - protected virtual void OnPressureBuildUpChanged(Double pressurebuildup) - { - PressureBuildUpChanged?.Invoke(this, pressurebuildup); - RaisePropertyChanged(nameof(PressureBuildUp)); - } - - /// <summary> /// Called when the ProcessParametersTablesGroup has changed. /// </summary> protected virtual void OnProcessParametersTablesGroupChanged(ProcessParametersTablesGroup processparameterstablesgroup) diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs index 005dd5b40..79e252b44 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProject.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProject.cs deleted file mode 100644 index 6812d5cd5..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProject.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Enumerations; - -namespace Tango.BL.Entities -{ - public class PublishedProcedureProject : PublishedProcedureProjectBase - { - [NotMapped] - [JsonIgnore] - public PublishedProcedureProjectsVersion CurrentVersion - { - get - { - return PublishedProcedureProjectsVersions.OrderBy(x => x.Version).LastOrDefault(); - } - } - - [NotMapped] - [JsonIgnore] - public PublishedProcedureProjectVisibilities ProjectVisibility - { - get { return (PublishedProcedureProjectVisibilities)Visibility; } - set { Visibility = value.ToInt32(); } - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectBase.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectBase.cs deleted file mode 100644 index b8792444d..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectBase.cs +++ /dev/null @@ -1,305 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("PUBLISHED_PROCEDURE_PROJECTS")] - public abstract class PublishedProcedureProjectBase : ObservableEntity<PublishedProcedureProject> - { - - public event EventHandler<String> NameChanged; - - public event EventHandler<String> DescriptionChanged; - - public event EventHandler<DateTime> PublishDateChanged; - - public event EventHandler<Int32> SortingIndexChanged; - - public event EventHandler<Boolean> IsVisibleChanged; - - public event EventHandler<Int32> VisibilityChanged; - - public event EventHandler<SynchronizedObservableCollection<PublishedProcedureProjectsVersion>> PublishedProcedureProjectsVersionsChanged; - - protected String _name; - - /// <summary> - /// Gets or sets the publishedprocedureprojectbase name. - /// </summary> - - [Column("NAME")] - - public String Name - { - get - { - return _name; - } - - set - { - if (_name != value) - { - _name = value; - - OnNameChanged(value); - - } - } - } - - protected String _description; - - /// <summary> - /// Gets or sets the publishedprocedureprojectbase description. - /// </summary> - - [Column("DESCRIPTION")] - - public String Description - { - get - { - return _description; - } - - set - { - if (_description != value) - { - _description = value; - - OnDescriptionChanged(value); - - } - } - } - - protected DateTime _publishdate; - - /// <summary> - /// Gets or sets the publishedprocedureprojectbase publish date. - /// </summary> - - [Column("PUBLISH_DATE")] - - public DateTime PublishDate - { - get - { - return _publishdate; - } - - set - { - if (_publishdate != value) - { - _publishdate = value; - - OnPublishDateChanged(value); - - } - } - } - - protected Int32 _sortingindex; - - /// <summary> - /// Gets or sets the publishedprocedureprojectbase sorting index. - /// </summary> - - [Column("SORTING_INDEX")] - - public Int32 SortingIndex - { - get - { - return _sortingindex; - } - - set - { - if (_sortingindex != value) - { - _sortingindex = value; - - OnSortingIndexChanged(value); - - } - } - } - - protected Boolean _isvisible; - - /// <summary> - /// Gets or sets the publishedprocedureprojectbase is visible. - /// </summary> - - [Column("IS_VISIBLE")] - - public Boolean IsVisible - { - get - { - return _isvisible; - } - - set - { - if (_isvisible != value) - { - _isvisible = value; - - OnIsVisibleChanged(value); - - } - } - } - - protected Int32 _visibility; - - /// <summary> - /// 0 - Public - /// 1 - Internal - /// </summary> - - [Column("VISIBILITY")] - - public Int32 Visibility - { - get - { - return _visibility; - } - - set - { - if (_visibility != value) - { - _visibility = value; - - OnVisibilityChanged(value); - - } - } - } - - protected SynchronizedObservableCollection<PublishedProcedureProjectsVersion> _publishedprocedureprojectsversions; - - /// <summary> - /// Gets or sets the publishedprocedureprojectbase published procedure projects versions. - /// </summary> - - public virtual SynchronizedObservableCollection<PublishedProcedureProjectsVersion> PublishedProcedureProjectsVersions - { - get - { - return _publishedprocedureprojectsversions; - } - - set - { - if (_publishedprocedureprojectsversions != value) - { - _publishedprocedureprojectsversions = value; - - OnPublishedProcedureProjectsVersionsChanged(value); - - } - } - } - - /// <summary> - /// Called when the Name has changed. - /// </summary> - protected virtual void OnNameChanged(String name) - { - NameChanged?.Invoke(this, name); - RaisePropertyChanged(nameof(Name)); - } - - /// <summary> - /// Called when the Description has changed. - /// </summary> - protected virtual void OnDescriptionChanged(String description) - { - DescriptionChanged?.Invoke(this, description); - RaisePropertyChanged(nameof(Description)); - } - - /// <summary> - /// Called when the PublishDate has changed. - /// </summary> - protected virtual void OnPublishDateChanged(DateTime publishdate) - { - PublishDateChanged?.Invoke(this, publishdate); - RaisePropertyChanged(nameof(PublishDate)); - } - - /// <summary> - /// Called when the SortingIndex has changed. - /// </summary> - protected virtual void OnSortingIndexChanged(Int32 sortingindex) - { - SortingIndexChanged?.Invoke(this, sortingindex); - RaisePropertyChanged(nameof(SortingIndex)); - } - - /// <summary> - /// Called when the IsVisible has changed. - /// </summary> - protected virtual void OnIsVisibleChanged(Boolean isvisible) - { - IsVisibleChanged?.Invoke(this, isvisible); - RaisePropertyChanged(nameof(IsVisible)); - } - - /// <summary> - /// Called when the Visibility has changed. - /// </summary> - protected virtual void OnVisibilityChanged(Int32 visibility) - { - VisibilityChanged?.Invoke(this, visibility); - RaisePropertyChanged(nameof(Visibility)); - } - - /// <summary> - /// Called when the PublishedProcedureProjectsVersions has changed. - /// </summary> - protected virtual void OnPublishedProcedureProjectsVersionsChanged(SynchronizedObservableCollection<PublishedProcedureProjectsVersion> publishedprocedureprojectsversions) - { - PublishedProcedureProjectsVersionsChanged?.Invoke(this, publishedprocedureprojectsversions); - RaisePropertyChanged(nameof(PublishedProcedureProjectsVersions)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="PublishedProcedureProjectBase" /> class. - /// </summary> - public PublishedProcedureProjectBase() : base() - { - - PublishedProcedureProjectsVersions = new SynchronizedObservableCollection<PublishedProcedureProjectsVersion>(); - - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectsVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectsVersion.cs deleted file mode 100644 index d9774f2bc..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectsVersion.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class PublishedProcedureProjectsVersion : PublishedProcedureProjectsVersionBase - { - - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectsVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectsVersionBase.cs deleted file mode 100644 index 730ea9758..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/PublishedProcedureProjectsVersionBase.cs +++ /dev/null @@ -1,220 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("PUBLISHED_PROCEDURE_PROJECTS_VERSIONS")] - public abstract class PublishedProcedureProjectsVersionBase : ObservableEntity<PublishedProcedureProjectsVersion> - { - - public event EventHandler<Int32> VersionChanged; - - public event EventHandler<String> AuthorChanged; - - public event EventHandler<String> ProjectJsonStringChanged; - - public event EventHandler<PublishedProcedureProject> PublishedProcedureProjectChanged; - - protected String _publishedprocedureprojectguid; - - /// <summary> - /// Gets or sets the publishedprocedureprojectsversionbase published procedure project guid. - /// </summary> - - [Column("PUBLISHED_PROCEDURE_PROJECT_GUID")] - [ForeignKey("PublishedProcedureProject")] - - public String PublishedProcedureProjectGuid - { - get - { - return _publishedprocedureprojectguid; - } - - set - { - if (_publishedprocedureprojectguid != value) - { - _publishedprocedureprojectguid = value; - - } - } - } - - protected Int32 _version; - - /// <summary> - /// Gets or sets the publishedprocedureprojectsversionbase version. - /// </summary> - - [Column("VERSION")] - - public Int32 Version - { - get - { - return _version; - } - - set - { - if (_version != value) - { - _version = value; - - OnVersionChanged(value); - - } - } - } - - protected String _author; - - /// <summary> - /// Gets or sets the publishedprocedureprojectsversionbase author. - /// </summary> - - [Column("AUTHOR")] - - public String Author - { - get - { - return _author; - } - - set - { - if (_author != value) - { - _author = value; - - OnAuthorChanged(value); - - } - } - } - - protected String _projectjsonstring; - - /// <summary> - /// Gets or sets the publishedprocedureprojectsversionbase project json string. - /// </summary> - - [Column("PROJECT_JSON_STRING")] - - public String ProjectJsonString - { - get - { - return _projectjsonstring; - } - - set - { - if (_projectjsonstring != value) - { - _projectjsonstring = value; - - OnProjectJsonStringChanged(value); - - } - } - } - - protected PublishedProcedureProject _publishedprocedureproject; - - /// <summary> - /// Gets or sets the publishedprocedureprojectsversionbase published procedure projects. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual PublishedProcedureProject PublishedProcedureProject - { - get - { - return _publishedprocedureproject; - } - - set - { - if (_publishedprocedureproject != value) - { - _publishedprocedureproject = value; - - if (PublishedProcedureProject != null) - { - PublishedProcedureProjectGuid = PublishedProcedureProject.Guid; - } - - OnPublishedProcedureProjectChanged(value); - - } - } - } - - /// <summary> - /// Called when the Version has changed. - /// </summary> - protected virtual void OnVersionChanged(Int32 version) - { - VersionChanged?.Invoke(this, version); - RaisePropertyChanged(nameof(Version)); - } - - /// <summary> - /// Called when the Author has changed. - /// </summary> - protected virtual void OnAuthorChanged(String author) - { - AuthorChanged?.Invoke(this, author); - RaisePropertyChanged(nameof(Author)); - } - - /// <summary> - /// Called when the ProjectJsonString has changed. - /// </summary> - protected virtual void OnProjectJsonStringChanged(String projectjsonstring) - { - ProjectJsonStringChanged?.Invoke(this, projectjsonstring); - RaisePropertyChanged(nameof(ProjectJsonString)); - } - - /// <summary> - /// Called when the PublishedProcedureProject has changed. - /// </summary> - protected virtual void OnPublishedProcedureProjectChanged(PublishedProcedureProject publishedprocedureproject) - { - PublishedProcedureProjectChanged?.Invoke(this, publishedprocedureproject); - RaisePropertyChanged(nameof(PublishedProcedureProject)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="PublishedProcedureProjectsVersionBase" /> class. - /// </summary> - public PublishedProcedureProjectsVersionBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index 679226fd2..b9224a6d6 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -1,14 +1,11 @@ using ColorMine.ColorSpaces; -using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using Tango.BL.Builders; -using Tango.BL.Enumerations; using Tango.BL.Serialization; namespace Tango.BL.Entities @@ -48,8 +45,6 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(Color)); } - [NotMapped] - [JsonIgnore] public Color Color { get @@ -60,40 +55,6 @@ namespace Tango.BL.Entities } } - /// <summary> - /// Gets or sets the thread head type. - /// </summary> - [NotMapped] - [JsonIgnore] - public HeadTypes RmlHeadType - { - get - { - return (HeadTypes)HeadType; - } - set - { - HeadType = value.ToInt32(); - } - } - - /// <summary> - /// Gets or sets the thread qualification level. - /// </summary> - [NotMapped] - [JsonIgnore] - public RmlQualifications RmlQualificationLevel - { - get - { - return (RmlQualifications)QualificationLevel; - } - set - { - QualificationLevel = value.ToInt32(); - } - } - public ProcessParametersTablesGroup GetActiveProcessGroup() { return ProcessParametersTablesGroups.FirstOrDefault(x => x.Active); @@ -103,13 +64,12 @@ namespace Tango.BL.Entities { return Task.Factory.StartNew<String>(() => { - var rml = new RmlBuilder(context).Set(Guid).WithActiveParametersGroup().WithCCT().WithLiquidFactors().WithSpools().Build(); + var rml = new RmlBuilder(context).Set(Guid).WithActiveParametersGroup().WithCCT().WithLiquidFactors().Build(); String result = rml.ToJson(new EntitySerializationStrategy() .Include(() => rml.Cct) .Include(() => rml.LiquidTypesRmls) .Include(() => rml.ProcessParametersTablesGroups) - .Include(() => rml.RmlsSpools) .Include(typeof(ProcessParametersTablesGroup).GetProperty(nameof(ProcessParametersTablesGroup.ProcessParametersTables))), EntitySerializationFlags.IgnoreCollections | EntitySerializationFlags.IgnoreReferenceTypes | EntitySerializationFlags.Indented); diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs index 8958884a2..853372bba 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -29,8 +28,6 @@ namespace Tango.BL.Entities public event EventHandler<String> NameChanged; - public event EventHandler<String> DisplayNameChanged; - public event EventHandler<String> ManufacturerChanged; public event EventHandler<Int32> CodeChanged; @@ -67,40 +64,6 @@ namespace Tango.BL.Entities public event EventHandler<Int32> ColorConversionVersionChanged; - public event EventHandler<Boolean> UseColorLibGradientsChanged; - - public event EventHandler<Int32> HeadTypeChanged; - - public event EventHandler<Int32> QualificationLevelChanged; - - public event EventHandler<Nullable<DateTime>> QualificationDateChanged; - - public event EventHandler<String> SpoolsCalibrationsStringChanged; - - public event EventHandler<Int32> FeederPChanged; - - public event EventHandler<Int32> FeederIChanged; - - public event EventHandler<Int32> FeederDChanged; - - public event EventHandler<Int32> PullerPChanged; - - public event EventHandler<Int32> PullerIChanged; - - public event EventHandler<Int32> PullerDChanged; - - public event EventHandler<Int32> WinderPChanged; - - public event EventHandler<Int32> WinderIChanged; - - public event EventHandler<Int32> WinderDChanged; - - public event EventHandler<Boolean> BypassRockersChanged; - - public event EventHandler<Int32> CleanerFlowChanged; - - public event EventHandler<Double> ArcHeadCleaningMotorSpeedChanged; - public event EventHandler<SynchronizedObservableCollection<Cat>> CatsChanged; public event EventHandler<Cct> CctChanged; @@ -117,6 +80,8 @@ namespace Tango.BL.Entities public event EventHandler<SynchronizedObservableCollection<LiquidTypesRml>> LiquidTypesRmlsChanged; + public event EventHandler<SynchronizedObservableCollection<Machine>> MachinesChanged; + public event EventHandler<MediaCondition> MediaConditionChanged; public event EventHandler<MediaMaterial> MediaMaterialChanged; @@ -125,10 +90,6 @@ namespace Tango.BL.Entities public event EventHandler<SynchronizedObservableCollection<ProcessParametersTablesGroup>> ProcessParametersTablesGroupsChanged; - public event EventHandler<SynchronizedObservableCollection<RmlsSpool>> RmlsSpoolsChanged; - - public event EventHandler<SynchronizedObservableCollection<SitesRml>> SitesRmlsChanged; - protected String _name; /// <summary> @@ -156,33 +117,6 @@ namespace Tango.BL.Entities } } - protected String _displayname; - - /// <summary> - /// Gets or sets the rmlbase display name. - /// </summary> - - [Column("DISPLAY_NAME")] - - public String DisplayName - { - get - { - return _displayname; - } - - set - { - if (_displayname != value) - { - _displayname = value; - - OnDisplayNameChanged(value); - - } - } - } - protected String _manufacturer; /// <summary> @@ -851,465 +785,6 @@ namespace Tango.BL.Entities } } - protected Boolean _usecolorlibgradients; - - /// <summary> - /// Gets or sets the rmlbase use color lib gradients. - /// </summary> - - [Column("USE_COLOR_LIB_GRADIENTS")] - - public Boolean UseColorLibGradients - { - get - { - return _usecolorlibgradients; - } - - set - { - if (_usecolorlibgradients != value) - { - _usecolorlibgradients = value; - - OnUseColorLibGradientsChanged(value); - - } - } - } - - protected Int32 _headtype; - - /// <summary> - /// Gets or sets the rmlbase head type. - /// </summary> - - [Column("HEAD_TYPE")] - - public Int32 HeadType - { - get - { - return _headtype; - } - - set - { - if (_headtype != value) - { - _headtype = value; - - OnHeadTypeChanged(value); - - } - } - } - - protected Int32 _qualificationlevel; - - /// <summary> - /// Gets or sets the rmlbase qualification level. - /// </summary> - - [Column("QUALIFICATION_LEVEL")] - - public Int32 QualificationLevel - { - get - { - return _qualificationlevel; - } - - set - { - if (_qualificationlevel != value) - { - _qualificationlevel = value; - - OnQualificationLevelChanged(value); - - } - } - } - - protected Nullable<DateTime> _qualificationdate; - - /// <summary> - /// Gets or sets the rmlbase qualification date. - /// </summary> - - [Column("QUALIFICATION_DATE")] - - public Nullable<DateTime> QualificationDate - { - get - { - return _qualificationdate; - } - - set - { - if (_qualificationdate != value) - { - _qualificationdate = value; - - OnQualificationDateChanged(value); - - } - } - } - - protected String _spoolscalibrationsstring; - - /// <summary> - /// Gets or sets the rmlbase spools calibrations string. - /// </summary> - - [Column("SPOOLS_CALIBRATIONS_STRING")] - - public String SpoolsCalibrationsString - { - get - { - return _spoolscalibrationsstring; - } - - set - { - if (_spoolscalibrationsstring != value) - { - _spoolscalibrationsstring = value; - - OnSpoolsCalibrationsStringChanged(value); - - } - } - } - - protected Int32 _feederp; - - /// <summary> - /// Gets or sets the rmlbase feeder p. - /// </summary> - - [Column("FEEDER_P")] - - public Int32 FeederP - { - get - { - return _feederp; - } - - set - { - if (_feederp != value) - { - _feederp = value; - - OnFeederPChanged(value); - - } - } - } - - protected Int32 _feederi; - - /// <summary> - /// Gets or sets the rmlbase feeder i. - /// </summary> - - [Column("FEEDER_I")] - - public Int32 FeederI - { - get - { - return _feederi; - } - - set - { - if (_feederi != value) - { - _feederi = value; - - OnFeederIChanged(value); - - } - } - } - - protected Int32 _feederd; - - /// <summary> - /// Gets or sets the rmlbase feeder d. - /// </summary> - - [Column("FEEDER_D")] - - public Int32 FeederD - { - get - { - return _feederd; - } - - set - { - if (_feederd != value) - { - _feederd = value; - - OnFeederDChanged(value); - - } - } - } - - protected Int32 _pullerp; - - /// <summary> - /// Gets or sets the rmlbase puller p. - /// </summary> - - [Column("PULLER_P")] - - public Int32 PullerP - { - get - { - return _pullerp; - } - - set - { - if (_pullerp != value) - { - _pullerp = value; - - OnPullerPChanged(value); - - } - } - } - - protected Int32 _pulleri; - - /// <summary> - /// Gets or sets the rmlbase puller i. - /// </summary> - - [Column("PULLER_I")] - - public Int32 PullerI - { - get - { - return _pulleri; - } - - set - { - if (_pulleri != value) - { - _pulleri = value; - - OnPullerIChanged(value); - - } - } - } - - protected Int32 _pullerd; - - /// <summary> - /// Gets or sets the rmlbase puller d. - /// </summary> - - [Column("PULLER_D")] - - public Int32 PullerD - { - get - { - return _pullerd; - } - - set - { - if (_pullerd != value) - { - _pullerd = value; - - OnPullerDChanged(value); - - } - } - } - - protected Int32 _winderp; - - /// <summary> - /// Gets or sets the rmlbase winder p. - /// </summary> - - [Column("WINDER_P")] - - public Int32 WinderP - { - get - { - return _winderp; - } - - set - { - if (_winderp != value) - { - _winderp = value; - - OnWinderPChanged(value); - - } - } - } - - protected Int32 _winderi; - - /// <summary> - /// Gets or sets the rmlbase winder i. - /// </summary> - - [Column("WINDER_I")] - - public Int32 WinderI - { - get - { - return _winderi; - } - - set - { - if (_winderi != value) - { - _winderi = value; - - OnWinderIChanged(value); - - } - } - } - - protected Int32 _winderd; - - /// <summary> - /// Gets or sets the rmlbase winder d. - /// </summary> - - [Column("WINDER_D")] - - public Int32 WinderD - { - get - { - return _winderd; - } - - set - { - if (_winderd != value) - { - _winderd = value; - - OnWinderDChanged(value); - - } - } - } - - protected Boolean _bypassrockers; - - /// <summary> - /// Gets or sets the rmlbase bypass rockers. - /// </summary> - - [Column("BYPASS_ROCKERS")] - - public Boolean BypassRockers - { - get - { - return _bypassrockers; - } - - set - { - if (_bypassrockers != value) - { - _bypassrockers = value; - - OnBypassRockersChanged(value); - - } - } - } - - protected Int32 _cleanerflow; - - /// <summary> - /// Gets or sets the rmlbase cleaner flow. - /// </summary> - - [Column("CLEANER_FLOW")] - - public Int32 CleanerFlow - { - get - { - return _cleanerflow; - } - - set - { - if (_cleanerflow != value) - { - _cleanerflow = value; - - OnCleanerFlowChanged(value); - - } - } - } - - protected Double _archeadcleaningmotorspeed; - - /// <summary> - /// Gets or sets the rmlbase arc head cleaning motor speed. - /// </summary> - - [Column("ARC_HEAD_CLEANING_MOTOR_SPEED")] - - public Double ArcHeadCleaningMotorSpeed - { - get - { - return _archeadcleaningmotorspeed; - } - - set - { - if (_archeadcleaningmotorspeed != value) - { - _archeadcleaningmotorspeed = value; - - OnArcHeadCleaningMotorSpeedChanged(value); - - } - } - } - protected SynchronizedObservableCollection<Cat> _cats; /// <summary> @@ -1538,6 +1013,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection<Machine> _machines; + + /// <summary> + /// Gets or sets the rmlbase machines. + /// </summary> + + public virtual SynchronizedObservableCollection<Machine> Machines + { + get + { + return _machines; + } + + set + { + if (_machines != value) + { + _machines = value; + + OnMachinesChanged(value); + + } + } + } + protected MediaCondition _mediacondition; /// <summary> @@ -1659,56 +1159,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<RmlsSpool> _rmlsspools; - - /// <summary> - /// Gets or sets the rmlbase rmls spools. - /// </summary> - - public virtual SynchronizedObservableCollection<RmlsSpool> RmlsSpools - { - get - { - return _rmlsspools; - } - - set - { - if (_rmlsspools != value) - { - _rmlsspools = value; - - OnRmlsSpoolsChanged(value); - - } - } - } - - protected SynchronizedObservableCollection<SitesRml> _sitesrmls; - - /// <summary> - /// Gets or sets the rmlbase sites rmls. - /// </summary> - - public virtual SynchronizedObservableCollection<SitesRml> SitesRmls - { - get - { - return _sitesrmls; - } - - set - { - if (_sitesrmls != value) - { - _sitesrmls = value; - - OnSitesRmlsChanged(value); - - } - } - } - /// <summary> /// Called when the Name has changed. /// </summary> @@ -1719,15 +1169,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the DisplayName has changed. - /// </summary> - protected virtual void OnDisplayNameChanged(String displayname) - { - DisplayNameChanged?.Invoke(this, displayname); - RaisePropertyChanged(nameof(DisplayName)); - } - - /// <summary> /// Called when the Manufacturer has changed. /// </summary> protected virtual void OnManufacturerChanged(String manufacturer) @@ -1890,159 +1331,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the UseColorLibGradients has changed. - /// </summary> - protected virtual void OnUseColorLibGradientsChanged(Boolean usecolorlibgradients) - { - UseColorLibGradientsChanged?.Invoke(this, usecolorlibgradients); - RaisePropertyChanged(nameof(UseColorLibGradients)); - } - - /// <summary> - /// Called when the HeadType has changed. - /// </summary> - protected virtual void OnHeadTypeChanged(Int32 headtype) - { - HeadTypeChanged?.Invoke(this, headtype); - RaisePropertyChanged(nameof(HeadType)); - } - - /// <summary> - /// Called when the QualificationLevel has changed. - /// </summary> - protected virtual void OnQualificationLevelChanged(Int32 qualificationlevel) - { - QualificationLevelChanged?.Invoke(this, qualificationlevel); - RaisePropertyChanged(nameof(QualificationLevel)); - } - - /// <summary> - /// Called when the QualificationDate has changed. - /// </summary> - protected virtual void OnQualificationDateChanged(Nullable<DateTime> qualificationdate) - { - QualificationDateChanged?.Invoke(this, qualificationdate); - RaisePropertyChanged(nameof(QualificationDate)); - } - - /// <summary> - /// Called when the SpoolsCalibrationsString has changed. - /// </summary> - protected virtual void OnSpoolsCalibrationsStringChanged(String spoolscalibrationsstring) - { - SpoolsCalibrationsStringChanged?.Invoke(this, spoolscalibrationsstring); - RaisePropertyChanged(nameof(SpoolsCalibrationsString)); - } - - /// <summary> - /// Called when the FeederP has changed. - /// </summary> - protected virtual void OnFeederPChanged(Int32 feederp) - { - FeederPChanged?.Invoke(this, feederp); - RaisePropertyChanged(nameof(FeederP)); - } - - /// <summary> - /// Called when the FeederI has changed. - /// </summary> - protected virtual void OnFeederIChanged(Int32 feederi) - { - FeederIChanged?.Invoke(this, feederi); - RaisePropertyChanged(nameof(FeederI)); - } - - /// <summary> - /// Called when the FeederD has changed. - /// </summary> - protected virtual void OnFeederDChanged(Int32 feederd) - { - FeederDChanged?.Invoke(this, feederd); - RaisePropertyChanged(nameof(FeederD)); - } - - /// <summary> - /// Called when the PullerP has changed. - /// </summary> - protected virtual void OnPullerPChanged(Int32 pullerp) - { - PullerPChanged?.Invoke(this, pullerp); - RaisePropertyChanged(nameof(PullerP)); - } - - /// <summary> - /// Called when the PullerI has changed. - /// </summary> - protected virtual void OnPullerIChanged(Int32 pulleri) - { - PullerIChanged?.Invoke(this, pulleri); - RaisePropertyChanged(nameof(PullerI)); - } - - /// <summary> - /// Called when the PullerD has changed. - /// </summary> - protected virtual void OnPullerDChanged(Int32 pullerd) - { - PullerDChanged?.Invoke(this, pullerd); - RaisePropertyChanged(nameof(PullerD)); - } - - /// <summary> - /// Called when the WinderP has changed. - /// </summary> - protected virtual void OnWinderPChanged(Int32 winderp) - { - WinderPChanged?.Invoke(this, winderp); - RaisePropertyChanged(nameof(WinderP)); - } - - /// <summary> - /// Called when the WinderI has changed. - /// </summary> - protected virtual void OnWinderIChanged(Int32 winderi) - { - WinderIChanged?.Invoke(this, winderi); - RaisePropertyChanged(nameof(WinderI)); - } - - /// <summary> - /// Called when the WinderD has changed. - /// </summary> - protected virtual void OnWinderDChanged(Int32 winderd) - { - WinderDChanged?.Invoke(this, winderd); - RaisePropertyChanged(nameof(WinderD)); - } - - /// <summary> - /// Called when the BypassRockers has changed. - /// </summary> - protected virtual void OnBypassRockersChanged(Boolean bypassrockers) - { - BypassRockersChanged?.Invoke(this, bypassrockers); - RaisePropertyChanged(nameof(BypassRockers)); - } - - /// <summary> - /// Called when the CleanerFlow has changed. - /// </summary> - protected virtual void OnCleanerFlowChanged(Int32 cleanerflow) - { - CleanerFlowChanged?.Invoke(this, cleanerflow); - RaisePropertyChanged(nameof(CleanerFlow)); - } - - /// <summary> - /// Called when the ArcHeadCleaningMotorSpeed has changed. - /// </summary> - protected virtual void OnArcHeadCleaningMotorSpeedChanged(Double archeadcleaningmotorspeed) - { - ArcHeadCleaningMotorSpeedChanged?.Invoke(this, archeadcleaningmotorspeed); - RaisePropertyChanged(nameof(ArcHeadCleaningMotorSpeed)); - } - - /// <summary> /// Called when the Cats has changed. /// </summary> protected virtual void OnCatsChanged(SynchronizedObservableCollection<Cat> cats) @@ -2115,6 +1403,15 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the Machines has changed. + /// </summary> + protected virtual void OnMachinesChanged(SynchronizedObservableCollection<Machine> machines) + { + MachinesChanged?.Invoke(this, machines); + RaisePropertyChanged(nameof(Machines)); + } + + /// <summary> /// Called when the MediaCondition has changed. /// </summary> protected virtual void OnMediaConditionChanged(MediaCondition mediacondition) @@ -2151,24 +1448,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the RmlsSpools has changed. - /// </summary> - protected virtual void OnRmlsSpoolsChanged(SynchronizedObservableCollection<RmlsSpool> rmlsspools) - { - RmlsSpoolsChanged?.Invoke(this, rmlsspools); - RaisePropertyChanged(nameof(RmlsSpools)); - } - - /// <summary> - /// Called when the SitesRmls has changed. - /// </summary> - protected virtual void OnSitesRmlsChanged(SynchronizedObservableCollection<SitesRml> sitesrmls) - { - SitesRmlsChanged?.Invoke(this, sitesrmls); - RaisePropertyChanged(nameof(SitesRmls)); - } - - /// <summary> /// Initializes a new instance of the <see cref="RmlBase" /> class. /// </summary> public RmlBase() : base() @@ -2182,11 +1461,9 @@ namespace Tango.BL.Entities LiquidTypesRmls = new SynchronizedObservableCollection<LiquidTypesRml>(); - ProcessParametersTablesGroups = new SynchronizedObservableCollection<ProcessParametersTablesGroup>(); - - RmlsSpools = new SynchronizedObservableCollection<RmlsSpool>(); + Machines = new SynchronizedObservableCollection<Machine>(); - SitesRmls = new SynchronizedObservableCollection<SitesRml>(); + ProcessParametersTablesGroups = new SynchronizedObservableCollection<ProcessParametersTablesGroup>(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs deleted file mode 100644 index 633180541..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlsSpool.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class RmlsSpool : RmlsSpoolBase - { - - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs deleted file mode 100644 index fee4ef6b4..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlsSpoolBase.cs +++ /dev/null @@ -1,327 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("RMLS_SPOOLS")] - public abstract class RmlsSpoolBase : ObservableEntity<RmlsSpool> - { - - public event EventHandler<Nullable<Double>> RotationsPerPassageChanged; - - public event EventHandler<Nullable<Double>> LengthChanged; - - public event EventHandler<Nullable<Int32>> BackingRateChanged; - - public event EventHandler<Nullable<Int32>> BottomBackingRateChanged; - - public event EventHandler<Rml> RmlChanged; - - public event EventHandler<SpoolType> SpoolTypeChanged; - - protected String _spooltypeguid; - - /// <summary> - /// Gets or sets the rmlsspoolbase spool type guid. - /// </summary> - - [Column("SPOOL_TYPE_GUID")] - [ForeignKey("SpoolType")] - - public String SpoolTypeGuid - { - get - { - return _spooltypeguid; - } - - set - { - if (_spooltypeguid != value) - { - _spooltypeguid = value; - - } - } - } - - protected String _rmlguid; - - /// <summary> - /// Gets or sets the rmlsspoolbase rml guid. - /// </summary> - - [Column("RML_GUID")] - [ForeignKey("Rml")] - - public String RmlGuid - { - get - { - return _rmlguid; - } - - set - { - if (_rmlguid != value) - { - _rmlguid = value; - - } - } - } - - protected Nullable<Double> _rotationsperpassage; - - /// <summary> - /// Gets or sets the rmlsspoolbase rotations per passage. - /// </summary> - - [Column("ROTATIONS_PER_PASSAGE")] - - public Nullable<Double> RotationsPerPassage - { - get - { - return _rotationsperpassage; - } - - set - { - if (_rotationsperpassage != value) - { - _rotationsperpassage = value; - - OnRotationsPerPassageChanged(value); - - } - } - } - - protected Nullable<Double> _length; - - /// <summary> - /// Gets or sets the rmlsspoolbase length. - /// </summary> - - [Column("LENGTH")] - - public Nullable<Double> Length - { - get - { - return _length; - } - - set - { - if (_length != value) - { - _length = value; - - OnLengthChanged(value); - - } - } - } - - protected Nullable<Int32> _backingrate; - - /// <summary> - /// Gets or sets the rmlsspoolbase backing rate. - /// </summary> - - [Column("BACKING_RATE")] - - public Nullable<Int32> BackingRate - { - get - { - return _backingrate; - } - - set - { - if (_backingrate != value) - { - _backingrate = value; - - OnBackingRateChanged(value); - - } - } - } - - protected Nullable<Int32> _bottombackingrate; - - /// <summary> - /// Gets or sets the rmlsspoolbase bottom backing rate. - /// </summary> - - [Column("BOTTOM_BACKING_RATE")] - - public Nullable<Int32> BottomBackingRate - { - get - { - return _bottombackingrate; - } - - set - { - if (_bottombackingrate != value) - { - _bottombackingrate = value; - - OnBottomBackingRateChanged(value); - - } - } - } - - protected Rml _rml; - - /// <summary> - /// Gets or sets the rmlsspoolbase rml. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual Rml Rml - { - get - { - return _rml; - } - - set - { - if (_rml != value) - { - _rml = value; - - if (Rml != null) - { - RmlGuid = Rml.Guid; - } - - OnRmlChanged(value); - - } - } - } - - protected SpoolType _spooltype; - - /// <summary> - /// Gets or sets the rmlsspoolbase spool types. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual SpoolType SpoolType - { - get - { - return _spooltype; - } - - set - { - if (_spooltype != value) - { - _spooltype = value; - - if (SpoolType != null) - { - SpoolTypeGuid = SpoolType.Guid; - } - - OnSpoolTypeChanged(value); - - } - } - } - - /// <summary> - /// Called when the RotationsPerPassage has changed. - /// </summary> - protected virtual void OnRotationsPerPassageChanged(Nullable<Double> rotationsperpassage) - { - RotationsPerPassageChanged?.Invoke(this, rotationsperpassage); - RaisePropertyChanged(nameof(RotationsPerPassage)); - } - - /// <summary> - /// Called when the Length has changed. - /// </summary> - protected virtual void OnLengthChanged(Nullable<Double> length) - { - LengthChanged?.Invoke(this, length); - RaisePropertyChanged(nameof(Length)); - } - - /// <summary> - /// Called when the BackingRate has changed. - /// </summary> - protected virtual void OnBackingRateChanged(Nullable<Int32> backingrate) - { - BackingRateChanged?.Invoke(this, backingrate); - RaisePropertyChanged(nameof(BackingRate)); - } - - /// <summary> - /// Called when the BottomBackingRate has changed. - /// </summary> - protected virtual void OnBottomBackingRateChanged(Nullable<Int32> bottombackingrate) - { - BottomBackingRateChanged?.Invoke(this, bottombackingrate); - RaisePropertyChanged(nameof(BottomBackingRate)); - } - - /// <summary> - /// Called when the Rml has changed. - /// </summary> - protected virtual void OnRmlChanged(Rml rml) - { - RmlChanged?.Invoke(this, rml); - RaisePropertyChanged(nameof(Rml)); - } - - /// <summary> - /// Called when the SpoolType has changed. - /// </summary> - protected virtual void OnSpoolTypeChanged(SpoolType spooltype) - { - SpoolTypeChanged?.Invoke(this, spooltype); - RaisePropertyChanged(nameof(SpoolType)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="RmlsSpoolBase" /> class. - /// </summary> - public RmlsSpoolBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/Role.cs b/Software/Visual_Studio/Tango.BL/Entities/Role.cs index 3e5ee6076..1108d6de3 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Role.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Role.cs @@ -1,11 +1,8 @@ -using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.BL.Enumerations; namespace Tango.BL.Entities { @@ -18,18 +15,5 @@ namespace Tango.BL.Entities { } - - [JsonIgnore] - [NotMapped] - public Roles RoleEnum - { - get { return (Roles)Code; } - set { Code = (int)value; } - } - - public override string ToString() - { - return Name; - } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs index ed8d67233..cca6b7600 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs index 6fa2adf77..bdaaaac3c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs index bcdfcccc4..56d863299 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs @@ -228,7 +228,7 @@ namespace Tango.BL.Entities foreach (var stop in BrushStops.ToList().OrderBy(x => x.StopIndex).ToList()) { - stops.Add(new GradientStop(stop.IsTransparent ? Colors.Transparent : stop.Color, stop.OffsetPercent / 100d)); + stops.Add(new GradientStop(stop.Color, stop.OffsetPercent / 100d)); } LinearGradientBrush brush = new LinearGradientBrush(); @@ -244,7 +244,7 @@ namespace Tango.BL.Entities { for (int i = 0; i < BrushStops.Count; i++) { - _brush.GradientStops[i].Color = BrushStops[i].IsTransparent ? Colors.Transparent : BrushStops[i].Color; + _brush.GradientStops[i].Color = BrushStops[i].Color; _brush.GradientStops[i].Offset = BrushStops[i].OffsetPercent / 100d; } @@ -298,16 +298,6 @@ namespace Tango.BL.Entities stop.Segment = this; stop.Color = Colors.White; - if (stop.ColorSpace != null) - { - if (stop.BrushColorSpace == Enumerations.ColorSpaces.LAB) - { - stop.L = 100; - stop.A = 0; - stop.B = 0; - } - } - BrushStops.Add(stop); return stop; diff --git a/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs index f98239bf3..40f86a34c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/Site.cs b/Software/Visual_Studio/Tango.BL/Entities/Site.cs deleted file mode 100644 index 6e95aa39d..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/Site.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class Site : SiteBase - { - public override void Delete(ObservablesContext context) - { - base.Delete(context); - - var site_rmls = context.SitesRmls.Where(x => x.SiteGuid == Guid).ToList(); - var site_catalogs = context.SitesCatalogs.Where(x => x.SiteGuid == Guid).ToList(); - context.SitesRmls.RemoveRange(site_rmls); - context.SitesCatalogs.RemoveRange(site_catalogs); - context.Machines.Where(x => x.SiteGuid == Guid).ToList().ForEach(x => x.SiteGuid = null); - context.Sites.Remove(this); - } - - protected override void OnValidating(ObservablesContext context) - { - base.OnValidating(context); - - if (String.IsNullOrWhiteSpace(Name)) - { - InsertError(nameof(Name), "Site name is required"); - } - - if (Name != null && Name.Length > 100) - { - InsertError(nameof(Name), "The site name exceeds the maximum allowed characters."); - } - - if (Description != null && Description.Length > 200) - { - InsertError(nameof(Description), "The site description exceeds the maximum allowed characters."); - } - - if (OrganizationGuid == null) - { - InsertError(nameof(OrganizationGuid), "Site organization is required."); - } - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SiteBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SiteBase.cs deleted file mode 100644 index 071dd7ea9..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/SiteBase.cs +++ /dev/null @@ -1,259 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("SITES")] - public abstract class SiteBase : ObservableEntity<Site> - { - - public event EventHandler<String> NameChanged; - - public event EventHandler<String> DescriptionChanged; - - public event EventHandler<Organization> OrganizationChanged; - - public event EventHandler<SynchronizedObservableCollection<SitesCatalog>> SitesCatalogsChanged; - - public event EventHandler<SynchronizedObservableCollection<SitesRml>> SitesRmlsChanged; - - protected String _organizationguid; - - /// <summary> - /// Gets or sets the sitebase organization guid. - /// </summary> - - [Column("ORGANIZATION_GUID")] - [ForeignKey("Organization")] - - public String OrganizationGuid - { - get - { - return _organizationguid; - } - - set - { - if (_organizationguid != value) - { - _organizationguid = value; - - } - } - } - - protected String _name; - - /// <summary> - /// Gets or sets the sitebase name. - /// </summary> - - [Column("NAME")] - - public String Name - { - get - { - return _name; - } - - set - { - if (_name != value) - { - _name = value; - - OnNameChanged(value); - - } - } - } - - protected String _description; - - /// <summary> - /// Gets or sets the sitebase description. - /// </summary> - - [Column("DESCRIPTION")] - - public String Description - { - get - { - return _description; - } - - set - { - if (_description != value) - { - _description = value; - - OnDescriptionChanged(value); - - } - } - } - - protected Organization _organization; - - /// <summary> - /// Gets or sets the sitebase organization. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual Organization Organization - { - get - { - return _organization; - } - - set - { - if (_organization != value) - { - _organization = value; - - if (Organization != null) - { - OrganizationGuid = Organization.Guid; - } - - OnOrganizationChanged(value); - - } - } - } - - protected SynchronizedObservableCollection<SitesCatalog> _sitescatalogs; - - /// <summary> - /// Gets or sets the sitebase sites catalogs. - /// </summary> - - public virtual SynchronizedObservableCollection<SitesCatalog> SitesCatalogs - { - get - { - return _sitescatalogs; - } - - set - { - if (_sitescatalogs != value) - { - _sitescatalogs = value; - - OnSitesCatalogsChanged(value); - - } - } - } - - protected SynchronizedObservableCollection<SitesRml> _sitesrmls; - - /// <summary> - /// Gets or sets the sitebase sites rmls. - /// </summary> - - public virtual SynchronizedObservableCollection<SitesRml> SitesRmls - { - get - { - return _sitesrmls; - } - - set - { - if (_sitesrmls != value) - { - _sitesrmls = value; - - OnSitesRmlsChanged(value); - - } - } - } - - /// <summary> - /// Called when the Name has changed. - /// </summary> - protected virtual void OnNameChanged(String name) - { - NameChanged?.Invoke(this, name); - RaisePropertyChanged(nameof(Name)); - } - - /// <summary> - /// Called when the Description has changed. - /// </summary> - protected virtual void OnDescriptionChanged(String description) - { - DescriptionChanged?.Invoke(this, description); - RaisePropertyChanged(nameof(Description)); - } - - /// <summary> - /// Called when the Organization has changed. - /// </summary> - protected virtual void OnOrganizationChanged(Organization organization) - { - OrganizationChanged?.Invoke(this, organization); - RaisePropertyChanged(nameof(Organization)); - } - - /// <summary> - /// Called when the SitesCatalogs has changed. - /// </summary> - protected virtual void OnSitesCatalogsChanged(SynchronizedObservableCollection<SitesCatalog> sitescatalogs) - { - SitesCatalogsChanged?.Invoke(this, sitescatalogs); - RaisePropertyChanged(nameof(SitesCatalogs)); - } - - /// <summary> - /// Called when the SitesRmls has changed. - /// </summary> - protected virtual void OnSitesRmlsChanged(SynchronizedObservableCollection<SitesRml> sitesrmls) - { - SitesRmlsChanged?.Invoke(this, sitesrmls); - RaisePropertyChanged(nameof(SitesRmls)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="SiteBase" /> class. - /// </summary> - public SiteBase() : base() - { - - SitesCatalogs = new SynchronizedObservableCollection<SitesCatalog>(); - - SitesRmls = new SynchronizedObservableCollection<SitesRml>(); - - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SitesCatalog.cs b/Software/Visual_Studio/Tango.BL/Entities/SitesCatalog.cs deleted file mode 100644 index 886d06719..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/SitesCatalog.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class SitesCatalog : SitesCatalogBase - { - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SitesCatalogBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SitesCatalogBase.cs deleted file mode 100644 index 4f4665203..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/SitesCatalogBase.cs +++ /dev/null @@ -1,175 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("SITES_CATALOGS")] - public abstract class SitesCatalogBase : ObservableEntity<SitesCatalog> - { - - public event EventHandler<ColorCatalog> ColorCatalogChanged; - - public event EventHandler<Site> SiteChanged; - - protected String _siteguid; - - /// <summary> - /// Gets or sets the sitescatalogbase site guid. - /// </summary> - - [Column("SITE_GUID")] - [ForeignKey("Site")] - - public String SiteGuid - { - get - { - return _siteguid; - } - - set - { - if (_siteguid != value) - { - _siteguid = value; - - } - } - } - - protected String _colorcatalogguid; - - /// <summary> - /// Gets or sets the sitescatalogbase color catalog guid. - /// </summary> - - [Column("COLOR_CATALOG_GUID")] - [ForeignKey("ColorCatalog")] - - public String ColorCatalogGuid - { - get - { - return _colorcatalogguid; - } - - set - { - if (_colorcatalogguid != value) - { - _colorcatalogguid = value; - - } - } - } - - protected ColorCatalog _colorcatalog; - - /// <summary> - /// Gets or sets the sitescatalogbase color catalogs. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual ColorCatalog ColorCatalog - { - get - { - return _colorcatalog; - } - - set - { - if (_colorcatalog != value) - { - _colorcatalog = value; - - if (ColorCatalog != null) - { - ColorCatalogGuid = ColorCatalog.Guid; - } - - OnColorCatalogChanged(value); - - } - } - } - - protected Site _site; - - /// <summary> - /// Gets or sets the sitescatalogbase site. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual Site Site - { - get - { - return _site; - } - - set - { - if (_site != value) - { - _site = value; - - if (Site != null) - { - SiteGuid = Site.Guid; - } - - OnSiteChanged(value); - - } - } - } - - /// <summary> - /// Called when the ColorCatalog has changed. - /// </summary> - protected virtual void OnColorCatalogChanged(ColorCatalog colorcatalog) - { - ColorCatalogChanged?.Invoke(this, colorcatalog); - RaisePropertyChanged(nameof(ColorCatalog)); - } - - /// <summary> - /// Called when the Site has changed. - /// </summary> - protected virtual void OnSiteChanged(Site site) - { - SiteChanged?.Invoke(this, site); - RaisePropertyChanged(nameof(Site)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="SitesCatalogBase" /> class. - /// </summary> - public SitesCatalogBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SitesRml.cs b/Software/Visual_Studio/Tango.BL/Entities/SitesRml.cs deleted file mode 100644 index 1d6dafe8b..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/SitesRml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.BL.Entities -{ - public class SitesRml : SitesRmlBase - { - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SitesRmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SitesRmlBase.cs deleted file mode 100644 index d9111def7..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/SitesRmlBase.cs +++ /dev/null @@ -1,175 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("SITES_RMLS")] - public abstract class SitesRmlBase : ObservableEntity<SitesRml> - { - - public event EventHandler<Rml> RmlChanged; - - public event EventHandler<Site> SiteChanged; - - protected String _siteguid; - - /// <summary> - /// Gets or sets the sitesrmlbase site guid. - /// </summary> - - [Column("SITE_GUID")] - [ForeignKey("Site")] - - public String SiteGuid - { - get - { - return _siteguid; - } - - set - { - if (_siteguid != value) - { - _siteguid = value; - - } - } - } - - protected String _rmlguid; - - /// <summary> - /// Gets or sets the sitesrmlbase rml guid. - /// </summary> - - [Column("RML_GUID")] - [ForeignKey("Rml")] - - public String RmlGuid - { - get - { - return _rmlguid; - } - - set - { - if (_rmlguid != value) - { - _rmlguid = value; - - } - } - } - - protected Rml _rml; - - /// <summary> - /// Gets or sets the sitesrmlbase rml. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual Rml Rml - { - get - { - return _rml; - } - - set - { - if (_rml != value) - { - _rml = value; - - if (Rml != null) - { - RmlGuid = Rml.Guid; - } - - OnRmlChanged(value); - - } - } - } - - protected Site _site; - - /// <summary> - /// Gets or sets the sitesrmlbase site. - /// </summary> - - [XmlIgnore] - [JsonIgnore] - public virtual Site Site - { - get - { - return _site; - } - - set - { - if (_site != value) - { - _site = value; - - if (Site != null) - { - SiteGuid = Site.Guid; - } - - OnSiteChanged(value); - - } - } - } - - /// <summary> - /// Called when the Rml has changed. - /// </summary> - protected virtual void OnRmlChanged(Rml rml) - { - RmlChanged?.Invoke(this, rml); - RaisePropertyChanged(nameof(Rml)); - } - - /// <summary> - /// Called when the Site has changed. - /// </summary> - protected virtual void OnSiteChanged(Site site) - { - SiteChanged?.Invoke(this, site); - RaisePropertyChanged(nameof(Site)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="SitesRmlBase" /> class. - /// </summary> - public SitesRmlBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs index b1ac62815..5794da91b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -27,15 +26,13 @@ namespace Tango.BL.Entities public abstract class SpoolBase : ObservableEntity<Spool> { - public event EventHandler<Nullable<Int32>> StartOffsetPulsesChanged; + public event EventHandler<Int32> StartOffsetPulsesChanged; - public event EventHandler<Nullable<Int32>> BackingRateChanged; + public event EventHandler<Int32> BackingRateChanged; - public event EventHandler<Nullable<Int32>> SegmentOffsetPulsesChanged; + public event EventHandler<Int32> SegmentOffsetPulsesChanged; - public event EventHandler<Nullable<Int32>> BottomBackingRateChanged; - - public event EventHandler<Nullable<Int32>> LimitSwitchStartPointOffsetChanged; + public event EventHandler<Int32> BottomBackingRateChanged; public event EventHandler<Machine> MachineChanged; @@ -93,7 +90,7 @@ namespace Tango.BL.Entities } } - protected Nullable<Int32> _startoffsetpulses; + protected Int32 _startoffsetpulses; /// <summary> /// Gets or sets the spoolbase start offset pulses. @@ -101,7 +98,7 @@ namespace Tango.BL.Entities [Column("START_OFFSET_PULSES")] - public Nullable<Int32> StartOffsetPulses + public Int32 StartOffsetPulses { get { @@ -120,7 +117,7 @@ namespace Tango.BL.Entities } } - protected Nullable<Int32> _backingrate; + protected Int32 _backingrate; /// <summary> /// Gets or sets the spoolbase backing rate. @@ -128,7 +125,7 @@ namespace Tango.BL.Entities [Column("BACKING_RATE")] - public Nullable<Int32> BackingRate + public Int32 BackingRate { get { @@ -147,7 +144,7 @@ namespace Tango.BL.Entities } } - protected Nullable<Int32> _segmentoffsetpulses; + protected Int32 _segmentoffsetpulses; /// <summary> /// Gets or sets the spoolbase segment offset pulses. @@ -155,7 +152,7 @@ namespace Tango.BL.Entities [Column("SEGMENT_OFFSET_PULSES")] - public Nullable<Int32> SegmentOffsetPulses + public Int32 SegmentOffsetPulses { get { @@ -174,7 +171,7 @@ namespace Tango.BL.Entities } } - protected Nullable<Int32> _bottombackingrate; + protected Int32 _bottombackingrate; /// <summary> /// Gets or sets the spoolbase bottom backing rate. @@ -182,7 +179,7 @@ namespace Tango.BL.Entities [Column("BOTTOM_BACKING_RATE")] - public Nullable<Int32> BottomBackingRate + public Int32 BottomBackingRate { get { @@ -201,33 +198,6 @@ namespace Tango.BL.Entities } } - protected Nullable<Int32> _limitswitchstartpointoffset; - - /// <summary> - /// Gets or sets the spoolbase limit switch start point offset. - /// </summary> - - [Column("LIMIT_SWITCH_START_POINT_OFFSET")] - - public Nullable<Int32> LimitSwitchStartPointOffset - { - get - { - return _limitswitchstartpointoffset; - } - - set - { - if (_limitswitchstartpointoffset != value) - { - _limitswitchstartpointoffset = value; - - OnLimitSwitchStartPointOffsetChanged(value); - - } - } - } - protected Machine _machine; /// <summary> @@ -295,7 +265,7 @@ namespace Tango.BL.Entities /// <summary> /// Called when the StartOffsetPulses has changed. /// </summary> - protected virtual void OnStartOffsetPulsesChanged(Nullable<Int32> startoffsetpulses) + protected virtual void OnStartOffsetPulsesChanged(Int32 startoffsetpulses) { StartOffsetPulsesChanged?.Invoke(this, startoffsetpulses); RaisePropertyChanged(nameof(StartOffsetPulses)); @@ -304,7 +274,7 @@ namespace Tango.BL.Entities /// <summary> /// Called when the BackingRate has changed. /// </summary> - protected virtual void OnBackingRateChanged(Nullable<Int32> backingrate) + protected virtual void OnBackingRateChanged(Int32 backingrate) { BackingRateChanged?.Invoke(this, backingrate); RaisePropertyChanged(nameof(BackingRate)); @@ -313,7 +283,7 @@ namespace Tango.BL.Entities /// <summary> /// Called when the SegmentOffsetPulses has changed. /// </summary> - protected virtual void OnSegmentOffsetPulsesChanged(Nullable<Int32> segmentoffsetpulses) + protected virtual void OnSegmentOffsetPulsesChanged(Int32 segmentoffsetpulses) { SegmentOffsetPulsesChanged?.Invoke(this, segmentoffsetpulses); RaisePropertyChanged(nameof(SegmentOffsetPulses)); @@ -322,22 +292,13 @@ namespace Tango.BL.Entities /// <summary> /// Called when the BottomBackingRate has changed. /// </summary> - protected virtual void OnBottomBackingRateChanged(Nullable<Int32> bottombackingrate) + protected virtual void OnBottomBackingRateChanged(Int32 bottombackingrate) { BottomBackingRateChanged?.Invoke(this, bottombackingrate); RaisePropertyChanged(nameof(BottomBackingRate)); } /// <summary> - /// Called when the LimitSwitchStartPointOffset has changed. - /// </summary> - protected virtual void OnLimitSwitchStartPointOffsetChanged(Nullable<Int32> limitswitchstartpointoffset) - { - LimitSwitchStartPointOffsetChanged?.Invoke(this, limitswitchstartpointoffset); - RaisePropertyChanged(nameof(LimitSwitchStartPointOffset)); - } - - /// <summary> /// Called when the Machine has changed. /// </summary> protected virtual void OnMachineChanged(Machine machine) diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs index a3e59bbc7..55edff2e0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -39,19 +38,9 @@ namespace Tango.BL.Entities public event EventHandler<Double> RotationsPerPassageChanged; - public event EventHandler<Int32> StartOffsetPulsesChanged; - - public event EventHandler<Int32> BackingRateChanged; - - public event EventHandler<Int32> SegmentOffsetPulsesChanged; - - public event EventHandler<Int32> BottomBackingRateChanged; - - public event EventHandler<Int32> LimitSwitchStartPointOffsetChanged; - public event EventHandler<SynchronizedObservableCollection<Job>> JobsChanged; - public event EventHandler<SynchronizedObservableCollection<RmlsSpool>> RmlsSpoolsChanged; + public event EventHandler<SynchronizedObservableCollection<Machine>> MachinesChanged; public event EventHandler<SynchronizedObservableCollection<Spool>> SpoolsChanged; @@ -217,141 +206,6 @@ namespace Tango.BL.Entities } } - protected Int32 _startoffsetpulses; - - /// <summary> - /// Gets or sets the spooltypebase start offset pulses. - /// </summary> - - [Column("START_OFFSET_PULSES")] - - public Int32 StartOffsetPulses - { - get - { - return _startoffsetpulses; - } - - set - { - if (_startoffsetpulses != value) - { - _startoffsetpulses = value; - - OnStartOffsetPulsesChanged(value); - - } - } - } - - protected Int32 _backingrate; - - /// <summary> - /// Gets or sets the spooltypebase backing rate. - /// </summary> - - [Column("BACKING_RATE")] - - public Int32 BackingRate - { - get - { - return _backingrate; - } - - set - { - if (_backingrate != value) - { - _backingrate = value; - - OnBackingRateChanged(value); - - } - } - } - - protected Int32 _segmentoffsetpulses; - - /// <summary> - /// Gets or sets the spooltypebase segment offset pulses. - /// </summary> - - [Column("SEGMENT_OFFSET_PULSES")] - - public Int32 SegmentOffsetPulses - { - get - { - return _segmentoffsetpulses; - } - - set - { - if (_segmentoffsetpulses != value) - { - _segmentoffsetpulses = value; - - OnSegmentOffsetPulsesChanged(value); - - } - } - } - - protected Int32 _bottombackingrate; - - /// <summary> - /// Gets or sets the spooltypebase bottom backing rate. - /// </summary> - - [Column("BOTTOM_BACKING_RATE")] - - public Int32 BottomBackingRate - { - get - { - return _bottombackingrate; - } - - set - { - if (_bottombackingrate != value) - { - _bottombackingrate = value; - - OnBottomBackingRateChanged(value); - - } - } - } - - protected Int32 _limitswitchstartpointoffset; - - /// <summary> - /// Gets or sets the spooltypebase limit switch start point offset. - /// </summary> - - [Column("LIMIT_SWITCH_START_POINT_OFFSET")] - - public Int32 LimitSwitchStartPointOffset - { - get - { - return _limitswitchstartpointoffset; - } - - set - { - if (_limitswitchstartpointoffset != value) - { - _limitswitchstartpointoffset = value; - - OnLimitSwitchStartPointOffsetChanged(value); - - } - } - } - protected SynchronizedObservableCollection<Job> _jobs; /// <summary> @@ -377,26 +231,26 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<RmlsSpool> _rmlsspools; + protected SynchronizedObservableCollection<Machine> _machines; /// <summary> - /// Gets or sets the spooltypebase rmls spools. + /// Gets or sets the spooltypebase machines. /// </summary> - public virtual SynchronizedObservableCollection<RmlsSpool> RmlsSpools + public virtual SynchronizedObservableCollection<Machine> Machines { get { - return _rmlsspools; + return _machines; } set { - if (_rmlsspools != value) + if (_machines != value) { - _rmlsspools = value; + _machines = value; - OnRmlsSpoolsChanged(value); + OnMachinesChanged(value); } } @@ -482,51 +336,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the StartOffsetPulses has changed. - /// </summary> - protected virtual void OnStartOffsetPulsesChanged(Int32 startoffsetpulses) - { - StartOffsetPulsesChanged?.Invoke(this, startoffsetpulses); - RaisePropertyChanged(nameof(StartOffsetPulses)); - } - - /// <summary> - /// Called when the BackingRate has changed. - /// </summary> - protected virtual void OnBackingRateChanged(Int32 backingrate) - { - BackingRateChanged?.Invoke(this, backingrate); - RaisePropertyChanged(nameof(BackingRate)); - } - - /// <summary> - /// Called when the SegmentOffsetPulses has changed. - /// </summary> - protected virtual void OnSegmentOffsetPulsesChanged(Int32 segmentoffsetpulses) - { - SegmentOffsetPulsesChanged?.Invoke(this, segmentoffsetpulses); - RaisePropertyChanged(nameof(SegmentOffsetPulses)); - } - - /// <summary> - /// Called when the BottomBackingRate has changed. - /// </summary> - protected virtual void OnBottomBackingRateChanged(Int32 bottombackingrate) - { - BottomBackingRateChanged?.Invoke(this, bottombackingrate); - RaisePropertyChanged(nameof(BottomBackingRate)); - } - - /// <summary> - /// Called when the LimitSwitchStartPointOffset has changed. - /// </summary> - protected virtual void OnLimitSwitchStartPointOffsetChanged(Int32 limitswitchstartpointoffset) - { - LimitSwitchStartPointOffsetChanged?.Invoke(this, limitswitchstartpointoffset); - RaisePropertyChanged(nameof(LimitSwitchStartPointOffset)); - } - - /// <summary> /// Called when the Jobs has changed. /// </summary> protected virtual void OnJobsChanged(SynchronizedObservableCollection<Job> jobs) @@ -536,12 +345,12 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the RmlsSpools has changed. + /// Called when the Machines has changed. /// </summary> - protected virtual void OnRmlsSpoolsChanged(SynchronizedObservableCollection<RmlsSpool> rmlsspools) + protected virtual void OnMachinesChanged(SynchronizedObservableCollection<Machine> machines) { - RmlsSpoolsChanged?.Invoke(this, rmlsspools); - RaisePropertyChanged(nameof(RmlsSpools)); + MachinesChanged?.Invoke(this, machines); + RaisePropertyChanged(nameof(Machines)); } /// <summary> @@ -561,7 +370,7 @@ namespace Tango.BL.Entities Jobs = new SynchronizedObservableCollection<Job>(); - RmlsSpools = new SynchronizedObservableCollection<RmlsSpool>(); + Machines = new SynchronizedObservableCollection<Machine>(); Spools = new SynchronizedObservableCollection<Spool>(); diff --git a/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs index ea816c4f3..91b1ca9ac 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs index 5480d47f1..2e99df9b0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -27,19 +26,17 @@ namespace Tango.BL.Entities public abstract class SysdiagramBase : ObservableEntity<Sysdiagram> { - public event EventHandler<Nullable<Int32>> VersionChanged; + public event EventHandler<SynchronizedObservableCollection<Int32>> VersionChanged; public event EventHandler<Byte[]> DefinitionChanged; - protected Nullable<Int32> _version; + protected SynchronizedObservableCollection<Int32> _version; /// <summary> /// Gets or sets the sysdiagrambase version. /// </summary> - [Column("version")] - - public Nullable<Int32> Version + public virtual SynchronizedObservableCollection<Int32> Version { get { @@ -88,7 +85,7 @@ namespace Tango.BL.Entities /// <summary> /// Called when the Version has changed. /// </summary> - protected virtual void OnVersionChanged(Nullable<Int32> version) + protected virtual void OnVersionChanged(SynchronizedObservableCollection<Int32> version) { VersionChanged?.Invoke(this, version); RaisePropertyChanged(nameof(Version)); @@ -108,6 +105,9 @@ namespace Tango.BL.Entities /// </summary> public SysdiagramBase() : base() { + + Version = new SynchronizedObservableCollection<Int32>(); + } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs deleted file mode 100644 index d5b10ee45..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs +++ /dev/null @@ -1,161 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Enumerations; - -namespace Tango.BL.Entities -{ - public class TangoUpdate : TangoUpdateBase - { - [NotMapped] - [JsonIgnore] - public TangoUpdateStatuses UpdateStatus - { - get - { - return (TangoUpdateStatuses)Status; - } - set - { - Status = (int)value; - RaisePropertyChangedAuto(); - } - } - - [NotMapped] - [JsonIgnore] - public bool IsSetup - { - get - { - return - UpdateStatus == TangoUpdateStatuses.SetupStarted || - UpdateStatus == TangoUpdateStatuses.SetupCompleted || - UpdateStatus == TangoUpdateStatuses.SetupFailed; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsUpdate - { - get - { - return - UpdateStatus == TangoUpdateStatuses.UpdateStarted || - UpdateStatus == TangoUpdateStatuses.UpdateCompleted || - UpdateStatus == TangoUpdateStatuses.UpdateFailed; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsDataBase - { - get - { - return - UpdateStatus == TangoUpdateStatuses.DatabaseStarted || - UpdateStatus == TangoUpdateStatuses.DatabaseCompleted || - UpdateStatus == TangoUpdateStatuses.DatabaseFailed; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsSynchronization - { - get - { - return - UpdateStatus == TangoUpdateStatuses.SynchronizationStarted || - UpdateStatus == TangoUpdateStatuses.SynchronizationCompleted || - UpdateStatus == TangoUpdateStatuses.SynchronizationFailed; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsOfflineUpdate - { - get - { - return - UpdateStatus == TangoUpdateStatuses.OfflineUpdateStarted || - UpdateStatus == TangoUpdateStatuses.OfflineUpdateCompleted || - UpdateStatus == TangoUpdateStatuses.OfflineUpdateFailed; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsOfflineFirmwareUpgrade - { - get - { - return - UpdateStatus == TangoUpdateStatuses.OfflineFirmwareUpgradeStarted || - UpdateStatus == TangoUpdateStatuses.OfflineFirmwareUpgradeCompleted || - UpdateStatus == TangoUpdateStatuses.OfflineFirmwareUpgradeFailed; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsStarted - { - get - { - return - UpdateStatus == TangoUpdateStatuses.SetupStarted || - UpdateStatus == TangoUpdateStatuses.UpdateStarted || - UpdateStatus == TangoUpdateStatuses.DatabaseStarted || - UpdateStatus == TangoUpdateStatuses.SynchronizationStarted || - UpdateStatus == TangoUpdateStatuses.OfflineUpdateStarted || - UpdateStatus == TangoUpdateStatuses.OfflineFirmwareUpgradeStarted; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsCompleted - { - get - { - return - UpdateStatus == TangoUpdateStatuses.SetupCompleted || - UpdateStatus == TangoUpdateStatuses.UpdateCompleted || - UpdateStatus == TangoUpdateStatuses.DatabaseCompleted || - UpdateStatus == TangoUpdateStatuses.SynchronizationCompleted || - UpdateStatus == TangoUpdateStatuses.OfflineUpdateCompleted || - UpdateStatus == TangoUpdateStatuses.OfflineFirmwareUpgradeCompleted; - } - } - - [NotMapped] - [JsonIgnore] - public bool IsFailed - { - get - { - return - UpdateStatus == TangoUpdateStatuses.SetupFailed || - UpdateStatus == TangoUpdateStatuses.UpdateFailed || - UpdateStatus == TangoUpdateStatuses.DatabaseFailed || - UpdateStatus == TangoUpdateStatuses.SynchronizationFailed || - UpdateStatus == TangoUpdateStatuses.OfflineUpdateFailed || - UpdateStatus == TangoUpdateStatuses.OfflineFirmwareUpgradeFailed; - } - } - - protected override void OnStatusChanged(int status) - { - base.OnStatusChanged(status); - RaisePropertyChanged(nameof(UpdateStatus)); - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoUpdateBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoUpdateBase.cs deleted file mode 100644 index 677886b47..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/TangoUpdateBase.cs +++ /dev/null @@ -1,366 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Tango Observables Generator -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. Do not modify! -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Xml.Serialization; -using Newtonsoft.Json; -using System.Linq; -using Tango.DAL.Remote.DB; -using Tango.Core; -using System.ComponentModel; -using Tango.Core.CustomAttributes; - -namespace Tango.BL.Entities -{ - [Table("TANGO_UPDATES")] - public abstract class TangoUpdateBase : ObservableEntity<TangoUpdate> - { - - public event EventHandler<String> ApplicationVersionChanged; - - public event EventHandler<String> FirmwareVersionChanged; - - public event EventHandler<Int32> StatusChanged; - - public event EventHandler<String> FailedReasonChanged; - - public event EventHandler<String> FailedLogChanged; - - public event EventHandler<DateTime> StartDateChanged; - - public event EventHandler<Nullable<DateTime>> EndDateChanged; - - public event EventHandler<Boolean> IsSynchronizedChanged; - - protected String _applicationversion; - - /// <summary> - /// Gets or sets the tangoupdatebase application version. - /// </summary> - - [Column("APPLICATION_VERSION")] - - public String ApplicationVersion - { - get - { - return _applicationversion; - } - - set - { - if (_applicationversion != value) - { - _applicationversion = value; - - OnApplicationVersionChanged(value); - - } - } - } - - protected String _firmwareversion; - - /// <summary> - /// Gets or sets the tangoupdatebase firmware version. - /// </summary> - - [Column("FIRMWARE_VERSION")] - - public String FirmwareVersion - { - get - { - return _firmwareversion; - } - - set - { - if (_firmwareversion != value) - { - _firmwareversion = value; - - OnFirmwareVersionChanged(value); - - } - } - } - - protected String _machineguid; - - /// <summary> - /// Gets or sets the tangoupdatebase machine guid. - /// </summary> - - [Column("MACHINE_GUID")] - - public String MachineGuid - { - get - { - return _machineguid; - } - - set - { - if (_machineguid != value) - { - _machineguid = value; - - } - } - } - - protected Int32 _status; - - /// <summary> - /// Gets or sets the tangoupdatebase status. - /// </summary> - - [Column("STATUS")] - - public Int32 Status - { - get - { - return _status; - } - - set - { - if (_status != value) - { - _status = value; - - OnStatusChanged(value); - - } - } - } - - protected String _failedreason; - - /// <summary> - /// Gets or sets the tangoupdatebase failed reason. - /// </summary> - - [Column("FAILED_REASON")] - - public String FailedReason - { - get - { - return _failedreason; - } - - set - { - if (_failedreason != value) - { - _failedreason = value; - - OnFailedReasonChanged(value); - - } - } - } - - protected String _failedlog; - - /// <summary> - /// Gets or sets the tangoupdatebase failed log. - /// </summary> - - [Column("FAILED_LOG")] - - public String FailedLog - { - get - { - return _failedlog; - } - - set - { - if (_failedlog != value) - { - _failedlog = value; - - OnFailedLogChanged(value); - - } - } - } - - protected DateTime _startdate; - - /// <summary> - /// Gets or sets the tangoupdatebase start date. - /// </summary> - - [Column("START_DATE")] - - public DateTime StartDate - { - get - { - return _startdate; - } - - set - { - if (_startdate != value) - { - _startdate = value; - - OnStartDateChanged(value); - - } - } - } - - protected Nullable<DateTime> _enddate; - - /// <summary> - /// Gets or sets the tangoupdatebase end date. - /// </summary> - - [Column("END_DATE")] - - public Nullable<DateTime> EndDate - { - get - { - return _enddate; - } - - set - { - if (_enddate != value) - { - _enddate = value; - - OnEndDateChanged(value); - - } - } - } - - protected Boolean _issynchronized; - - /// <summary> - /// Gets or sets the tangoupdatebase is synchronized. - /// </summary> - - [Column("IS_SYNCHRONIZED")] - - public Boolean IsSynchronized - { - get - { - return _issynchronized; - } - - set - { - if (_issynchronized != value) - { - _issynchronized = value; - - OnIsSynchronizedChanged(value); - - } - } - } - - /// <summary> - /// Called when the ApplicationVersion has changed. - /// </summary> - protected virtual void OnApplicationVersionChanged(String applicationversion) - { - ApplicationVersionChanged?.Invoke(this, applicationversion); - RaisePropertyChanged(nameof(ApplicationVersion)); - } - - /// <summary> - /// Called when the FirmwareVersion has changed. - /// </summary> - protected virtual void OnFirmwareVersionChanged(String firmwareversion) - { - FirmwareVersionChanged?.Invoke(this, firmwareversion); - RaisePropertyChanged(nameof(FirmwareVersion)); - } - - /// <summary> - /// Called when the Status has changed. - /// </summary> - protected virtual void OnStatusChanged(Int32 status) - { - StatusChanged?.Invoke(this, status); - RaisePropertyChanged(nameof(Status)); - } - - /// <summary> - /// Called when the FailedReason has changed. - /// </summary> - protected virtual void OnFailedReasonChanged(String failedreason) - { - FailedReasonChanged?.Invoke(this, failedreason); - RaisePropertyChanged(nameof(FailedReason)); - } - - /// <summary> - /// Called when the FailedLog has changed. - /// </summary> - protected virtual void OnFailedLogChanged(String failedlog) - { - FailedLogChanged?.Invoke(this, failedlog); - RaisePropertyChanged(nameof(FailedLog)); - } - - /// <summary> - /// Called when the StartDate has changed. - /// </summary> - protected virtual void OnStartDateChanged(DateTime startdate) - { - StartDateChanged?.Invoke(this, startdate); - RaisePropertyChanged(nameof(StartDate)); - } - - /// <summary> - /// Called when the EndDate has changed. - /// </summary> - protected virtual void OnEndDateChanged(Nullable<DateTime> enddate) - { - EndDateChanged?.Invoke(this, enddate); - RaisePropertyChanged(nameof(EndDate)); - } - - /// <summary> - /// Called when the IsSynchronized has changed. - /// </summary> - protected virtual void OnIsSynchronizedChanged(Boolean issynchronized) - { - IsSynchronizedChanged?.Invoke(this, issynchronized); - RaisePropertyChanged(nameof(IsSynchronized)); - } - - /// <summary> - /// Initializes a new instance of the <see cref="TangoUpdateBase" /> class. - /// </summary> - public TangoUpdateBase() : base() - { - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs index 2fece7fdb..ddf7561af 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -37,8 +36,6 @@ namespace Tango.BL.Entities public event EventHandler<String> CommentsChanged; - public event EventHandler<Boolean> DisabledChanged; - public event EventHandler<MachineVersion> MachineVersionChanged; public event EventHandler<User> UserChanged; @@ -230,33 +227,6 @@ namespace Tango.BL.Entities } } - protected Boolean _disabled; - - /// <summary> - /// Gets or sets the tangoversionbase disabled. - /// </summary> - - [Column("DISABLED")] - - public Boolean Disabled - { - get - { - return _disabled; - } - - set - { - if (_disabled != value) - { - _disabled = value; - - OnDisabledChanged(value); - - } - } - } - protected MachineVersion _machineversion; /// <summary> @@ -367,15 +337,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the Disabled has changed. - /// </summary> - protected virtual void OnDisabledChanged(Boolean disabled) - { - DisabledChanged?.Invoke(this, disabled); - RaisePropertyChanged(nameof(Disabled)); - } - - /// <summary> /// Called when the MachineVersion has changed. /// </summary> protected virtual void OnMachineVersionChanged(MachineVersion machineversion) diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechControllerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TechControllerBase.cs index b060ded50..72fe76f3c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TechControllerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TechControllerBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechDispenserBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TechDispenserBase.cs index ba6309950..ccb3e7c03 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TechDispenserBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TechDispenserBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechHeaterBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TechHeaterBase.cs index 5dc7d2a5a..2fc68c69c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TechHeaterBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TechHeaterBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechIoBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TechIoBase.cs index e027e81b1..0b140690f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TechIoBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TechIoBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechMonitorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TechMonitorBase.cs index f9f9c7140..d7ff856b6 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TechMonitorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TechMonitorBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechValveBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TechValveBase.cs index e22bd450e..5275c924b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TechValveBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TechValveBase.cs @@ -19,10 +19,14 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("TECH_VALVES")] public abstract class TechValveBase : ObservableEntity<TechValve> { diff --git a/Software/Visual_Studio/Tango.BL/Entities/User.cs b/Software/Visual_Studio/Tango.BL/Entities/User.cs index dc27b5625..7c6780972 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/User.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/User.cs @@ -16,6 +16,8 @@ namespace Tango.BL.Entities { private static IHashGenerator _hashGenerator; + private bool _passwordGatewayModified = false; + /// <summary> /// Determines whether the user has the specified permission. /// </summary> @@ -38,7 +40,7 @@ namespace Tango.BL.Entities } /// <summary> - /// Gets the aggregated user roles. + /// Gets the aggregated user roles as enumerations. /// </summary> [NotMapped] public List<Role> Roles @@ -47,29 +49,49 @@ namespace Tango.BL.Entities } /// <summary> - /// Gets the aggregated FSE user roles. + /// Gets the aggregated user permissions as enumerations. /// </summary> [NotMapped] - public List<Role> FSERoles + public List<Permission> Permissions { - get { return UsersRoles.Select(x => x.Role).Where(x => x.Name.StartsWith("FSE")).ToList(); } + get + { + return UsersRoles.Select(x => x.Role).ToList().SelectMany(x => x.RolesPermissions).Select(x => x.Permission).ToList(); + } } + + private String _passwordGateway; /// <summary> - /// Gets the aggregated user permissions as enumerations. + /// Gets or sets the password gate way. /// </summary> [NotMapped] - public List<Permission> Permissions + [JsonIgnore] + [XmlIgnore] + public String PasswordGateWay { get { - return UsersRoles.Select(x => x.Role).ToList().SelectMany(x => x.RolesPermissions).Select(x => x.Permission).ToList(); + return _passwordGateway; + } + set + { + _passwordGateway = value; + Password = GetHashGenerator().Encrypt(_passwordGateway); + RaisePropertyChangedAuto(); + + _passwordGatewayModified = true; } } protected override void RaisePropertyChanged(string propName) { base.RaisePropertyChanged(propName); + + if (propName == nameof(Password)) + { + RaisePropertyChanged(nameof(PasswordGateWay)); + } } public override bool Validate(ObservablesContext context) @@ -92,6 +114,14 @@ namespace Tango.BL.Entities { InsertError(nameof(Email), "The specified email address is invalid."); } + + if (_passwordGatewayModified) + { + if (!PasswordGateWay.IsBetweenLength(4, 30)) + { + InsertError(nameof(PasswordGateWay), "A user password must be at least 4 characters long and maximum 30."); + } + } } /// <summary> diff --git a/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs b/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs index eb6eae4f7..5445b2980 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/UserBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -35,16 +34,10 @@ namespace Tango.BL.Entities public event EventHandler<Nullable<DateTime>> LastLoginChanged; - public event EventHandler<Boolean> PasswordChangeRequiredChanged; - - public event EventHandler<SynchronizedObservableCollection<ActionLog>> ActionLogsChanged; - public event EventHandler<Address> AddressChanged; public event EventHandler<Contact> ContactChanged; - public event EventHandler<SynchronizedObservableCollection<FseVersion>> FseVersionsChanged; - public event EventHandler<SynchronizedObservableCollection<Job>> JobsChanged; public event EventHandler<SynchronizedObservableCollection<MachineStudioVersion>> MachineStudioVersionsChanged; @@ -243,58 +236,6 @@ namespace Tango.BL.Entities } } - protected Boolean _passwordchangerequired; - - /// <summary> - /// Gets or sets the userbase password change required. - /// </summary> - - [Column("PASSWORD_CHANGE_REQUIRED")] - - public Boolean PasswordChangeRequired - { - get - { - return _passwordchangerequired; - } - - set - { - if (_passwordchangerequired != value) - { - _passwordchangerequired = value; - - OnPasswordChangeRequiredChanged(value); - - } - } - } - - protected SynchronizedObservableCollection<ActionLog> _actionlogs; - - /// <summary> - /// Gets or sets the userbase action logs. - /// </summary> - - public virtual SynchronizedObservableCollection<ActionLog> ActionLogs - { - get - { - return _actionlogs; - } - - set - { - if (_actionlogs != value) - { - _actionlogs = value; - - OnActionLogsChanged(value); - - } - } - } - protected Address _address; /// <summary> @@ -359,31 +300,6 @@ namespace Tango.BL.Entities } } - protected SynchronizedObservableCollection<FseVersion> _fseversions; - - /// <summary> - /// Gets or sets the userbase fse versions. - /// </summary> - - public virtual SynchronizedObservableCollection<FseVersion> FseVersions - { - get - { - return _fseversions; - } - - set - { - if (_fseversions != value) - { - _fseversions = value; - - OnFseVersionsChanged(value); - - } - } - } - protected SynchronizedObservableCollection<Job> _jobs; /// <summary> @@ -578,24 +494,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the PasswordChangeRequired has changed. - /// </summary> - protected virtual void OnPasswordChangeRequiredChanged(Boolean passwordchangerequired) - { - PasswordChangeRequiredChanged?.Invoke(this, passwordchangerequired); - RaisePropertyChanged(nameof(PasswordChangeRequired)); - } - - /// <summary> - /// Called when the ActionLogs has changed. - /// </summary> - protected virtual void OnActionLogsChanged(SynchronizedObservableCollection<ActionLog> actionlogs) - { - ActionLogsChanged?.Invoke(this, actionlogs); - RaisePropertyChanged(nameof(ActionLogs)); - } - - /// <summary> /// Called when the Address has changed. /// </summary> protected virtual void OnAddressChanged(Address address) @@ -614,15 +512,6 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the FseVersions has changed. - /// </summary> - protected virtual void OnFseVersionsChanged(SynchronizedObservableCollection<FseVersion> fseversions) - { - FseVersionsChanged?.Invoke(this, fseversions); - RaisePropertyChanged(nameof(FseVersions)); - } - - /// <summary> /// Called when the Jobs has changed. /// </summary> protected virtual void OnJobsChanged(SynchronizedObservableCollection<Job> jobs) @@ -682,10 +571,6 @@ namespace Tango.BL.Entities public UserBase() : base() { - ActionLogs = new SynchronizedObservableCollection<ActionLog>(); - - FseVersions = new SynchronizedObservableCollection<FseVersion>(); - Jobs = new SynchronizedObservableCollection<Job>(); MachineStudioVersions = new SynchronizedObservableCollection<MachineStudioVersion>(); diff --git a/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs b/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs index 877f66c72..2927d05f1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/UsersRoleBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/WindingMethodBase.cs b/Software/Visual_Studio/Tango.BL/Entities/WindingMethodBase.cs index e64f989aa..ce4c22313 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/WindingMethodBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/WindingMethodBase.cs @@ -19,7 +19,6 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; -using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { |
