private CostBatch removeSubScope(TECSubScope ss) { CostBatch deltas = new CostBatch(); foreach (IEndDevice endDev in ss.Devices) { if (endDev is TECDevice dev) { deltas += (DeviceSummaryVM.RemoveHardware(dev)); } else if (endDev is TECValve valve) { deltas += (ValveSummaryVM.RemoveValve(valve)); } else { logger.Error("IEndDevice isn't recognized. Not valve or device. " + "MaterialSummaryVM cannot add IEndDevice. IEndDevice: {0}", endDev.Name); } } foreach (ICost cost in ss.AssociatedCosts) { deltas += (MiscSummaryVM.RemoveCost(cost)); } return(deltas); }
private CostBatch removeSystem(TECSystem system) { CostBatch deltas = new CostBatch(); foreach (TECEquipment equip in system.Equipment) { deltas += removeEquipment(equip); } foreach (TECController controller in system.Controllers) { deltas += removeController(controller); } foreach (TECPanel panel in system.Panels) { deltas += removePanel(panel); } foreach (TECMisc misc in system.MiscCosts) { deltas += (MiscSummaryVM.RemoveCost(misc)); } foreach (ICost cost in system.AssociatedCosts) { deltas += (MiscSummaryVM.RemoveCost(cost)); } return(deltas); }
private CostBatch removeEquipment(TECEquipment equip) { CostBatch deltas = new CostBatch(); foreach (TECSubScope ss in equip.SubScope) { deltas += (removeSubScope(ss)); } foreach (ICost cost in equip.AssociatedCosts) { deltas += (MiscSummaryVM.RemoveCost(cost)); } return(deltas); }