Stefan Lange-Hegermann 38183f5282 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.
2026-08-18 10:59:16 +02:00
2025-10-13 09:38:22 +02:00
2026-08-12 11:49:04 +02:00
2025-11-07 11:18:03 +01:00
2025-09-11 10:34:08 +02:00
2025-10-20 15:37:06 +02:00
2025-10-13 09:38:22 +02:00
2025-09-16 22:00:04 +02:00
2025-10-07 22:38:11 +02:00
2025-09-24 19:43:26 +02:00
2025-11-07 11:18:03 +01:00
2025-10-07 22:45:02 +02:00

Cable

Cable is a SwiftUI app for laying out low voltage electrical systems. It helps you size conductors, manage saved loads, and browse the VoltPlan component library so you can assemble accurate bills of materials for off-grid or mobile installs.

Requirements

  • macOS with Xcode 15 or newer
  • iOS 17 simulator (iPhone 15 target used in CI)
  • SwiftData and SwiftUI are bundled with the Xcode toolchain; no additional dependencies are required

Getting Started

  • open Cable.xcodeproj launches the project with the correct scheme configuration
  • Alternatively run xed Cable.xcodeproj from Terminal to open the project in Xcode
  • Select the Cable scheme and the iPhone 15 simulator, then press Run

Build & Test from the Command Line

  • Build: xcodebuild -scheme Cable -destination 'platform=iOS Simulator,name=iPhone 15' build
  • Test (unit + UI bundles): xcodebuild -scheme Cable -destination 'platform=iOS Simulator,name=iPhone 15' test
  • Clean derived data if Xcode caches cause issues: xcodebuild -scheme Cable clean

Project Layout

  • Cable/ – SwiftUI source, models, and assets (CableApp.swift, CalculatorView, SystemEditorView, ComponentLibraryView, etc.)
  • CableTests/ – Focused XCTest coverage for calculator logic, unit conversions, and persistence helpers
  • CableUITests/ – UI automation flows that exercise onboarding, load editing, and the component browser
  • fastlane/ – Automation scripts for screenshots and releases
  • Cable.xcodeproj – Project configuration targeting iOS 17

Core Features

  • Interactive cable sizing calculator with support for metric and imperial unit systems
  • SwiftData-backed storage for electrical systems and saved loads
  • Remote VoltPlan component library with searchable affiliate links
  • Onboarding flows that guide new users through system setup and load entry

Development Tips

  • Stick to idiomatic Swift style: four-space indentation, trailing commas on multiline collections, and UpperCamelCase/lowerCamelCase naming
  • Keep SwiftUI view files focused on a single primary view; extract helpers when logic grows
  • Run the test targets before opening a pull request to maintain coverage
  • Commit messages should be short, imperative phrases (e.g., Update library paging)
Description
No description provided
Readme 75 MiB
Languages
Swift 59.6%
Kotlin 31.4%
PureBasic 3.8%
Shell 2.7%
HTML 1.1%
Other 1.4%