Fixes
This commit is contained in:
@@ -156,13 +156,22 @@ namespace Step.Database.Controllers
|
||||
// Populate nks
|
||||
List<DTONcShankModel> dtoShanks = GetShanks();
|
||||
|
||||
List<DTONcFamilyModel> 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<DTONcFamilyModel> 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;
|
||||
|
||||
Reference in New Issue
Block a user