67 lines
1.8 KiB
Swift
67 lines
1.8 KiB
Swift
public enum HeatingBalancePoint {
|
|
|
|
public static let description: String = """
|
|
Calculate the heating balance point.
|
|
"""
|
|
|
|
public enum Mode: String, CaseIterable, Codable, Equatable, Sendable {
|
|
case economic
|
|
case thermal
|
|
}
|
|
|
|
public enum Request: Codable, Equatable, Sendable {
|
|
case thermal(Thermal)
|
|
|
|
public struct Thermal: Codable, Equatable, Sendable {
|
|
|
|
public let systemSize: Double
|
|
public let capacityAt47: Double?
|
|
public let capacityAt17: Double?
|
|
public let heatingDesignTemperature: Double
|
|
public let buildingHeatLoss: HeatingBalancePoint.HeatLoss
|
|
|
|
public init(
|
|
systemSize: Double,
|
|
capacityAt47: Double? = nil,
|
|
capacityAt17: Double? = nil,
|
|
heatingDesignTemperature: Double,
|
|
buildingHeatLoss: HeatingBalancePoint.HeatLoss
|
|
) {
|
|
self.systemSize = systemSize
|
|
self.capacityAt47 = capacityAt47
|
|
self.capacityAt17 = capacityAt17
|
|
self.heatingDesignTemperature = heatingDesignTemperature
|
|
self.buildingHeatLoss = buildingHeatLoss
|
|
}
|
|
}
|
|
}
|
|
|
|
public enum Response: Codable, Equatable, Sendable {
|
|
case thermal(Thermal)
|
|
|
|
public struct Thermal: Codable, Equatable, Sendable {
|
|
|
|
public let capacityAt47: Double
|
|
public let capacityAt17: Double
|
|
public let balancePointTemperature: Double
|
|
|
|
public init(capacityAt47: Double, capacityAt17: Double, balancePointTemperature: Double) {
|
|
self.capacityAt47 = capacityAt47
|
|
self.capacityAt17 = capacityAt17
|
|
self.balancePointTemperature = balancePointTemperature
|
|
}
|
|
}
|
|
}
|
|
|
|
public enum HeatLoss: Codable, Equatable, Sendable {
|
|
|
|
public enum Mode: String, CaseIterable, Codable, Equatable, Sendable {
|
|
case estimated
|
|
case known
|
|
}
|
|
|
|
case known(btu: Double)
|
|
case estimated(squareFeet: Double)
|
|
}
|
|
}
|