summaryrefslogtreecommitdiff
path: root/ShedCalc/ParamModel.swift
diff options
context:
space:
mode:
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
+ }
}