Compare commits
2 Commits
eb6c844be7
...
25736638eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
25736638eb
|
|||
|
5d6e50a983
|
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.DS_Store
|
||||||
|
/.build
|
||||||
|
/Packages
|
||||||
|
xcuserdata/
|
||||||
|
DerivedData/
|
||||||
|
.swiftpm/configuration/registries.json
|
||||||
|
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
||||||
|
.netrc
|
||||||
23
Package.swift
Normal file
23
Package.swift
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// swift-tools-version: 6.2
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "swift-manual-d",
|
||||||
|
products: [
|
||||||
|
.library(name: "swift-manual-d", targets: ["swift-manual-d"]),
|
||||||
|
.library(name: "ManualDCore", targets: ["ManualDCore"]),
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
.target(
|
||||||
|
name: "swift-manual-d"
|
||||||
|
),
|
||||||
|
.target(
|
||||||
|
name: "ManualDCore"
|
||||||
|
),
|
||||||
|
.testTarget(
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Sources/swift-manual-d/swift_manual_d.swift
Normal file
2
Sources/swift-manual-d/swift_manual_d.swift
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// The Swift Programming Language
|
||||||
|
// https://docs.swift.org/swift-book
|
||||||
6
Tests/swift-manual-dTests/swift_manual_dTests.swift
Normal file
6
Tests/swift-manual-dTests/swift_manual_dTests.swift
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import Testing
|
||||||
|
@testable import swift_manual_d
|
||||||
|
|
||||||
|
@Test func example() async throws {
|
||||||
|
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user