From 3549567e8db23411a84e006229f3382d912209fb Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 16 Mar 2020 23:21:15 +0200 Subject: PPC v1.1.7 --- Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs') diff --git a/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs index b105b8254..0f53e1504 100644 --- a/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs @@ -19,7 +19,7 @@ namespace Tango.JobRunsGenerator static void Main(string[] args) { DataSource dataSource = new DataSource(); - dataSource.Catalog = "Tango_DEV"; + dataSource.Catalog = "Tango_TEST"; dataSource.Address = "twine.database.windows.net"; dataSource.IntegratedSecurity = false; dataSource.UserName = "Roy"; -- cgit v1.3.1 From 3d09f9c2aef7ab4ca2c66a35c8c25a39bc748d1b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 16 Mar 2020 23:59:42 +0200 Subject: Implemented job runs individual liquid quantities. Added to job runs fixer. --- .../Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs | 56 +++++ .../Visual_Studio/Tango.BL/Entities/JobRunBase.cs | 266 +++++++++++++++++++++ .../Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs | 7 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 21 ++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 158 ++++++------ .../JobRuns/BasicJobRunsLogger.cs | 30 +++ .../Utilities/Tango.JobRunsGenerator/Program.cs | 40 +++- 7 files changed, 498 insertions(+), 80 deletions(-) (limited to 'Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs') diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs index 8b5b29482..a728ef881 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs @@ -165,6 +165,62 @@ namespace Tango.BL.DTO get; set; } + /// + /// cyan quantity + /// + public Int32 CyanQuantity + { + get; set; + } + + /// + /// magenta quantity + /// + public Int32 MagentaQuantity + { + get; set; + } + + /// + /// yellow quantity + /// + public Int32 YellowQuantity + { + get; set; + } + + /// + /// black quantity + /// + public Int32 BlackQuantity + { + get; set; + } + + /// + /// transparent quantity + /// + public Int32 TransparentQuantity + { + get; set; + } + + /// + /// lubricant quantity + /// + public Int32 LubricantQuantity + { + get; set; + } + + /// + /// cleaner quantity + /// + public Int32 CleanerQuantity + { + get; set; + } + /// /// end position /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index 2b002d19a..9277e279b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -55,6 +55,20 @@ namespace Tango.BL.Entities public event EventHandler LiquidQuantityStringChanged; + public event EventHandler CyanQuantityChanged; + + public event EventHandler MagentaQuantityChanged; + + public event EventHandler YellowQuantityChanged; + + public event EventHandler BlackQuantityChanged; + + public event EventHandler TransparentQuantityChanged; + + public event EventHandler LubricantQuantityChanged; + + public event EventHandler CleanerQuantityChanged; + public event EventHandler EndPositionChanged; public event EventHandler FailedMessageChanged; @@ -541,6 +555,195 @@ namespace Tango.BL.Entities } } + protected Int32 _cyanquantity; + + /// + /// Gets or sets the jobrunbase cyan quantity. + /// + + [Column("CYAN_QUANTITY")] + + public Int32 CyanQuantity + { + get + { + return _cyanquantity; + } + + set + { + if (_cyanquantity != value) + { + _cyanquantity = value; + + OnCyanQuantityChanged(value); + + } + } + } + + protected Int32 _magentaquantity; + + /// + /// Gets or sets the jobrunbase magenta quantity. + /// + + [Column("MAGENTA_QUANTITY")] + + public Int32 MagentaQuantity + { + get + { + return _magentaquantity; + } + + set + { + if (_magentaquantity != value) + { + _magentaquantity = value; + + OnMagentaQuantityChanged(value); + + } + } + } + + protected Int32 _yellowquantity; + + /// + /// Gets or sets the jobrunbase yellow quantity. + /// + + [Column("YELLOW_QUANTITY")] + + public Int32 YellowQuantity + { + get + { + return _yellowquantity; + } + + set + { + if (_yellowquantity != value) + { + _yellowquantity = value; + + OnYellowQuantityChanged(value); + + } + } + } + + protected Int32 _blackquantity; + + /// + /// Gets or sets the jobrunbase black quantity. + /// + + [Column("BLACK_QUANTITY")] + + public Int32 BlackQuantity + { + get + { + return _blackquantity; + } + + set + { + if (_blackquantity != value) + { + _blackquantity = value; + + OnBlackQuantityChanged(value); + + } + } + } + + protected Int32 _transparentquantity; + + /// + /// Gets or sets the jobrunbase transparent quantity. + /// + + [Column("TRANSPARENT_QUANTITY")] + + public Int32 TransparentQuantity + { + get + { + return _transparentquantity; + } + + set + { + if (_transparentquantity != value) + { + _transparentquantity = value; + + OnTransparentQuantityChanged(value); + + } + } + } + + protected Int32 _lubricantquantity; + + /// + /// Gets or sets the jobrunbase lubricant quantity. + /// + + [Column("LUBRICANT_QUANTITY")] + + public Int32 LubricantQuantity + { + get + { + return _lubricantquantity; + } + + set + { + if (_lubricantquantity != value) + { + _lubricantquantity = value; + + OnLubricantQuantityChanged(value); + + } + } + } + + protected Int32 _cleanerquantity; + + /// + /// Gets or sets the jobrunbase cleaner quantity. + /// + + [Column("CLEANER_QUANTITY")] + + public Int32 CleanerQuantity + { + get + { + return _cleanerquantity; + } + + set + { + if (_cleanerquantity != value) + { + _cleanerquantity = value; + + OnCleanerQuantityChanged(value); + + } + } + } + protected Double _endposition; /// @@ -748,6 +951,69 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(LiquidQuantityString)); } + /// + /// Called when the CyanQuantity has changed. + /// + protected virtual void OnCyanQuantityChanged(Int32 cyanquantity) + { + CyanQuantityChanged?.Invoke(this, cyanquantity); + RaisePropertyChanged(nameof(CyanQuantity)); + } + + /// + /// Called when the MagentaQuantity has changed. + /// + protected virtual void OnMagentaQuantityChanged(Int32 magentaquantity) + { + MagentaQuantityChanged?.Invoke(this, magentaquantity); + RaisePropertyChanged(nameof(MagentaQuantity)); + } + + /// + /// Called when the YellowQuantity has changed. + /// + protected virtual void OnYellowQuantityChanged(Int32 yellowquantity) + { + YellowQuantityChanged?.Invoke(this, yellowquantity); + RaisePropertyChanged(nameof(YellowQuantity)); + } + + /// + /// Called when the BlackQuantity has changed. + /// + protected virtual void OnBlackQuantityChanged(Int32 blackquantity) + { + BlackQuantityChanged?.Invoke(this, blackquantity); + RaisePropertyChanged(nameof(BlackQuantity)); + } + + /// + /// Called when the TransparentQuantity has changed. + /// + protected virtual void OnTransparentQuantityChanged(Int32 transparentquantity) + { + TransparentQuantityChanged?.Invoke(this, transparentquantity); + RaisePropertyChanged(nameof(TransparentQuantity)); + } + + /// + /// Called when the LubricantQuantity has changed. + /// + protected virtual void OnLubricantQuantityChanged(Int32 lubricantquantity) + { + LubricantQuantityChanged?.Invoke(this, lubricantquantity); + RaisePropertyChanged(nameof(LubricantQuantity)); + } + + /// + /// Called when the CleanerQuantity has changed. + /// + protected virtual void OnCleanerQuantityChanged(Int32 cleanerquantity) + { + CleanerQuantityChanged?.Invoke(this, cleanerquantity); + RaisePropertyChanged(nameof(CleanerQuantity)); + } + /// /// Called when the EndPosition has changed. /// diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs index faad22636..834a27443 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs @@ -35,6 +35,13 @@ namespace Tango.DAL.Remote.DB public bool IS_GRADIENT { get; set; } public int GRADIENT_RESOLUTION_CM { get; set; } public string LIQUID_QUANTITY_STRING { get; set; } + public int CYAN_QUANTITY { get; set; } + public int MAGENTA_QUANTITY { get; set; } + public int YELLOW_QUANTITY { get; set; } + public int BLACK_QUANTITY { get; set; } + public int TRANSPARENT_QUANTITY { get; set; } + public int LUBRICANT_QUANTITY { get; set; } + public int CLEANER_QUANTITY { get; set; } public double END_POSITION { get; set; } public string FAILED_MESSAGE { get; set; } public bool IS_SYNCHRONIZED { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 41f24052a..3cf2baaba 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -619,6 +619,13 @@ + + + + + + + @@ -3911,6 +3918,13 @@ + + + + + + + @@ -6375,6 +6389,13 @@ + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 95c9f4744..a69b91e87 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,85 +5,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs index 0fadd1baa..75d940566 100644 --- a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs +++ b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs @@ -115,6 +115,36 @@ namespace Tango.Integration.JobRuns run.GradientResolutionCm = MachineOperator.GradientGenerationConfiguration.ResolutionCM; run.JobString = _job.ToJobFileWhenLoaded().ToString(); + //Set individual liquid quantities + + //Cyan + var cyan = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Cyan); + run.CyanQuantity = cyan != null ? cyan.Quantity : 0; + + //Magenta + var magenta = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Magenta); + run.MagentaQuantity = magenta != null ? magenta.Quantity : 0; + + //Yellow + var yellow = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Yellow); + run.YellowQuantity = yellow != null ? yellow.Quantity : 0; + + //Black + var black = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Black); + run.BlackQuantity = black != null ? black.Quantity : 0; + + //TI + var ti = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.TransparentInk); + run.TransparentQuantity = ti != null ? ti.Quantity : 0; + + //Lubricant + var lubricant = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Lubricant); + run.LubricantQuantity = lubricant != null ? lubricant.Quantity : 0; + + //Lubricant + var cleaner = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Cleaner); + run.CleanerQuantity = cleaner != null ? cleaner.Quantity : 0; + if (exception != null) { run.FailedMessage = exception.FlattenMessage(); diff --git a/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs index 0f53e1504..b8031fdaf 100644 --- a/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.JobRunsGenerator/Program.cs @@ -19,7 +19,7 @@ namespace Tango.JobRunsGenerator static void Main(string[] args) { DataSource dataSource = new DataSource(); - dataSource.Catalog = "Tango_TEST"; + dataSource.Catalog = "Tango_DEV"; dataSource.Address = "twine.database.windows.net"; dataSource.IntegratedSecurity = false; dataSource.UserName = "Roy"; @@ -78,6 +78,44 @@ namespace Tango.JobRunsGenerator if (run.ActualStartDate == null) run.ActualStartDate = run.StartDate; run.IsGradient = job.Segments.Any(x => x.BrushStops.Count > 1); + //Set new liquid quantities. + if (run.CyanQuantity == 0 && + run.MagentaQuantity == 0 && + run.YellowQuantity == 0 && + run.BlackQuantity == 0 && + run.TransparentQuantity == 0 && + run.LubricantQuantity == 0 && + run.CleanerQuantity == 0) + { + //Cyan + var cyan = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Cyan); + run.CyanQuantity = cyan != null ? cyan.Quantity : 0; + + //Magenta + var magenta = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Magenta); + run.MagentaQuantity = magenta != null ? magenta.Quantity : 0; + + //Yellow + var yellow = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Yellow); + run.YellowQuantity = yellow != null ? yellow.Quantity : 0; + + //Black + var black = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Black); + run.BlackQuantity = black != null ? black.Quantity : 0; + + //TI + var ti = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.TransparentInk); + run.TransparentQuantity = ti != null ? ti.Quantity : 0; + + //Lubricant + var lubricant = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Lubricant); + run.LubricantQuantity = lubricant != null ? lubricant.Quantity : 0; + + //Lubricant + var cleaner = run.LiquidQuantities.FirstOrDefault(x => x.LiquidType == BL.Enumerations.LiquidTypes.Cleaner); + run.CleanerQuantity = cleaner != null ? cleaner.Quantity : 0; + } + saveIndex++; if (saveIndex > 100) -- cgit v1.3.1