feat: Begins hvac system performance

This commit is contained in:
2025-02-27 22:41:37 -05:00
parent dc01477c3e
commit 7cd02971a3
15 changed files with 341 additions and 16 deletions

View 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 {}