feat: Adding improvements to pressure estimations feature.
This commit is contained in:
@@ -51,7 +51,7 @@ public struct FlaggedMeasurementsList: Sendable {
|
||||
@CasePathable
|
||||
public enum ReceiveAction: Sendable {
|
||||
case existingFlaggedMeasurement(EquipmentMeasurement.FlaggedMeasurement)
|
||||
case estimatedFlaggedMeasurement(name: String, measurement: EquipmentMeasurement.FlaggedMeasurement)
|
||||
case estimatedFlaggedMeasurement(SharedPressureEstimationState.FlaggedEstimationContainer)
|
||||
}
|
||||
|
||||
@CasePathable
|
||||
@@ -81,14 +81,8 @@ public struct FlaggedMeasurementsList: Sendable {
|
||||
state.sharedSettings.flaggedEquipmentMeasurement = measurement
|
||||
return .none
|
||||
|
||||
case let .estimatedFlaggedMeasurement(name: name, measurement: measurement):
|
||||
state.flaggedEstimations.append(
|
||||
.init(
|
||||
id: uuid(),
|
||||
name: name,
|
||||
flaggedMeasurement: measurement
|
||||
)
|
||||
)
|
||||
case let .estimatedFlaggedMeasurement(container):
|
||||
state.flaggedEstimations[id: container.id] = container
|
||||
return .none
|
||||
}
|
||||
}
|
||||
@@ -203,7 +197,11 @@ public struct FlaggedMeasurementsList: Sendable {
|
||||
tons: form.coolingCapacity
|
||||
)
|
||||
|
||||
return .estimatedFlaggedMeasurement(name: form.name, measurement: flaggedMeasurement)
|
||||
return .estimatedFlaggedMeasurement(.init(
|
||||
id: form.id ?? uuid(),
|
||||
estimationState: .init(state: form),
|
||||
flaggedMeasurement: flaggedMeasurement
|
||||
))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -241,7 +239,7 @@ public struct FlaggedMeasurementListView: View {
|
||||
)
|
||||
} header: {
|
||||
HStack {
|
||||
Text(measurement.name)
|
||||
Text(measurement.displayName)
|
||||
Spacer()
|
||||
Menu {
|
||||
EditButton { send(.editButtonTapped(id: measurement.id)) }
|
||||
@@ -301,7 +299,10 @@ private let flaggedMeasurements = IdentifiedArrayOf<SharedPressureEstimationStat
|
||||
uniqueElements: [
|
||||
.init(
|
||||
id: UUID(0),
|
||||
name: "Existing",
|
||||
estimationState: .init(
|
||||
cfm: .cfmPerTon(400, .three),
|
||||
filterPressureDrop: 0.1
|
||||
),
|
||||
flaggedMeasurement: .init(
|
||||
budgets: budgets,
|
||||
measurement: .mock(type: .airHandler),
|
||||
|
||||
Reference in New Issue
Block a user