feat: Begins hvac system performance
This commit is contained in:
62
Sources/ViewController/Views/HVACSystemPerformance.swift
Normal file
62
Sources/ViewController/Views/HVACSystemPerformance.swift
Normal file
@@ -0,0 +1,62 @@
|
||||
import Elementary
|
||||
import ElementaryHTMX
|
||||
import Routes
|
||||
import Styleguide
|
||||
|
||||
struct HVACSystemPerformanceForm: HTML, Sendable {
|
||||
|
||||
var content: some HTML {
|
||||
FormHeader(label: "HVAC System Performance", svg: .thermometerSun)
|
||||
form(
|
||||
// Using index to get the correct path, but really uses the `submit` end-point.
|
||||
.hx.post(route: .hvacSystemPerformance(.index)),
|
||||
.hx.target("#result")
|
||||
) {
|
||||
div(.class("space-y-6")) {
|
||||
div(.class("grid grid-cols-1 md:grid-cols-3 gap-4")) {
|
||||
LabeledContent(label: "System Size (Tons)") {
|
||||
Input(id: "systemSize", placeholder: "System size")
|
||||
.attributes(.type(.number), .min("1"), .step("0.5"), .autofocus, .required)
|
||||
}
|
||||
LabeledContent(label: "Airflow (CFM)") {
|
||||
Input(id: "airflow", placeholder: "Airflow")
|
||||
.attributes(.type(.number), .min("1"), .step("0.5"), .required)
|
||||
}
|
||||
LabeledContent(label: "Altitude (ft.)") {
|
||||
Input(id: "altitude", placeholder: "Altitude (Optional)")
|
||||
.attributes(.type(.number), .min("1"), .step("0.5"))
|
||||
}
|
||||
}
|
||||
|
||||
div(.class("grid grid-cols-1 md:grid-cols-2 gap-4")) {
|
||||
div(.class("space-y-4")) {
|
||||
h3(.class("text-lg font-medium")) { "Return Air" }
|
||||
LabeledContent(label: "Dry Bulb (°F)") {
|
||||
Input(id: "returnAirTemperature", placeholder: "Return temperature")
|
||||
}
|
||||
LabeledContent(label: "Indoor Humdity (%)") {
|
||||
Input(id: "returnAirHumidity", placeholder: "Return humidity")
|
||||
.attributes(.type(.number), .step("0.1"), .min("0.1"), .required)
|
||||
}
|
||||
}
|
||||
div(.class("space-y-4")) {
|
||||
h3(.class("text-lg font-medium")) { "Supply Air" }
|
||||
LabeledContent(label: "Dry Bulb (°F)") {
|
||||
Input(id: "supplyAirTemperature", placeholder: "Supply temperature")
|
||||
}
|
||||
LabeledContent(label: "Indoor Humdity (%)") {
|
||||
Input(id: "supplyAirHumidity", placeholder: "Supply humidity")
|
||||
.attributes(.type(.number), .step("0.1"), .min("0.1"), .required)
|
||||
}
|
||||
}
|
||||
}
|
||||
div {
|
||||
SubmitButton(label: "Calculate Performance")
|
||||
}
|
||||
}
|
||||
}
|
||||
div(.id("result")) {}
|
||||
}
|
||||
}
|
||||
|
||||
struct HVACSystemPerformanceResult: HTML, Sendable {}
|
||||
Reference in New Issue
Block a user