From 157937ececbada7c1083e95d84c5131645c825eb Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Thu, 27 Aug 2026 09:54:08 +0100 Subject: added weather wrap calculations --- ShedCalc/BOMController.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'ShedCalc/BOMController.swift') diff --git a/ShedCalc/BOMController.swift b/ShedCalc/BOMController.swift index be70a65..35713e4 100644 --- a/ShedCalc/BOMController.swift +++ b/ShedCalc/BOMController.swift @@ -126,14 +126,20 @@ class BOMController { } private func calcWeatherWrap(from paramModel: ParamModel) -> MaterialItem { + let wrapRollArea = paramModel.wrapWidth * paramModel.wrapLength + let wrapPricePerMeter = paramModel.wrapPrice / wrapRollArea + let wrapArea = paramModel.totalWallArea() + + let totalPieces = roundUpPieces(Double(wrapArea)/Double(wrapRollArea)) + let totalPrice = Double(totalPieces) * paramModel.wrapPrice return MaterialItem( materialName: "Weather Wrap", - pricePerMeter: Double(0.1), - totalMeters: Double(0.1), - totalPrice: Double(0.1), - metersPerPiece:Double(0.1), - totalPieces: Double(0.1) + pricePerMeter: wrapPricePerMeter, + totalMeters: wrapArea, + totalPrice: totalPrice, + metersPerPiece: paramModel.wrapPrice, + totalPieces: Double(totalPieces) ) } -- cgit v1.2.3