diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 9239cb64..11b92e2c 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Database/Controllers/NcToolManagerController.cs b/Step.Database/Controllers/NcToolManagerController.cs index cccb0f48..d6b49dac 100644 --- a/Step.Database/Controllers/NcToolManagerController.cs +++ b/Step.Database/Controllers/NcToolManagerController.cs @@ -156,13 +156,22 @@ namespace Step.Database.Controllers // Populate nks List dtoShanks = GetShanks(); + List dtoFamilies = GetFamilies(); + // Calculate & set space occupied for each shank foreach(var shank in dtoShanks) { - GetShankMaxSpaceOccupied(shank.Id, out int maxRight, out int maxLeft); + // Get only families id + short[] ids = shank.ChildsTools.Select(x => x.FamilyId).ToArray(); - shank.MaxRight = maxRight; - shank.MaxLeft = maxLeft; + // Get Families data + List families = dtoFamilies + .Where(x => ids.Contains(x.Id)) + .ToList(); + + // Find max between families + shank.MaxRight = families.Max(x => x.RightSize); + shank.MaxLeft = families.Max(x => x.LeftSize); } return dtoShanks; diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index af5bc3d7..0740ff4f 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -788,6 +788,9 @@ namespace Step.NC List plcAlarms = new List(); // Read PLC Active Messages cmsError = numericalControl.PLC_RActiveMessages(ref plcAlarms); + if (cmsError.IsError()) + return cmsError; + bool restorationIsEnabled = false; foreach (PlcAlarmModel plcAlarm in plcAlarms) {