From b77fbb01ed5b63b65f6e755fef9ca49c3e58ea50 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 5 Dec 2024 02:38:10 +0200 Subject: Last say on extra inks branch --- .../Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs | 64 +++++ .../Tango.BL/DTO/LiquidTypeDTOBase.cs | 16 ++ .../Visual_Studio/Tango.BL/Entities/JobRunBase.cs | 304 +++++++++++++++++++++ .../Visual_Studio/Tango.BL/Entities/LiquidType.cs | 7 + .../Tango.BL/Entities/LiquidTypeBase.cs | 76 ++++++ Software/Visual_Studio/Tango.BL/LiquidVolume.cs | 22 +- 6 files changed, 484 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/Tango.BL') diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs index 139223d8d..08e8d7337 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs @@ -357,5 +357,69 @@ namespace Tango.BL.DTO get; set; } + /// + /// blue quantity + /// + public Int64 BlueQuantity + { + get; set; + } + + /// + /// light blue quantity + /// + public Int64 LightBlueQuantity + { + get; set; + } + + /// + /// orange quantity + /// + public Int64 OrangeQuantity + { + get; set; + } + + /// + /// light orange quantity + /// + public Int64 LightOrangeQuantity + { + get; set; + } + + /// + /// rubine quantity + /// + public Int64 RubineQuantity + { + get; set; + } + + /// + /// light rubine quantity + /// + public Int64 LightRubineQuantity + { + get; set; + } + + /// + /// navy quantity + /// + public Int64 NavyQuantity + { + get; set; + } + + /// + /// violet quantity + /// + public Int64 VioletQuantity + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/DTO/LiquidTypeDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/LiquidTypeDTOBase.cs index 1cb00d6bc..eba35dbd6 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/LiquidTypeDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/LiquidTypeDTOBase.cs @@ -93,5 +93,21 @@ namespace Tango.BL.DTO get; set; } + /// + /// is light ink + /// + public Boolean IsLightInk + { + get; set; + } + + /// + /// dark ink code + /// + public Int32 DarkInkCode + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index 6da5b8f8b..54685f7ee 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -101,6 +101,22 @@ namespace Tango.BL.Entities public event EventHandler ActualEndPositionChanged; + public event EventHandler BlueQuantityChanged; + + public event EventHandler LightBlueQuantityChanged; + + public event EventHandler OrangeQuantityChanged; + + public event EventHandler LightOrangeQuantityChanged; + + public event EventHandler RubineQuantityChanged; + + public event EventHandler LightRubineQuantityChanged; + + public event EventHandler NavyQuantityChanged; + + public event EventHandler VioletQuantityChanged; + protected String _machineguid; /// @@ -1227,6 +1243,222 @@ namespace Tango.BL.Entities } } + protected Int64 _bluequantity; + + /// + /// Gets or sets the jobrunbase blue quantity. + /// + + [Column("BLUE_QUANTITY")] + + public Int64 BlueQuantity + { + get + { + return _bluequantity; + } + + set + { + if (_bluequantity != value) + { + _bluequantity = value; + + OnBlueQuantityChanged(value); + + } + } + } + + protected Int64 _lightbluequantity; + + /// + /// Gets or sets the jobrunbase light blue quantity. + /// + + [Column("LIGHT_BLUE_QUANTITY")] + + public Int64 LightBlueQuantity + { + get + { + return _lightbluequantity; + } + + set + { + if (_lightbluequantity != value) + { + _lightbluequantity = value; + + OnLightBlueQuantityChanged(value); + + } + } + } + + protected Int64 _orangequantity; + + /// + /// Gets or sets the jobrunbase orange quantity. + /// + + [Column("ORANGE_QUANTITY")] + + public Int64 OrangeQuantity + { + get + { + return _orangequantity; + } + + set + { + if (_orangequantity != value) + { + _orangequantity = value; + + OnOrangeQuantityChanged(value); + + } + } + } + + protected Int64 _lightorangequantity; + + /// + /// Gets or sets the jobrunbase light orange quantity. + /// + + [Column("LIGHT_ORANGE_QUANTITY")] + + public Int64 LightOrangeQuantity + { + get + { + return _lightorangequantity; + } + + set + { + if (_lightorangequantity != value) + { + _lightorangequantity = value; + + OnLightOrangeQuantityChanged(value); + + } + } + } + + protected Int64 _rubinequantity; + + /// + /// Gets or sets the jobrunbase rubine quantity. + /// + + [Column("RUBINE_QUANTITY")] + + public Int64 RubineQuantity + { + get + { + return _rubinequantity; + } + + set + { + if (_rubinequantity != value) + { + _rubinequantity = value; + + OnRubineQuantityChanged(value); + + } + } + } + + protected Int64 _lightrubinequantity; + + /// + /// Gets or sets the jobrunbase light rubine quantity. + /// + + [Column("LIGHT_RUBINE_QUANTITY")] + + public Int64 LightRubineQuantity + { + get + { + return _lightrubinequantity; + } + + set + { + if (_lightrubinequantity != value) + { + _lightrubinequantity = value; + + OnLightRubineQuantityChanged(value); + + } + } + } + + protected Int64 _navyquantity; + + /// + /// Gets or sets the jobrunbase navy quantity. + /// + + [Column("NAVY_QUANTITY")] + + public Int64 NavyQuantity + { + get + { + return _navyquantity; + } + + set + { + if (_navyquantity != value) + { + _navyquantity = value; + + OnNavyQuantityChanged(value); + + } + } + } + + protected Int64 _violetquantity; + + /// + /// Gets or sets the jobrunbase violet quantity. + /// + + [Column("VIOLET_QUANTITY")] + + public Int64 VioletQuantity + { + get + { + return _violetquantity; + } + + set + { + if (_violetquantity != value) + { + _violetquantity = value; + + OnVioletQuantityChanged(value); + + } + } + } + /// /// Called when the JobName has changed. /// @@ -1560,6 +1792,78 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(ActualEndPosition)); } + /// + /// Called when the BlueQuantity has changed. + /// + protected virtual void OnBlueQuantityChanged(Int64 bluequantity) + { + BlueQuantityChanged?.Invoke(this, bluequantity); + RaisePropertyChanged(nameof(BlueQuantity)); + } + + /// + /// Called when the LightBlueQuantity has changed. + /// + protected virtual void OnLightBlueQuantityChanged(Int64 lightbluequantity) + { + LightBlueQuantityChanged?.Invoke(this, lightbluequantity); + RaisePropertyChanged(nameof(LightBlueQuantity)); + } + + /// + /// Called when the OrangeQuantity has changed. + /// + protected virtual void OnOrangeQuantityChanged(Int64 orangequantity) + { + OrangeQuantityChanged?.Invoke(this, orangequantity); + RaisePropertyChanged(nameof(OrangeQuantity)); + } + + /// + /// Called when the LightOrangeQuantity has changed. + /// + protected virtual void OnLightOrangeQuantityChanged(Int64 lightorangequantity) + { + LightOrangeQuantityChanged?.Invoke(this, lightorangequantity); + RaisePropertyChanged(nameof(LightOrangeQuantity)); + } + + /// + /// Called when the RubineQuantity has changed. + /// + protected virtual void OnRubineQuantityChanged(Int64 rubinequantity) + { + RubineQuantityChanged?.Invoke(this, rubinequantity); + RaisePropertyChanged(nameof(RubineQuantity)); + } + + /// + /// Called when the LightRubineQuantity has changed. + /// + protected virtual void OnLightRubineQuantityChanged(Int64 lightrubinequantity) + { + LightRubineQuantityChanged?.Invoke(this, lightrubinequantity); + RaisePropertyChanged(nameof(LightRubineQuantity)); + } + + /// + /// Called when the NavyQuantity has changed. + /// + protected virtual void OnNavyQuantityChanged(Int64 navyquantity) + { + NavyQuantityChanged?.Invoke(this, navyquantity); + RaisePropertyChanged(nameof(NavyQuantity)); + } + + /// + /// Called when the VioletQuantity has changed. + /// + protected virtual void OnVioletQuantityChanged(Int64 violetquantity) + { + VioletQuantityChanged?.Invoke(this, violetquantity); + RaisePropertyChanged(nameof(VioletQuantity)); + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs index d7b0f4f58..b9a7d3557 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs @@ -39,6 +39,13 @@ namespace Tango.BL.Entities get { return (LiquidTypes)Code; } } + [NotMapped] + [JsonIgnore] + public LiquidTypes? DarkType + { + get { return DarkInkCode < 0 ? null : (LiquidTypes?)DarkInkCode; } + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs index bfdc8cfb7..82403a11b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs @@ -45,6 +45,10 @@ namespace Tango.BL.Entities public event EventHandler IsExtraInkChanged; + public event EventHandler IsLightInkChanged; + + public event EventHandler DarkInkCodeChanged; + public event EventHandler> CatsChanged; public event EventHandler> IdsPacksChanged; @@ -296,6 +300,60 @@ namespace Tango.BL.Entities } } + protected Boolean _islightink; + + /// + /// Gets or sets the liquidtypebase is light ink. + /// + + [Column("IS_LIGHT_INK")] + + public Boolean IsLightInk + { + get + { + return _islightink; + } + + set + { + if (_islightink != value) + { + _islightink = value; + + OnIsLightInkChanged(value); + + } + } + } + + protected Int32 _darkinkcode; + + /// + /// Gets or sets the liquidtypebase dark ink code. + /// + + [Column("DARK_INK_CODE")] + + public Int32 DarkInkCode + { + get + { + return _darkinkcode; + } + + set + { + if (_darkinkcode != value) + { + _darkinkcode = value; + + OnDarkInkCodeChanged(value); + + } + } + } + protected SynchronizedObservableCollection _cats; /// @@ -477,6 +535,24 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(IsExtraInk)); } + /// + /// Called when the IsLightInk has changed. + /// + protected virtual void OnIsLightInkChanged(Boolean islightink) + { + IsLightInkChanged?.Invoke(this, islightink); + RaisePropertyChanged(nameof(IsLightInk)); + } + + /// + /// Called when the DarkInkCode has changed. + /// + protected virtual void OnDarkInkCodeChanged(Int32 darkinkcode) + { + DarkInkCodeChanged?.Invoke(this, darkinkcode); + RaisePropertyChanged(nameof(DarkInkCode)); + } + /// /// Called when the Cats has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs index 5b4cec488..014ca040a 100644 --- a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs +++ b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs @@ -14,6 +14,7 @@ namespace Tango.BL public class LiquidVolume : ExtendedObject { public event Action VolumeChanged; + private static object _lock = new object(); private BrushStop _brushStop; [JsonIgnore] @@ -82,14 +83,25 @@ namespace Tango.BL public void Invalidate() { - if (BrushStop.LiquidVolumes != null) + lock (_lock) { - InvalidateSolo(); - - foreach (var liquidVolume in BrushStop.LiquidVolumes.ToList().Where(x => x != this)) + try { - liquidVolume.InvalidateSolo(); + if (BrushStop.LiquidVolumes != null) + { + InvalidateSolo(); + + foreach (var liquidVolume in BrushStop.LiquidVolumes.ToList().Where(x => x != this)) + { + liquidVolume.InvalidateSolo(); + } + } } + catch (Exception ex) + { + + throw; + } } } -- cgit v1.3.1