61 lines
1.6 KiB
Swift
61 lines
1.6 KiB
Swift
import Foundation
|
|
|
|
public enum DehumidifierSize {
|
|
|
|
public static let description = """
|
|
Calculate dehumidifier size based on latent load and performance data.
|
|
"""
|
|
|
|
/// Represents the request for determining dehumidifier size based on
|
|
/// latent load and indoor conditions.
|
|
public struct Request: Codable, Equatable, Sendable, Hashable {
|
|
|
|
public let latentLoad: Double
|
|
public let temperature: Double
|
|
public let humidity: Double
|
|
|
|
public init(latentLoad: Double, temperature: Double, humidity: Double) {
|
|
self.latentLoad = latentLoad
|
|
self.temperature = temperature
|
|
self.humidity = humidity
|
|
}
|
|
}
|
|
|
|
/// Represents the response for determining dehumidifier size based on
|
|
/// latent load and indoor conditions.
|
|
public struct Response: Codable, Equatable, Sendable {
|
|
|
|
public let requiredCapacity: Double
|
|
public let pintsPerDay: Double
|
|
public let recommendedSize: Int
|
|
public let recommendedUrl: String?
|
|
public let warnings: [String]
|
|
|
|
public init(
|
|
requiredCapacity: Double,
|
|
pintsPerDay: Double,
|
|
recommendedSize: Int,
|
|
recommendedUrl: String? = nil,
|
|
warnings: [String] = []
|
|
) {
|
|
self.requiredCapacity = requiredCapacity
|
|
self.pintsPerDay = pintsPerDay
|
|
self.recommendedSize = recommendedSize
|
|
self.recommendedUrl = recommendedUrl
|
|
self.warnings = warnings
|
|
}
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
|
|
public extension DehumidifierSize.Response {
|
|
|
|
static var mock: Self {
|
|
.init(requiredCapacity: 100, pintsPerDay: 100, recommendedSize: 100, recommendedUrl: "#", warnings: [
|
|
"A warning.", "B warning"
|
|
])
|
|
}
|
|
}
|
|
#endif
|