feat: Adds cooling interpolation tests.
This commit is contained in:
@@ -4,7 +4,7 @@ import Models
|
||||
extension SizingLimits.Request {
|
||||
func respond() async throws -> SizingLimits.Response {
|
||||
return try .init(
|
||||
oversizing: .oversizingLimit(systemType: systemType, houseLoad: houseLoad),
|
||||
oversizing: .oversizingLimit(systemType: systemType, houseLoad: coolingLoad),
|
||||
undersizing: .undersizingLimits
|
||||
)
|
||||
}
|
||||
@@ -20,7 +20,7 @@ private extension SizingLimits.Limits {
|
||||
|
||||
static func oversizingLimit(
|
||||
systemType: SystemType,
|
||||
houseLoad: HouseLoad?
|
||||
houseLoad: Capacity.Cooling?
|
||||
) throws -> Self {
|
||||
switch systemType {
|
||||
case let .heatingOnly(type: type):
|
||||
@@ -51,7 +51,7 @@ private extension SystemType.HeatingOnlyType {
|
||||
}
|
||||
|
||||
private func coolingTotalOversizingLimit(
|
||||
houseLoad: HouseLoad?,
|
||||
houseLoad: Capacity.Cooling?,
|
||||
compressorType: SystemType.CompressorType,
|
||||
climateType: SystemType.ClimateType
|
||||
) throws -> Int {
|
||||
@@ -67,7 +67,7 @@ private func coolingTotalOversizingLimit(
|
||||
guard let houseLoad else {
|
||||
throw HouseLoadError()
|
||||
}
|
||||
let decimal = Double(houseLoad.coolingTotal + 15000) / Double(houseLoad.coolingTotal)
|
||||
let decimal = Double(houseLoad.total + 15000) / Double(houseLoad.total)
|
||||
return Int(round(decimal * 100))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user