feat: Moves info view feature to it's own module.
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import ComposableArchitecture
|
||||
import DependenciesAdditions
|
||||
import EstimatedPressureDependency
|
||||
import InfoViewFeature
|
||||
import SharedModels
|
||||
import Styleguide
|
||||
import SwiftUI
|
||||
import TCAExtras
|
||||
|
||||
@Reducer
|
||||
public struct CalculateAtFeature {
|
||||
|
||||
public struct CalculateAtFeature: Sendable {
|
||||
|
||||
@Reducer(state: .equatable)
|
||||
public enum Destination {
|
||||
case infoView(InfoViewFeature)
|
||||
@@ -16,7 +17,7 @@ public struct CalculateAtFeature {
|
||||
|
||||
@ObservableState
|
||||
@dynamicMemberLookup
|
||||
public struct State: Equatable {
|
||||
public struct State: Equatable, Sendable {
|
||||
@Presents public var destination: Destination.State?
|
||||
public var focus: Focus? = nil
|
||||
public var values: ValueContainer
|
||||
@@ -53,7 +54,7 @@ public struct CalculateAtFeature {
|
||||
case targetValue
|
||||
}
|
||||
|
||||
public struct ValueContainer: Equatable {
|
||||
public struct ValueContainer: Equatable, Sendable {
|
||||
public var existingAirflow: Double?
|
||||
public var existingPressure: Double?
|
||||
public var targetValue: Double?
|
||||
@@ -72,7 +73,7 @@ public struct CalculateAtFeature {
|
||||
}
|
||||
}
|
||||
|
||||
public enum CalculationType: Hashable, CaseIterable, Identifiable {
|
||||
public enum CalculationType: Hashable, CaseIterable, Identifiable, Sendable {
|
||||
case airflowAtNewPressure
|
||||
case pressureAtNewAirflow
|
||||
|
||||
@@ -145,7 +146,7 @@ public struct CalculateAtFeature {
|
||||
case view(View)
|
||||
|
||||
@CasePathable
|
||||
public enum ReceiveAction {
|
||||
public enum ReceiveAction: Sendable {
|
||||
case calculatedValue(Positive<Double>?)
|
||||
}
|
||||
|
||||
@@ -365,19 +366,19 @@ fileprivate extension InfoViewFeature.State {
|
||||
switch calculationType {
|
||||
case .airflowAtNewPressure:
|
||||
self.init(
|
||||
title: """
|
||||
Calculate the airflow at the target pressure from the existing airflow and existing pressure.
|
||||
""",
|
||||
title: "Airflow at Pressure",
|
||||
body: """
|
||||
Calculate the airflow at the target pressure from the existing airflow and existing pressure.
|
||||
|
||||
This can be useful to determine the effect of a different blower speed on a specific measurement location (generally the supply or return plenum).
|
||||
"""
|
||||
)
|
||||
case .pressureAtNewAirflow:
|
||||
self.init(
|
||||
title: """
|
||||
Calculate the pressure at the target airflow from the existing airflow and existing pressure.
|
||||
""",
|
||||
title: "Pressure at Airflow",
|
||||
body: """
|
||||
Calculate the pressure at the target airflow from the existing airflow and existing pressure.
|
||||
|
||||
This can be useful to determine the effect of a different blower speed on a specific measurement location (generally the supply or return plenum).
|
||||
"""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user