summaryrefslogtreecommitdiff
path: root/ShedCalc/ParamModel.swift
diff options
context:
space:
mode:
authorArturs Artamonovs <arturs.artamonovs@protonmail.com>2026-08-26 21:37:56 +0100
committerArturs Artamonovs <arturs.artamonovs@protonmail.com>2026-08-26 21:37:56 +0100
commite8b5398d8f9a2d4fa9ed339fec774badc270979f (patch)
tree2e4607262e7887cdb37003568d846503b35f9cc8 /ShedCalc/ParamModel.swift
parent91d0042017e6c46f2c9f5d42d438836efa6d53e4 (diff)
downloadShedCalc-e8b5398d8f9a2d4fa9ed339fec774badc270979f.tar.gz
ShedCalc-e8b5398d8f9a2d4fa9ed339fec774badc270979f.zip
All views seem to work ok
Diffstat (limited to 'ShedCalc/ParamModel.swift')
-rw-r--r--ShedCalc/ParamModel.swift40
1 files changed, 33 insertions, 7 deletions
diff --git a/ShedCalc/ParamModel.swift b/ShedCalc/ParamModel.swift
index 4935bcd..f3cbbd7 100644
--- a/ShedCalc/ParamModel.swift
+++ b/ShedCalc/ParamModel.swift
@@ -10,20 +10,30 @@ import Observation
@Observable
class ParamModel {
- var width: Float = 1.0
- var height: Float = 1.0
- var length: Float = 1.0
- var beamSpace: Float = 0.6
+ var width: Double = 3.0
+ var height: Double = 1.0
+ var length: Double = 1.0
+ var beamSpace: Double = 0.6
+ var OSBSheetPrice: Double = 0.0
+ var timberBeamPrice: Double = 0.0
+ var timberLengthSize: Double = 2.4
+ var feltPrice: Double = 0.0
+ var feltWidth: Double = 1.0
+ var feltLength: Double = 10
+ var claddingPrice: Double = 0.1
+ var claddingLength: Double = 0.1
+ var claddingWidth: Double = 0.1
+ var claddingOverlap: Double = 0.1
- func floorArea() -> Float {
+ func floorArea() -> Double {
return width*length
}
- func roofArea() -> Float {
+ func roofArea() -> Double {
return width*length
}
- func dimensions() -> SIMD3<Float> {
+ func dimensions() -> SIMD3<Double> {
return [width,length,height]
}
@@ -34,4 +44,20 @@ class ParamModel {
func lengthBeamNum() -> Int {
return Int(length/beamSpace) + 1
}
+
+ func setBeamSpace(_ bs: Double) {
+ self.beamSpace = bs
+ }
+
+ func totalWallBeams() -> Int {
+ return 2 * (widthBeamNum() + lengthBeamNum())
+ }
+
+ func totalWallBeamLength() -> Double {
+ return Double(totalWallBeams()) * self.height
+ }
+
+ func totalJoistBeamLength() -> Double {
+ return Double(widthBeamNum())*beamSpace
+ }
}