diff options
| author | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2026-08-27 09:54:08 +0100 |
|---|---|---|
| committer | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2026-08-27 09:54:08 +0100 |
| commit | 157937ececbada7c1083e95d84c5131645c825eb (patch) | |
| tree | f5f9762c7d95364a3a7262b4c3723cb92a9e893a /ShedCalc/BOMController.swift | |
| parent | e8b5398d8f9a2d4fa9ed339fec774badc270979f (diff) | |
| download | ShedCalc-157937ececbada7c1083e95d84c5131645c825eb.tar.gz ShedCalc-157937ececbada7c1083e95d84c5131645c825eb.zip | |
added weather wrap calculationsmain
Diffstat (limited to 'ShedCalc/BOMController.swift')
| -rw-r--r-- | ShedCalc/BOMController.swift | 16 |
1 files changed, 11 insertions, 5 deletions
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) ) } |
