# BMS Point Schedule & I/O Planner — prototype

Implemented by user request on 2026-09-22. **Prototype · Work in progress** is
shown on the page and on its Home / All tools cards. This is a generic point
schedule, not a manufacturer controller selector or an approved wiring schedule.

## Workflow and scope

Open `io-planner.html` directly. Add Custom/AHU/VAV/FCU/Pump/Boiler example points,
edit equipment, name, connection, type, signal, controller, terminal and notes.
Each row represents one point; valve command and feedback are separate rows.
Templates are deliberately editable and do not prescribe an equipment sequence.
Duplicate one equipment to a numbered prefix (1–100 copies). Copies keep signal
requirements but clear controller and terminal assignments to avoid copied wiring.
Existing equipment names are rejected case-insensitively for batch duplication.

Register controller names and optionally their capacity pools. Filter by equipment
or controller, select rows (100 per page) and assign them together. Changing the
assigned controller clears the terminal; renaming a registered controller updates
its linked points. Removing a controller retains and flags its point assignments.
Deleting selected points or replacing a project requires a UI confirmation.

Project totals always include all rows; filters control the editable table and CSV
export. Export can sort by equipment or controller. The project remains in memory
only; reload/closing can lose changes. Download JSON to retain the entire project.
A browser before-unload warning is provided for changed data but is not persistence.

## Counting and optional capacity review

- `Hardwired`: AI/AO/BI/BO count toward physical requirements. Signal text groups
  points by exact entered label and type; the UI allows vendor-specific signals.
- `BACnet`: type means analog/binary input/output value category. These rows are
  counted separately and do not consume physical I/O or capacity allowance.
- Blank type is flagged; it is not silently inferred or counted as a channel type.
- Extra channel allowance is `ceil(demand × (1 + percentage/100))`, per controller
  and type. It means additional channels relative to used count, not a percentage
  of the total installed controller capacity.
- Dedicated AI/BI/AO/BO pools and one independent shared AI/BI UI pool are supported.
  Do not include shared channels in dedicated counts. Shared UI is counted once.
- Input shortfall = `max(0, max(0, AI − dedicatedAI) + max(0, BI − dedicatedBI) − UI)`.
  AI, BI and UI capacities must all be known to evaluate the input pool. Blank
  means unknown; explicit zero means no channels. AO and BO are checked separately.
- An optional semicolon-separated controller signal list flags missing membership
  using trimmed, case-insensitive text comparison. Labels otherwise must match,
  including punctuation. Membership is not terminal/electrical compatibility.
- UI output sharing (UIO), terminal inventory, signal-specific per-terminal
  allocation, expansion bus/power restrictions, current ratings and sensor curves
  are not verified. A remaining-count result is not equipment approval.

Schedule checks flag missing equipment/name/type/signal, unassigned/unregistered
controllers, missing physical terminal labels, duplicated equipment+point names,
duplicated controller+terminal labels and physical terminal labels on BACnet rows.
Terminal labels are free text and unique per controller, case-insensitively.
Capacity findings are separate from the schedule issue count. Incomplete rows are
retained for editing and explicitly reported, not silently removed from the project.

## Import/export contract

CSV and Excel tab-separated paste use eight headers in any order:
`equipment, point, connection, type, signal, controller, terminal, notes`.
Headers are case-insensitive. Connection values are `Hardwired` or `BACnet`;
type values are AI/AO/BI/BO or blank. One row is one point; there is no quantity column.
Quoted separators, embedded newlines, escaped quotes, CRLF and UTF-8 BOM are handled.
Imports append atomically only after all rows validate. They do not create controllers.
Download an empty CSV as a column template, or export some example points first.

CSV contains only point rows. JSON format version 1 stores project name, extra
allowance, controller inventory and all point rows. Invalid/version-mismatched
project files preserve the current project. JSON loading replaces only after user
confirmation when current content exists. Files are read locally, never uploaded.

Formula-leading CSV cells are prefixed with an apostrophe for spreadsheet safety.
The matching import removes one protective apostrophe before formula-leading text;
literal apostrophes before such text are escaped on export to preserve round trips.
Text is trimmed and rendered with DOM text/value APIs, never injected as HTML.
Prototype limits: 5,000 points, 200 controllers, 160 characters per cell, 3 MB per
file (exports above the reimport limit are rejected too). Save smaller projects if
long text reaches the file limit before the point count. Failed edits/imports do
not mutate accepted data; visible invalid drafts must be corrected before export.

## Architecture and verification

`js/planner/model.js`: pure validation, templates, duplication, counting, shared
pool checks and serialization. `js/planner/ui.js`: editable tables, drafts, filters,
selection, local file controls and DOM rendering. `css/planner.css`: responsive
panels and scrollable schedule tables. Classic scripts, no fetch, server or packages.
Existing simulator/calculator engineering logic is unchanged.

Verification: 29 planner model/serialization/actual-page DOM checks passed,
including file-handler tests with test doubles. Site wiring and 91 FCU regressions
also passed. Run `node tests/planner-tests.cjs` and `node tests/run-node.cjs`.
Actual browser layout, native
file pickers/downloads, Excel application behavior, confirmation dialogs and mobile
interaction remain pending. DOM checks are not browser verification; prior local
file-URL access restrictions have not been shown to be resolved.

## Deferred

Manufacturer catalogs, automatic SKU/module selection, full signal-specific
terminal allocation, UIO output sharing, drag/drop wiring, spreadsheet XLSX support,
cloud accounts/saving and approved design-document generation. Scaling Troubleshooter
remains deferred; it is not part of this implementation.
