@vessel-dsp/compiler 0.4.0 → 0.6.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.
- package/README.md +4 -2
- package/dist/bbd-clock.d.ts.map +1 -1
- package/dist/bbd-clock.js +5 -0
- package/dist/bbd-clock.js.map +1 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +305 -12
- package/dist/compile.js.map +1 -1
- package/dist/device-laws.d.ts.map +1 -1
- package/dist/device-laws.js +552 -97
- package/dist/device-laws.js.map +1 -1
- package/dist/fixtures/circuits.d.ts +23 -2
- package/dist/fixtures/circuits.d.ts.map +1 -1
- package/dist/fixtures/circuits.js +205 -2
- package/dist/fixtures/circuits.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +4 -0
- package/dist/lower.js.map +1 -1
- package/dist/netlist.d.ts +52 -0
- package/dist/netlist.d.ts.map +1 -1
- package/dist/netlist.js +585 -13
- package/dist/netlist.js.map +1 -1
- package/dist/part-catalog.d.ts +35 -6
- package/dist/part-catalog.d.ts.map +1 -1
- package/dist/part-catalog.js +2544 -443
- package/dist/part-catalog.js.map +1 -1
- package/dist/registry-data/bjt.d.ts +3 -0
- package/dist/registry-data/bjt.d.ts.map +1 -0
- package/dist/registry-data/bjt.js +1350 -0
- package/dist/registry-data/bjt.js.map +1 -0
- package/dist/registry-data/charge-pump.d.ts +3 -0
- package/dist/registry-data/charge-pump.d.ts.map +1 -0
- package/dist/registry-data/charge-pump.js +204 -0
- package/dist/registry-data/charge-pump.js.map +1 -0
- package/dist/registry-data/diode.d.ts +3 -0
- package/dist/registry-data/diode.d.ts.map +1 -0
- package/dist/registry-data/diode.js +683 -0
- package/dist/registry-data/diode.js.map +1 -0
- package/dist/registry-data/index.d.ts +20 -0
- package/dist/registry-data/index.d.ts.map +1 -0
- package/dist/registry-data/index.js +100 -0
- package/dist/registry-data/index.js.map +1 -0
- package/dist/registry-data/jfet.d.ts +3 -0
- package/dist/registry-data/jfet.d.ts.map +1 -0
- package/dist/registry-data/jfet.js +605 -0
- package/dist/registry-data/jfet.js.map +1 -0
- package/dist/registry-data/loader.d.ts +137 -0
- package/dist/registry-data/loader.d.ts.map +1 -0
- package/dist/registry-data/loader.js +350 -0
- package/dist/registry-data/loader.js.map +1 -0
- package/dist/registry-data/mosfet.d.ts +3 -0
- package/dist/registry-data/mosfet.d.ts.map +1 -0
- package/dist/registry-data/mosfet.js +63 -0
- package/dist/registry-data/mosfet.js.map +1 -0
- package/dist/registry-data/opamp.d.ts +37 -0
- package/dist/registry-data/opamp.d.ts.map +1 -0
- package/dist/registry-data/opamp.js +669 -0
- package/dist/registry-data/opamp.js.map +1 -0
- package/dist/registry-data/regulator.d.ts +3 -0
- package/dist/registry-data/regulator.d.ts.map +1 -0
- package/dist/registry-data/regulator.js +189 -0
- package/dist/registry-data/regulator.js.map +1 -0
- package/dist/registry-data/schema.d.ts +56 -0
- package/dist/registry-data/schema.d.ts.map +1 -0
- package/dist/registry-data/schema.js +142 -0
- package/dist/registry-data/schema.js.map +1 -0
- package/dist/registry-data/zener.d.ts +3 -0
- package/dist/registry-data/zener.d.ts.map +1 -0
- package/dist/registry-data/zener.js +547 -0
- package/dist/registry-data/zener.js.map +1 -0
- package/dist/registry.d.ts +72 -5
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +65 -6
- package/dist/registry.js.map +1 -1
- package/dist/types.d.ts +255 -19
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/registry.d.ts
CHANGED
|
@@ -168,6 +168,22 @@ export declare function pinoutMatches(pinout: PartPinout, terminalRoles: readonl
|
|
|
168
168
|
import type { FirmwareEvidence } from "./firmware-class";
|
|
169
169
|
import type { TerminalProfile } from "./terminal-role";
|
|
170
170
|
import type { ProxyDeclaration } from "./proxy-declaration";
|
|
171
|
+
/**
|
|
172
|
+
* One provisional parameter an entry's law carries: the registry parameter name and
|
|
173
|
+
* the `community` source URL its value was taken from.
|
|
174
|
+
*
|
|
175
|
+
* Stamped by the `registry-data` builders (`bjtLawEntry`, `diodeLawEntry`,
|
|
176
|
+
* `fetLawEntry`, the op-amp gain-bandwidth and output-swing passes) from the record's
|
|
177
|
+
* `community`-basis parameters, so the compiler can name every device that runs on a
|
|
178
|
+
* provisional value without importing any part data. Absent or empty means the entry
|
|
179
|
+
* carries no provisional value.
|
|
180
|
+
*/
|
|
181
|
+
export type ProvisionalParam = {
|
|
182
|
+
/** The registry parameter name, e.g. `saturationCurrent`. */
|
|
183
|
+
readonly name: string;
|
|
184
|
+
/** The community source URL the value was taken from. */
|
|
185
|
+
readonly url: string;
|
|
186
|
+
};
|
|
171
187
|
export type PartEntry = {
|
|
172
188
|
/** Matched whole and case-folded against a device's part number. */
|
|
173
189
|
readonly partIds: readonly string[];
|
|
@@ -187,6 +203,13 @@ export type PartEntry = {
|
|
|
187
203
|
* reproduce. Absent means the entry asserts it models the part.
|
|
188
204
|
*/
|
|
189
205
|
readonly proxy?: ProxyDeclaration;
|
|
206
|
+
/**
|
|
207
|
+
* **Provisional parameters this entry's law carries.** Each names a registry
|
|
208
|
+
* parameter whose value came from a `community` source, with that source's URL.
|
|
209
|
+
* See `ProvisionalParam`. Absent or empty means the entry carries no provisional
|
|
210
|
+
* value, and nothing about the entry changes: the law stamps exactly as before.
|
|
211
|
+
*/
|
|
212
|
+
readonly provisionalParams?: readonly ProvisionalParam[];
|
|
190
213
|
/**
|
|
191
214
|
* **Whether this chip's behaviour comes from a program — typed, with positive evidence.**
|
|
192
215
|
* Absent means `undetermined`, which is **not** a scope boundary. See `firmware-class.ts`: the
|
|
@@ -207,6 +230,20 @@ export type PartEntry = {
|
|
|
207
230
|
* Absent means no datasheet figure is recorded, and the part draws nothing, as before.
|
|
208
231
|
*/
|
|
209
232
|
readonly quiescentSupplyAmps?: number;
|
|
233
|
+
/**
|
|
234
|
+
* **A charge pump's fixed open-circuit shortfall below ideal inversion, in volts,
|
|
235
|
+
* from its datasheet.**
|
|
236
|
+
*
|
|
237
|
+
* Present only on single-section `voltage-source` entries that model a
|
|
238
|
+
* switched-capacitor inverter: the derived rail is
|
|
239
|
+
* `-(inputVolts) - sign * chargePumpLossVolts` with the section law's `sourceOhms`
|
|
240
|
+
* carrying the load-dependent drop (see `pumpDerivation` in `device-laws.ts`).
|
|
241
|
+
* The CMOS 7660 family prints ~99.9% open-circuit conversion efficiency and so
|
|
242
|
+
* carries 0; the LT1054 prints a loss table (0.35 V TYP at 10 mA, TI SLVS033G p5)
|
|
243
|
+
* and carries that. Absent means the entry is not a pump model and the derivation
|
|
244
|
+
* never reads it.
|
|
245
|
+
*/
|
|
246
|
+
readonly chargePumpLossVolts?: number;
|
|
210
247
|
/**
|
|
211
248
|
* **What each terminal IS, with per-terminal evidence.** Absent means `unpopulated`, which is a
|
|
212
249
|
* correct state rather than a gap: a consumer that needs audio terminals must fall back to
|
|
@@ -313,11 +350,41 @@ export declare function foldToken(value: string | undefined | null): string;
|
|
|
313
350
|
* a silent one is what let every amp in the corpus run a 6V6 fit.
|
|
314
351
|
*/
|
|
315
352
|
export declare function registryLawFor(registry: PartRegistry, partNumber: string | null, lawKind: DeviceLaw["kind"]): DeviceLaw | null;
|
|
353
|
+
/** A part's printed output swing, as the registry states it. See `DeviceLaw` `outputSwingDropHighVolts`. */
|
|
354
|
+
export type OpampOutputSwing = {
|
|
355
|
+
readonly highVolts: number;
|
|
356
|
+
readonly lowVolts: number;
|
|
357
|
+
readonly printed: NonNullable<Extract<DeviceLaw, {
|
|
358
|
+
kind: "ideal-opamp";
|
|
359
|
+
}>["outputSwingPrinted"]>;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* The output-swing pair, with the condition it was printed at, from an `ideal-opamp` law, or `null`
|
|
363
|
+
* when the law states none. **Both of the pair or neither, and the printed condition exactly when the
|
|
364
|
+
* pair is**: a law that states a half, or a pair with no condition, or a condition with no pair, is a
|
|
365
|
+
* table error and throws, naming the part. Nothing here guesses a missing side from the other.
|
|
366
|
+
*/
|
|
367
|
+
export declare function opampOutputSwingOf(law: Extract<DeviceLaw, {
|
|
368
|
+
kind: "ideal-opamp";
|
|
369
|
+
}>, partId: string): OpampOutputSwing | null;
|
|
316
370
|
/**
|
|
317
|
-
* How far a part's output stops short of each supply rail,
|
|
318
|
-
* it, or `null` when the part is not in the registry
|
|
319
|
-
* they are). Read from either an `ideal-opamp` law
|
|
320
|
-
* entry, because a declared `opamp` device never reaches the
|
|
371
|
+
* How far a part's output stops short of each supply rail, as its datasheet prints it, from the
|
|
372
|
+
* registry entry that names it by exact folded part id, or `null` when the part is not in the registry
|
|
373
|
+
* or its entry states none (the rails are then used as they are). Read from either an `ideal-opamp` law
|
|
374
|
+
* entry or the first section of a `sections` entry, because a declared `opamp` device never reaches the
|
|
375
|
+
* section lowering. Throws on a half-stated pair (`opampOutputSwingOf`).
|
|
376
|
+
*/
|
|
377
|
+
export declare function registryOpampSwing(registry: PartRegistry, partNumber: string | null): OpampOutputSwing | null;
|
|
378
|
+
/**
|
|
379
|
+
* The gain-bandwidth product, in hertz, that a part's datasheet states, from the registry entry
|
|
380
|
+
* that names it by exact part id, or `null` when the part is not in the registry or its entry states
|
|
381
|
+
* none. Read the same way as `registryOpampSwing` -- from an `ideal-opamp` law entry or the first
|
|
382
|
+
* section of a `sections` entry -- and for the same reason: a declared `opamp` device never reaches
|
|
383
|
+
* the section lowering, so this is the only door through which the catalog's figure reaches it.
|
|
384
|
+
*
|
|
385
|
+
* `null` is an answer, not a failure: the caller then has no part fact, and lowers a `null` stamp
|
|
386
|
+
* that the consoles run on their class default and the compiler names in a warning. Whole folded id
|
|
387
|
+
* only (`foldPartId`); there is no prefix, substring or family rule on this path.
|
|
321
388
|
*/
|
|
322
|
-
export declare function
|
|
389
|
+
export declare function registryOpampGainBandwidth(registry: PartRegistry, partNumber: string | null): number | null;
|
|
323
390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
166
166
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
167
|
+
* The output-swing pair, with the condition it was printed at, from an `ideal-opamp` law, or `null`
|
|
168
|
+
* when the law states none. **Both of the pair or neither, and the printed condition exactly when the
|
|
169
|
+
* pair is**: a law that states a half, or a pair with no condition, or a condition with no pair, is a
|
|
170
|
+
* table error and throws, naming the part. Nothing here guesses a missing side from the other.
|
|
171
171
|
*/
|
|
172
|
-
export function
|
|
172
|
+
export function opampOutputSwingOf(law, partId) {
|
|
173
|
+
const high = law.outputSwingDropHighVolts;
|
|
174
|
+
const low = law.outputSwingDropLowVolts;
|
|
175
|
+
const printed = law.outputSwingPrinted;
|
|
176
|
+
if (high === undefined && low === undefined && printed === undefined) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
if (high === undefined || low === undefined || printed === undefined) {
|
|
180
|
+
throw new Error(`${partId}: an op-amp output swing is a pair with its printed condition, both sides and the condition or none ` +
|
|
181
|
+
`(outputSwingDropHighVolts ${String(high)}, outputSwingDropLowVolts ${String(low)}, outputSwingPrinted ${printed === undefined ? "absent" : "present"})`);
|
|
182
|
+
}
|
|
183
|
+
const finitePositive = (value) => Number.isFinite(value) && value > 0;
|
|
184
|
+
if (!finitePositive(high) ||
|
|
185
|
+
!finitePositive(low) ||
|
|
186
|
+
!finitePositive(printed.supplyVolts) ||
|
|
187
|
+
!finitePositive(printed.loadOhms) ||
|
|
188
|
+
(printed.translation !== "constant" && printed.translation !== "proportional")) {
|
|
189
|
+
throw new Error(`${partId}: an op-amp output swing needs finite positive drops, supply and load and a translation of "constant" or "proportional"`);
|
|
190
|
+
}
|
|
191
|
+
return { highVolts: high, lowVolts: low, printed };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* How far a part's output stops short of each supply rail, as its datasheet prints it, from the
|
|
195
|
+
* registry entry that names it by exact folded part id, or `null` when the part is not in the registry
|
|
196
|
+
* or its entry states none (the rails are then used as they are). Read from either an `ideal-opamp` law
|
|
197
|
+
* entry or the first section of a `sections` entry, because a declared `opamp` device never reaches the
|
|
198
|
+
* section lowering. Throws on a half-stated pair (`opampOutputSwingOf`).
|
|
199
|
+
*/
|
|
200
|
+
export function registryOpampSwing(registry, partNumber) {
|
|
201
|
+
if (partNumber === null) {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
const folded = foldPartId(partNumber);
|
|
205
|
+
for (const entry of registry.entries) {
|
|
206
|
+
if (!entry.partIds.some((id) => foldPartId(id) === folded)) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
const law = entry.model.kind === "law"
|
|
210
|
+
? entry.model.law
|
|
211
|
+
: entry.model.kind === "sections"
|
|
212
|
+
? entry.model.sections[0]?.law
|
|
213
|
+
: undefined;
|
|
214
|
+
if (law !== undefined && law.kind === "ideal-opamp") {
|
|
215
|
+
return opampOutputSwingOf(law, partNumber);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* The gain-bandwidth product, in hertz, that a part's datasheet states, from the registry entry
|
|
222
|
+
* that names it by exact part id, or `null` when the part is not in the registry or its entry states
|
|
223
|
+
* none. Read the same way as `registryOpampSwing` -- from an `ideal-opamp` law entry or the first
|
|
224
|
+
* section of a `sections` entry -- and for the same reason: a declared `opamp` device never reaches
|
|
225
|
+
* the section lowering, so this is the only door through which the catalog's figure reaches it.
|
|
226
|
+
*
|
|
227
|
+
* `null` is an answer, not a failure: the caller then has no part fact, and lowers a `null` stamp
|
|
228
|
+
* that the consoles run on their class default and the compiler names in a warning. Whole folded id
|
|
229
|
+
* only (`foldPartId`); there is no prefix, substring or family rule on this path.
|
|
230
|
+
*/
|
|
231
|
+
export function registryOpampGainBandwidth(registry, partNumber) {
|
|
173
232
|
if (partNumber === null) {
|
|
174
233
|
return null;
|
|
175
234
|
}
|
|
@@ -184,7 +243,7 @@ export function registryOpampSwingDrop(registry, partNumber) {
|
|
|
184
243
|
? entry.model.sections[0]?.law
|
|
185
244
|
: undefined;
|
|
186
245
|
if (law !== undefined && law.kind === "ideal-opamp") {
|
|
187
|
-
return law.
|
|
246
|
+
return law.gainBandwidthHz ?? null;
|
|
188
247
|
}
|
|
189
248
|
}
|
|
190
249
|
return null;
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,kFAAkF;AAClF,4EAA4E;AAC5E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,mFAAmF;AACnF,4CAA4C;AAC5C,iFAAiF;AACjF,gFAAgF;AA6JhF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC/B,aAAyC,EACzC,OAA0B;IAE1B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACrD,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAChD,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAE,OAAO,CAAC,CAAC,CAAY,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC5B,MAAkB,EAClB,aAAyC;IAEzC,IAAI,MAAM,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAClB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,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AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,0BAA0B,CACzC,QAAsB,EACtB,UAAyB;IAEzB,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,EAAE,CAAC;YAC5D,SAAS;QACV,CAAC;QACD,MAAM,GAAG,GACR,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK;YACzB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG;YACjB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU;gBAChC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG;gBAC9B,CAAC,CAAC,SAAS,CAAC;QACf,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YACrD,OAAO,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC;QACpC,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -125,6 +125,43 @@ export type DeclaredWindingImpedance = Readonly<{
|
|
|
125
125
|
across: readonly [number, number];
|
|
126
126
|
ohms: number;
|
|
127
127
|
}>;
|
|
128
|
+
/**
|
|
129
|
+
* An explicit device-parameter override block, as declared in a component's `properties`
|
|
130
|
+
* under the `DeviceOverride` key (stage 2).
|
|
131
|
+
*
|
|
132
|
+
* A `.vdsp` NAMES the part; the registry holds its parameters. This block states measured
|
|
133
|
+
* values that replace registry values for this device (`kind: "measured"`), or the full
|
|
134
|
+
* parameter set for a part the registry does not have (`kind: "custom"`). Parameter names
|
|
135
|
+
* are the part's own class-schema names (`CLASS_PARAM_SCHEMAS`), values are plain SI numbers
|
|
136
|
+
* with one value per parameter. Parsed and validated by `readDeviceOverride` in `netlist.ts`;
|
|
137
|
+
* this type is the validated shape that `device.parameters` merging and the
|
|
138
|
+
* `registry-override-applied` notice both read.
|
|
139
|
+
*/
|
|
140
|
+
export type DeviceOverrideParameter = Readonly<{
|
|
141
|
+
/** A class-schema parameter name (checked against the part's class schema). */
|
|
142
|
+
readonly name: string;
|
|
143
|
+
/** The single SI number the engine uses. */
|
|
144
|
+
readonly value: number;
|
|
145
|
+
}>;
|
|
146
|
+
export type DeviceOverrideKind = "measured" | "custom";
|
|
147
|
+
export type DeviceOverrideProvenance = Readonly<{
|
|
148
|
+
readonly kind: DeviceOverrideKind;
|
|
149
|
+
/** What was measured, or which document the numbers come from. */
|
|
150
|
+
readonly source: string;
|
|
151
|
+
/** Instrument/procedure for `measured`; why the registry lacks the part for `custom`. */
|
|
152
|
+
readonly method: string;
|
|
153
|
+
/** Sitting date, ISO YYYY-MM-DD. */
|
|
154
|
+
readonly date: string;
|
|
155
|
+
/** A named person or organisation. */
|
|
156
|
+
readonly by: string;
|
|
157
|
+
/** Optional supply, temperature, current. */
|
|
158
|
+
readonly conditions?: string;
|
|
159
|
+
}>;
|
|
160
|
+
export type DeviceOverride = Readonly<{
|
|
161
|
+
readonly provenance: DeviceOverrideProvenance;
|
|
162
|
+
/** A list (not a mapping) so a duplicate name stays detectable. */
|
|
163
|
+
readonly parameters: readonly DeviceOverrideParameter[];
|
|
164
|
+
}>;
|
|
128
165
|
export type Device = {
|
|
129
166
|
readonly id: DeviceId;
|
|
130
167
|
readonly kind: DeviceKind;
|
|
@@ -136,6 +173,15 @@ export type Device = {
|
|
|
136
173
|
readonly control: ControlId | null;
|
|
137
174
|
readonly identity: DeviceIdentity;
|
|
138
175
|
readonly isLed?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* This device's explicit parameter override, as the source declared it under
|
|
178
|
+
* `properties.DeviceOverride`, or absent where it declares none. Validated at
|
|
179
|
+
* read time (unknown names, bad provenance and `custom` rule violations refuse
|
|
180
|
+
* the pedal); the merged values already sit in `parameters`, so this carries
|
|
181
|
+
* the provenance and the per-parameter record the `registry-override-applied`
|
|
182
|
+
* notice reports.
|
|
183
|
+
*/
|
|
184
|
+
readonly deviceOverride?: DeviceOverride;
|
|
139
185
|
/**
|
|
140
186
|
* This device's id **within its package**, when the source split the package itself.
|
|
141
187
|
*
|
|
@@ -255,8 +301,15 @@ export type DeclaredProgram = Readonly<{
|
|
|
255
301
|
* `reverse-linear` is a real track the corpus declares (`klon-centaur`,
|
|
256
302
|
* `vemuram-jan-ray`, `jhs-morning-glory`) and is not the same device as
|
|
257
303
|
* `reverse-logarithmic`: the track is linear, only its direction is reversed.
|
|
304
|
+
*
|
|
305
|
+
* `s-curve` is Alpha's W(4B) and only that: the one S-curve a vendor sheet on file prints
|
|
306
|
+
* (RV16AF §2.4: 5-15 % at 90 degrees, 40-60 % at 150, 85-95 % at 210, of a 300-degree rotation).
|
|
307
|
+
* Any other S-curve is `custom` in the core format until a source prints its points.
|
|
308
|
+
*
|
|
309
|
+
* The runtime refuses a taper outside this list rather than reading it as linear, so a program
|
|
310
|
+
* naming a law a console does not implement stops at load instead of playing the wrong curve.
|
|
258
311
|
*/
|
|
259
|
-
export type TaperKind = "linear" | "logarithmic" | "reverse-logarithmic" | "reverse-linear";
|
|
312
|
+
export type TaperKind = "linear" | "logarithmic" | "reverse-logarithmic" | "reverse-linear" | "s-curve";
|
|
260
313
|
export type Control = {
|
|
261
314
|
readonly id: ControlId;
|
|
262
315
|
readonly taper: TaperKind;
|
|
@@ -363,6 +416,13 @@ export type PartIdentity = {
|
|
|
363
416
|
readonly partId: string;
|
|
364
417
|
readonly evidence: "exact-part" | "declared-type" | "pinout";
|
|
365
418
|
};
|
|
419
|
+
/**
|
|
420
|
+
* How a printed op-amp output-swing pair is carried to a pedal whose supply is not the supply it
|
|
421
|
+
* was printed at (`DeviceLaw` `outputSwingPrinted`). A closed pair of words, compared whole:
|
|
422
|
+
* `"constant"` applies the printed drops as printed; `"proportional"` multiplies both by the
|
|
423
|
+
* op-amp's own supply span over the printed supply.
|
|
424
|
+
*/
|
|
425
|
+
export type OpampOutputSwingTranslation = "constant" | "proportional";
|
|
366
426
|
/** A lumped constitutive relation the solver can stamp into a matrix. */
|
|
367
427
|
export type DeviceLaw = {
|
|
368
428
|
readonly kind: "conductance";
|
|
@@ -888,14 +948,60 @@ export type DeviceLaw = {
|
|
|
888
948
|
*/
|
|
889
949
|
readonly openLoopGain: number;
|
|
890
950
|
/**
|
|
891
|
-
* How far the output stops short of
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* close to them it gets
|
|
896
|
-
* ground
|
|
951
|
+
* How far the output stops short of the positive and of the negative supply rail, in volts,
|
|
952
|
+
* **as the part's datasheet prints it, at the condition it prints it at**
|
|
953
|
+
* (`outputSwingPrinted`). A drop from the rail, not an absolute swing: the output clamps to
|
|
954
|
+
* `railLow + low .. railHigh - high`. The pedal still owns the rails; the part owns only how
|
|
955
|
+
* close to them it gets, and the two sides are separate facts so a part that prints them
|
|
956
|
+
* separately (an LM358's swing to ground) can say so.
|
|
957
|
+
*
|
|
958
|
+
* **Both or neither**, and `outputSwingPrinted` exactly when the pair is: the catalog loader
|
|
959
|
+
* and `registryOpampSwing` throw on anything else. Absent means the part states none and the
|
|
960
|
+
* rails are used as they are (`opamp-law-default-parameters` names it). There is no single
|
|
961
|
+
* symmetric field: the one that was here carried a figure printed at +-15 V to a 9 V pedal
|
|
962
|
+
* without saying so.
|
|
963
|
+
*
|
|
964
|
+
* On a lowered law (a section of a resolved device) these stay the printed figures; what the
|
|
965
|
+
* lowering actually applied is `outputSwingCarried`.
|
|
966
|
+
*/
|
|
967
|
+
readonly outputSwingDropHighVolts?: number;
|
|
968
|
+
readonly outputSwingDropLowVolts?: number;
|
|
969
|
+
/**
|
|
970
|
+
* The condition `outputSwingDropHighVolts`/`outputSwingDropLowVolts` were printed at, and how
|
|
971
|
+
* they are carried to a pedal on another supply: `supplyVolts` is the **total** supply of the
|
|
972
|
+
* printed row (30 for +-15 V), `loadOhms` the printed load, `translation` the owner's stated
|
|
973
|
+
* reading of the datasheet. `"constant"` applies the printed drops as printed;
|
|
974
|
+
* `"proportional"` scales both by `(railHigh - railLow) / supplyVolts`. Evidence status is
|
|
975
|
+
* part of the choice and lives in the table row's `source`, never in this field.
|
|
976
|
+
*/
|
|
977
|
+
readonly outputSwingPrinted?: {
|
|
978
|
+
readonly supplyVolts: number;
|
|
979
|
+
readonly loadOhms: number;
|
|
980
|
+
readonly translation: OpampOutputSwingTranslation;
|
|
981
|
+
};
|
|
982
|
+
/**
|
|
983
|
+
* Set by the lowering, only on a lowered law, and only when it moved the rails: the drops it
|
|
984
|
+
* applied (after `translation`) and the supply span of the op-amp they were applied to. Read
|
|
985
|
+
* by `opamp-law-default-parameters` to tell a pair carried across a supply from one used at
|
|
986
|
+
* the supply it was printed at.
|
|
897
987
|
*/
|
|
898
|
-
readonly
|
|
988
|
+
readonly outputSwingCarried?: {
|
|
989
|
+
readonly highVolts: number;
|
|
990
|
+
readonly lowVolts: number;
|
|
991
|
+
readonly circuitSupplyVolts: number;
|
|
992
|
+
};
|
|
993
|
+
/**
|
|
994
|
+
* Gain-bandwidth product in hertz: where a single-pole part's open-loop gain falls to
|
|
995
|
+
* unity, so its dominant pole sits at `gainBandwidthHz / openLoopGain`. A closed-loop
|
|
996
|
+
* stage of gain `G` rolls off at `gainBandwidthHz / G`.
|
|
997
|
+
*
|
|
998
|
+
* **A stated fact or nothing.** It comes from the packet's own typed `GBP`, else from the
|
|
999
|
+
* part's datasheet typical figure (`part-catalog.ts`, by exact part id), and is absent when
|
|
1000
|
+
* neither states one -- never an estimate, and never chosen to fit a capture. Absent lowers
|
|
1001
|
+
* to a `null` stamp, which the consoles run on their class default of 1 MHz and which the
|
|
1002
|
+
* `opamp-gain-bandwidth-default` warning names.
|
|
1003
|
+
*/
|
|
1004
|
+
readonly gainBandwidthHz?: number;
|
|
899
1005
|
} | {
|
|
900
1006
|
readonly kind: "logic-divider";
|
|
901
1007
|
readonly thresholdVolts: number;
|
|
@@ -1144,7 +1250,7 @@ export type MacroClockControl = {
|
|
|
1144
1250
|
* `electrically-isolated` has its own dedicated warning (`electrically-isolated-ic`) and is
|
|
1145
1251
|
* tagged only so `findIcsNotExecuted` can exclude it by the decision rather than by guessing.
|
|
1146
1252
|
*/
|
|
1147
|
-
export type OpenIcReason = "source-boundary-shell" | "registry-arity-mismatch" | "electrically-isolated" | "charge-pump-declared-rail" | "registry-open" | "declared-class-without-model";
|
|
1253
|
+
export type OpenIcReason = "source-boundary-shell" | "registry-arity-mismatch" | "electrically-isolated" | "charge-pump-declared-rail" | "charge-pump-no-input" | "charge-pump-output-unloaded" | "registry-open" | "declared-class-without-model";
|
|
1148
1254
|
/**
|
|
1149
1255
|
* Which phase-3 bucket an unmodelled core belongs in (board-p3 row 1).
|
|
1150
1256
|
*
|
|
@@ -1483,6 +1589,16 @@ export type Stamp = {
|
|
|
1483
1589
|
* op-amp stiffness, the saturation band and the step limiter was taken at the default.
|
|
1484
1590
|
*/
|
|
1485
1591
|
readonly openLoopGain: number;
|
|
1592
|
+
/**
|
|
1593
|
+
* Gain-bandwidth product in hertz, or `null` when no source states one for this section.
|
|
1594
|
+
*
|
|
1595
|
+
* Both consoles read this field for the dominant pole at `gainBandwidthHz / openLoopGain`;
|
|
1596
|
+
* `null` runs the consoles' class default of 1 MHz, which was the only value every op-amp
|
|
1597
|
+
* had before this field existed. The number of sections left on that default is the
|
|
1598
|
+
* `opamp-gain-bandwidth-default` warning, so the default is visible rather than hidden.
|
|
1599
|
+
* Unrailed sections are virtual shorts with no pole, so the field is inert for them.
|
|
1600
|
+
*/
|
|
1601
|
+
readonly gainBandwidthHz: number | null;
|
|
1486
1602
|
readonly sourceIndex: number;
|
|
1487
1603
|
readonly railHigh: number | null;
|
|
1488
1604
|
readonly railLow: number | null;
|
|
@@ -2815,24 +2931,144 @@ export type BjtLawDefaultWarning = {
|
|
|
2815
2931
|
readonly detail: string;
|
|
2816
2932
|
};
|
|
2817
2933
|
/**
|
|
2818
|
-
*
|
|
2819
|
-
*
|
|
2934
|
+
* A device whose law runs on at least one provisional `community` registry value,
|
|
2935
|
+
* because no datasheet, manufacturer model or owner measurement states it.
|
|
2936
|
+
*
|
|
2937
|
+
* **Why it is named.** A community value is a published number, not a measured fact
|
|
2938
|
+
* about the part: a SPICE model fit at other currents, or one author's bench reading.
|
|
2939
|
+
* The pedal still renders -- this is a notice, not a refusal -- but a reader quoting
|
|
2940
|
+
* the render is entitled to know which parts of it rest on provisional values and
|
|
2941
|
+
* where those values can be checked. Adding a better source for the same parameter
|
|
2942
|
+
* of the same part throws until the community record is removed, so this warning can
|
|
2943
|
+
* only ever name values nothing better has replaced.
|
|
2944
|
+
*
|
|
2945
|
+
* **What it does not claim.** Not that the value is wrong: only that it is
|
|
2946
|
+
* provisional. A device whose document types the parameter runs on its own typed
|
|
2947
|
+
* value instead and is not listed for that parameter.
|
|
2948
|
+
*/
|
|
2949
|
+
export type RegistryProvisionalValueWarning = {
|
|
2950
|
+
readonly code: "registry-provisional-value";
|
|
2951
|
+
readonly device: DeviceId;
|
|
2952
|
+
/** The part number as the source authored it. */
|
|
2953
|
+
readonly partNumber: string | null;
|
|
2954
|
+
/** The registry parameter names this device took from community values. */
|
|
2955
|
+
readonly parameters: readonly string[];
|
|
2956
|
+
/** The distinct community source URLs those values were taken from. */
|
|
2957
|
+
readonly urls: readonly string[];
|
|
2958
|
+
readonly detail: string;
|
|
2959
|
+
};
|
|
2960
|
+
/**
|
|
2961
|
+
* A device parameter the source still types under its legacy spelling (`Aol`, `IS`, `BF`,
|
|
2962
|
+
* `Vt0`, `Beta`, `GBP`, `EmissionCoefficient`, ...), which the compiler still reads while
|
|
2963
|
+
* the artifacts migration to explicit `DeviceOverride` blocks is in flight. One warning per
|
|
2964
|
+
* device, naming every legacy key present.
|
|
2965
|
+
*
|
|
2966
|
+
* **Why it is named.** The end state (stage 4) reads device parameters from no other property:
|
|
2967
|
+
* a legacy key the migration drops without converting silently changes the program (or, for
|
|
2968
|
+
* keys the compiler never read, silently changes nothing while looking like it did). Naming
|
|
2969
|
+
* every still-read legacy key per device is the migration checklist, and the `overridden`
|
|
2970
|
+
* subset says which ones an override block already supersedes. REMOVAL of legacy reading is
|
|
2971
|
+
* stage 4, not this task: this warning is additive and changes no program.
|
|
2972
|
+
*/
|
|
2973
|
+
export type LegacyDeviceParameterWarning = {
|
|
2974
|
+
readonly code: "legacy-device-parameter";
|
|
2975
|
+
readonly device: DeviceId;
|
|
2976
|
+
/** Every legacy typed device-parameter key present on the component, as authored. */
|
|
2977
|
+
readonly keys: readonly string[];
|
|
2978
|
+
/** The subset an explicit override block supersedes (the override value wins). */
|
|
2979
|
+
readonly overridden: readonly string[];
|
|
2980
|
+
readonly detail: string;
|
|
2981
|
+
};
|
|
2982
|
+
/**
|
|
2983
|
+
* One applied explicit parameter override: the device's values that came from its
|
|
2984
|
+
* `DeviceOverride` block rather than the registry or a class default. One notice per device,
|
|
2985
|
+
* so a player can show "measured by ... on ..." beside the part.
|
|
2986
|
+
*
|
|
2987
|
+
* A notice, never a refusal: the values already stamped (precedence override > legacy typed
|
|
2988
|
+
* key > registry > class default). `registryValue` is `null` when no registry value was
|
|
2989
|
+
* replaced -- either the part has no entry, or the entry states no such parameter -- and
|
|
2990
|
+
* `detail` says which.
|
|
2991
|
+
*/
|
|
2992
|
+
export type RegistryOverrideAppliedWarning = {
|
|
2993
|
+
readonly code: "registry-override-applied";
|
|
2994
|
+
readonly device: DeviceId;
|
|
2995
|
+
/** The part number as the source authored it (null when the device names none). */
|
|
2996
|
+
readonly partNumber: string | null;
|
|
2997
|
+
/** Per overridden parameter: what the override states and what it replaced. */
|
|
2998
|
+
readonly items: readonly {
|
|
2999
|
+
readonly parameter: string;
|
|
3000
|
+
readonly overrideValue: number;
|
|
3001
|
+
readonly registryValue: number | null;
|
|
3002
|
+
}[];
|
|
3003
|
+
readonly provenance: DeviceOverrideProvenance;
|
|
3004
|
+
readonly detail: string;
|
|
3005
|
+
};
|
|
3006
|
+
/**
|
|
3007
|
+
* Why one op-amp is named by `opamp-law-default-parameters`. `not-stated`: the part states no
|
|
3008
|
+
* output-swing pair, so the output runs the full supply. `stated-at-other-supply`: the part's
|
|
3009
|
+
* datasheet prints a pair, but at a supply other than this pedal's, and the lowering carried it
|
|
3010
|
+
* across by the row's stated `translation`; `printedSupplyVolts` is the row's total supply and
|
|
3011
|
+
* `circuitSupplyVolts` the span of the op-amp it was carried to.
|
|
3012
|
+
*/
|
|
3013
|
+
export type OpampLawDefaultItem = {
|
|
3014
|
+
readonly device: DeviceId;
|
|
3015
|
+
readonly reason: "not-stated";
|
|
3016
|
+
} | {
|
|
3017
|
+
readonly device: DeviceId;
|
|
3018
|
+
readonly reason: "stated-at-other-supply";
|
|
3019
|
+
readonly printedSupplyVolts: number;
|
|
3020
|
+
readonly circuitSupplyVolts: number;
|
|
3021
|
+
};
|
|
3022
|
+
/**
|
|
3023
|
+
* Op-amps whose output swing the compiler could not take from the part at this pedal's supply:
|
|
3024
|
+
* either the part states no distance it stops short of the rails (`outputSwingDropHighVolts` /
|
|
3025
|
+
* `outputSwingDropLowVolts`), or it states one printed at another supply and the lowering carried it.
|
|
3026
|
+
* One warning per document, naming every such device with a typed reason (`items`); `devices` is
|
|
3027
|
+
* the same list without the reason.
|
|
2820
3028
|
*
|
|
2821
3029
|
* **Why it is named.** No real op-amp reaches its rails. `mxr-phase-90` read WEAK 79.6 deg on
|
|
2822
3030
|
* rail-to-rail TL062s and SWEEPING 106.0 deg once they stopped 1.2 V short of each rail
|
|
2823
|
-
* (packet-study/mxr-phase-90, 2026-09-29), and three simulators agreed on the wrong answer
|
|
2824
|
-
*
|
|
2825
|
-
*
|
|
3031
|
+
* (packet-study/mxr-phase-90, 2026-09-29), and three simulators agreed on the wrong answer because
|
|
3032
|
+
* the oracle deck follows the program's rails. A comparator or LFO near the rails, or a clipper, is
|
|
3033
|
+
* decided by this number. Almost every printed swing row is at +-15 V and almost every pedal runs
|
|
3034
|
+
* at 9 V, so a figure carried across the supply is a choice the part's datasheet does not make; the
|
|
3035
|
+
* second reason names it instead of hiding it.
|
|
2826
3036
|
*
|
|
2827
3037
|
* **What it does not claim.** Not that the source is wrong, and not that the stamped rails are
|
|
2828
|
-
* wrong for a circuit that never nears them; a unity-gain buffer at low level is untouched.
|
|
2829
|
-
*
|
|
2830
|
-
*
|
|
3038
|
+
* wrong for a circuit that never nears them; a unity-gain buffer at low level is untouched. The
|
|
3039
|
+
* claim is only that the swing came from the consumer's default (the supply) or from a datasheet
|
|
3040
|
+
* row carried across a supply, not from a figure printed for this pedal. LM358, LM324 and TL022 are
|
|
3041
|
+
* listed until a row for them is typed.
|
|
2831
3042
|
*/
|
|
2832
3043
|
export type OpampLawDefaultWarning = {
|
|
2833
3044
|
readonly code: "opamp-law-default-parameters";
|
|
2834
3045
|
readonly device: null;
|
|
2835
3046
|
readonly devices: readonly DeviceId[];
|
|
3047
|
+
readonly items: readonly OpampLawDefaultItem[];
|
|
3048
|
+
readonly detail: string;
|
|
3049
|
+
};
|
|
3050
|
+
/**
|
|
3051
|
+
* Op-amp sections whose gain-bandwidth product no source states, so both consoles run them on
|
|
3052
|
+
* the class default of 1 MHz. One warning per document, counting the sections and naming every
|
|
3053
|
+
* device that has one.
|
|
3054
|
+
*
|
|
3055
|
+
* **Why it is named.** Until `gainBandwidthHz` existed every op-amp in every pedal ran a 1 MHz
|
|
3056
|
+
* product, whatever its part: a gain-100 stage's closed-loop corner is `GBP / 100`, 10 kHz at
|
|
3057
|
+
* 1 MHz and 30 kHz at a 4558's printed 3 MHz, so a wrong product is audible exactly where a stage's
|
|
3058
|
+
* high-frequency droop sits. A section whose packet declares a typed `GBP`, or whose exact part id
|
|
3059
|
+
* has a datasheet figure in the catalog, is not listed. Naming the rest keeps the default visible.
|
|
3060
|
+
*
|
|
3061
|
+
* **What it does not claim.** Not that 1 MHz is wrong for the part -- only that no source says so.
|
|
3062
|
+
* Only railed sections are counted: an unrailed op-amp is a virtual short with no pole, so the
|
|
3063
|
+
* product does nothing there. A compandor's internal op-amp is counted (the law states no product),
|
|
3064
|
+
* under the compandor's device id.
|
|
3065
|
+
*/
|
|
3066
|
+
export type OpampGainBandwidthDefaultWarning = {
|
|
3067
|
+
readonly code: "opamp-gain-bandwidth-default";
|
|
3068
|
+
readonly device: null;
|
|
3069
|
+
readonly devices: readonly DeviceId[];
|
|
3070
|
+
/** How many railed op-amp sections run on the class default. At least `devices.length`. */
|
|
3071
|
+
readonly sections: number;
|
|
2836
3072
|
readonly detail: string;
|
|
2837
3073
|
};
|
|
2838
3074
|
export type ElectricallyIsolatedIcWarning = {
|
|
@@ -3002,7 +3238,7 @@ export type GenericTubeFitWarning = {
|
|
|
3002
3238
|
* whose source explicitly records the marking as unknown, has nothing for this stage to have
|
|
3003
3239
|
* failed to read and is silent. This fires only where the source states something: a part marking
|
|
3004
3240
|
* whose law is not derivable here (`W20`, `Boss-G-taper`, `BH`), or a taper core's format supports
|
|
3005
|
-
* and this runtime has no curve for (`
|
|
3241
|
+
* and this runtime has no curve for (`stepped`, `custom`).
|
|
3006
3242
|
*
|
|
3007
3243
|
* Measured 2026-09-03: 69 of the corpus's 608 declared tapers fell through to linear, and all 69
|
|
3008
3244
|
* did it silently. An audio pot rendered linear is audible across the whole knob sweep, which is
|
|
@@ -3077,7 +3313,7 @@ export type PowerDomainControlWarning = {
|
|
|
3077
3313
|
readonly device: DeviceId;
|
|
3078
3314
|
readonly detail: string;
|
|
3079
3315
|
};
|
|
3080
|
-
export type CompileWarning = UnroutableThrowWarning | GenericSpeakerProfileWarning | LedgerDivergenceWarning | GenericTubeFitWarning | InertControlWarning | UnboundedOpampWarning | SupplyShortWarning | TaperNotExecutableWarning | OverDrivenNodeWarning | DanglingActiveTerminalWarning | ClockDriverSupplyAtGroundWarning | NonExecutableClockDriverWarning | NonExecutableSupportShellWarning | UnconnectedBehaviorComponentWarning | UnreadableTerminalRoleWarning | UnverifiedPinoutBindingWarning | PowerDomainControlWarning | UnimplementedControlRoleWarning | UnimplementedDeviceLawWarning | ElectricallyIsolatedIcWarning | RailWithoutVoltageWarning | FetLawDefaultWarning | BjtLawDefaultWarning | OpampLawDefaultWarning | IcNotExecutedWarning | OutputPortUnreachableWarning | InterfaceOrSourceOnlyWarning | NotPopulatedWarning | NotPopulatedWithoutValueWarning | UnsupportedComponentWarning | UnexecutedActiveRegionWarning | OutputPortNotTransformerCoupledWarning | NoOutputTransformerWarning | DeclaredDelayWarning | ControlPositionDisagreesWarning | BypassEngagedDisagreesWarning | ModulationNotModelledWarning | ConverterScaleNotModelledWarning;
|
|
3316
|
+
export type CompileWarning = UnroutableThrowWarning | GenericSpeakerProfileWarning | LedgerDivergenceWarning | GenericTubeFitWarning | InertControlWarning | UnboundedOpampWarning | SupplyShortWarning | TaperNotExecutableWarning | OverDrivenNodeWarning | DanglingActiveTerminalWarning | ClockDriverSupplyAtGroundWarning | NonExecutableClockDriverWarning | NonExecutableSupportShellWarning | UnconnectedBehaviorComponentWarning | UnreadableTerminalRoleWarning | UnverifiedPinoutBindingWarning | PowerDomainControlWarning | UnimplementedControlRoleWarning | UnimplementedDeviceLawWarning | ElectricallyIsolatedIcWarning | RailWithoutVoltageWarning | FetLawDefaultWarning | BjtLawDefaultWarning | RegistryProvisionalValueWarning | LegacyDeviceParameterWarning | RegistryOverrideAppliedWarning | OpampLawDefaultWarning | OpampGainBandwidthDefaultWarning | IcNotExecutedWarning | OutputPortUnreachableWarning | InterfaceOrSourceOnlyWarning | NotPopulatedWarning | NotPopulatedWithoutValueWarning | UnsupportedComponentWarning | UnexecutedActiveRegionWarning | OutputPortNotTransformerCoupledWarning | NoOutputTransformerWarning | DeclaredDelayWarning | ControlPositionDisagreesWarning | BypassEngagedDisagreesWarning | ModulationNotModelledWarning | ConverterScaleNotModelledWarning;
|
|
3081
3317
|
/**
|
|
3082
3318
|
* A composed program that touches a data converter but runs unity in volts, because one side's
|
|
3083
3319
|
* converter is unwired, ambiguous, or has no cited full scale. See `converter-scale.ts`: the
|