feat: Finalizes room-pressure view.

This commit is contained in:
2025-03-01 11:46:47 -05:00
parent 5630820575
commit eaf0387899
8 changed files with 108 additions and 35 deletions

View File

@@ -20,23 +20,6 @@ public extension RoomPressure.Request {
14: OrderedSet([14])
]
// OrderedSet([
// (width: 8, height: 4),
// (width: 10, height: 4),
// (width: 12, height: 4),
// (width: 14, height: 4),
// (width: 8, height: 6),
// (width: 10, height: 6),
// (width: 12, height: 6),
// (width: 14, height: 6),
// (width: 10, height: 8),
// (width: 12, height: 8),
// (width: 14, height: 8),
// (width: 10, height: 10),
// (width: 12, height: 12),
// (width: 14, height: 14)
// ])
func respond(logger: Logger) async throws -> RoomPressure.Response {
switch self {
case let .knownAirflow(request):
@@ -67,6 +50,7 @@ public extension RoomPressure.Request {
let (standardDuctSize, actualVelocity) = calculateDuctMetrics(for: request.supplyAirflow)
return .init(
mode: .knownAirflow,
grilleSize: .init(width: grilleDimensions.width, height: grilleDimensions.height, area: netFreeArea / 144),
ductSize: .init(diameter: standardDuctSize, velocity: actualVelocity),
warnings: generateWarnings(
@@ -101,6 +85,7 @@ public extension RoomPressure.Request {
let (standardDuctSize, actualVelocity) = calculateDuctMetrics(for: calculatedAirflow)
return .init(
mode: .measuredPressure,
grilleSize: .init(width: grilleDimensions.width, height: grilleDimensions.height, area: netFreeArea / 144),
ductSize: .init(diameter: standardDuctSize, velocity: actualVelocity),
calculatedAirflow: calculatedAirflow,