summaryrefslogtreecommitdiff
path: root/ShedCalc/ParamView.swift
diff options
context:
space:
mode:
authorArturs Artamonovs <arturs.artamonovs@protonmail.com>2026-08-07 02:01:40 +0100
committerArturs Artamonovs <arturs.artamonovs@protonmail.com>2026-08-07 02:01:40 +0100
commit91d0042017e6c46f2c9f5d42d438836efa6d53e4 (patch)
treeaf8c2dbad8ea148e882136843634ff53c42dd20b /ShedCalc/ParamView.swift
parentdabeb1603cf146aa671dddf949788b514b983b76 (diff)
downloadShedCalc-91d0042017e6c46f2c9f5d42d438836efa6d53e4.tar.gz
ShedCalc-91d0042017e6c46f2c9f5d42d438836efa6d53e4.zip
Added 3 views. Added basic beam drawing and basic calculations for width and length + beam drawing
Diffstat (limited to 'ShedCalc/ParamView.swift')
-rw-r--r--ShedCalc/ParamView.swift41
1 files changed, 41 insertions, 0 deletions
diff --git a/ShedCalc/ParamView.swift b/ShedCalc/ParamView.swift
new file mode 100644
index 0000000..3e27978
--- /dev/null
+++ b/ShedCalc/ParamView.swift
@@ -0,0 +1,41 @@
+//
+// ParamView.swift
+// ShedCalc
+//
+// Created by Jacky Jack on 28/07/2026.
+//
+
+import SwiftUI
+
+
+struct ParamView: View {
+ //@StateObject private var viewModel = ParamModel()
+ @Environment(ParamModel.self) var paramModel
+
+ var body: some View {
+ @Bindable var paramModel = paramModel
+ VStack {
+ HStack {
+ Text("All in meters")
+ }
+ HStack {
+ Text("Width")
+ TextField("Width", value: $paramModel.width, format: .number)
+ }
+ HStack {
+ Text("Height")
+ TextField("Height", value: $paramModel.height, format: .number)
+ }
+ HStack {
+ Text("Length")
+ TextField("Length", value: $paramModel.length, format: .number)
+ }
+ HStack {
+ Text("Total floor area: \(paramModel.floorArea(), specifier: "%.2f") m^2")
+ }
+ HStack {
+ Text("Total roof area: \(paramModel.roofArea(), specifier: "%.2f") m^2")
+ }
+ }
+ }
+}