oltc-selector 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +91 -0
  2. package/bin/oltc.js +2095 -0
  3. package/package.json +27 -0
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # OLTC Selector / 有载开关选型
2
+
3
+ 填工况,给出 2025 目录里**最低满足**的型号。网页和 `oltc` CLI 共用同一份 `selectOltc` 引擎。
4
+
5
+ **CLI(无报价):** `npm i -g oltc-selector`,命令是 `oltc`。
6
+ **网页:** [oltc-selector.vercel.app](https://oltc-selector.vercel.app/) · [GitHub Pages](https://erict16.github.io/oltc-selector/)
7
+
8
+ 私人辅助,不是厂家官网。型号是起点,出 OS 前要工程确认。
9
+
10
+ ![工作台](docs/assets/readme.png)
11
+
12
+ ## CLI
13
+
14
+ 不需要 clone 本仓库。不输出人民币、系数、报价。
15
+
16
+ ```bash
17
+ npm i -g oltc-selector
18
+
19
+ oltc --iu 350 --um 40.5 --conn D --reg W --pm 8
20
+ # CV2III-350D/40.5-10193W
21
+
22
+ oltc --octc --iu 800 --um 72.5 --conn D --series II --contact 6x5
23
+ oltc --iu 600 --um 72.5 --conn Y --reg W --pm 8 --structure combined
24
+ oltc --mva 25 --kv 110 --conn Y --reg W --pm 8
25
+ ```
26
+
27
+ | Flag | Meaning | Default |
28
+ |------|---------|---------|
29
+ | `--iu` / `--imax` | Max through-current Imax (A). **No** safety factor. | required unless `--mva` |
30
+ | `--mva` `--kv` | Transformer MVA + tap-side kV → Imax (min tap + `--k`) | |
31
+ | `--k` | Safety factor, **capacity path only** | 1.2 |
32
+ | `--um` | Equipment Um (kV) | derived from `--kv` on MVA path |
33
+ | `--ust` | Step voltage (V) | 0, or derived on MVA path |
34
+ | `--conn Y\|D` | Switch star / delta (not Dyn11) | Y |
35
+ | `--reg W\|G\|0` | Reversing / coarse-fine / linear | W |
36
+ | `--pm` | ± steps | 8 |
37
+ | `--octc` | Off-circuit 无载 (WSL/WSG) | on-load |
38
+ | `--structure` | `auto` / `combined` 组合式 / `compound` 复合式 / `cage` 笼式 / `drum` 鼓式 | `auto` |
39
+ | `--series` | OCTC wiring II IV V VI VII VIII | auto (Y→IV, D→II) |
40
+ | `--mount` | `in-tank` / `on-tank` / `dry` | in-tank |
41
+ | `--oil` / `--vacuum` | Switching medium | vacuum (on-load) |
42
+ | `--contact` | OCTC contact e.g. `6x5` | |
43
+ | `--json` | Machine output, still no prices | |
44
+
45
+ `--structure auto` and omitting `--octc` match the web first paint: on-load, in-tank vacuum, minimum-adequate ranking.
46
+
47
+ ## Selection rules
48
+
49
+ 1. **Minimum-adequate, not SHZV-by-default.** Rank **CV2 → CM2 → SHZV → SHZVG**. Prefer one three-phase unit over `3×` singles when a brochure III type exists.
50
+ 2. **OLTC existence comes from brochure / catalogue axes** (`lib/catalog.ts`), **not price-list Y/D twins**. A 2025 list row that prices `CM2III-…D` the same as Y does **not** make `CM2III-…D` a type.
51
+ 3. **No CV2-500.** CV2 III currents are 350 and 600 only.
52
+ 4. **No combined III-D.** CM / CM2 / CMD / SHZV / SHZVG three-phase strings are star-point Y. Cover delta with `3x…I-` when that I type exists. Compound **CV / CV2 / SV** and on-tank **HWV** III-D **do** exist.
53
+ 5. **Compound has no selector grade letter.** No `CV2III-350Y/40.5B-…`. Combined in-tank may have B/C/D/DE after Um.
54
+ 6. **WSL / WDL existence is 2025-list row keys without prices** (`lib/listIndex.data.json`). Missing rows (no `WSLIV-2000D/126`, no `7x6E` @ 72.5) are not emitted.
55
+ 7. **WSG** is catalogue axes only (no 2025 list sheet in the index).
56
+ 8. **Typing Imax (`--iu`) does not apply a safety factor.** `--k` only applies on the transformer-capacity (`--mva`) path.
57
+
58
+ ## Web app
59
+
60
+ 预选 66 / 110 / 220 kV 带常用工况。默认真变压器容量,星/角推出 Imax(最低分接和安全系数)。调压侧电压推出 Um。点「选型」之后才出型号。
61
+
62
+ ```bash
63
+ npm install
64
+ npm run dev # http://127.0.0.1:3000
65
+ npm test
66
+ npm run pack:cli
67
+ ```
68
+
69
+ GitHub Pages:`npm run build:gh`(`GH_PAGES=true`)。Vercel 根路径,不要设 `GH_PAGES`。
70
+
71
+ 内部看价仍在网页右上角「内部」(口令)。**CLI 包不含价表。** 本地 `.env.local`:
72
+
73
+ ```
74
+ NEXT_PUBLIC_ADMIN_PASSWORD_SHA256=<sha256 hex of the password>
75
+ ```
76
+
77
+ 语言:中文、English、Tiếng Việt、Español、Türkçe、Русский。
78
+
79
+ ## OS regression
80
+
81
+ `docs/replay/2025-os-sales.xlsx` and `2026-os-sales.xlsx` hold sold type plus duty (Imax, Um, Ust, ±, Y/D, phases, serial). Rebuild from JSON:
82
+
83
+ ```bash
84
+ python scripts/os-to-excel.py
85
+ ```
86
+
87
+ `npm test` runs shipped `selectOltc` on every complete row: no illegal type out; a legal sold type that covers the duty must appear in ranked results.
88
+
89
+ ## 许可
90
+
91
+ [条款](https://erict16.github.io/oltc-selector/terms/) · [隐私](https://erict16.github.io/oltc-selector/privacy/)。仅供参考。