feat: Begins manual d core models.
This commit is contained in:
@@ -1,26 +1,23 @@
|
|||||||
// swift-tools-version: 6.2
|
// swift-tools-version: 6.2
|
||||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
||||||
|
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "swift-manual-d",
|
name: "swift-manual-d",
|
||||||
products: [
|
products: [
|
||||||
// Products define the executables and libraries a package produces, making them visible to other packages.
|
.library(name: "swift-manual-d", targets: ["swift-manual-d"]),
|
||||||
.library(
|
.library(name: "ManualDCore", targets: ["ManualDCore"]),
|
||||||
name: "swift-manual-d",
|
],
|
||||||
targets: ["swift-manual-d"]
|
targets: [
|
||||||
),
|
.target(
|
||||||
],
|
name: "swift-manual-d"
|
||||||
targets: [
|
),
|
||||||
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
.target(
|
||||||
// Targets can depend on other targets in this package and products from dependencies.
|
name: "ManualDCore"
|
||||||
.target(
|
),
|
||||||
name: "swift-manual-d"
|
.testTarget(
|
||||||
),
|
name: "swift-manual-dTests",
|
||||||
.testTarget(
|
dependencies: ["swift-manual-d"]
|
||||||
name: "swift-manual-dTests",
|
),
|
||||||
dependencies: ["swift-manual-d"]
|
]
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
|
|||||||
7
Sources/ManualDCore/ComponentPressureLosses.swift
Normal file
7
Sources/ManualDCore/ComponentPressureLosses.swift
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
public typealias ComponentPressureLosses = [String: Double]
|
||||||
|
|
||||||
|
extension ComponentPressureLosses {
|
||||||
|
public var totalLosses: Double { values.reduce(0) { $0 + $1 } }
|
||||||
|
}
|
||||||
13
Sources/ManualDCore/CoolingLoad.swift
Normal file
13
Sources/ManualDCore/CoolingLoad.swift
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
public struct CoolingLoad: Codable, Equatable {
|
||||||
|
public let total: Double
|
||||||
|
public let sensible: Double
|
||||||
|
public var latent: Double { total - sensible }
|
||||||
|
public var shr: Double { sensible / total }
|
||||||
|
|
||||||
|
public init(total: Double, sensible: Double) {
|
||||||
|
self.total = total
|
||||||
|
self.sensible = sensible
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Sources/ManualDCore/EquipmentInfo.swift
Normal file
17
Sources/ManualDCore/EquipmentInfo.swift
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
public struct EquipmentInfo: Codable, Equatable {
|
||||||
|
public let staticPressure: Double
|
||||||
|
public let heatingCFM: Int
|
||||||
|
public let coolingCFM: Int
|
||||||
|
|
||||||
|
public init(
|
||||||
|
staticPressure: Double = 0.5,
|
||||||
|
heatingCFM: Int,
|
||||||
|
coolingCFM: Int
|
||||||
|
) {
|
||||||
|
self.staticPressure = staticPressure
|
||||||
|
self.heatingCFM = heatingCFM
|
||||||
|
self.coolingCFM = coolingCFM
|
||||||
|
}
|
||||||
|
}
|
||||||
20
Sources/ManualDCore/Room.swift
Normal file
20
Sources/ManualDCore/Room.swift
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
public struct Room: Codable, Equatable {
|
||||||
|
public let name: String
|
||||||
|
public let heatingLoad: Double
|
||||||
|
public let coolingLoad: CoolingLoad
|
||||||
|
public let registerCount: Int
|
||||||
|
|
||||||
|
public init(
|
||||||
|
name: String,
|
||||||
|
heatingLoad: Double,
|
||||||
|
coolingLoad: CoolingLoad,
|
||||||
|
registerCount: Int = 1
|
||||||
|
) {
|
||||||
|
self.name = name
|
||||||
|
self.heatingLoad = heatingLoad
|
||||||
|
self.coolingLoad = coolingLoad
|
||||||
|
self.registerCount = registerCount
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user