51 lines
1.2 KiB
Swift
51 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
public struct RatedEnvelope<Rating>: Equatable {
|
|
public var maximum: Double
|
|
public var minimum: Double
|
|
public var rated: Double
|
|
|
|
public init(
|
|
maximum: Double,
|
|
minimum: Double,
|
|
rated: Double
|
|
) {
|
|
self.maximum = maximum
|
|
self.minimum = minimum
|
|
self.rated = rated
|
|
}
|
|
}
|
|
|
|
// MARK: - Namespaces
|
|
public enum StaticPressure { }
|
|
public enum AirflowPerTon { }
|
|
public enum AirflowLimits { }
|
|
|
|
// MARK: - Static Pressures
|
|
public typealias RatedStaticPressures = RatedEnvelope<StaticPressure>
|
|
extension RatedStaticPressures {
|
|
public init() {
|
|
self.init(maximum: 0.8, minimum: 0.3, rated: 0.5)
|
|
}
|
|
}
|
|
|
|
// MARK: - Airflow Per Ton
|
|
public typealias RatedAirflowPerTon = RatedEnvelope<AirflowPerTon>
|
|
extension RatedAirflowPerTon {
|
|
public init() {
|
|
self.init(maximum: 500, minimum: 350, rated: 400)
|
|
}
|
|
}
|
|
|
|
// MARK: - Airflow Limits
|
|
public typealias RatedAirflowLimits = RatedEnvelope<AirflowLimits>
|
|
extension RatedAirflowLimits {
|
|
public init(tons: CoolingCapacity, using airflowPerTon: RatedAirflowPerTon = .init()) {
|
|
self.init(
|
|
maximum: airflowPerTon.maximum * tons.rawValue,
|
|
minimum: airflowPerTon.minimum * tons.rawValue,
|
|
rated: airflowPerTon.rated * tons.rawValue
|
|
)
|
|
}
|
|
}
|