@vessel-dsp/core 0.6.29 → 0.6.31
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/dist/formats/interchange/parser.d.ts.map +1 -1
- package/dist/formats/interchange/parser.js +25 -0
- package/dist/formats/interchange/parser.js.map +1 -1
- package/dist/formats/interchange/serializer.js +11 -0
- package/dist/formats/interchange/serializer.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/model/devices.d.ts +55 -0
- package/dist/model/devices.d.ts.map +1 -0
- package/dist/model/devices.js +140 -0
- package/dist/model/devices.js.map +1 -0
- package/dist/model/taper.d.ts +64 -0
- package/dist/model/taper.d.ts.map +1 -0
- package/dist/model/taper.js +160 -0
- package/dist/model/taper.js.map +1 -0
- package/dist/model/types.d.ts +44 -0
- package/dist/model/types.d.ts.map +1 -1
- package/dist/model/types.js.map +1 -1
- package/dist/model/validation.d.ts.map +1 -1
- package/dist/model/validation.js +10 -0
- package/dist/model/validation.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.6.
|
|
1
|
+
export declare const VERSION = "0.6.31";
|
|
2
2
|
export type { CreateComponentArgs, DocumentCommand, EditorCommand, EditorState, TidyLayoutOptions, } from "./editor";
|
|
3
3
|
export { applyDocumentCommand, applyEditorCommand, buildComponent, canRedo, canUndo, createEditorState, resetEditorState, tidyDocumentLayout, } from "./editor";
|
|
4
4
|
export type { AnyCircuitElement, AnyCircuitElementInput, CircuitJson, CircuitJsonElement, CircuitJsonExport, CircuitJsonExportOptions, CircuitJsonExportTarget, CircuitJsonSchemaValidationIssue, CircuitJsonSchemaValidationResult, CircuitJsonSourceComponent, CircuitJsonSourceNet, CircuitJsonSourcePort, CircuitJsonSourceTrace, ParseCircuitJsonDocumentOptions, } from "./formats/circuit-json/serializer";
|
|
@@ -8,6 +8,10 @@ export { convertCircuitDocumentFile, convertCircuitDocumentFileWithReport, detec
|
|
|
8
8
|
export { INTERCHANGE_CONTRACT_VERSION } from "./formats/interchange/contract";
|
|
9
9
|
export { AMBIGUOUS_POTENTIOMETER_END_TOKENS, POTENTIOMETER_TERMINAL_ROLE_ALIASES, POTENTIOMETER_TERMINAL_ROLES, classifyPotentiometerTerminalRole, resolveDocumentPotentiometerTerminalRoles, resolvePotentiometerTerminalRoles, } from "./model/terminal-roles";
|
|
10
10
|
export type { PotentiometerTerminalRole, PotentiometerTerminalRoleResolution, PotentiometerTerminalRoleVerdict, } from "./model/terminal-roles";
|
|
11
|
+
export { POTENTIOMETER_TAPERS, SUPERSEDED_TAPER_PROPERTY_KEYS, TAPER_PROPERTY_KEY, classifyTaper, collectTaperIssues, } from "./model/taper";
|
|
12
|
+
export type { PotentiometerTaper, TaperIssue, TaperVerdict } from "./model/taper";
|
|
13
|
+
export { componentDevices, deviceTerminalRoles, validateComponentDevices, } from "./model/devices";
|
|
14
|
+
export type { DeviceValidationIssue, ResolvedComponentDevice } from "./model/devices";
|
|
11
15
|
export { AMBIGUOUS_DEVICE_TERMINAL_TOKENS, DEVICE_TERMINAL_ROLES, TERMINAL_ROLES_BY_KIND, collectTerminalRoleWarnings, isLegalTerminalRole, terminalRolesFor, SUFFIXABLE_DEVICE_TERMINAL_ROLES, classifyDeviceTerminalRole, isRoledDeviceKind, resolveComponentTerminalRoles, } from "./model/device-terminal-roles";
|
|
12
16
|
export type { DeviceTerminalRole, DeviceTerminalRoleVerdict, RoledDeviceKind, TerminalRole, } from "./model/device-terminal-roles";
|
|
13
17
|
export type { InterchangeTopologyParseResult } from "./formats/interchange/parser";
|
|
@@ -29,7 +33,7 @@ export { isParsedQuantity, isPropertyObject, propertyBooleanValue, propertyNumer
|
|
|
29
33
|
export { parseQuantity } from "./model/quantity";
|
|
30
34
|
export type { TracePlausibilityOptions } from "./model/trace-plausibility";
|
|
31
35
|
export { traceConnectivityCompleteness, validateAudioTopologyWarnings, validatePreferredValues, validateRcCornerHeuristic, validateTracePlausibility, validateTraceStructure, } from "./model/trace-plausibility";
|
|
32
|
-
export type { BoardApplicability, BoardEdgeTerminal, BoardFamily, BoardFootprint, BoardFootprintCatalog, BoardFootprintPlacement, BoardHole, BoardKind, BoardNet, BoardNetlist, BoardNetMember, BoardNetRef, BoardPlacedPad, BoardRealization, BoardReview, BoardRoute, BoardSourceCircuitHash, BoardSubtype, BuildBom, BuildBomItem, BuildBomRef, BuildBomRefKind, BuildCompleteness, BuildIntent, BuildPartProfile, BuildPartProfileCatalog, BuildScope, CabinetDimensionsM, CabinetDriverLoadout, CabinetEnclosure, CabinetEnclosureProfile, CabinetEnclosureType, CabinetPort, CanonicalCircuitNetRef, CircuitDocument, CircuitDocumentBehaviorFirmwareArtifactType, CircuitDocumentBehaviorFirmwareOwner, CircuitDocumentBehaviorFirmwareRef, CircuitDocumentBehaviorFirmwareSourceVisibility, CircuitDocumentBehaviorFirmwareStatus, CircuitDocumentBehaviorRole, CircuitDocumentBehaviorRoleKind, CircuitDocumentDevice, CircuitDocumentDeviceKind, CircuitPower, CircuitPowerCoverage, CircuitPowerDomain, CircuitPowerGroundPolarity, CircuitPowerRailBinding, CircuitPowerRailDerivation, CircuitPowerRailRole, CircuitPowerSourceKind, Component, ComponentKind, ComponentTerminalRef, ControlApplicabilityPredicate, ControlContext, ControlGroup, ControlGroupMember, ControlInterface, ControlInterfaceAssignmentHint, ControlInterfaceBinding, ControlInterfaceConnector, ControlInterfacePolarity, ControlInterfaceRole, ControlOutput, ControlOutputSwitchMode, DeviceInterface, DeviceInterfaceAudioBinding, DeviceInterfaceBinding, DeviceInterfaceControl, DeviceInterfaceControlKind, DocumentAmpAppearance, DocumentAppearance, DocumentAppearanceLabel, DocumentAppearanceMaterial, DocumentMetadata, DocumentSource, DocumentStompboxAppearance, KnownPhysicalProfile, MechanicalBuildMetadata, MicrophoneAcousticCoupling, MicrophoneElectrical, MicrophoneTransducer, MicrophoneTransducerPrinciple, MicrophoneTransducerProfile, MillimeterRect, OffBoardSignalRef, OffBoardWireAttributes, OffBoardWiringConnection, OffBoardWiringCoverage, OffBoardWiringEndpoint, OffBoardWiringEndpointKind, OffBoardWiringHarness, OffBoardWiringHarnessStatus, OffBoardWiringPlan, PanelColumnOrder, PanelControlKind, PanelControlPlacement, PanelElementBinding, PanelElementPhysicalPlacement, PanelElementPlacement, PanelFace, PanelFaceGeometry, PanelGridIndexing, PanelGridLayout, PanelGridPosition, PanelPlacementMetadata, PanelRowOrder, ParsedQuantity, PhysicalProfileBase, PhysicalProfileIdentity, Point, ProfileResponseRef, PropertyObject, PropertyValue, Rotation, SimulationProfile, SimulationProfileCatalog, SpeakerDriverGeometry, SpeakerDriverProfile, SpeakerDriverSmallSignal, Terminal, VdspBuildDataObject, VdspBuildDataScalar, VdspBuildDataValue, Warning, Wire, } from "./model/types";
|
|
36
|
+
export type { BoardApplicability, BoardEdgeTerminal, BoardFamily, BoardFootprint, BoardFootprintCatalog, BoardFootprintPlacement, BoardHole, BoardKind, BoardNet, BoardNetlist, BoardNetMember, BoardNetRef, BoardPlacedPad, BoardRealization, BoardReview, BoardRoute, BoardSourceCircuitHash, BoardSubtype, BuildBom, BuildBomItem, BuildBomRef, BuildBomRefKind, BuildCompleteness, BuildIntent, BuildPartProfile, BuildPartProfileCatalog, BuildScope, CabinetDimensionsM, CabinetDriverLoadout, CabinetEnclosure, CabinetEnclosureProfile, CabinetEnclosureType, CabinetPort, CanonicalCircuitNetRef, CircuitDocument, CircuitDocumentBehaviorFirmwareArtifactType, CircuitDocumentBehaviorFirmwareOwner, CircuitDocumentBehaviorFirmwareRef, CircuitDocumentBehaviorFirmwareSourceVisibility, CircuitDocumentBehaviorFirmwareStatus, CircuitDocumentBehaviorRole, CircuitDocumentBehaviorRoleKind, CircuitDocumentDevice, CircuitDocumentDeviceKind, CircuitPower, CircuitPowerCoverage, CircuitPowerDomain, CircuitPowerGroundPolarity, CircuitPowerRailBinding, CircuitPowerRailDerivation, CircuitPowerRailRole, CircuitPowerSourceKind, Component, ComponentDevice, ComponentKind, ComponentTerminalRef, ControlApplicabilityPredicate, ControlContext, ControlGroup, ControlGroupMember, ControlInterface, ControlInterfaceAssignmentHint, ControlInterfaceBinding, ControlInterfaceConnector, ControlInterfacePolarity, ControlInterfaceRole, ControlOutput, ControlOutputSwitchMode, DeviceInterface, DeviceInterfaceAudioBinding, DeviceInterfaceBinding, DeviceInterfaceControl, DeviceInterfaceControlKind, DocumentAmpAppearance, DocumentAppearance, DocumentAppearanceLabel, DocumentAppearanceMaterial, DocumentMetadata, DocumentSource, DocumentStompboxAppearance, KnownPhysicalProfile, MechanicalBuildMetadata, MicrophoneAcousticCoupling, MicrophoneElectrical, MicrophoneTransducer, MicrophoneTransducerPrinciple, MicrophoneTransducerProfile, MillimeterRect, OffBoardSignalRef, OffBoardWireAttributes, OffBoardWiringConnection, OffBoardWiringCoverage, OffBoardWiringEndpoint, OffBoardWiringEndpointKind, OffBoardWiringHarness, OffBoardWiringHarnessStatus, OffBoardWiringPlan, PanelColumnOrder, PanelControlKind, PanelControlPlacement, PanelElementBinding, PanelElementPhysicalPlacement, PanelElementPlacement, PanelFace, PanelFaceGeometry, PanelGridIndexing, PanelGridLayout, PanelGridPosition, PanelPlacementMetadata, PanelRowOrder, ParsedQuantity, PhysicalProfileBase, PhysicalProfileIdentity, Point, ProfileResponseRef, PropertyObject, PropertyValue, Rotation, SimulationProfile, SimulationProfileCatalog, SpeakerDriverGeometry, SpeakerDriverProfile, SpeakerDriverSmallSignal, Terminal, VdspBuildDataObject, VdspBuildDataScalar, VdspBuildDataValue, Warning, Wire, } from "./model/types";
|
|
33
37
|
export { EMPTY_DOCUMENT } from "./model/types";
|
|
34
38
|
export type { ControlRole, DocumentValidationContext, DocumentValidationRule, PropertyRule, QuantityRule, StringRule, ValidateDocumentOptions, ValidateSourceRuntimeBoundaryOptions, ValidationCode, ValidationIssue, ValidationSeverity, } from "./model/validation";
|
|
35
39
|
export { CONTROL_ROLE_VALUES, createSourceRuntimeBoundaryRule, getRulesForKind, hasErrors, validateComponent, validateDocument, validateSourceRuntimeBoundary, } from "./model/validation";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,YAAY,EACX,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,UAAU,CAAC;AAClB,YAAY,EACX,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,gCAAgC,EAChC,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,+BAA+B,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,GAC3B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACX,mCAAmC,EACnC,mCAAmC,EACnC,mCAAmC,EACnC,yBAAyB,EACzB,aAAa,EACb,iCAAiC,EACjC,2CAA2C,EAC3C,+BAA+B,EAC/B,2BAA2B,EAC3B,mCAAmC,EACnC,mCAAmC,EACnC,wCAAwC,EACxC,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,oCAAoC,EACpC,4B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C;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACN,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACN,YAAY,EACZ,eAAe,EACf,sBAAsB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACxE,YAAY,EACX,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export const VERSION = "0.6.
|
|
1
|
+
export const VERSION = "0.6.31";
|
|
2
2
|
export { applyDocumentCommand, applyEditorCommand, buildComponent, canRedo, canUndo, createEditorState, resetEditorState, tidyDocumentLayout, } from "./editor/index.js";
|
|
3
3
|
export { parseCircuitJsonDocument, serializeCircuitJsonDocument, validateCircuitJsonDocument, } from "./formats/circuit-json/serializer.js";
|
|
4
4
|
export { convertCircuitDocumentFile, convertCircuitDocumentFileWithReport, detectCircuitDocumentFileFormat, detectCircuitFormat, isVdspFilename, parseCircuitDocument, parseCircuitDocumentFile, parseVdspCircuitDocument, parseVdspCircuitDocumentWithTopology, serializeCircuitDocumentFile, serializeVdspCircuitDocument, validateVdspCircuitDocumentSchema, vdspFileExtension, vdspFilenameFromName, } from "./formats/document.js";
|
|
5
5
|
export { INTERCHANGE_CONTRACT_VERSION } from "./formats/interchange/contract.js";
|
|
6
6
|
export { AMBIGUOUS_POTENTIOMETER_END_TOKENS, POTENTIOMETER_TERMINAL_ROLE_ALIASES, POTENTIOMETER_TERMINAL_ROLES, classifyPotentiometerTerminalRole, resolveDocumentPotentiometerTerminalRoles, resolvePotentiometerTerminalRoles, } from "./model/terminal-roles.js";
|
|
7
|
+
export { POTENTIOMETER_TAPERS, SUPERSEDED_TAPER_PROPERTY_KEYS, TAPER_PROPERTY_KEY, classifyTaper, collectTaperIssues, } from "./model/taper.js";
|
|
8
|
+
export { componentDevices, deviceTerminalRoles, validateComponentDevices, } from "./model/devices.js";
|
|
7
9
|
export { AMBIGUOUS_DEVICE_TERMINAL_TOKENS, DEVICE_TERMINAL_ROLES, TERMINAL_ROLES_BY_KIND, collectTerminalRoleWarnings, isLegalTerminalRole, terminalRolesFor, SUFFIXABLE_DEVICE_TERMINAL_ROLES, classifyDeviceTerminalRole, isRoledDeviceKind, resolveComponentTerminalRoles, } from "./model/device-terminal-roles.js";
|
|
8
10
|
export { parseInterchangeYaml, parseInterchangeYamlWithTopology, } from "./formats/interchange/parser.js";
|
|
9
11
|
export { serializeInterchangeYaml } from "./formats/interchange/serializer.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{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AE1C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAexE,OAAO,EACN,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Component, ComponentKind } from "./types";
|
|
2
|
+
/** A device with its defaults resolved: `kind` filled in, terminals as declared. */
|
|
3
|
+
export type ResolvedComponentDevice = Readonly<{
|
|
4
|
+
id: string;
|
|
5
|
+
kind: ComponentKind;
|
|
6
|
+
/** Terminal names, in declaration order. Order carries no meaning; a law binds by role. */
|
|
7
|
+
terminals: readonly string[];
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Every device in a component, with defaults resolved.
|
|
11
|
+
*
|
|
12
|
+
* A component that declares no `devices` yields exactly one, whose id is the component's own,
|
|
13
|
+
* whose kind is the component's, and which uses every terminal. That is the overwhelming majority
|
|
14
|
+
* of components, and it is a default rather than a special case: a caller never branches on
|
|
15
|
+
* whether the list was written down.
|
|
16
|
+
*/
|
|
17
|
+
export declare function componentDevices(component: Component): readonly ResolvedComponentDevice[];
|
|
18
|
+
/**
|
|
19
|
+
* The role each of a device's terminals declares, keyed by terminal name.
|
|
20
|
+
*
|
|
21
|
+
* This is the binding a device law reads. Scoped to one device on purpose: a dual op-amp declares
|
|
22
|
+
* two of every signal role across its package, and only inside a device is the read unambiguous.
|
|
23
|
+
* A terminal the device names but the component does not declare, or one carrying no role, is
|
|
24
|
+
* absent from the map rather than guessed at -- `validateComponentDevices` is what reports it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function deviceTerminalRoles(component: Component, device: ResolvedComponentDevice): ReadonlyMap<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* One problem with a declared device list.
|
|
29
|
+
*
|
|
30
|
+
* `error` is a malformed declaration -- it refers to a terminal that does not exist, names a
|
|
31
|
+
* device twice, or claims a role the device's kind cannot carry. `warning` is a well-formed
|
|
32
|
+
* declaration that may still be incomplete: a terminal belonging to no device is either
|
|
33
|
+
* decorative or an omission, and the document cannot tell core which.
|
|
34
|
+
*/
|
|
35
|
+
export type DeviceValidationIssue = Readonly<{
|
|
36
|
+
code: string;
|
|
37
|
+
severity: "error" | "warning";
|
|
38
|
+
message: string;
|
|
39
|
+
componentId: string;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a declared device list is well-formed.
|
|
43
|
+
*
|
|
44
|
+
* **Errors are the document's; the sufficiency of a device's roles is not checked here.** How
|
|
45
|
+
* many plates a rectifier law needs, or whether an op-amp may run without its supplies declared,
|
|
46
|
+
* is the consuming law's question, and encoding one law's expectations in the format would make
|
|
47
|
+
* the format wrong for the next law. What this checks is that the declaration refers to things
|
|
48
|
+
* that exist, does not name the same device twice, and does not claim a role the kind cannot
|
|
49
|
+
* carry.
|
|
50
|
+
*
|
|
51
|
+
* A terminal in no device is a **warning**: it is either decorative (a shield, an unwired lug) or
|
|
52
|
+
* an omission, and the document cannot tell core which.
|
|
53
|
+
*/
|
|
54
|
+
export declare function validateComponentDevices(component: Component): readonly DeviceValidationIssue[];
|
|
55
|
+
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/model/devices.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExD,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,2FAA2F;IAC3F,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,GAClB,SAAS,uBAAuB,EAAE,CAgBpC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,uBAAuB,GAC7B,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAY7B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACvC,SAAS,EAAE,SAAS,GAClB,SAAS,qBAAqB,EAAE,CAgFlC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Reading a component's devices, and validating a declared device list.
|
|
2
|
+
//
|
|
3
|
+
// A component models a schematic symbol -- a package -- and a package may hold several devices.
|
|
4
|
+
// `Component.devices` states the split; omitting it means the component is one device. Every
|
|
5
|
+
// consumer should read through `componentDevices()` so the two shapes are one shape, because the
|
|
6
|
+
// alternative is what this construct exists to end: each consumer reconstructing the split from
|
|
7
|
+
// terminal names.
|
|
8
|
+
//
|
|
9
|
+
// See `docs/device-construct-design.md`.
|
|
10
|
+
import { isLegalTerminalRole, terminalRolesFor } from "./device-terminal-roles.js";
|
|
11
|
+
/**
|
|
12
|
+
* Every device in a component, with defaults resolved.
|
|
13
|
+
*
|
|
14
|
+
* A component that declares no `devices` yields exactly one, whose id is the component's own,
|
|
15
|
+
* whose kind is the component's, and which uses every terminal. That is the overwhelming majority
|
|
16
|
+
* of components, and it is a default rather than a special case: a caller never branches on
|
|
17
|
+
* whether the list was written down.
|
|
18
|
+
*/
|
|
19
|
+
export function componentDevices(component) {
|
|
20
|
+
const declared = component.devices;
|
|
21
|
+
if (declared === undefined || declared.length === 0) {
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
id: component.id,
|
|
25
|
+
kind: component.kind,
|
|
26
|
+
terminals: component.terminals.map((terminal) => terminal.name),
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
return declared.map((device) => ({
|
|
31
|
+
id: device.id,
|
|
32
|
+
kind: device.kind ?? component.kind,
|
|
33
|
+
terminals: device.terminals,
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The role each of a device's terminals declares, keyed by terminal name.
|
|
38
|
+
*
|
|
39
|
+
* This is the binding a device law reads. Scoped to one device on purpose: a dual op-amp declares
|
|
40
|
+
* two of every signal role across its package, and only inside a device is the read unambiguous.
|
|
41
|
+
* A terminal the device names but the component does not declare, or one carrying no role, is
|
|
42
|
+
* absent from the map rather than guessed at -- `validateComponentDevices` is what reports it.
|
|
43
|
+
*/
|
|
44
|
+
export function deviceTerminalRoles(component, device) {
|
|
45
|
+
const byName = new Map(component.terminals.map((terminal) => [terminal.name, terminal]));
|
|
46
|
+
const roles = new Map();
|
|
47
|
+
for (const name of device.terminals) {
|
|
48
|
+
const role = byName.get(name)?.role;
|
|
49
|
+
if (role !== undefined) {
|
|
50
|
+
roles.set(name, role);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return roles;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether a declared device list is well-formed.
|
|
57
|
+
*
|
|
58
|
+
* **Errors are the document's; the sufficiency of a device's roles is not checked here.** How
|
|
59
|
+
* many plates a rectifier law needs, or whether an op-amp may run without its supplies declared,
|
|
60
|
+
* is the consuming law's question, and encoding one law's expectations in the format would make
|
|
61
|
+
* the format wrong for the next law. What this checks is that the declaration refers to things
|
|
62
|
+
* that exist, does not name the same device twice, and does not claim a role the kind cannot
|
|
63
|
+
* carry.
|
|
64
|
+
*
|
|
65
|
+
* A terminal in no device is a **warning**: it is either decorative (a shield, an unwired lug) or
|
|
66
|
+
* an omission, and the document cannot tell core which.
|
|
67
|
+
*/
|
|
68
|
+
export function validateComponentDevices(component) {
|
|
69
|
+
const warnings = [];
|
|
70
|
+
const declaredNames = new Set(component.terminals.map((terminal) => terminal.name));
|
|
71
|
+
const seenDeviceIds = new Set();
|
|
72
|
+
const claimed = new Set();
|
|
73
|
+
for (const device of component.devices ?? []) {
|
|
74
|
+
if (seenDeviceIds.has(device.id)) {
|
|
75
|
+
warnings.push({
|
|
76
|
+
code: "component-device-id-duplicate",
|
|
77
|
+
severity: "error",
|
|
78
|
+
message: `device "${device.id}" is declared more than once`,
|
|
79
|
+
componentId: component.id,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
seenDeviceIds.add(device.id);
|
|
83
|
+
if (device.terminals.length === 0) {
|
|
84
|
+
warnings.push({
|
|
85
|
+
code: "component-device-empty",
|
|
86
|
+
severity: "error",
|
|
87
|
+
message: `device "${device.id}" names no terminals`,
|
|
88
|
+
componentId: component.id,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const kind = device.kind ?? component.kind;
|
|
92
|
+
const seenInDevice = new Set();
|
|
93
|
+
for (const name of device.terminals) {
|
|
94
|
+
if (!declaredNames.has(name)) {
|
|
95
|
+
warnings.push({
|
|
96
|
+
code: "component-device-terminal-unknown",
|
|
97
|
+
severity: "error",
|
|
98
|
+
message: `device "${device.id}" names terminal "${name}", which this component does not declare`,
|
|
99
|
+
componentId: component.id,
|
|
100
|
+
});
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (seenInDevice.has(name)) {
|
|
104
|
+
warnings.push({
|
|
105
|
+
code: "component-device-terminal-repeated",
|
|
106
|
+
severity: "error",
|
|
107
|
+
message: `device "${device.id}" names terminal "${name}" twice`,
|
|
108
|
+
componentId: component.id,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
seenInDevice.add(name);
|
|
112
|
+
claimed.add(name);
|
|
113
|
+
// A role legal for the package may be illegal for a device of a different kind --
|
|
114
|
+
// an optocoupler's `led` device cannot carry a `wiper`.
|
|
115
|
+
const role = component.terminals.find((terminal) => terminal.name === name)?.role;
|
|
116
|
+
if (role !== undefined && !isLegalTerminalRole(kind, role)) {
|
|
117
|
+
warnings.push({
|
|
118
|
+
code: "component-device-role-illegal",
|
|
119
|
+
severity: "error",
|
|
120
|
+
message: `device "${device.id}" is a ${kind} and uses terminal "${name}", whose role "${role}" a ${kind} cannot carry; legal roles: ${terminalRolesFor(kind).join(", ") || "(none)"}`,
|
|
121
|
+
componentId: component.id,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if ((component.devices ?? []).length > 0) {
|
|
127
|
+
for (const name of declaredNames) {
|
|
128
|
+
if (!claimed.has(name)) {
|
|
129
|
+
warnings.push({
|
|
130
|
+
code: "component-device-terminal-orphaned",
|
|
131
|
+
severity: "warning",
|
|
132
|
+
message: `terminal "${name}" belongs to no device, so nothing executes it`,
|
|
133
|
+
componentId: component.id,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return warnings;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/model/devices.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,iGAAiG;AACjG,gGAAgG;AAChG,kBAAkB;AAClB,EAAE;AACF,yCAAyC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAWhF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC/B,SAAoB;IAEpB,MAAM,QAAQ,GAAG,SAAS,CAAC,OA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I,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,oCAAoC;oBAC1C,QAAQ,EAAE,SAAS;oBACnB,OAAO,EAAE,aAAa,IAAI,gDAAgD;oBAC1E,WAAW,EAAE,SAAS,CAAC,EAAE;iBACzB,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Component } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* The resistance laws a potentiometer track may follow.
|
|
4
|
+
*
|
|
5
|
+
* **Spellings are taken from `KnobTaper` in `panel/types.ts`, which shipped first.** That enum is
|
|
6
|
+
* published API with consumers in `control-ui` and panel extraction, and it already names three
|
|
7
|
+
* of these laws `linear`, `log` and `reverse-log`. Defining a second spelling for the same fact
|
|
8
|
+
* here -- `logarithmic` was the first draft -- would have created exactly the two-vocabularies
|
|
9
|
+
* drift this work exists to remove, inside the same package. The corpus writes `Logarithmic`, so
|
|
10
|
+
* it is the corpus that backfills; a published enum with consumers is the stronger constraint.
|
|
11
|
+
*
|
|
12
|
+
* `log` is the law audio parts also print as "audio", and `reverse-log` the one printed as
|
|
13
|
+
* "reverse audio", "anti-log" or "negative log". Those are synonyms rather than spellings, so
|
|
14
|
+
* they are not accepted: a document naming one is a document to correct.
|
|
15
|
+
*
|
|
16
|
+
* `custom` is a real, distinct curve with no published form -- a wah's Hot Potz, a Boss G or W
|
|
17
|
+
* taper. It says "there is a law here and it is none of the above", which is true where
|
|
18
|
+
* inventing `log` would not be.
|
|
19
|
+
*
|
|
20
|
+
* **`unknown` is deliberately absent**, though `KnobTaper` carries it. A panel knob's `taper` is
|
|
21
|
+
* a required field, so that model needs a value for "not stated"; a component property can simply
|
|
22
|
+
* be omitted, and absence is the honest way to say the source did not mark the pot.
|
|
23
|
+
*/
|
|
24
|
+
export type PotentiometerTaper = "linear" | "log" | "reverse-log" | "reverse-linear" | "s-curve" | "stepped" | "custom";
|
|
25
|
+
export declare const POTENTIOMETER_TAPERS: readonly PotentiometerTaper[];
|
|
26
|
+
/** The canonical property key. `Sweep` states the same fact and is superseded. */
|
|
27
|
+
export declare const TAPER_PROPERTY_KEY = "Taper";
|
|
28
|
+
/** Superseded keys that state the same fact as {@link TAPER_PROPERTY_KEY}. */
|
|
29
|
+
export declare const SUPERSEDED_TAPER_PROPERTY_KEYS: readonly string[];
|
|
30
|
+
export type TaperVerdict = {
|
|
31
|
+
readonly status: "canonical";
|
|
32
|
+
readonly taper: PotentiometerTaper;
|
|
33
|
+
}
|
|
34
|
+
/** The value states that no taper is known. Fix: omit the property. */
|
|
35
|
+
| {
|
|
36
|
+
readonly status: "absence";
|
|
37
|
+
}
|
|
38
|
+
/** The value names a package or a range, not a law. */
|
|
39
|
+
| {
|
|
40
|
+
readonly status: "not-a-law";
|
|
41
|
+
}
|
|
42
|
+
/** Anything else, including manufacturer letter codes. */
|
|
43
|
+
| {
|
|
44
|
+
readonly status: "unrecognized";
|
|
45
|
+
};
|
|
46
|
+
/** Classify one declared taper value. */
|
|
47
|
+
export declare function classifyTaper(value: string): TaperVerdict;
|
|
48
|
+
export type TaperIssue = Readonly<{
|
|
49
|
+
code: string;
|
|
50
|
+
severity: "error" | "warning";
|
|
51
|
+
message: string;
|
|
52
|
+
componentId: string;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Report a component's taper declaration against the vocabulary.
|
|
56
|
+
*
|
|
57
|
+
* Every verdict is a **warning**, not an error, for the reason the terminal-role work settled: a
|
|
58
|
+
* required vocabulary that refused every document written before it existed would refuse the whole
|
|
59
|
+
* corpus. The counts are the backfill's remaining work, and each message says what the fix is,
|
|
60
|
+
* because "unrecognized" alone does not distinguish a letter code from a provenance note from a
|
|
61
|
+
* package name.
|
|
62
|
+
*/
|
|
63
|
+
export declare function collectTaperIssues(component: Component): readonly TaperIssue[];
|
|
64
|
+
//# sourceMappingURL=taper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taper.d.ts","sourceRoot":"","sources":["../../src/model/taper.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,kBAAkB,GAC3B,QAAQ,GACR,KAAK,GACL,aAAa,GACb,gBAAgB,GAChB,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;AAEZ,eAAO,MAAM,oBAAoB,EAAE,SAAS,kBAAkB,EAQ7D,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,8EAA8E;AAC9E,eAAO,MAAM,8BAA8B,EAAE,SAAS,MAAM,EAAc,CAAC;AAuB3E,MAAM,MAAM,YAAY,GACrB;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE;AACtE,uEAAuE;GACrE;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE;AAChC,uDAAuD;GACrD;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE;AAClC,0DAA0D;GACxD;IAAE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC;AAevC,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAQzD;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAQH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,SAAS,GAClB,SAAS,UAAU,EAAE,CAyDvB"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// A potentiometer's taper: the resistance law along its track, and the values that state it.
|
|
2
|
+
//
|
|
3
|
+
// **Why this needs a vocabulary.** Taper is audible -- it is how a knob's travel maps to its
|
|
4
|
+
// effect -- and the corpus states it three incompatible ways across *two* keys. Measured over 142
|
|
5
|
+
// documents and 609 potentiometers:
|
|
6
|
+
//
|
|
7
|
+
// `Taper` 264 declarations, 30 distinct values
|
|
8
|
+
// `Sweep` 397 declarations, 16 distinct values
|
|
9
|
+
// both on the same component: 57
|
|
10
|
+
//
|
|
11
|
+
// Those 57 are the proof that the two keys are one fact: `Taper: B` sits beside `Sweep: Linear`
|
|
12
|
+
// 26 times, `Taper: A` beside `Sweep: Logarithmic` 8 times, `Taper: C` beside
|
|
13
|
+
// `Sweep: ReverseLogarithmic` or `ReverseAudio` 7 times. One is the manufacturer's letter code,
|
|
14
|
+
// the other the law's English name. **`Taper` is the canonical key and `Sweep` is superseded.**
|
|
15
|
+
//
|
|
16
|
+
// **The canonical values are the law, not the notation, and letter codes are deliberately not
|
|
17
|
+
// accepted.** `A`, `B` and `C` are manufacturer markings whose meaning is a convention rather
|
|
18
|
+
// than a definition -- the mapping above is the Japanese/Alps convention this corpus happens to
|
|
19
|
+
// use, and it is not universal. Reading a printed marking as a law would be exactly the inference
|
|
20
|
+
// this format is removing elsewhere. The marking is source provenance and belongs in a source
|
|
21
|
+
// property beside the rest of what the part is printed with; the law goes here.
|
|
22
|
+
//
|
|
23
|
+
// **Three classes of existing value are not tapers at all**, and `classifyTaper` reports them
|
|
24
|
+
// separately because the fix differs:
|
|
25
|
+
//
|
|
26
|
+
// provenance `source-unmarked`, `Unknown`, `not-visible`, `source-unspecified` -- these say
|
|
27
|
+
// the source did not state a taper. The fix is to omit the property, not to
|
|
28
|
+
// invent a value for absence.
|
|
29
|
+
// form factor `trim`/`Trim` -- a trimmer is a physical package, not a resistance law. A trim
|
|
30
|
+
// pot still has a taper, usually linear, and this value states neither.
|
|
31
|
+
// range `0..1` -- a travel range, not a law.
|
|
32
|
+
import { normalizeToken } from "./tokens.js";
|
|
33
|
+
export const POTENTIOMETER_TAPERS = [
|
|
34
|
+
"linear",
|
|
35
|
+
"log",
|
|
36
|
+
"reverse-log",
|
|
37
|
+
"reverse-linear",
|
|
38
|
+
"s-curve",
|
|
39
|
+
"stepped",
|
|
40
|
+
"custom",
|
|
41
|
+
];
|
|
42
|
+
/** The canonical property key. `Sweep` states the same fact and is superseded. */
|
|
43
|
+
export const TAPER_PROPERTY_KEY = "Taper";
|
|
44
|
+
/** Superseded keys that state the same fact as {@link TAPER_PROPERTY_KEY}. */
|
|
45
|
+
export const SUPERSEDED_TAPER_PROPERTY_KEYS = ["Sweep"];
|
|
46
|
+
/**
|
|
47
|
+
* Values that state the *absence* of a taper rather than a taper.
|
|
48
|
+
*
|
|
49
|
+
* A source that does not mark its pots is a real and common situation, and the honest declaration
|
|
50
|
+
* is no `Taper` property at all. A magic value for absence is worse than absence: a consumer must
|
|
51
|
+
* then know that `Unknown` is not a law, which is the kind of tribal knowledge a typed vocabulary
|
|
52
|
+
* exists to remove.
|
|
53
|
+
*/
|
|
54
|
+
const ABSENCE_VALUES = new Set([
|
|
55
|
+
"unknown",
|
|
56
|
+
"source-unmarked",
|
|
57
|
+
"source-marked",
|
|
58
|
+
"source-unspecified",
|
|
59
|
+
"not-visible",
|
|
60
|
+
"unspecified",
|
|
61
|
+
"none",
|
|
62
|
+
]);
|
|
63
|
+
/** Values naming a physical package or a travel range rather than a resistance law. */
|
|
64
|
+
const NOT_A_LAW_VALUES = new Set(["trim", "0..1"]);
|
|
65
|
+
/**
|
|
66
|
+
* Normalize a declared taper to the canonical token shape.
|
|
67
|
+
*
|
|
68
|
+
* Beyond `normalizeToken`'s case and separator folding, a word boundary written as CamelCase is
|
|
69
|
+
* split: `ReverseLogarithmic` and `reverse-logarithmic` are the same word sequence joined two
|
|
70
|
+
* ways, so accepting both is normalization rather than aliasing. What is *not* normalized is a
|
|
71
|
+
* synonym -- `Audio` names the same law as `logarithmic` under a different word, and accepting it
|
|
72
|
+
* would be the accommodation this vocabulary exists to avoid.
|
|
73
|
+
*/
|
|
74
|
+
function normalizeTaperToken(value) {
|
|
75
|
+
return normalizeToken(value.replace(/([a-z0-9])([A-Z])/g, "$1-$2"));
|
|
76
|
+
}
|
|
77
|
+
/** Classify one declared taper value. */
|
|
78
|
+
export function classifyTaper(value) {
|
|
79
|
+
const token = normalizeTaperToken(value);
|
|
80
|
+
if (POTENTIOMETER_TAPERS.includes(token)) {
|
|
81
|
+
return { status: "canonical", taper: token };
|
|
82
|
+
}
|
|
83
|
+
if (ABSENCE_VALUES.has(token))
|
|
84
|
+
return { status: "absence" };
|
|
85
|
+
if (NOT_A_LAW_VALUES.has(token))
|
|
86
|
+
return { status: "not-a-law" };
|
|
87
|
+
return { status: "unrecognized" };
|
|
88
|
+
}
|
|
89
|
+
const TAPER_BEARING_KINDS = new Set([
|
|
90
|
+
"potentiometer",
|
|
91
|
+
"variable-resistor",
|
|
92
|
+
"rheostat",
|
|
93
|
+
]);
|
|
94
|
+
/**
|
|
95
|
+
* Report a component's taper declaration against the vocabulary.
|
|
96
|
+
*
|
|
97
|
+
* Every verdict is a **warning**, not an error, for the reason the terminal-role work settled: a
|
|
98
|
+
* required vocabulary that refused every document written before it existed would refuse the whole
|
|
99
|
+
* corpus. The counts are the backfill's remaining work, and each message says what the fix is,
|
|
100
|
+
* because "unrecognized" alone does not distinguish a letter code from a provenance note from a
|
|
101
|
+
* package name.
|
|
102
|
+
*/
|
|
103
|
+
export function collectTaperIssues(component) {
|
|
104
|
+
if (!TAPER_BEARING_KINDS.has(component.kind))
|
|
105
|
+
return [];
|
|
106
|
+
const issues = [];
|
|
107
|
+
const properties = component.properties;
|
|
108
|
+
for (const key of SUPERSEDED_TAPER_PROPERTY_KEYS) {
|
|
109
|
+
if (properties[key] !== undefined) {
|
|
110
|
+
issues.push({
|
|
111
|
+
code: "taper-property-superseded",
|
|
112
|
+
severity: "warning",
|
|
113
|
+
message: `property "${key}" states the same fact as "${TAPER_PROPERTY_KEY}"; declare the taper law under "${TAPER_PROPERTY_KEY}" only`,
|
|
114
|
+
componentId: component.id,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const declared = properties[TAPER_PROPERTY_KEY];
|
|
119
|
+
if (declared === undefined)
|
|
120
|
+
return issues;
|
|
121
|
+
if (typeof declared !== "string") {
|
|
122
|
+
issues.push({
|
|
123
|
+
code: "taper-not-a-string",
|
|
124
|
+
severity: "warning",
|
|
125
|
+
message: `property "${TAPER_PROPERTY_KEY}" must be one of: ${POTENTIOMETER_TAPERS.join(", ")}`,
|
|
126
|
+
componentId: component.id,
|
|
127
|
+
});
|
|
128
|
+
return issues;
|
|
129
|
+
}
|
|
130
|
+
const verdict = classifyTaper(declared);
|
|
131
|
+
switch (verdict.status) {
|
|
132
|
+
case "canonical":
|
|
133
|
+
return issues;
|
|
134
|
+
case "absence":
|
|
135
|
+
issues.push({
|
|
136
|
+
code: "taper-states-absence",
|
|
137
|
+
severity: "warning",
|
|
138
|
+
message: `"${declared}" says no taper is known rather than naming a law; omit the "${TAPER_PROPERTY_KEY}" property instead`,
|
|
139
|
+
componentId: component.id,
|
|
140
|
+
});
|
|
141
|
+
return issues;
|
|
142
|
+
case "not-a-law":
|
|
143
|
+
issues.push({
|
|
144
|
+
code: "taper-not-a-law",
|
|
145
|
+
severity: "warning",
|
|
146
|
+
message: `"${declared}" names a package or a travel range, not a resistance law; a trimmer still has a taper, and this states neither`,
|
|
147
|
+
componentId: component.id,
|
|
148
|
+
});
|
|
149
|
+
return issues;
|
|
150
|
+
default:
|
|
151
|
+
issues.push({
|
|
152
|
+
code: "taper-unrecognized",
|
|
153
|
+
severity: "warning",
|
|
154
|
+
message: `"${declared}" is not a taper law. A manufacturer letter code is a printed marking whose meaning is a convention, not a definition -- record it as source provenance and declare the law here, one of: ${POTENTIOMETER_TAPERS.join(", ")}`,
|
|
155
|
+
componentId: component.id,
|
|
156
|
+
});
|
|
157
|
+
return issues;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=taper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taper.js","sourceRoot":"","sources":["../../src/model/taper.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,EAAE;AACF,6FAA6F;AAC7F,kGAAkG;AAClG,oCAAoC;AACpC,EAAE;AACF,kDAAkD;AAClD,kDAAkD;AAClD,mCAAmC;AACnC,EAAE;AACF,gGAAgG;AAChG,8EAA8E;AAC9E,gGAAgG;AAChG,gGAAgG;AAChG,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,gGAAgG;AAChG,kGAAkG;AAClG,8FAA8F;AAC9F,gFAAgF;AAChF,EAAE;AACF,8FAA8F;AAC9F,sCAAsC;AACtC,EAAE;AACF,gGAAgG;AAChG,2FAA2F;AAC3F,6CAA6C;AAC7C,gGAAgG;AAChG,uFAAuF;AACvF,sDAAsD;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiC1C,MAAM,CAAC,MAAM,oBAAoB,GAAkC;IAClE,QAAQ;IACR,KAAK;IACL,aAAa;IACb,gBAAgB;IAChB,SAAS;IACT,SAAS;IACT,QAAQ;CACR,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAE1C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,8BAA8B,GAAsB,CAAC,OAAO,CAAC,CAAC;AAE3E;;;;;;;GAOG;AACH,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACnD,SAAS;IACT,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IAC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E;aACzB,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;QACf;YACC,MAAM,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,oBAAoB;gBAC1B,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,IAAI,QAAQ,6LAA6L,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACnP,WAAW,EAAE,SAAS,CAAC,EAAE;aACzB,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;IAChB,CAAC;AACF,CAAC"}
|
package/dist/model/types.d.ts
CHANGED
|
@@ -60,14 +60,58 @@ export type CircuitDocumentBehaviorRole = Readonly<{
|
|
|
60
60
|
kind: CircuitDocumentBehaviorRoleKind;
|
|
61
61
|
firmwareRef?: CircuitDocumentBehaviorFirmwareRef;
|
|
62
62
|
}>;
|
|
63
|
+
/**
|
|
64
|
+
* One device inside a component's package.
|
|
65
|
+
*
|
|
66
|
+
* A component models a schematic **symbol**, which may hold several devices: a dual rectifier is
|
|
67
|
+
* two diodes on one cathode, a dual op-amp two amplifiers on one supply pair, an optocoupler an
|
|
68
|
+
* LED beside a photoresistor. Consumers need the devices, and before this construct each one
|
|
69
|
+
* reconstructed the split by parsing terminal names.
|
|
70
|
+
*
|
|
71
|
+
* See `docs/device-construct-design.md` for the survey this is built from and for the two cases
|
|
72
|
+
* that are *not* uses of it: transformer windings and switch poles both group the terminals of a
|
|
73
|
+
* single device, which is the opposite claim.
|
|
74
|
+
*/
|
|
75
|
+
export type ComponentDevice = Readonly<{
|
|
76
|
+
/** Unique within its component. Addressable as `<componentId>.<deviceId>`. */
|
|
77
|
+
id: string;
|
|
78
|
+
/**
|
|
79
|
+
* This device's law. Omitted means the component's own `kind`, which is the common case; an
|
|
80
|
+
* optocoupler is why it can differ, holding an `led` and a `variable-resistor`.
|
|
81
|
+
*/
|
|
82
|
+
kind?: ComponentKind;
|
|
83
|
+
/**
|
|
84
|
+
* The component terminals this device uses, by `name`.
|
|
85
|
+
*
|
|
86
|
+
* By name rather than index or position: a name is already unique within its component -- the
|
|
87
|
+
* `nodes` ledger addresses pins as `<componentId>.<name>` and core refuses duplicates -- so a
|
|
88
|
+
* name is a sufficient reference, and stating membership here is what an index could not do.
|
|
89
|
+
*
|
|
90
|
+
* A terminal may appear in several devices. The shared cathode of a dual rectifier and the
|
|
91
|
+
* shared supplies of a dual op-amp are the ordinary case, not an exception.
|
|
92
|
+
*
|
|
93
|
+
* Order carries no meaning. A device binds by the `role` its terminals declare, and the
|
|
94
|
+
* ambiguity a role could not resolve existed only across the whole package.
|
|
95
|
+
*/
|
|
96
|
+
terminals: readonly string[];
|
|
97
|
+
}>;
|
|
63
98
|
export type Component = Readonly<{
|
|
64
99
|
id: string;
|
|
100
|
+
/** What this package primarily is, and the default `kind` of every device inside it. */
|
|
65
101
|
kind: ComponentKind;
|
|
66
102
|
name: string;
|
|
67
103
|
origin: Point;
|
|
68
104
|
rotation: Rotation;
|
|
69
105
|
flipped: boolean;
|
|
70
106
|
terminals: readonly Terminal[];
|
|
107
|
+
/**
|
|
108
|
+
* The devices this package contains.
|
|
109
|
+
*
|
|
110
|
+
* Omitted means exactly one device, of the component's `kind`, using all its terminals --
|
|
111
|
+
* which is what nearly every component is, and why declaring it is not required. Use
|
|
112
|
+
* `componentDevices()` to read either shape uniformly.
|
|
113
|
+
*/
|
|
114
|
+
devices?: readonly ComponentDevice[];
|
|
71
115
|
properties: Readonly<Record<string, PropertyValue>>;
|
|
72
116
|
sourceTypeName: string | null;
|
|
73
117
|
}>;
|