From f093251572ae64ca133a73d3a9ac75c18052d6fe Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 13 Jul 2020 16:37:37 +0300 Subject: Fixed a bug where RML cannot be added when no other RMLs exists because of auto CODE increment. --- .../Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index 36398a593..d4bb07a9b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -468,7 +468,7 @@ namespace Tango.MachineStudio.RML.ViewModels rml.DisplayName = name; rml.QualificationDate = DateTime.UtcNow; rml.Manufacturer = "Twine"; - rml.Code = Rmls.Max(x => x.Code) + 1; + rml.Code = Rmls.Count > 0 ? Rmls.Max(x => x.Code) + 1 : 1; rml.MediaMaterial = Materials.FirstOrDefault(); rml.MediaPurpose = Purposes.FirstOrDefault(); rml.MediaCondition = Conditions.FirstOrDefault(); -- cgit v1.3.1 From 2405a27b29abf5382da56e67cc46cc338d2d0f89 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 20 Jul 2020 15:33:37 +0300 Subject: Refactored total liquid volume exceeds the max calc to nl/cm based. Fixed notes for New Environment. Applied possible fix for PPC power up message stuck. --- .../ViewModels/ColorConversionViewVM.cs | 4 ++-- .../Notes/Tango.Notes/Azure/New Environment.txt | 4 ++-- .../PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | 11 +++++++++-- Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs | 17 +++++++++-------- 4 files changed, 22 insertions(+), 14 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs index f583fa15e..d9ba419e0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -314,11 +314,11 @@ namespace Tango.MachineStudio.RML.ViewModels try { var tables = RML.GetActiveProcessGroup().ProcessParametersTables.OrderBy(x => x.TableIndex).ToList(); - return (tables[1].MaxInkUptake / tables[0].MaxInkUptake) * 100; + return tables.Max(x => x.MaxInkUptake); } catch { - return BrushStop.MAX_TOTAL_LIQUID_VOLUME; + return BrushStop.MAX_INK_UPTAKE; } } diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Azure/New Environment.txt b/Software/Visual_Studio/Notes/Tango.Notes/Azure/New Environment.txt index 710cdcb2d..212da09a2 100644 --- a/Software/Visual_Studio/Notes/Tango.Notes/Azure/New Environment.txt +++ b/Software/Visual_Studio/Notes/Tango.Notes/Azure/New Environment.txt @@ -41,8 +41,8 @@ EXEC sp_addrolemember N'db_datawriter', N'BackupUser' CREATE USER [Tango] FROM EXTERNAL PROVIDER WITH DEFAULT_SCHEMA=[dbo] GO -EXEC sp_addrolemember N'db_datareader', N'BackupUser' -EXEC sp_addrolemember N'db_datawriter', N'BackupUser' +EXEC sp_addrolemember N'db_datareader', N'Tango' +EXEC sp_addrolemember N'db_datawriter', N'Tango' 9. Create a new storage blob container for the machine studio versions. diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs index e84fd81a1..3b45a0c2b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs @@ -35,6 +35,7 @@ namespace Tango.PPC.UI.ViewModels private bool _isPowerUpDialogShown; private bool _isThreadLoadingShown; private PowerUpAppBarItem _powerUpAppBar; + private bool _started; private DateTime _currentDateTime; /// @@ -79,6 +80,7 @@ namespace Tango.PPC.UI.ViewModels private void MachineOperator_PowerUpEnded(object sender, EventArgs e) { + _started = false; _powerUpAppBar?.Close(); _powerUpAppBar = null; } @@ -93,6 +95,8 @@ namespace Tango.PPC.UI.ViewModels private void MachineOperator_PowerUpStarted(object sender, PMR.Power.StartPowerUpResponse e) { + _started = true; + InvokeUI(() => { if (_powerUpAppBar != null) @@ -100,8 +104,11 @@ namespace Tango.PPC.UI.ViewModels _powerUpAppBar.Close(); } - _powerUpAppBar = NotificationProvider.PushAppBarItem(); - _powerUpAppBar.Priority = AppBarPriority.Low; + if (_started) + { + _powerUpAppBar = NotificationProvider.PushAppBarItem(); + _powerUpAppBar.Priority = AppBarPriority.Low; + } }); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs index 6633d9eed..4ad21d4cd 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 _colorPropertyNames; - public const double MAX_TOTAL_LIQUID_VOLUME = 200; + public const double MAX_INK_UPTAKE = 400; #region Enums @@ -104,7 +104,7 @@ namespace Tango.BL.Entities #region Properties /// - /// Gets or sets a value indicating whether the total value of liquid volumes has exceeded the maximum range of . + /// Gets or sets a value indicating whether the total value of liquid volumes has exceeded the maximum range of . /// [NotMapped] [JsonIgnore] @@ -112,7 +112,7 @@ namespace Tango.BL.Entities { get { - return LiquidVolumes != null ? LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > GetTotalMaximumLiquidVolumeLimit() : false; + return LiquidVolumes != null ? LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.NanoliterPerCentimeter) > GetTotalMaximumLiquidNlPerCMLimit() : false; } } @@ -780,23 +780,24 @@ namespace Tango.BL.Entities #region Private Methods - private double GetTotalMaximumLiquidVolumeLimit() + private double GetTotalMaximumLiquidNlPerCMLimit() { try { var tables = Segment.Job.Rml.GetActiveProcessGroup().ProcessParametersTables.OrderBy(x => x.TableIndex).ToList(); - if (tables.Count > 1) + + if (tables.Count > 0) { - return (tables[1].MaxInkUptake / tables[0].MaxInkUptake) * 100; + return tables.Max(x => x.MaxInkUptake); } else { - return MAX_TOTAL_LIQUID_VOLUME; + return MAX_INK_UPTAKE; } } catch { - return MAX_TOTAL_LIQUID_VOLUME; + return MAX_INK_UPTAKE; } } -- cgit v1.3.1