This commit is contained in:
66
Sources/Models/ProposedKWInterpolation.swift
Normal file
66
Sources/Models/ProposedKWInterpolation.swift
Normal file
@@ -0,0 +1,66 @@
|
||||
public enum ProposedKWInterpolation {
|
||||
public struct Request: Codable, Equatable, Sendable {
|
||||
|
||||
public let elevation: Int?
|
||||
|
||||
// These are required if also doing a heat pump heating interpolation.
|
||||
public let winterDesignTemperature: Int?
|
||||
public let climateType: SystemType.ClimateType?
|
||||
public let capacity: Capacity.HeatPumpHeating?
|
||||
|
||||
public let heatLoss: Int
|
||||
public let proposedKW: Int
|
||||
|
||||
public init(
|
||||
elevation: Int? = nil,
|
||||
winterDesignTemperature: Int? = nil,
|
||||
climateType: SystemType.ClimateType? = nil,
|
||||
capacity: Capacity.HeatPumpHeating? = nil,
|
||||
heatLoss: Int,
|
||||
proposedKW: Int
|
||||
) {
|
||||
self.elevation = elevation
|
||||
self.winterDesignTemperature = winterDesignTemperature
|
||||
self.climateType = climateType
|
||||
self.capacity = capacity
|
||||
self.heatLoss = heatLoss
|
||||
self.proposedKW = proposedKW
|
||||
}
|
||||
}
|
||||
|
||||
public struct Response: Codable, Equatable, Sendable {
|
||||
|
||||
public let failed: Bool
|
||||
public let failures: [String]?
|
||||
public let supplementalHeatRequired: Int
|
||||
public let capacityAsPercentOfLoad: Int
|
||||
public let oversizingLimit: Int
|
||||
|
||||
// These are if a heat pump interpolation is also done.
|
||||
public let altitudeAdjustmentMultiplier: Double?
|
||||
public let balancePointTemperature: Int?
|
||||
public let capacityAtDesign: Int?
|
||||
public let finalCapacity: Capacity.HeatPumpHeating?
|
||||
|
||||
public init(
|
||||
failures: [String]? = nil,
|
||||
supplementalHeatRequired: Int,
|
||||
capacityAsPercentOfLoad: Int,
|
||||
oversizingLimit: Int,
|
||||
altitudeAdjustmentMultiplier: Double? = nil,
|
||||
balancePointTemperature: Int? = nil,
|
||||
capacityAtDesign: Int? = nil,
|
||||
finalCapacity: Capacity.HeatPumpHeating? = nil
|
||||
) {
|
||||
self.failed = failures == nil ? false : !failures!.isEmpty
|
||||
self.failures = failures
|
||||
self.supplementalHeatRequired = supplementalHeatRequired
|
||||
self.capacityAsPercentOfLoad = capacityAsPercentOfLoad
|
||||
self.oversizingLimit = oversizingLimit
|
||||
self.altitudeAdjustmentMultiplier = altitudeAdjustmentMultiplier
|
||||
self.balancePointTemperature = balancePointTemperature
|
||||
self.capacityAtDesign = capacityAtDesign
|
||||
self.finalCapacity = finalCapacity
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user