Calculator: size cables for ampacity and drop budget
recommendedCrossSection now satisfies two criteria and takes whichever demands more copper: the voltage-drop budget, and an ampacity at least as high as the fuse protecting the circuit (ABYC E-11: the OCP rating must not exceed the conductor's ampacity). Ampacity comes from ABYC E-11 Table 6A for AWG and ISO 13297 Table A1 for mm², both 105 °C. Before this, a 40 A load over 0.5 m was sized 1.5 mm² / AWG 16 next to a 50 A fuse: a cable the fuse can never protect. Long runs stay voltage-drop driven and unchanged. The drop budget is now stored per system (3 / 5 / 10 %) and editable in the system editor, with a global default in Settings that the standalone calculator uses and new systems inherit. Cross-sections are derived, never entered by the user, so LoadCableSync re-derives them when a system opens and when its budget changes. Library loads are computed instead of being stored as a 1.0 mm² placeholder. LoadConfigurationStatus therefore reports only what the user can actually fix: missing length or current. Also removes the dead cable.pro.* strings and folds three copies of the mm²-to-AWG conversion into ElectricalCalculations.nearestAWG.
This commit is contained in:
@@ -4,6 +4,7 @@ import SwiftData
|
||||
struct SystemOverviewView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
|
||||
@State private var activeStatus: LoadConfigurationStatus?
|
||||
@State private var suppressLoadNavigation = false
|
||||
@State private var showingRuntimeGoalEditor = false
|
||||
@@ -390,7 +391,6 @@ struct SystemOverviewView: View {
|
||||
.fill(Color(.tertiarySystemBackground))
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.alert(item: $activeStatus) { status in
|
||||
let detail = status.detailInfo()
|
||||
return Alert(
|
||||
@@ -588,14 +588,7 @@ struct SystemOverviewView: View {
|
||||
}
|
||||
|
||||
private var loadStatus: LoadConfigurationStatus? {
|
||||
guard !loads.isEmpty else { return nil }
|
||||
let incomplete = loads.filter { load in
|
||||
load.length <= 0 || load.crossSection <= 0
|
||||
}
|
||||
if !incomplete.isEmpty {
|
||||
return .missingDetails(count: incomplete.count)
|
||||
}
|
||||
return nil
|
||||
LoadConfigurationStatus.evaluate(loads: loads)
|
||||
}
|
||||
|
||||
private var totalCurrent: Double {
|
||||
|
||||
Reference in New Issue
Block a user