kicadts 0.0.34 → 0.0.36
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/index.d.ts +407 -19
- package/dist/index.js +1272 -180
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9006,6 +9006,7 @@ var SUPPORTED_SINGLE_TOKENS2 = /* @__PURE__ */ new Set([
|
|
|
9006
9006
|
"effects",
|
|
9007
9007
|
"tstamp",
|
|
9008
9008
|
"uuid",
|
|
9009
|
+
"locked",
|
|
9009
9010
|
"unlocked",
|
|
9010
9011
|
"hide"
|
|
9011
9012
|
]);
|
|
@@ -9016,6 +9017,7 @@ var FpText = class _FpText extends SxClass {
|
|
|
9016
9017
|
_type;
|
|
9017
9018
|
_text = "";
|
|
9018
9019
|
_sxPosition;
|
|
9020
|
+
_sxLocked;
|
|
9019
9021
|
_sxUnlocked;
|
|
9020
9022
|
_sxHide;
|
|
9021
9023
|
_sxLayer;
|
|
@@ -9027,6 +9029,7 @@ var FpText = class _FpText extends SxClass {
|
|
|
9027
9029
|
if (params.type !== void 0) this.type = params.type;
|
|
9028
9030
|
if (params.text !== void 0) this.text = params.text;
|
|
9029
9031
|
if (params.position !== void 0) this.position = params.position;
|
|
9032
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
9030
9033
|
if (params.unlocked !== void 0) this.unlocked = params.unlocked;
|
|
9031
9034
|
if (params.hidden !== void 0) this.hidden = params.hidden;
|
|
9032
9035
|
if (params.layer !== void 0) this.layer = params.layer;
|
|
@@ -9107,6 +9110,7 @@ var FpText = class _FpText extends SxClass {
|
|
|
9107
9110
|
fpText._sxEffects = propertyMap.effects;
|
|
9108
9111
|
fpText._sxTstamp = propertyMap.tstamp;
|
|
9109
9112
|
fpText._sxUuid = propertyMap.uuid;
|
|
9113
|
+
fpText._sxLocked = propertyMap.locked;
|
|
9110
9114
|
const unlockedEntry = propertyMap.unlocked;
|
|
9111
9115
|
const hideEntry = propertyMap.hide;
|
|
9112
9116
|
if (unlockedEntry && sawBareUnlocked) {
|
|
@@ -9155,6 +9159,12 @@ var FpText = class _FpText extends SxClass {
|
|
|
9155
9159
|
}
|
|
9156
9160
|
this._sxPosition = At.from(value);
|
|
9157
9161
|
}
|
|
9162
|
+
get locked() {
|
|
9163
|
+
return this._sxLocked?.value ?? false;
|
|
9164
|
+
}
|
|
9165
|
+
set locked(value) {
|
|
9166
|
+
this._sxLocked = value ? new FpTextLocked({ value: true }) : void 0;
|
|
9167
|
+
}
|
|
9158
9168
|
get unlocked() {
|
|
9159
9169
|
return this._sxUnlocked?.value ?? false;
|
|
9160
9170
|
}
|
|
@@ -9210,6 +9220,7 @@ var FpText = class _FpText extends SxClass {
|
|
|
9210
9220
|
}
|
|
9211
9221
|
getChildren() {
|
|
9212
9222
|
const children = [];
|
|
9223
|
+
if (this._sxLocked) children.push(this._sxLocked);
|
|
9213
9224
|
if (this._sxPosition) children.push(this._sxPosition);
|
|
9214
9225
|
if (this._sxUnlocked) children.push(this._sxUnlocked);
|
|
9215
9226
|
if (this._sxLayer) children.push(this._sxLayer);
|
|
@@ -9267,6 +9278,29 @@ var FpTextUnlocked = class _FpTextUnlocked extends SxClass {
|
|
|
9267
9278
|
}
|
|
9268
9279
|
};
|
|
9269
9280
|
SxClass.register(FpTextUnlocked);
|
|
9281
|
+
var FpTextLocked = class _FpTextLocked extends SxClass {
|
|
9282
|
+
static token = "locked";
|
|
9283
|
+
static parentToken = "fp_text";
|
|
9284
|
+
token = "locked";
|
|
9285
|
+
value;
|
|
9286
|
+
constructor(options = {}) {
|
|
9287
|
+
super();
|
|
9288
|
+
this.value = options.value ?? true;
|
|
9289
|
+
}
|
|
9290
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
9291
|
+
const [raw] = primitiveSexprs;
|
|
9292
|
+
const rawString = toStringValue(raw);
|
|
9293
|
+
const value = rawString === void 0 ? true : !/^(no|false)$/iu.test(rawString);
|
|
9294
|
+
return new _FpTextLocked({ value });
|
|
9295
|
+
}
|
|
9296
|
+
getChildren() {
|
|
9297
|
+
return [];
|
|
9298
|
+
}
|
|
9299
|
+
getString() {
|
|
9300
|
+
return `(locked ${this.value ? "yes" : "no"})`;
|
|
9301
|
+
}
|
|
9302
|
+
};
|
|
9303
|
+
SxClass.register(FpTextLocked);
|
|
9270
9304
|
var FpTextHide = class _FpTextHide extends SxClass {
|
|
9271
9305
|
static token = "hide";
|
|
9272
9306
|
static parentToken = "fp_text";
|
|
@@ -11129,6 +11163,7 @@ var FootprintModel = class _FootprintModel extends SxClass {
|
|
|
11129
11163
|
_offset;
|
|
11130
11164
|
_scale;
|
|
11131
11165
|
_rotate;
|
|
11166
|
+
_opacity;
|
|
11132
11167
|
_hide = false;
|
|
11133
11168
|
constructor(path) {
|
|
11134
11169
|
super();
|
|
@@ -11170,6 +11205,10 @@ var FootprintModel = class _FootprintModel extends SxClass {
|
|
|
11170
11205
|
model._rotate = parseVectorArgs(args, "rotate");
|
|
11171
11206
|
continue;
|
|
11172
11207
|
}
|
|
11208
|
+
if (token === "opacity") {
|
|
11209
|
+
model._opacity = parseOpacityArgs(args);
|
|
11210
|
+
continue;
|
|
11211
|
+
}
|
|
11173
11212
|
if (token === "hide") {
|
|
11174
11213
|
model._hide = parseHideArgs(args);
|
|
11175
11214
|
continue;
|
|
@@ -11202,6 +11241,12 @@ var FootprintModel = class _FootprintModel extends SxClass {
|
|
|
11202
11241
|
set rotate(value) {
|
|
11203
11242
|
this._rotate = value ? { ...value } : void 0;
|
|
11204
11243
|
}
|
|
11244
|
+
get opacity() {
|
|
11245
|
+
return this._opacity;
|
|
11246
|
+
}
|
|
11247
|
+
set opacity(value) {
|
|
11248
|
+
this._opacity = value;
|
|
11249
|
+
}
|
|
11205
11250
|
get hide() {
|
|
11206
11251
|
return this._hide;
|
|
11207
11252
|
}
|
|
@@ -11216,6 +11261,9 @@ var FootprintModel = class _FootprintModel extends SxClass {
|
|
|
11216
11261
|
if (this._hide) {
|
|
11217
11262
|
lines.push(" (hide yes)");
|
|
11218
11263
|
}
|
|
11264
|
+
if (this._opacity !== void 0) {
|
|
11265
|
+
lines.push(` (opacity ${this._opacity})`);
|
|
11266
|
+
}
|
|
11219
11267
|
if (this._offset) {
|
|
11220
11268
|
lines.push(renderVectorBlock("offset", this._offset));
|
|
11221
11269
|
}
|
|
@@ -11266,6 +11314,18 @@ function parseHideArgs(args) {
|
|
|
11266
11314
|
}
|
|
11267
11315
|
return parsed;
|
|
11268
11316
|
}
|
|
11317
|
+
function parseOpacityArgs(args) {
|
|
11318
|
+
if (args.length !== 1) {
|
|
11319
|
+
throw new Error("model opacity expects a single number");
|
|
11320
|
+
}
|
|
11321
|
+
const opacity = toNumberValue(args[0]);
|
|
11322
|
+
if (opacity === void 0) {
|
|
11323
|
+
throw new Error(
|
|
11324
|
+
`model opacity expects a number, received ${JSON.stringify(args[0])}`
|
|
11325
|
+
);
|
|
11326
|
+
}
|
|
11327
|
+
return opacity;
|
|
11328
|
+
}
|
|
11269
11329
|
|
|
11270
11330
|
// lib/sexpr/classes/EmbeddedFileChecksum.ts
|
|
11271
11331
|
var EmbeddedFileChecksum = class _EmbeddedFileChecksum extends SxClass {
|
|
@@ -11642,145 +11702,1103 @@ var FootprintPoint = class _FootprintPoint extends SxClass {
|
|
|
11642
11702
|
if (this._sxUuid) children.push(this._sxUuid);
|
|
11643
11703
|
return children;
|
|
11644
11704
|
}
|
|
11645
|
-
};
|
|
11646
|
-
SxClass.register(FootprintPoint);
|
|
11647
|
-
|
|
11648
|
-
// lib/sexpr/classes/FootprintUnitName.ts
|
|
11649
|
-
var FootprintUnitName = class _FootprintUnitName extends SxClass {
|
|
11650
|
-
static token = "name";
|
|
11651
|
-
static parentToken = "unit";
|
|
11652
|
-
token = "name";
|
|
11653
|
-
value;
|
|
11654
|
-
constructor(value) {
|
|
11655
|
-
super();
|
|
11656
|
-
this.value = value;
|
|
11705
|
+
};
|
|
11706
|
+
SxClass.register(FootprintPoint);
|
|
11707
|
+
|
|
11708
|
+
// lib/sexpr/classes/FootprintUnitName.ts
|
|
11709
|
+
var FootprintUnitName = class _FootprintUnitName extends SxClass {
|
|
11710
|
+
static token = "name";
|
|
11711
|
+
static parentToken = "unit";
|
|
11712
|
+
token = "name";
|
|
11713
|
+
value;
|
|
11714
|
+
constructor(value) {
|
|
11715
|
+
super();
|
|
11716
|
+
this.value = value;
|
|
11717
|
+
}
|
|
11718
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11719
|
+
const value = toStringValue(primitiveSexprs[0]);
|
|
11720
|
+
if (value === void 0) {
|
|
11721
|
+
throw new Error("footprint unit name expects a string value");
|
|
11722
|
+
}
|
|
11723
|
+
return new _FootprintUnitName(value);
|
|
11724
|
+
}
|
|
11725
|
+
getChildren() {
|
|
11726
|
+
return [];
|
|
11727
|
+
}
|
|
11728
|
+
getString() {
|
|
11729
|
+
return `(name ${quoteSExprString(this.value)})`;
|
|
11730
|
+
}
|
|
11731
|
+
};
|
|
11732
|
+
SxClass.register(FootprintUnitName);
|
|
11733
|
+
|
|
11734
|
+
// lib/sexpr/classes/FootprintUnitPins.ts
|
|
11735
|
+
var FootprintUnitPins = class _FootprintUnitPins extends SxClass {
|
|
11736
|
+
static token = "pins";
|
|
11737
|
+
static parentToken = "unit";
|
|
11738
|
+
token = "pins";
|
|
11739
|
+
values;
|
|
11740
|
+
constructor(values = []) {
|
|
11741
|
+
super();
|
|
11742
|
+
this.values = values;
|
|
11743
|
+
}
|
|
11744
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11745
|
+
const values = primitiveSexprs.map((primitive) => {
|
|
11746
|
+
const value = toStringValue(primitive);
|
|
11747
|
+
if (value === void 0) {
|
|
11748
|
+
throw new Error("footprint unit pins expects string values");
|
|
11749
|
+
}
|
|
11750
|
+
return value;
|
|
11751
|
+
});
|
|
11752
|
+
return new _FootprintUnitPins(values);
|
|
11753
|
+
}
|
|
11754
|
+
getChildren() {
|
|
11755
|
+
return [];
|
|
11756
|
+
}
|
|
11757
|
+
getString() {
|
|
11758
|
+
return `(pins ${this.values.map((value) => quoteSExprString(value)).join(" ")})`;
|
|
11759
|
+
}
|
|
11760
|
+
};
|
|
11761
|
+
SxClass.register(FootprintUnitPins);
|
|
11762
|
+
|
|
11763
|
+
// lib/sexpr/classes/FootprintUnit.ts
|
|
11764
|
+
var FootprintUnit = class _FootprintUnit extends SxClass {
|
|
11765
|
+
static token = "unit";
|
|
11766
|
+
static parentToken = "units";
|
|
11767
|
+
token = "unit";
|
|
11768
|
+
_sxName;
|
|
11769
|
+
_sxPins;
|
|
11770
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11771
|
+
const unit = new _FootprintUnit();
|
|
11772
|
+
const { propertyMap } = SxClass.parsePrimitivesToClassProperties(
|
|
11773
|
+
primitiveSexprs,
|
|
11774
|
+
this.token
|
|
11775
|
+
);
|
|
11776
|
+
unit._sxName = propertyMap.name;
|
|
11777
|
+
unit._sxPins = propertyMap.pins;
|
|
11778
|
+
return unit;
|
|
11779
|
+
}
|
|
11780
|
+
getChildren() {
|
|
11781
|
+
const children = [];
|
|
11782
|
+
if (this._sxName) children.push(this._sxName);
|
|
11783
|
+
if (this._sxPins) children.push(this._sxPins);
|
|
11784
|
+
return children;
|
|
11785
|
+
}
|
|
11786
|
+
};
|
|
11787
|
+
SxClass.register(FootprintUnit);
|
|
11788
|
+
|
|
11789
|
+
// lib/sexpr/classes/FootprintUnits.ts
|
|
11790
|
+
var FootprintUnits = class _FootprintUnits extends SxClass {
|
|
11791
|
+
static token = "units";
|
|
11792
|
+
static parentToken = "footprint";
|
|
11793
|
+
token = "units";
|
|
11794
|
+
_units = [];
|
|
11795
|
+
constructor(units = []) {
|
|
11796
|
+
super();
|
|
11797
|
+
this._units = units;
|
|
11798
|
+
}
|
|
11799
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11800
|
+
const { arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(
|
|
11801
|
+
primitiveSexprs,
|
|
11802
|
+
this.token
|
|
11803
|
+
);
|
|
11804
|
+
return new _FootprintUnits(arrayPropertyMap.unit ?? []);
|
|
11805
|
+
}
|
|
11806
|
+
getChildren() {
|
|
11807
|
+
return [...this._units];
|
|
11808
|
+
}
|
|
11809
|
+
};
|
|
11810
|
+
SxClass.register(FootprintUnits);
|
|
11811
|
+
|
|
11812
|
+
// lib/sexpr/classes/Layers.ts
|
|
11813
|
+
var Layers = class _Layers extends SxClass {
|
|
11814
|
+
static token = "layers";
|
|
11815
|
+
token = "layers";
|
|
11816
|
+
_names = [];
|
|
11817
|
+
constructor(names = []) {
|
|
11818
|
+
super();
|
|
11819
|
+
this.names = names;
|
|
11820
|
+
}
|
|
11821
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11822
|
+
const names = primitiveSexprs.map(
|
|
11823
|
+
(primitive) => typeof primitive === "string" || typeof primitive === "number" ? String(primitive) : printSExpr(primitive)
|
|
11824
|
+
);
|
|
11825
|
+
return new _Layers(names);
|
|
11826
|
+
}
|
|
11827
|
+
get names() {
|
|
11828
|
+
return [...this._names];
|
|
11829
|
+
}
|
|
11830
|
+
set names(values) {
|
|
11831
|
+
this._names = values.map((value) => String(value));
|
|
11832
|
+
}
|
|
11833
|
+
getString() {
|
|
11834
|
+
const rendered = this._names.map((name) => {
|
|
11835
|
+
if (/^[^\s()"]+$/u.test(name) && !["nil", "#t", "#f"].includes(name)) {
|
|
11836
|
+
return name;
|
|
11837
|
+
}
|
|
11838
|
+
return quoteSExprString(name);
|
|
11839
|
+
}).join(" ");
|
|
11840
|
+
return `(layers ${rendered})`;
|
|
11841
|
+
}
|
|
11842
|
+
};
|
|
11843
|
+
SxClass.register(Layers);
|
|
11844
|
+
|
|
11845
|
+
// lib/sexpr/classes/ZoneAttrTeardropType.ts
|
|
11846
|
+
var ZoneAttrTeardropType = class extends SxPrimitiveString {
|
|
11847
|
+
static token = "type";
|
|
11848
|
+
static parentToken = "teardrop";
|
|
11849
|
+
token = "type";
|
|
11850
|
+
};
|
|
11851
|
+
SxClass.register(ZoneAttrTeardropType);
|
|
11852
|
+
|
|
11853
|
+
// lib/sexpr/classes/ZoneAttrTeardrop.ts
|
|
11854
|
+
var ZoneAttrTeardrop = class _ZoneAttrTeardrop extends SxClass {
|
|
11855
|
+
static token = "teardrop";
|
|
11856
|
+
static parentToken = "attr";
|
|
11857
|
+
token = "teardrop";
|
|
11858
|
+
_sxType;
|
|
11859
|
+
constructor(type) {
|
|
11860
|
+
super();
|
|
11861
|
+
this.type = type;
|
|
11862
|
+
}
|
|
11863
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11864
|
+
const teardrop = new _ZoneAttrTeardrop();
|
|
11865
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
11866
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
11867
|
+
if (token !== "type") {
|
|
11868
|
+
throw new Error(
|
|
11869
|
+
`zone attr teardrop encountered unsupported child "${token}"`
|
|
11870
|
+
);
|
|
11871
|
+
}
|
|
11872
|
+
if (entries.length > 1) {
|
|
11873
|
+
throw new Error("zone attr teardrop does not support repeated type");
|
|
11874
|
+
}
|
|
11875
|
+
}
|
|
11876
|
+
teardrop._sxType = propertyMap.type;
|
|
11877
|
+
return teardrop;
|
|
11878
|
+
}
|
|
11879
|
+
get type() {
|
|
11880
|
+
return this._sxType?.value;
|
|
11881
|
+
}
|
|
11882
|
+
set type(value) {
|
|
11883
|
+
this._sxType = value === void 0 ? void 0 : value instanceof ZoneAttrTeardropType ? value : new ZoneAttrTeardropType(value);
|
|
11884
|
+
}
|
|
11885
|
+
getChildren() {
|
|
11886
|
+
return this._sxType ? [this._sxType] : [];
|
|
11887
|
+
}
|
|
11888
|
+
};
|
|
11889
|
+
SxClass.register(ZoneAttrTeardrop);
|
|
11890
|
+
|
|
11891
|
+
// lib/sexpr/classes/ZoneAttr.ts
|
|
11892
|
+
var ZoneAttr = class _ZoneAttr extends SxClass {
|
|
11893
|
+
static token = "attr";
|
|
11894
|
+
static parentToken = "zone";
|
|
11895
|
+
token = "attr";
|
|
11896
|
+
_sxTeardrop;
|
|
11897
|
+
constructor(params = {}) {
|
|
11898
|
+
super();
|
|
11899
|
+
if (params.teardrop !== void 0) this.teardrop = params.teardrop;
|
|
11900
|
+
}
|
|
11901
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11902
|
+
const attr = new _ZoneAttr();
|
|
11903
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
11904
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
11905
|
+
if (token !== "teardrop") {
|
|
11906
|
+
throw new Error(`zone attr encountered unsupported child "${token}"`);
|
|
11907
|
+
}
|
|
11908
|
+
if (entries.length > 1) {
|
|
11909
|
+
throw new Error("zone attr does not support repeated teardrop children");
|
|
11910
|
+
}
|
|
11911
|
+
}
|
|
11912
|
+
attr._sxTeardrop = propertyMap.teardrop;
|
|
11913
|
+
return attr;
|
|
11914
|
+
}
|
|
11915
|
+
get teardrop() {
|
|
11916
|
+
return this._sxTeardrop;
|
|
11917
|
+
}
|
|
11918
|
+
set teardrop(value) {
|
|
11919
|
+
this._sxTeardrop = value;
|
|
11920
|
+
}
|
|
11921
|
+
getChildren() {
|
|
11922
|
+
return this._sxTeardrop ? [this._sxTeardrop] : [];
|
|
11923
|
+
}
|
|
11924
|
+
};
|
|
11925
|
+
SxClass.register(ZoneAttr);
|
|
11926
|
+
|
|
11927
|
+
// lib/sexpr/classes/ZoneConnectPadsClearance.ts
|
|
11928
|
+
var ZoneConnectPadsClearance = class extends SxPrimitiveNumber {
|
|
11929
|
+
static token = "clearance";
|
|
11930
|
+
static parentToken = "connect_pads";
|
|
11931
|
+
token = "clearance";
|
|
11932
|
+
};
|
|
11933
|
+
SxClass.register(ZoneConnectPadsClearance);
|
|
11934
|
+
|
|
11935
|
+
// lib/sexpr/classes/ZoneConnectPads.ts
|
|
11936
|
+
var ZoneConnectPads = class _ZoneConnectPads extends SxClass {
|
|
11937
|
+
static token = "connect_pads";
|
|
11938
|
+
static parentToken = "zone";
|
|
11939
|
+
token = "connect_pads";
|
|
11940
|
+
_enabled;
|
|
11941
|
+
_sxClearance;
|
|
11942
|
+
constructor(params = {}) {
|
|
11943
|
+
super();
|
|
11944
|
+
if (params.enabled !== void 0) this.enabled = params.enabled;
|
|
11945
|
+
if (params.clearance !== void 0) this.clearance = params.clearance;
|
|
11946
|
+
}
|
|
11947
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11948
|
+
const connectPads = new _ZoneConnectPads();
|
|
11949
|
+
for (const primitive of primitiveSexprs) {
|
|
11950
|
+
const enabled = parseYesNo(primitive);
|
|
11951
|
+
if (enabled !== void 0) {
|
|
11952
|
+
connectPads.enabled = enabled;
|
|
11953
|
+
continue;
|
|
11954
|
+
}
|
|
11955
|
+
if (!Array.isArray(primitive) || typeof primitive[0] !== "string") {
|
|
11956
|
+
throw new Error(
|
|
11957
|
+
`zone connect_pads encountered invalid child expression: ${JSON.stringify(primitive)}`
|
|
11958
|
+
);
|
|
11959
|
+
}
|
|
11960
|
+
const parsed = SxClass.parsePrimitiveSexpr(primitive, {
|
|
11961
|
+
parentToken: this.token
|
|
11962
|
+
});
|
|
11963
|
+
if (parsed instanceof ZoneConnectPadsClearance) {
|
|
11964
|
+
if (connectPads._sxClearance) {
|
|
11965
|
+
throw new Error("zone connect_pads encountered duplicate clearance");
|
|
11966
|
+
}
|
|
11967
|
+
connectPads._sxClearance = parsed;
|
|
11968
|
+
continue;
|
|
11969
|
+
}
|
|
11970
|
+
throw new Error(
|
|
11971
|
+
`zone connect_pads encountered unsupported child ${JSON.stringify(primitive)}`
|
|
11972
|
+
);
|
|
11973
|
+
}
|
|
11974
|
+
return connectPads;
|
|
11975
|
+
}
|
|
11976
|
+
get enabled() {
|
|
11977
|
+
return this._enabled;
|
|
11978
|
+
}
|
|
11979
|
+
set enabled(value) {
|
|
11980
|
+
this._enabled = value;
|
|
11981
|
+
}
|
|
11982
|
+
get clearance() {
|
|
11983
|
+
return this._sxClearance?.value;
|
|
11984
|
+
}
|
|
11985
|
+
set clearance(value) {
|
|
11986
|
+
this._sxClearance = value === void 0 ? void 0 : value instanceof ZoneConnectPadsClearance ? value : new ZoneConnectPadsClearance(value);
|
|
11987
|
+
}
|
|
11988
|
+
getChildren() {
|
|
11989
|
+
return this._sxClearance ? [this._sxClearance] : [];
|
|
11990
|
+
}
|
|
11991
|
+
getString() {
|
|
11992
|
+
if (this._enabled === void 0) return super.getString();
|
|
11993
|
+
const children = this.getChildren();
|
|
11994
|
+
if (children.length === 0) {
|
|
11995
|
+
return `(connect_pads ${this._enabled ? "yes" : "no"})`;
|
|
11996
|
+
}
|
|
11997
|
+
const lines = [`(connect_pads ${this._enabled ? "yes" : "no"}`];
|
|
11998
|
+
for (const child of children) lines.push(child.getStringIndented());
|
|
11999
|
+
lines.push(")");
|
|
12000
|
+
return lines.join("\n");
|
|
12001
|
+
}
|
|
12002
|
+
};
|
|
12003
|
+
SxClass.register(ZoneConnectPads);
|
|
12004
|
+
|
|
12005
|
+
// lib/sexpr/classes/ZoneFillIslandAreaMin.ts
|
|
12006
|
+
var ZoneFillIslandAreaMin = class extends SxPrimitiveNumber {
|
|
12007
|
+
static token = "island_area_min";
|
|
12008
|
+
static parentToken = "fill";
|
|
12009
|
+
token = "island_area_min";
|
|
12010
|
+
};
|
|
12011
|
+
SxClass.register(ZoneFillIslandAreaMin);
|
|
12012
|
+
|
|
12013
|
+
// lib/sexpr/classes/ZoneFillIslandRemovalMode.ts
|
|
12014
|
+
var ZoneFillIslandRemovalMode = class extends SxPrimitiveNumber {
|
|
12015
|
+
static token = "island_removal_mode";
|
|
12016
|
+
static parentToken = "fill";
|
|
12017
|
+
token = "island_removal_mode";
|
|
12018
|
+
};
|
|
12019
|
+
SxClass.register(ZoneFillIslandRemovalMode);
|
|
12020
|
+
|
|
12021
|
+
// lib/sexpr/classes/ZoneFillRadius.ts
|
|
12022
|
+
var ZoneFillRadius = class extends SxPrimitiveNumber {
|
|
12023
|
+
static token = "radius";
|
|
12024
|
+
static parentToken = "fill";
|
|
12025
|
+
token = "radius";
|
|
12026
|
+
};
|
|
12027
|
+
SxClass.register(ZoneFillRadius);
|
|
12028
|
+
|
|
12029
|
+
// lib/sexpr/classes/ZoneFillSmoothing.ts
|
|
12030
|
+
var ZoneFillSmoothing = class extends SxPrimitiveString {
|
|
12031
|
+
static token = "smoothing";
|
|
12032
|
+
static parentToken = "fill";
|
|
12033
|
+
token = "smoothing";
|
|
12034
|
+
};
|
|
12035
|
+
SxClass.register(ZoneFillSmoothing);
|
|
12036
|
+
|
|
12037
|
+
// lib/sexpr/classes/ZoneFillThermalBridgeWidth.ts
|
|
12038
|
+
var ZoneFillThermalBridgeWidth = class extends SxPrimitiveNumber {
|
|
12039
|
+
static token = "thermal_bridge_width";
|
|
12040
|
+
static parentToken = "fill";
|
|
12041
|
+
token = "thermal_bridge_width";
|
|
12042
|
+
};
|
|
12043
|
+
SxClass.register(ZoneFillThermalBridgeWidth);
|
|
12044
|
+
|
|
12045
|
+
// lib/sexpr/classes/ZoneFillThermalGap.ts
|
|
12046
|
+
var ZoneFillThermalGap = class extends SxPrimitiveNumber {
|
|
12047
|
+
static token = "thermal_gap";
|
|
12048
|
+
static parentToken = "fill";
|
|
12049
|
+
token = "thermal_gap";
|
|
12050
|
+
};
|
|
12051
|
+
SxClass.register(ZoneFillThermalGap);
|
|
12052
|
+
|
|
12053
|
+
// lib/sexpr/classes/ZoneFill.ts
|
|
12054
|
+
var SINGLE_TOKENS2 = /* @__PURE__ */ new Set([
|
|
12055
|
+
"thermal_gap",
|
|
12056
|
+
"thermal_bridge_width",
|
|
12057
|
+
"smoothing",
|
|
12058
|
+
"radius",
|
|
12059
|
+
"island_removal_mode",
|
|
12060
|
+
"island_area_min"
|
|
12061
|
+
]);
|
|
12062
|
+
var ZoneFill = class _ZoneFill extends SxClass {
|
|
12063
|
+
static token = "fill";
|
|
12064
|
+
static parentToken = "zone";
|
|
12065
|
+
token = "fill";
|
|
12066
|
+
_filled;
|
|
12067
|
+
_sxThermalGap;
|
|
12068
|
+
_sxThermalBridgeWidth;
|
|
12069
|
+
_sxSmoothing;
|
|
12070
|
+
_sxRadius;
|
|
12071
|
+
_sxIslandRemovalMode;
|
|
12072
|
+
_sxIslandAreaMin;
|
|
12073
|
+
constructor(params = {}) {
|
|
12074
|
+
super();
|
|
12075
|
+
if (params.filled !== void 0) this.filled = params.filled;
|
|
12076
|
+
if (params.thermalGap !== void 0) this.thermalGap = params.thermalGap;
|
|
12077
|
+
if (params.thermalBridgeWidth !== void 0)
|
|
12078
|
+
this.thermalBridgeWidth = params.thermalBridgeWidth;
|
|
12079
|
+
if (params.smoothing !== void 0) this.smoothing = params.smoothing;
|
|
12080
|
+
if (params.radius !== void 0) this.radius = params.radius;
|
|
12081
|
+
if (params.islandRemovalMode !== void 0)
|
|
12082
|
+
this.islandRemovalMode = params.islandRemovalMode;
|
|
12083
|
+
if (params.islandAreaMin !== void 0)
|
|
12084
|
+
this.islandAreaMin = params.islandAreaMin;
|
|
12085
|
+
}
|
|
12086
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12087
|
+
const fill = new _ZoneFill();
|
|
12088
|
+
const nodes = [];
|
|
12089
|
+
for (const primitive of primitiveSexprs) {
|
|
12090
|
+
const filled = parseYesNo(primitive);
|
|
12091
|
+
if (filled !== void 0) {
|
|
12092
|
+
fill.filled = filled;
|
|
12093
|
+
continue;
|
|
12094
|
+
}
|
|
12095
|
+
if (!Array.isArray(primitive) || typeof primitive[0] !== "string") {
|
|
12096
|
+
throw new Error(
|
|
12097
|
+
`zone fill encountered invalid child expression: ${JSON.stringify(primitive)}`
|
|
12098
|
+
);
|
|
12099
|
+
}
|
|
12100
|
+
nodes.push(primitive);
|
|
12101
|
+
}
|
|
12102
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(nodes, this.token);
|
|
12103
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12104
|
+
if (!SINGLE_TOKENS2.has(token)) {
|
|
12105
|
+
throw new Error(`zone fill encountered unsupported child "${token}"`);
|
|
12106
|
+
}
|
|
12107
|
+
if (entries.length > 1) {
|
|
12108
|
+
throw new Error(`zone fill does not support repeated child "${token}"`);
|
|
12109
|
+
}
|
|
12110
|
+
}
|
|
12111
|
+
fill._sxThermalGap = propertyMap.thermal_gap;
|
|
12112
|
+
fill._sxThermalBridgeWidth = propertyMap.thermal_bridge_width;
|
|
12113
|
+
fill._sxSmoothing = propertyMap.smoothing;
|
|
12114
|
+
fill._sxRadius = propertyMap.radius;
|
|
12115
|
+
fill._sxIslandRemovalMode = propertyMap.island_removal_mode;
|
|
12116
|
+
fill._sxIslandAreaMin = propertyMap.island_area_min;
|
|
12117
|
+
return fill;
|
|
12118
|
+
}
|
|
12119
|
+
get filled() {
|
|
12120
|
+
return this._filled;
|
|
12121
|
+
}
|
|
12122
|
+
set filled(value) {
|
|
12123
|
+
this._filled = value;
|
|
12124
|
+
}
|
|
12125
|
+
get thermalGap() {
|
|
12126
|
+
return this._sxThermalGap?.value;
|
|
12127
|
+
}
|
|
12128
|
+
set thermalGap(value) {
|
|
12129
|
+
this._sxThermalGap = value === void 0 ? void 0 : value instanceof ZoneFillThermalGap ? value : new ZoneFillThermalGap(value);
|
|
12130
|
+
}
|
|
12131
|
+
get thermalBridgeWidth() {
|
|
12132
|
+
return this._sxThermalBridgeWidth?.value;
|
|
12133
|
+
}
|
|
12134
|
+
set thermalBridgeWidth(value) {
|
|
12135
|
+
this._sxThermalBridgeWidth = value === void 0 ? void 0 : value instanceof ZoneFillThermalBridgeWidth ? value : new ZoneFillThermalBridgeWidth(value);
|
|
12136
|
+
}
|
|
12137
|
+
get smoothing() {
|
|
12138
|
+
return this._sxSmoothing?.value;
|
|
12139
|
+
}
|
|
12140
|
+
set smoothing(value) {
|
|
12141
|
+
this._sxSmoothing = value === void 0 ? void 0 : value instanceof ZoneFillSmoothing ? value : new ZoneFillSmoothing(value);
|
|
12142
|
+
}
|
|
12143
|
+
get radius() {
|
|
12144
|
+
return this._sxRadius?.value;
|
|
12145
|
+
}
|
|
12146
|
+
set radius(value) {
|
|
12147
|
+
this._sxRadius = value === void 0 ? void 0 : value instanceof ZoneFillRadius ? value : new ZoneFillRadius(value);
|
|
12148
|
+
}
|
|
12149
|
+
get islandRemovalMode() {
|
|
12150
|
+
return this._sxIslandRemovalMode?.value;
|
|
12151
|
+
}
|
|
12152
|
+
set islandRemovalMode(value) {
|
|
12153
|
+
this._sxIslandRemovalMode = value === void 0 ? void 0 : value instanceof ZoneFillIslandRemovalMode ? value : new ZoneFillIslandRemovalMode(value);
|
|
12154
|
+
}
|
|
12155
|
+
get islandAreaMin() {
|
|
12156
|
+
return this._sxIslandAreaMin?.value;
|
|
12157
|
+
}
|
|
12158
|
+
set islandAreaMin(value) {
|
|
12159
|
+
this._sxIslandAreaMin = value === void 0 ? void 0 : value instanceof ZoneFillIslandAreaMin ? value : new ZoneFillIslandAreaMin(value);
|
|
12160
|
+
}
|
|
12161
|
+
getChildren() {
|
|
12162
|
+
const children = [];
|
|
12163
|
+
if (this._sxThermalGap) children.push(this._sxThermalGap);
|
|
12164
|
+
if (this._sxThermalBridgeWidth) children.push(this._sxThermalBridgeWidth);
|
|
12165
|
+
if (this._sxSmoothing) children.push(this._sxSmoothing);
|
|
12166
|
+
if (this._sxRadius) children.push(this._sxRadius);
|
|
12167
|
+
if (this._sxIslandRemovalMode) children.push(this._sxIslandRemovalMode);
|
|
12168
|
+
if (this._sxIslandAreaMin) children.push(this._sxIslandAreaMin);
|
|
12169
|
+
return children;
|
|
12170
|
+
}
|
|
12171
|
+
getString() {
|
|
12172
|
+
if (this._filled === void 0) return super.getString();
|
|
12173
|
+
const children = this.getChildren();
|
|
12174
|
+
if (children.length === 0) {
|
|
12175
|
+
return `(fill ${this._filled ? "yes" : "no"})`;
|
|
12176
|
+
}
|
|
12177
|
+
const lines = [`(fill ${this._filled ? "yes" : "no"}`];
|
|
12178
|
+
for (const child of children) lines.push(child.getStringIndented());
|
|
12179
|
+
lines.push(")");
|
|
12180
|
+
return lines.join("\n");
|
|
12181
|
+
}
|
|
12182
|
+
};
|
|
12183
|
+
SxClass.register(ZoneFill);
|
|
12184
|
+
|
|
12185
|
+
// lib/sexpr/classes/ZoneFilledAreasThickness.ts
|
|
12186
|
+
var ZoneFilledAreasThickness = class extends SxPrimitiveBoolean {
|
|
12187
|
+
static token = "filled_areas_thickness";
|
|
12188
|
+
static parentToken = "zone";
|
|
12189
|
+
token = "filled_areas_thickness";
|
|
12190
|
+
};
|
|
12191
|
+
SxClass.register(ZoneFilledAreasThickness);
|
|
12192
|
+
|
|
12193
|
+
// lib/sexpr/classes/ZoneFilledPolygon.ts
|
|
12194
|
+
var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
|
|
12195
|
+
static token = "filled_polygon";
|
|
12196
|
+
static parentToken = "zone";
|
|
12197
|
+
token = "filled_polygon";
|
|
12198
|
+
_sxLayer;
|
|
12199
|
+
_sxPts;
|
|
12200
|
+
constructor(params = {}) {
|
|
12201
|
+
super();
|
|
12202
|
+
if (params.layer !== void 0) this.layer = params.layer;
|
|
12203
|
+
if (params.pts !== void 0) this.pts = params.pts;
|
|
12204
|
+
}
|
|
12205
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12206
|
+
const polygon = new _ZoneFilledPolygon();
|
|
12207
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12208
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12209
|
+
if (token !== "layer" && token !== "pts") {
|
|
12210
|
+
throw new Error(
|
|
12211
|
+
`zone filled_polygon encountered unsupported child "${token}"`
|
|
12212
|
+
);
|
|
12213
|
+
}
|
|
12214
|
+
if (entries.length > 1) {
|
|
12215
|
+
throw new Error(
|
|
12216
|
+
`zone filled_polygon does not support repeated child "${token}"`
|
|
12217
|
+
);
|
|
12218
|
+
}
|
|
12219
|
+
}
|
|
12220
|
+
polygon._sxLayer = propertyMap.layer;
|
|
12221
|
+
polygon._sxPts = propertyMap.pts;
|
|
12222
|
+
return polygon;
|
|
12223
|
+
}
|
|
12224
|
+
get layer() {
|
|
12225
|
+
return this._sxLayer;
|
|
12226
|
+
}
|
|
12227
|
+
set layer(value) {
|
|
12228
|
+
this._sxLayer = value;
|
|
12229
|
+
}
|
|
12230
|
+
get pts() {
|
|
12231
|
+
return this._sxPts;
|
|
12232
|
+
}
|
|
12233
|
+
set pts(value) {
|
|
12234
|
+
this._sxPts = value;
|
|
12235
|
+
}
|
|
12236
|
+
getChildren() {
|
|
12237
|
+
const children = [];
|
|
12238
|
+
if (this._sxLayer) children.push(this._sxLayer);
|
|
12239
|
+
if (this._sxPts) children.push(this._sxPts);
|
|
12240
|
+
return children;
|
|
12241
|
+
}
|
|
12242
|
+
};
|
|
12243
|
+
SxClass.register(ZoneFilledPolygon);
|
|
12244
|
+
|
|
12245
|
+
// lib/sexpr/classes/ZoneHatch.ts
|
|
12246
|
+
var ZoneHatch = class _ZoneHatch extends SxClass {
|
|
12247
|
+
constructor(style, pitch) {
|
|
12248
|
+
super();
|
|
12249
|
+
this.style = style;
|
|
12250
|
+
this.pitch = pitch;
|
|
12251
|
+
}
|
|
12252
|
+
style;
|
|
12253
|
+
pitch;
|
|
12254
|
+
static token = "hatch";
|
|
12255
|
+
static parentToken = "zone";
|
|
12256
|
+
token = "hatch";
|
|
12257
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12258
|
+
const style = toStringValue(primitiveSexprs[0]);
|
|
12259
|
+
const pitch = toNumberValue(primitiveSexprs[1]);
|
|
12260
|
+
if (style === void 0 || pitch === void 0) {
|
|
12261
|
+
throw new Error("zone hatch requires style and numeric pitch");
|
|
12262
|
+
}
|
|
12263
|
+
return new _ZoneHatch(style, pitch);
|
|
12264
|
+
}
|
|
12265
|
+
getString() {
|
|
12266
|
+
return `(hatch ${this.style} ${this.pitch})`;
|
|
12267
|
+
}
|
|
12268
|
+
};
|
|
12269
|
+
SxClass.register(ZoneHatch);
|
|
12270
|
+
|
|
12271
|
+
// lib/sexpr/classes/ZoneKeepoutCopperpour.ts
|
|
12272
|
+
var ZoneKeepoutCopperpour = class extends SxPrimitiveString {
|
|
12273
|
+
static token = "copperpour";
|
|
12274
|
+
static parentToken = "keepout";
|
|
12275
|
+
token = "copperpour";
|
|
12276
|
+
};
|
|
12277
|
+
SxClass.register(ZoneKeepoutCopperpour);
|
|
12278
|
+
|
|
12279
|
+
// lib/sexpr/classes/ZoneKeepoutFootprints.ts
|
|
12280
|
+
var ZoneKeepoutFootprints = class extends SxPrimitiveString {
|
|
12281
|
+
static token = "footprints";
|
|
12282
|
+
static parentToken = "keepout";
|
|
12283
|
+
token = "footprints";
|
|
12284
|
+
};
|
|
12285
|
+
SxClass.register(ZoneKeepoutFootprints);
|
|
12286
|
+
|
|
12287
|
+
// lib/sexpr/classes/ZoneKeepoutPads.ts
|
|
12288
|
+
var ZoneKeepoutPads = class extends SxPrimitiveString {
|
|
12289
|
+
static token = "pads";
|
|
12290
|
+
static parentToken = "keepout";
|
|
12291
|
+
token = "pads";
|
|
12292
|
+
};
|
|
12293
|
+
SxClass.register(ZoneKeepoutPads);
|
|
12294
|
+
|
|
12295
|
+
// lib/sexpr/classes/ZoneKeepoutTracks.ts
|
|
12296
|
+
var ZoneKeepoutTracks = class extends SxPrimitiveString {
|
|
12297
|
+
static token = "tracks";
|
|
12298
|
+
static parentToken = "keepout";
|
|
12299
|
+
token = "tracks";
|
|
12300
|
+
};
|
|
12301
|
+
SxClass.register(ZoneKeepoutTracks);
|
|
12302
|
+
|
|
12303
|
+
// lib/sexpr/classes/ZoneKeepoutVias.ts
|
|
12304
|
+
var ZoneKeepoutVias = class extends SxPrimitiveString {
|
|
12305
|
+
static token = "vias";
|
|
12306
|
+
static parentToken = "keepout";
|
|
12307
|
+
token = "vias";
|
|
12308
|
+
};
|
|
12309
|
+
SxClass.register(ZoneKeepoutVias);
|
|
12310
|
+
|
|
12311
|
+
// lib/sexpr/classes/ZoneKeepout.ts
|
|
12312
|
+
var SINGLE_TOKENS3 = /* @__PURE__ */ new Set([
|
|
12313
|
+
"tracks",
|
|
12314
|
+
"vias",
|
|
12315
|
+
"pads",
|
|
12316
|
+
"copperpour",
|
|
12317
|
+
"footprints"
|
|
12318
|
+
]);
|
|
12319
|
+
var ZoneKeepout = class _ZoneKeepout extends SxClass {
|
|
12320
|
+
static token = "keepout";
|
|
12321
|
+
static parentToken = "zone";
|
|
12322
|
+
token = "keepout";
|
|
12323
|
+
_sxTracks;
|
|
12324
|
+
_sxVias;
|
|
12325
|
+
_sxPads;
|
|
12326
|
+
_sxCopperpour;
|
|
12327
|
+
_sxFootprints;
|
|
12328
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12329
|
+
const keepout = new _ZoneKeepout();
|
|
12330
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12331
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12332
|
+
if (!SINGLE_TOKENS3.has(token)) {
|
|
12333
|
+
throw new Error(`zone keepout encountered unsupported child "${token}"`);
|
|
12334
|
+
}
|
|
12335
|
+
if (entries.length > 1) {
|
|
12336
|
+
throw new Error(
|
|
12337
|
+
`zone keepout does not support repeated child "${token}"`
|
|
12338
|
+
);
|
|
12339
|
+
}
|
|
12340
|
+
}
|
|
12341
|
+
keepout._sxTracks = propertyMap.tracks;
|
|
12342
|
+
keepout._sxVias = propertyMap.vias;
|
|
12343
|
+
keepout._sxPads = propertyMap.pads;
|
|
12344
|
+
keepout._sxCopperpour = propertyMap.copperpour;
|
|
12345
|
+
keepout._sxFootprints = propertyMap.footprints;
|
|
12346
|
+
return keepout;
|
|
12347
|
+
}
|
|
12348
|
+
get tracks() {
|
|
12349
|
+
return this._sxTracks?.value;
|
|
12350
|
+
}
|
|
12351
|
+
set tracks(value) {
|
|
12352
|
+
this._sxTracks = value === void 0 ? void 0 : value instanceof ZoneKeepoutTracks ? value : new ZoneKeepoutTracks(value);
|
|
12353
|
+
}
|
|
12354
|
+
get vias() {
|
|
12355
|
+
return this._sxVias?.value;
|
|
12356
|
+
}
|
|
12357
|
+
set vias(value) {
|
|
12358
|
+
this._sxVias = value === void 0 ? void 0 : value instanceof ZoneKeepoutVias ? value : new ZoneKeepoutVias(value);
|
|
12359
|
+
}
|
|
12360
|
+
get pads() {
|
|
12361
|
+
return this._sxPads?.value;
|
|
12362
|
+
}
|
|
12363
|
+
set pads(value) {
|
|
12364
|
+
this._sxPads = value === void 0 ? void 0 : value instanceof ZoneKeepoutPads ? value : new ZoneKeepoutPads(value);
|
|
12365
|
+
}
|
|
12366
|
+
get copperpour() {
|
|
12367
|
+
return this._sxCopperpour?.value;
|
|
12368
|
+
}
|
|
12369
|
+
set copperpour(value) {
|
|
12370
|
+
this._sxCopperpour = value === void 0 ? void 0 : value instanceof ZoneKeepoutCopperpour ? value : new ZoneKeepoutCopperpour(value);
|
|
12371
|
+
}
|
|
12372
|
+
get footprints() {
|
|
12373
|
+
return this._sxFootprints?.value;
|
|
12374
|
+
}
|
|
12375
|
+
set footprints(value) {
|
|
12376
|
+
this._sxFootprints = value === void 0 ? void 0 : value instanceof ZoneKeepoutFootprints ? value : new ZoneKeepoutFootprints(value);
|
|
12377
|
+
}
|
|
12378
|
+
getChildren() {
|
|
12379
|
+
const children = [];
|
|
12380
|
+
if (this._sxTracks) children.push(this._sxTracks);
|
|
12381
|
+
if (this._sxVias) children.push(this._sxVias);
|
|
12382
|
+
if (this._sxPads) children.push(this._sxPads);
|
|
12383
|
+
if (this._sxCopperpour) children.push(this._sxCopperpour);
|
|
12384
|
+
if (this._sxFootprints) children.push(this._sxFootprints);
|
|
12385
|
+
return children;
|
|
12386
|
+
}
|
|
12387
|
+
};
|
|
12388
|
+
SxClass.register(ZoneKeepout);
|
|
12389
|
+
|
|
12390
|
+
// lib/sexpr/classes/ZoneMinThickness.ts
|
|
12391
|
+
var ZoneMinThickness = class extends SxPrimitiveNumber {
|
|
12392
|
+
static token = "min_thickness";
|
|
12393
|
+
static parentToken = "zone";
|
|
12394
|
+
token = "min_thickness";
|
|
12395
|
+
};
|
|
12396
|
+
SxClass.register(ZoneMinThickness);
|
|
12397
|
+
|
|
12398
|
+
// lib/sexpr/classes/ZoneName.ts
|
|
12399
|
+
var ZoneName = class extends SxPrimitiveString {
|
|
12400
|
+
static token = "name";
|
|
12401
|
+
static parentToken = "zone";
|
|
12402
|
+
token = "name";
|
|
12403
|
+
};
|
|
12404
|
+
SxClass.register(ZoneName);
|
|
12405
|
+
|
|
12406
|
+
// lib/sexpr/classes/ZoneNet.ts
|
|
12407
|
+
var ZoneNet = class _ZoneNet extends SxClass {
|
|
12408
|
+
constructor(value) {
|
|
12409
|
+
super();
|
|
12410
|
+
this.value = value;
|
|
12411
|
+
}
|
|
12412
|
+
value;
|
|
12413
|
+
static token = "net";
|
|
12414
|
+
static parentToken = "zone";
|
|
12415
|
+
token = "net";
|
|
12416
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12417
|
+
const numberValue = toNumberValue(primitiveSexprs[0]);
|
|
12418
|
+
if (numberValue !== void 0) return new _ZoneNet(numberValue);
|
|
12419
|
+
const stringValue = toStringValue(primitiveSexprs[0]);
|
|
12420
|
+
if (stringValue === void 0) {
|
|
12421
|
+
throw new Error("zone net requires a numeric id or string name");
|
|
12422
|
+
}
|
|
12423
|
+
return new _ZoneNet(stringValue);
|
|
12424
|
+
}
|
|
12425
|
+
getString() {
|
|
12426
|
+
return `(net ${typeof this.value === "number" ? this.value : quoteIfNeeded(this.value)})`;
|
|
12427
|
+
}
|
|
12428
|
+
};
|
|
12429
|
+
SxClass.register(ZoneNet);
|
|
12430
|
+
|
|
12431
|
+
// lib/sexpr/classes/ZoneNetName.ts
|
|
12432
|
+
var ZoneNetName = class extends SxPrimitiveString {
|
|
12433
|
+
static token = "net_name";
|
|
12434
|
+
static parentToken = "zone";
|
|
12435
|
+
token = "net_name";
|
|
12436
|
+
};
|
|
12437
|
+
SxClass.register(ZoneNetName);
|
|
12438
|
+
|
|
12439
|
+
// lib/sexpr/classes/ZonePlacementEnabled.ts
|
|
12440
|
+
var ZonePlacementEnabled = class extends SxPrimitiveBoolean {
|
|
12441
|
+
static token = "enabled";
|
|
12442
|
+
static parentToken = "placement";
|
|
12443
|
+
token = "enabled";
|
|
12444
|
+
};
|
|
12445
|
+
SxClass.register(ZonePlacementEnabled);
|
|
12446
|
+
|
|
12447
|
+
// lib/sexpr/classes/ZonePlacementSheetname.ts
|
|
12448
|
+
var ZonePlacementSheetname = class extends SxPrimitiveString {
|
|
12449
|
+
static token = "sheetname";
|
|
12450
|
+
static parentToken = "placement";
|
|
12451
|
+
token = "sheetname";
|
|
12452
|
+
};
|
|
12453
|
+
SxClass.register(ZonePlacementSheetname);
|
|
12454
|
+
|
|
12455
|
+
// lib/sexpr/classes/ZonePlacement.ts
|
|
12456
|
+
var ZonePlacement = class _ZonePlacement extends SxClass {
|
|
12457
|
+
static token = "placement";
|
|
12458
|
+
static parentToken = "zone";
|
|
12459
|
+
token = "placement";
|
|
12460
|
+
_sxEnabled;
|
|
12461
|
+
_sxSheetname;
|
|
12462
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12463
|
+
const placement = new _ZonePlacement();
|
|
12464
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12465
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12466
|
+
if (token !== "enabled" && token !== "sheetname") {
|
|
12467
|
+
throw new Error(
|
|
12468
|
+
`zone placement encountered unsupported child "${token}"`
|
|
12469
|
+
);
|
|
12470
|
+
}
|
|
12471
|
+
if (entries.length > 1) {
|
|
12472
|
+
throw new Error(
|
|
12473
|
+
`zone placement does not support repeated child "${token}"`
|
|
12474
|
+
);
|
|
12475
|
+
}
|
|
12476
|
+
}
|
|
12477
|
+
placement._sxEnabled = propertyMap.enabled;
|
|
12478
|
+
placement._sxSheetname = propertyMap.sheetname;
|
|
12479
|
+
return placement;
|
|
12480
|
+
}
|
|
12481
|
+
get enabled() {
|
|
12482
|
+
return this._sxEnabled?.value;
|
|
12483
|
+
}
|
|
12484
|
+
set enabled(value) {
|
|
12485
|
+
this._sxEnabled = value === void 0 ? void 0 : value instanceof ZonePlacementEnabled ? value : new ZonePlacementEnabled(value);
|
|
12486
|
+
}
|
|
12487
|
+
get sheetname() {
|
|
12488
|
+
return this._sxSheetname?.value;
|
|
12489
|
+
}
|
|
12490
|
+
set sheetname(value) {
|
|
12491
|
+
this._sxSheetname = value === void 0 ? void 0 : value instanceof ZonePlacementSheetname ? value : new ZonePlacementSheetname(value);
|
|
12492
|
+
}
|
|
12493
|
+
getChildren() {
|
|
12494
|
+
const children = [];
|
|
12495
|
+
if (this._sxEnabled) children.push(this._sxEnabled);
|
|
12496
|
+
if (this._sxSheetname) children.push(this._sxSheetname);
|
|
12497
|
+
return children;
|
|
12498
|
+
}
|
|
12499
|
+
};
|
|
12500
|
+
SxClass.register(ZonePlacement);
|
|
12501
|
+
|
|
12502
|
+
// lib/sexpr/classes/ZonePolygon.ts
|
|
12503
|
+
var ZonePolygon = class _ZonePolygon extends SxClass {
|
|
12504
|
+
static token = "polygon";
|
|
12505
|
+
static parentToken = "zone";
|
|
12506
|
+
token = "polygon";
|
|
12507
|
+
_sxPts;
|
|
12508
|
+
constructor(pts) {
|
|
12509
|
+
super();
|
|
12510
|
+
this._sxPts = pts;
|
|
12511
|
+
}
|
|
12512
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12513
|
+
const polygon = new _ZonePolygon();
|
|
12514
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12515
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12516
|
+
if (token !== "pts") {
|
|
12517
|
+
throw new Error(`zone polygon encountered unsupported child "${token}"`);
|
|
12518
|
+
}
|
|
12519
|
+
if (entries.length > 1) {
|
|
12520
|
+
throw new Error("zone polygon does not support repeated pts children");
|
|
12521
|
+
}
|
|
12522
|
+
}
|
|
12523
|
+
polygon._sxPts = propertyMap.pts;
|
|
12524
|
+
return polygon;
|
|
12525
|
+
}
|
|
12526
|
+
get pts() {
|
|
12527
|
+
return this._sxPts;
|
|
12528
|
+
}
|
|
12529
|
+
set pts(value) {
|
|
12530
|
+
this._sxPts = value;
|
|
12531
|
+
}
|
|
12532
|
+
getChildren() {
|
|
12533
|
+
return this._sxPts ? [this._sxPts] : [];
|
|
12534
|
+
}
|
|
12535
|
+
};
|
|
12536
|
+
SxClass.register(ZonePolygon);
|
|
12537
|
+
|
|
12538
|
+
// lib/sexpr/classes/ZonePriority.ts
|
|
12539
|
+
var ZonePriority = class extends SxPrimitiveNumber {
|
|
12540
|
+
static token = "priority";
|
|
12541
|
+
static parentToken = "zone";
|
|
12542
|
+
token = "priority";
|
|
12543
|
+
};
|
|
12544
|
+
SxClass.register(ZonePriority);
|
|
12545
|
+
|
|
12546
|
+
// lib/sexpr/classes/Zone.ts
|
|
12547
|
+
var SINGLE_TOKENS4 = /* @__PURE__ */ new Set([
|
|
12548
|
+
"net",
|
|
12549
|
+
"net_name",
|
|
12550
|
+
"layer",
|
|
12551
|
+
"layers",
|
|
12552
|
+
"tstamp",
|
|
12553
|
+
"uuid",
|
|
12554
|
+
"name",
|
|
12555
|
+
"hatch",
|
|
12556
|
+
"priority",
|
|
12557
|
+
"attr",
|
|
12558
|
+
"connect_pads",
|
|
12559
|
+
"min_thickness",
|
|
12560
|
+
"filled_areas_thickness",
|
|
12561
|
+
"keepout",
|
|
12562
|
+
"placement",
|
|
12563
|
+
"fill"
|
|
12564
|
+
]);
|
|
12565
|
+
var MULTI_TOKENS2 = /* @__PURE__ */ new Set(["polygon", "filled_polygon"]);
|
|
12566
|
+
var SUPPORTED_TOKENS15 = /* @__PURE__ */ new Set([...SINGLE_TOKENS4, ...MULTI_TOKENS2]);
|
|
12567
|
+
var Zone = class _Zone extends SxClass {
|
|
12568
|
+
static token = "zone";
|
|
12569
|
+
token = "zone";
|
|
12570
|
+
_sxNet;
|
|
12571
|
+
_sxNetName;
|
|
12572
|
+
_sxLayer;
|
|
12573
|
+
_sxLayers;
|
|
12574
|
+
_sxTstamp;
|
|
12575
|
+
_sxUuid;
|
|
12576
|
+
_sxName;
|
|
12577
|
+
_sxHatch;
|
|
12578
|
+
_sxPriority;
|
|
12579
|
+
_sxAttr;
|
|
12580
|
+
_sxConnectPads;
|
|
12581
|
+
_sxMinThickness;
|
|
12582
|
+
_sxFilledAreasThickness;
|
|
12583
|
+
_sxKeepout;
|
|
12584
|
+
_sxPlacement;
|
|
12585
|
+
_sxFill;
|
|
12586
|
+
_polygons = [];
|
|
12587
|
+
_filledPolygons = [];
|
|
12588
|
+
constructor(params = {}) {
|
|
12589
|
+
super();
|
|
12590
|
+
if (params.net !== void 0) this.net = params.net;
|
|
12591
|
+
if (params.netName !== void 0) this.netName = params.netName;
|
|
12592
|
+
if (params.layer !== void 0) this.layer = params.layer;
|
|
12593
|
+
if (params.layers !== void 0) this.layers = params.layers;
|
|
12594
|
+
if (params.tstamp !== void 0) this.tstamp = params.tstamp;
|
|
12595
|
+
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
12596
|
+
if (params.name !== void 0) this.name = params.name;
|
|
12597
|
+
if (params.hatch !== void 0) this.hatch = params.hatch;
|
|
12598
|
+
if (params.priority !== void 0) this.priority = params.priority;
|
|
12599
|
+
if (params.attr !== void 0) this.attr = params.attr;
|
|
12600
|
+
if (params.connectPads !== void 0) this.connectPads = params.connectPads;
|
|
12601
|
+
if (params.minThickness !== void 0)
|
|
12602
|
+
this.minThickness = params.minThickness;
|
|
12603
|
+
if (params.filledAreasThickness !== void 0)
|
|
12604
|
+
this.filledAreasThickness = params.filledAreasThickness;
|
|
12605
|
+
if (params.keepout !== void 0) this.keepout = params.keepout;
|
|
12606
|
+
if (params.placement !== void 0) this.placement = params.placement;
|
|
12607
|
+
if (params.fill !== void 0) this.fill = params.fill;
|
|
12608
|
+
if (params.polygons !== void 0) this.polygons = params.polygons;
|
|
12609
|
+
if (params.filledPolygons !== void 0)
|
|
12610
|
+
this.filledPolygons = params.filledPolygons;
|
|
12611
|
+
}
|
|
12612
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12613
|
+
const zone = new _Zone();
|
|
12614
|
+
for (const primitive of primitiveSexprs) {
|
|
12615
|
+
if (!Array.isArray(primitive) || typeof primitive[0] !== "string") {
|
|
12616
|
+
throw new Error(
|
|
12617
|
+
`zone encountered invalid child expression: ${JSON.stringify(primitive)}`
|
|
12618
|
+
);
|
|
12619
|
+
}
|
|
12620
|
+
}
|
|
12621
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12622
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12623
|
+
if (!SUPPORTED_TOKENS15.has(token)) {
|
|
12624
|
+
throw new Error(`zone encountered unsupported child token "${token}"`);
|
|
12625
|
+
}
|
|
12626
|
+
if (!MULTI_TOKENS2.has(token) && entries.length > 1) {
|
|
12627
|
+
throw new Error(`zone does not support repeated child token "${token}"`);
|
|
12628
|
+
}
|
|
12629
|
+
}
|
|
12630
|
+
zone._sxNet = propertyMap.net;
|
|
12631
|
+
zone._sxNetName = propertyMap.net_name;
|
|
12632
|
+
zone._sxLayer = propertyMap.layer;
|
|
12633
|
+
zone._sxLayers = propertyMap.layers;
|
|
12634
|
+
if (zone._sxLayer && zone._sxLayers) {
|
|
12635
|
+
throw new Error("zone cannot include both layer and layers children");
|
|
12636
|
+
}
|
|
12637
|
+
zone._sxTstamp = propertyMap.tstamp;
|
|
12638
|
+
zone._sxUuid = propertyMap.uuid;
|
|
12639
|
+
zone._sxName = propertyMap.name;
|
|
12640
|
+
zone._sxHatch = propertyMap.hatch;
|
|
12641
|
+
zone._sxPriority = propertyMap.priority;
|
|
12642
|
+
zone._sxAttr = propertyMap.attr;
|
|
12643
|
+
zone._sxConnectPads = propertyMap.connect_pads;
|
|
12644
|
+
zone._sxMinThickness = propertyMap.min_thickness;
|
|
12645
|
+
zone._sxFilledAreasThickness = propertyMap.filled_areas_thickness;
|
|
12646
|
+
zone._sxKeepout = propertyMap.keepout;
|
|
12647
|
+
zone._sxPlacement = propertyMap.placement;
|
|
12648
|
+
zone._sxFill = propertyMap.fill;
|
|
12649
|
+
zone._polygons = arrayPropertyMap.polygon ?? [];
|
|
12650
|
+
zone._filledPolygons = arrayPropertyMap.filled_polygon ?? [];
|
|
12651
|
+
return zone;
|
|
12652
|
+
}
|
|
12653
|
+
get net() {
|
|
12654
|
+
return this._sxNet?.value;
|
|
12655
|
+
}
|
|
12656
|
+
set net(value) {
|
|
12657
|
+
this._sxNet = value === void 0 ? void 0 : value instanceof ZoneNet ? value : new ZoneNet(value);
|
|
12658
|
+
}
|
|
12659
|
+
get netClass() {
|
|
12660
|
+
return this._sxNet;
|
|
12661
|
+
}
|
|
12662
|
+
get netName() {
|
|
12663
|
+
return this._sxNetName?.value;
|
|
12664
|
+
}
|
|
12665
|
+
set netName(value) {
|
|
12666
|
+
this._sxNetName = value === void 0 ? void 0 : value instanceof ZoneNetName ? value : new ZoneNetName(value);
|
|
12667
|
+
}
|
|
12668
|
+
get layer() {
|
|
12669
|
+
return this._sxLayer;
|
|
12670
|
+
}
|
|
12671
|
+
set layer(value) {
|
|
12672
|
+
if (value === void 0) {
|
|
12673
|
+
this._sxLayer = void 0;
|
|
12674
|
+
return;
|
|
12675
|
+
}
|
|
12676
|
+
this._sxLayer = value instanceof Layer ? value : new Layer([value].flat());
|
|
12677
|
+
this._sxLayers = void 0;
|
|
12678
|
+
}
|
|
12679
|
+
get layers() {
|
|
12680
|
+
return this._sxLayers;
|
|
12681
|
+
}
|
|
12682
|
+
set layers(value) {
|
|
12683
|
+
if (value === void 0) {
|
|
12684
|
+
this._sxLayers = void 0;
|
|
12685
|
+
return;
|
|
12686
|
+
}
|
|
12687
|
+
this._sxLayers = value instanceof Layers ? value : new Layers(value);
|
|
12688
|
+
this._sxLayer = void 0;
|
|
12689
|
+
}
|
|
12690
|
+
get tstamp() {
|
|
12691
|
+
return this._sxTstamp;
|
|
12692
|
+
}
|
|
12693
|
+
set tstamp(value) {
|
|
12694
|
+
this._sxTstamp = value === void 0 ? void 0 : value instanceof Tstamp ? value : new Tstamp(value);
|
|
12695
|
+
}
|
|
12696
|
+
get uuid() {
|
|
12697
|
+
return this._sxUuid;
|
|
12698
|
+
}
|
|
12699
|
+
set uuid(value) {
|
|
12700
|
+
this._sxUuid = value === void 0 ? void 0 : value instanceof Uuid ? value : new Uuid(value);
|
|
12701
|
+
}
|
|
12702
|
+
get name() {
|
|
12703
|
+
return this._sxName?.value;
|
|
12704
|
+
}
|
|
12705
|
+
set name(value) {
|
|
12706
|
+
this._sxName = value === void 0 ? void 0 : value instanceof ZoneName ? value : new ZoneName(value);
|
|
12707
|
+
}
|
|
12708
|
+
get hatch() {
|
|
12709
|
+
return this._sxHatch;
|
|
12710
|
+
}
|
|
12711
|
+
set hatch(value) {
|
|
12712
|
+
this._sxHatch = value;
|
|
12713
|
+
}
|
|
12714
|
+
get priority() {
|
|
12715
|
+
return this._sxPriority?.value;
|
|
12716
|
+
}
|
|
12717
|
+
set priority(value) {
|
|
12718
|
+
this._sxPriority = value === void 0 ? void 0 : value instanceof ZonePriority ? value : new ZonePriority(value);
|
|
12719
|
+
}
|
|
12720
|
+
get attr() {
|
|
12721
|
+
return this._sxAttr;
|
|
12722
|
+
}
|
|
12723
|
+
set attr(value) {
|
|
12724
|
+
this._sxAttr = value;
|
|
11657
12725
|
}
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
if (value === void 0) {
|
|
11661
|
-
throw new Error("footprint unit name expects a string value");
|
|
11662
|
-
}
|
|
11663
|
-
return new _FootprintUnitName(value);
|
|
12726
|
+
get connectPads() {
|
|
12727
|
+
return this._sxConnectPads;
|
|
11664
12728
|
}
|
|
11665
|
-
|
|
11666
|
-
|
|
12729
|
+
set connectPads(value) {
|
|
12730
|
+
this._sxConnectPads = value;
|
|
11667
12731
|
}
|
|
11668
|
-
|
|
11669
|
-
return
|
|
12732
|
+
get minThickness() {
|
|
12733
|
+
return this._sxMinThickness?.value;
|
|
11670
12734
|
}
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
// lib/sexpr/classes/FootprintUnitPins.ts
|
|
11675
|
-
var FootprintUnitPins = class _FootprintUnitPins extends SxClass {
|
|
11676
|
-
static token = "pins";
|
|
11677
|
-
static parentToken = "unit";
|
|
11678
|
-
token = "pins";
|
|
11679
|
-
values;
|
|
11680
|
-
constructor(values = []) {
|
|
11681
|
-
super();
|
|
11682
|
-
this.values = values;
|
|
12735
|
+
set minThickness(value) {
|
|
12736
|
+
this._sxMinThickness = value === void 0 ? void 0 : value instanceof ZoneMinThickness ? value : new ZoneMinThickness(value);
|
|
11683
12737
|
}
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
const value = toStringValue(primitive);
|
|
11687
|
-
if (value === void 0) {
|
|
11688
|
-
throw new Error("footprint unit pins expects string values");
|
|
11689
|
-
}
|
|
11690
|
-
return value;
|
|
11691
|
-
});
|
|
11692
|
-
return new _FootprintUnitPins(values);
|
|
12738
|
+
get filledAreasThickness() {
|
|
12739
|
+
return this._sxFilledAreasThickness?.value;
|
|
11693
12740
|
}
|
|
11694
|
-
|
|
11695
|
-
|
|
12741
|
+
set filledAreasThickness(value) {
|
|
12742
|
+
this._sxFilledAreasThickness = value === void 0 ? void 0 : value instanceof ZoneFilledAreasThickness ? value : new ZoneFilledAreasThickness(value);
|
|
11696
12743
|
}
|
|
11697
|
-
|
|
11698
|
-
return
|
|
12744
|
+
get keepout() {
|
|
12745
|
+
return this._sxKeepout;
|
|
11699
12746
|
}
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
// lib/sexpr/classes/FootprintUnit.ts
|
|
11704
|
-
var FootprintUnit = class _FootprintUnit extends SxClass {
|
|
11705
|
-
static token = "unit";
|
|
11706
|
-
static parentToken = "units";
|
|
11707
|
-
token = "unit";
|
|
11708
|
-
_sxName;
|
|
11709
|
-
_sxPins;
|
|
11710
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
11711
|
-
const unit = new _FootprintUnit();
|
|
11712
|
-
const { propertyMap } = SxClass.parsePrimitivesToClassProperties(
|
|
11713
|
-
primitiveSexprs,
|
|
11714
|
-
this.token
|
|
11715
|
-
);
|
|
11716
|
-
unit._sxName = propertyMap.name;
|
|
11717
|
-
unit._sxPins = propertyMap.pins;
|
|
11718
|
-
return unit;
|
|
12747
|
+
set keepout(value) {
|
|
12748
|
+
this._sxKeepout = value;
|
|
11719
12749
|
}
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
if (this._sxName) children.push(this._sxName);
|
|
11723
|
-
if (this._sxPins) children.push(this._sxPins);
|
|
11724
|
-
return children;
|
|
12750
|
+
get placement() {
|
|
12751
|
+
return this._sxPlacement;
|
|
11725
12752
|
}
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
// lib/sexpr/classes/FootprintUnits.ts
|
|
11730
|
-
var FootprintUnits = class _FootprintUnits extends SxClass {
|
|
11731
|
-
static token = "units";
|
|
11732
|
-
static parentToken = "footprint";
|
|
11733
|
-
token = "units";
|
|
11734
|
-
_units = [];
|
|
11735
|
-
constructor(units = []) {
|
|
11736
|
-
super();
|
|
11737
|
-
this._units = units;
|
|
12753
|
+
set placement(value) {
|
|
12754
|
+
this._sxPlacement = value;
|
|
11738
12755
|
}
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
primitiveSexprs,
|
|
11742
|
-
this.token
|
|
11743
|
-
);
|
|
11744
|
-
return new _FootprintUnits(arrayPropertyMap.unit ?? []);
|
|
12756
|
+
get fill() {
|
|
12757
|
+
return this._sxFill;
|
|
11745
12758
|
}
|
|
11746
|
-
|
|
11747
|
-
|
|
12759
|
+
set fill(value) {
|
|
12760
|
+
this._sxFill = value;
|
|
11748
12761
|
}
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
// lib/sexpr/classes/Zone.ts
|
|
11753
|
-
var Zone = class _Zone extends SxClass {
|
|
11754
|
-
static token = "zone";
|
|
11755
|
-
token = "zone";
|
|
11756
|
-
_rawChildren = [];
|
|
11757
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
11758
|
-
const zone = new _Zone();
|
|
11759
|
-
zone._rawChildren = [...primitiveSexprs];
|
|
11760
|
-
return zone;
|
|
12762
|
+
get polygons() {
|
|
12763
|
+
return [...this._polygons];
|
|
11761
12764
|
}
|
|
11762
|
-
|
|
11763
|
-
|
|
12765
|
+
set polygons(value) {
|
|
12766
|
+
this._polygons = [...value];
|
|
11764
12767
|
}
|
|
11765
|
-
|
|
11766
|
-
|
|
12768
|
+
get filledPolygons() {
|
|
12769
|
+
return [...this._filledPolygons];
|
|
11767
12770
|
}
|
|
11768
|
-
|
|
11769
|
-
|
|
12771
|
+
set filledPolygons(value) {
|
|
12772
|
+
this._filledPolygons = [...value];
|
|
11770
12773
|
}
|
|
11771
|
-
|
|
11772
|
-
const
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
12774
|
+
getChildren() {
|
|
12775
|
+
const children = [];
|
|
12776
|
+
if (this._sxNet) children.push(this._sxNet);
|
|
12777
|
+
if (this._sxNetName) children.push(this._sxNetName);
|
|
12778
|
+
if (this._sxLayer) children.push(this._sxLayer);
|
|
12779
|
+
if (this._sxLayers) children.push(this._sxLayers);
|
|
12780
|
+
if (this._sxTstamp) children.push(this._sxTstamp);
|
|
12781
|
+
if (this._sxUuid) children.push(this._sxUuid);
|
|
12782
|
+
if (this._sxName) children.push(this._sxName);
|
|
12783
|
+
if (this._sxHatch) children.push(this._sxHatch);
|
|
12784
|
+
if (this._sxPriority) children.push(this._sxPriority);
|
|
12785
|
+
if (this._sxAttr) children.push(this._sxAttr);
|
|
12786
|
+
if (this._sxConnectPads) children.push(this._sxConnectPads);
|
|
12787
|
+
if (this._sxMinThickness) children.push(this._sxMinThickness);
|
|
12788
|
+
if (this._sxFilledAreasThickness)
|
|
12789
|
+
children.push(this._sxFilledAreasThickness);
|
|
12790
|
+
if (this._sxKeepout) children.push(this._sxKeepout);
|
|
12791
|
+
if (this._sxPlacement) children.push(this._sxPlacement);
|
|
12792
|
+
if (this._sxFill) children.push(this._sxFill);
|
|
12793
|
+
children.push(...this._polygons);
|
|
12794
|
+
children.push(...this._filledPolygons);
|
|
12795
|
+
return children;
|
|
11778
12796
|
}
|
|
11779
12797
|
};
|
|
11780
12798
|
SxClass.register(Zone);
|
|
11781
12799
|
|
|
11782
12800
|
// lib/sexpr/classes/Footprint.ts
|
|
11783
|
-
var
|
|
12801
|
+
var SINGLE_TOKENS5 = /* @__PURE__ */ new Set([
|
|
11784
12802
|
"version",
|
|
11785
12803
|
"generator",
|
|
11786
12804
|
"generator_version",
|
|
@@ -11814,7 +12832,7 @@ var SINGLE_TOKENS2 = /* @__PURE__ */ new Set([
|
|
|
11814
12832
|
"embedded_fonts",
|
|
11815
12833
|
"embedded_files"
|
|
11816
12834
|
]);
|
|
11817
|
-
var
|
|
12835
|
+
var MULTI_TOKENS3 = /* @__PURE__ */ new Set([
|
|
11818
12836
|
"property",
|
|
11819
12837
|
"fp_text",
|
|
11820
12838
|
"fp_text_box",
|
|
@@ -11828,7 +12846,7 @@ var MULTI_TOKENS2 = /* @__PURE__ */ new Set([
|
|
|
11828
12846
|
"model",
|
|
11829
12847
|
"zone"
|
|
11830
12848
|
]);
|
|
11831
|
-
var
|
|
12849
|
+
var SUPPORTED_TOKENS16 = /* @__PURE__ */ new Set([...SINGLE_TOKENS5, ...MULTI_TOKENS3]);
|
|
11832
12850
|
var Footprint = class _Footprint extends SxClass {
|
|
11833
12851
|
static token = "footprint";
|
|
11834
12852
|
token = "footprint";
|
|
@@ -11960,19 +12978,19 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
11960
12978
|
}
|
|
11961
12979
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rawNodes, this.token);
|
|
11962
12980
|
for (const token of Object.keys(propertyMap)) {
|
|
11963
|
-
if (!
|
|
12981
|
+
if (!SUPPORTED_TOKENS16.has(token)) {
|
|
11964
12982
|
throw new Error(
|
|
11965
12983
|
`footprint encountered unsupported child token "${token}"`
|
|
11966
12984
|
);
|
|
11967
12985
|
}
|
|
11968
12986
|
}
|
|
11969
12987
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
11970
|
-
if (!
|
|
12988
|
+
if (!SUPPORTED_TOKENS16.has(token)) {
|
|
11971
12989
|
throw new Error(
|
|
11972
12990
|
`footprint encountered unsupported child token "${token}"`
|
|
11973
12991
|
);
|
|
11974
12992
|
}
|
|
11975
|
-
if (!
|
|
12993
|
+
if (!MULTI_TOKENS3.has(token) && entries.length > 1) {
|
|
11976
12994
|
throw new Error(
|
|
11977
12995
|
`footprint does not support repeated child token "${token}"`
|
|
11978
12996
|
);
|
|
@@ -12511,6 +13529,34 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
12511
13529
|
};
|
|
12512
13530
|
SxClass.register(Footprint);
|
|
12513
13531
|
|
|
13532
|
+
// lib/sexpr/classes/GrArcLocked.ts
|
|
13533
|
+
var truthyStrings3 = /* @__PURE__ */ new Set(["true", "yes", "1"]);
|
|
13534
|
+
var GrArcLocked = class _GrArcLocked extends SxPrimitiveBoolean {
|
|
13535
|
+
static token = "locked";
|
|
13536
|
+
static parentToken = "gr_arc";
|
|
13537
|
+
token = "locked";
|
|
13538
|
+
constructor(value) {
|
|
13539
|
+
super(value);
|
|
13540
|
+
}
|
|
13541
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
13542
|
+
const [rawValue] = primitiveSexprs;
|
|
13543
|
+
if (rawValue === void 0) {
|
|
13544
|
+
return new _GrArcLocked(true);
|
|
13545
|
+
}
|
|
13546
|
+
if (typeof rawValue === "boolean") {
|
|
13547
|
+
return new _GrArcLocked(rawValue);
|
|
13548
|
+
}
|
|
13549
|
+
if (typeof rawValue === "string") {
|
|
13550
|
+
return new _GrArcLocked(truthyStrings3.has(rawValue.toLowerCase()));
|
|
13551
|
+
}
|
|
13552
|
+
return new _GrArcLocked(false);
|
|
13553
|
+
}
|
|
13554
|
+
getString() {
|
|
13555
|
+
return `(locked ${this.value ? "yes" : "no"})`;
|
|
13556
|
+
}
|
|
13557
|
+
};
|
|
13558
|
+
SxClass.register(GrArcLocked);
|
|
13559
|
+
|
|
12514
13560
|
// lib/sexpr/classes/GrArc.ts
|
|
12515
13561
|
var SUPPORTED_SINGLE_TOKENS6 = /* @__PURE__ */ new Set([
|
|
12516
13562
|
"start",
|
|
@@ -12520,7 +13566,8 @@ var SUPPORTED_SINGLE_TOKENS6 = /* @__PURE__ */ new Set([
|
|
|
12520
13566
|
"width",
|
|
12521
13567
|
"stroke",
|
|
12522
13568
|
"tstamp",
|
|
12523
|
-
"uuid"
|
|
13569
|
+
"uuid",
|
|
13570
|
+
"locked"
|
|
12524
13571
|
]);
|
|
12525
13572
|
var GrArc = class _GrArc extends SxClass {
|
|
12526
13573
|
static token = "gr_arc";
|
|
@@ -12533,6 +13580,7 @@ var GrArc = class _GrArc extends SxClass {
|
|
|
12533
13580
|
_sxStroke;
|
|
12534
13581
|
_sxTstamp;
|
|
12535
13582
|
_sxUuid;
|
|
13583
|
+
_sxLocked;
|
|
12536
13584
|
constructor(params = {}) {
|
|
12537
13585
|
super();
|
|
12538
13586
|
if (params.start !== void 0) this.start = params.start;
|
|
@@ -12543,6 +13591,7 @@ var GrArc = class _GrArc extends SxClass {
|
|
|
12543
13591
|
if (params.stroke !== void 0) this.stroke = params.stroke;
|
|
12544
13592
|
if (params.tstamp !== void 0) this.tstamp = params.tstamp;
|
|
12545
13593
|
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
13594
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
12546
13595
|
}
|
|
12547
13596
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
12548
13597
|
const grArc = new _GrArc();
|
|
@@ -12583,6 +13632,8 @@ var GrArc = class _GrArc extends SxClass {
|
|
|
12583
13632
|
grArc._sxStroke = propertyMap.stroke;
|
|
12584
13633
|
grArc._sxTstamp = propertyMap.tstamp;
|
|
12585
13634
|
grArc._sxUuid = propertyMap.uuid;
|
|
13635
|
+
const locked = propertyMap.locked;
|
|
13636
|
+
grArc._sxLocked = locked && locked.value ? locked : void 0;
|
|
12586
13637
|
if (!grArc._sxStart) {
|
|
12587
13638
|
throw new Error("gr_arc requires a start child token");
|
|
12588
13639
|
}
|
|
@@ -12681,6 +13732,12 @@ var GrArc = class _GrArc extends SxClass {
|
|
|
12681
13732
|
}
|
|
12682
13733
|
this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
|
|
12683
13734
|
}
|
|
13735
|
+
get locked() {
|
|
13736
|
+
return this._sxLocked?.value ?? false;
|
|
13737
|
+
}
|
|
13738
|
+
set locked(value) {
|
|
13739
|
+
this._sxLocked = value ? new GrArcLocked(true) : void 0;
|
|
13740
|
+
}
|
|
12684
13741
|
getChildren() {
|
|
12685
13742
|
const children = [];
|
|
12686
13743
|
if (this._sxStart) children.push(this._sxStart);
|
|
@@ -12688,6 +13745,7 @@ var GrArc = class _GrArc extends SxClass {
|
|
|
12688
13745
|
if (this._sxEnd) children.push(this._sxEnd);
|
|
12689
13746
|
if (this._sxStroke) children.push(this._sxStroke);
|
|
12690
13747
|
if (this._sxWidth) children.push(this._sxWidth);
|
|
13748
|
+
if (this._sxLocked) children.push(this._sxLocked);
|
|
12691
13749
|
if (this._sxLayer) children.push(this._sxLayer);
|
|
12692
13750
|
if (this._sxTstamp) children.push(this._sxTstamp);
|
|
12693
13751
|
if (this._sxUuid) children.push(this._sxUuid);
|
|
@@ -13127,7 +14185,7 @@ var GrCircleLocked = class _GrCircleLocked extends SxClass {
|
|
|
13127
14185
|
SxClass.register(GrCircleLocked);
|
|
13128
14186
|
|
|
13129
14187
|
// lib/sexpr/classes/GrCurve.ts
|
|
13130
|
-
var
|
|
14188
|
+
var SUPPORTED_TOKENS17 = /* @__PURE__ */ new Set([
|
|
13131
14189
|
"pts",
|
|
13132
14190
|
"xy",
|
|
13133
14191
|
"layer",
|
|
@@ -13159,12 +14217,12 @@ var GrCurve = class _GrCurve extends SxClass {
|
|
|
13159
14217
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
13160
14218
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
13161
14219
|
for (const token of Object.keys(propertyMap)) {
|
|
13162
|
-
if (!
|
|
14220
|
+
if (!SUPPORTED_TOKENS17.has(token)) {
|
|
13163
14221
|
unexpectedTokens.add(token);
|
|
13164
14222
|
}
|
|
13165
14223
|
}
|
|
13166
14224
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
13167
|
-
if (!
|
|
14225
|
+
if (!SUPPORTED_TOKENS17.has(token)) {
|
|
13168
14226
|
unexpectedTokens.add(token);
|
|
13169
14227
|
continue;
|
|
13170
14228
|
}
|
|
@@ -13329,7 +14387,7 @@ var GrLineAngle = class _GrLineAngle extends SxPrimitiveNumber {
|
|
|
13329
14387
|
SxClass.register(GrLineAngle);
|
|
13330
14388
|
|
|
13331
14389
|
// lib/sexpr/classes/GrLineLocked.ts
|
|
13332
|
-
var
|
|
14390
|
+
var truthyStrings4 = /* @__PURE__ */ new Set(["true", "yes", "1"]);
|
|
13333
14391
|
var GrLineLocked = class _GrLineLocked extends SxPrimitiveBoolean {
|
|
13334
14392
|
static token = "locked";
|
|
13335
14393
|
static parentToken = "gr_line";
|
|
@@ -13346,7 +14404,7 @@ var GrLineLocked = class _GrLineLocked extends SxPrimitiveBoolean {
|
|
|
13346
14404
|
return new _GrLineLocked(rawValue);
|
|
13347
14405
|
}
|
|
13348
14406
|
if (typeof rawValue === "string") {
|
|
13349
|
-
return new _GrLineLocked(
|
|
14407
|
+
return new _GrLineLocked(truthyStrings4.has(rawValue.toLowerCase()));
|
|
13350
14408
|
}
|
|
13351
14409
|
return new _GrLineLocked(false);
|
|
13352
14410
|
}
|
|
@@ -14268,7 +15326,7 @@ var GrPolyFill = class _GrPolyFill extends SxClass {
|
|
|
14268
15326
|
}
|
|
14269
15327
|
};
|
|
14270
15328
|
SxClass.register(GrPolyFill);
|
|
14271
|
-
var
|
|
15329
|
+
var SUPPORTED_TOKENS18 = /* @__PURE__ */ new Set([
|
|
14272
15330
|
"pts",
|
|
14273
15331
|
"xy",
|
|
14274
15332
|
"layer",
|
|
@@ -14303,12 +15361,12 @@ var GrPoly = class _GrPoly extends SxClass {
|
|
|
14303
15361
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14304
15362
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
14305
15363
|
for (const token of Object.keys(propertyMap)) {
|
|
14306
|
-
if (!
|
|
15364
|
+
if (!SUPPORTED_TOKENS18.has(token)) {
|
|
14307
15365
|
unexpectedTokens.add(token);
|
|
14308
15366
|
}
|
|
14309
15367
|
}
|
|
14310
15368
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14311
|
-
if (!
|
|
15369
|
+
if (!SUPPORTED_TOKENS18.has(token)) {
|
|
14312
15370
|
unexpectedTokens.add(token);
|
|
14313
15371
|
}
|
|
14314
15372
|
if (token !== "xy" && arrayPropertyMap[token].length > 1) {
|
|
@@ -14354,7 +15412,7 @@ var GrPoly = class _GrPoly extends SxClass {
|
|
|
14354
15412
|
`gr_poly child token must be a string, received: ${JSON.stringify(token)}`
|
|
14355
15413
|
);
|
|
14356
15414
|
}
|
|
14357
|
-
if (!
|
|
15415
|
+
if (!SUPPORTED_TOKENS18.has(token)) {
|
|
14358
15416
|
throw new Error(
|
|
14359
15417
|
`Unsupported child token inside gr_poly expression: ${token}`
|
|
14360
15418
|
);
|
|
@@ -14545,7 +15603,7 @@ var DimensionFormatUnitsFormat = class extends SxPrimitiveNumber {
|
|
|
14545
15603
|
SxClass.register(DimensionFormatUnitsFormat);
|
|
14546
15604
|
|
|
14547
15605
|
// lib/sexpr/classes/DimensionFormat.ts
|
|
14548
|
-
var
|
|
15606
|
+
var SUPPORTED_TOKENS19 = /* @__PURE__ */ new Set([
|
|
14549
15607
|
"prefix",
|
|
14550
15608
|
"suffix",
|
|
14551
15609
|
"units",
|
|
@@ -14569,7 +15627,7 @@ var DimensionFormat = class _DimensionFormat extends SxClass {
|
|
|
14569
15627
|
const format = new _DimensionFormat();
|
|
14570
15628
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14571
15629
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14572
|
-
if (!
|
|
15630
|
+
if (!SUPPORTED_TOKENS19.has(token)) {
|
|
14573
15631
|
throw new Error(`format does not support child token "${token}"`);
|
|
14574
15632
|
}
|
|
14575
15633
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -14729,7 +15787,7 @@ var DimensionTextPositionMode = class extends SxPrimitiveNumber {
|
|
|
14729
15787
|
SxClass.register(DimensionTextPositionMode);
|
|
14730
15788
|
|
|
14731
15789
|
// lib/sexpr/classes/DimensionStyle.ts
|
|
14732
|
-
var
|
|
15790
|
+
var SUPPORTED_TOKENS20 = /* @__PURE__ */ new Set([
|
|
14733
15791
|
"thickness",
|
|
14734
15792
|
"arrow_length",
|
|
14735
15793
|
"text_position_mode",
|
|
@@ -14755,7 +15813,7 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
|
|
|
14755
15813
|
const style = new _DimensionStyle();
|
|
14756
15814
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14757
15815
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14758
|
-
if (!
|
|
15816
|
+
if (!SUPPORTED_TOKENS20.has(token)) {
|
|
14759
15817
|
throw new Error(`style does not support child token "${token}"`);
|
|
14760
15818
|
}
|
|
14761
15819
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -14814,7 +15872,7 @@ var DimensionType = class extends SxPrimitiveString {
|
|
|
14814
15872
|
SxClass.register(DimensionType);
|
|
14815
15873
|
|
|
14816
15874
|
// lib/sexpr/classes/Dimension.ts
|
|
14817
|
-
var
|
|
15875
|
+
var SUPPORTED_TOKENS21 = /* @__PURE__ */ new Set([
|
|
14818
15876
|
"locked",
|
|
14819
15877
|
"type",
|
|
14820
15878
|
"layer",
|
|
@@ -14846,7 +15904,7 @@ var Dimension = class _Dimension extends SxClass {
|
|
|
14846
15904
|
const dimension = new _Dimension();
|
|
14847
15905
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14848
15906
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14849
|
-
if (!
|
|
15907
|
+
if (!SUPPORTED_TOKENS21.has(token)) {
|
|
14850
15908
|
throw new Error(`dimension does not support child token "${token}"`);
|
|
14851
15909
|
}
|
|
14852
15910
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -14917,7 +15975,7 @@ var TargetSize = class extends SxPrimitiveNumber {
|
|
|
14917
15975
|
SxClass.register(TargetSize);
|
|
14918
15976
|
|
|
14919
15977
|
// lib/sexpr/classes/Target.ts
|
|
14920
|
-
var
|
|
15978
|
+
var SUPPORTED_TOKENS22 = /* @__PURE__ */ new Set(["at", "size", "width", "layer", "uuid"]);
|
|
14921
15979
|
var Target = class _Target extends SxClass {
|
|
14922
15980
|
static token = "target";
|
|
14923
15981
|
static parentToken = "kicad_pcb";
|
|
@@ -14940,7 +15998,7 @@ var Target = class _Target extends SxClass {
|
|
|
14940
15998
|
const target = new _Target(rawShape);
|
|
14941
15999
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
|
|
14942
16000
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14943
|
-
if (!
|
|
16001
|
+
if (!SUPPORTED_TOKENS22.has(token)) {
|
|
14944
16002
|
throw new Error(`target does not support child token "${token}"`);
|
|
14945
16003
|
}
|
|
14946
16004
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -15212,6 +16270,7 @@ var PcbArc = class _PcbArc extends SxClass {
|
|
|
15212
16270
|
_sxWidth;
|
|
15213
16271
|
_sxLayer;
|
|
15214
16272
|
_net;
|
|
16273
|
+
_locked = false;
|
|
15215
16274
|
_sxUuid;
|
|
15216
16275
|
constructor(params = {}) {
|
|
15217
16276
|
super();
|
|
@@ -15221,6 +16280,7 @@ var PcbArc = class _PcbArc extends SxClass {
|
|
|
15221
16280
|
if (params.width !== void 0) this.width = params.width;
|
|
15222
16281
|
if (params.layer !== void 0) this.layer = params.layer;
|
|
15223
16282
|
if (params.net !== void 0) this.net = params.net;
|
|
16283
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
15224
16284
|
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
15225
16285
|
}
|
|
15226
16286
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
@@ -15254,7 +16314,11 @@ var PcbArc = class _PcbArc extends SxClass {
|
|
|
15254
16314
|
continue;
|
|
15255
16315
|
}
|
|
15256
16316
|
if (token === "net") {
|
|
15257
|
-
arc._net =
|
|
16317
|
+
arc._net = parseNet(args[0]);
|
|
16318
|
+
continue;
|
|
16319
|
+
}
|
|
16320
|
+
if (token === "locked") {
|
|
16321
|
+
arc._locked = parseLocked(args);
|
|
15258
16322
|
continue;
|
|
15259
16323
|
}
|
|
15260
16324
|
if (token === "uuid") {
|
|
@@ -15315,6 +16379,12 @@ var PcbArc = class _PcbArc extends SxClass {
|
|
|
15315
16379
|
set net(value) {
|
|
15316
16380
|
this._net = value;
|
|
15317
16381
|
}
|
|
16382
|
+
get locked() {
|
|
16383
|
+
return this._locked;
|
|
16384
|
+
}
|
|
16385
|
+
set locked(value) {
|
|
16386
|
+
this._locked = value;
|
|
16387
|
+
}
|
|
15318
16388
|
get uuid() {
|
|
15319
16389
|
return this._sxUuid;
|
|
15320
16390
|
}
|
|
@@ -15334,8 +16404,12 @@ var PcbArc = class _PcbArc extends SxClass {
|
|
|
15334
16404
|
if (this._mid) lines.push(renderPoint("mid", this._mid));
|
|
15335
16405
|
if (this._end) lines.push(renderPoint("end", this._end));
|
|
15336
16406
|
if (this._sxWidth) lines.push(this._sxWidth.getStringIndented());
|
|
16407
|
+
if (this._locked) lines.push(" (locked yes)");
|
|
15337
16408
|
if (this._sxLayer) lines.push(this._sxLayer.getStringIndented());
|
|
15338
|
-
if (this._net !== void 0)
|
|
16409
|
+
if (this._net !== void 0) {
|
|
16410
|
+
const netValue = typeof this._net === "number" ? String(this._net) : quoteSExprString(this._net);
|
|
16411
|
+
lines.push(` (net ${netValue})`);
|
|
16412
|
+
}
|
|
15339
16413
|
if (this._sxUuid) lines.push(this._sxUuid.getStringIndented());
|
|
15340
16414
|
lines.push(")");
|
|
15341
16415
|
return lines.join("\n");
|
|
@@ -15364,6 +16438,26 @@ function parseString(value, label) {
|
|
|
15364
16438
|
}
|
|
15365
16439
|
return value;
|
|
15366
16440
|
}
|
|
16441
|
+
function parseNet(value) {
|
|
16442
|
+
const numeric = toNumberValue(value);
|
|
16443
|
+
if (numeric !== void 0) return numeric;
|
|
16444
|
+
const stringValue = toStringValue(value);
|
|
16445
|
+
if (stringValue !== void 0) return stringValue;
|
|
16446
|
+
throw new Error("arc net expects a numeric id or string name");
|
|
16447
|
+
}
|
|
16448
|
+
function parseLocked(args) {
|
|
16449
|
+
if (args.length === 0) return true;
|
|
16450
|
+
if (args.length !== 1) {
|
|
16451
|
+
throw new Error("arc locked expects at most one value");
|
|
16452
|
+
}
|
|
16453
|
+
const parsed = parseYesNo(args[0]);
|
|
16454
|
+
if (parsed === void 0) {
|
|
16455
|
+
throw new Error(
|
|
16456
|
+
`arc locked expects yes/no, received ${JSON.stringify(args[0])}`
|
|
16457
|
+
);
|
|
16458
|
+
}
|
|
16459
|
+
return parsed;
|
|
16460
|
+
}
|
|
15367
16461
|
function parseLayer(args) {
|
|
15368
16462
|
if (args.length !== 1) {
|
|
15369
16463
|
throw new Error("arc layer expects a single string value");
|
|
@@ -15420,7 +16514,7 @@ var SegmentEnd = class _SegmentEnd extends SxClass {
|
|
|
15420
16514
|
SxClass.register(SegmentEnd);
|
|
15421
16515
|
|
|
15422
16516
|
// lib/sexpr/classes/SegmentLocked.ts
|
|
15423
|
-
var
|
|
16517
|
+
var truthyStrings5 = /* @__PURE__ */ new Set(["true", "yes", "1"]);
|
|
15424
16518
|
var SegmentLocked = class _SegmentLocked extends SxPrimitiveBoolean {
|
|
15425
16519
|
static token = "locked";
|
|
15426
16520
|
static parentToken = "segment";
|
|
@@ -15434,7 +16528,7 @@ var SegmentLocked = class _SegmentLocked extends SxPrimitiveBoolean {
|
|
|
15434
16528
|
return new _SegmentLocked(rawValue);
|
|
15435
16529
|
}
|
|
15436
16530
|
if (typeof rawValue === "string") {
|
|
15437
|
-
return new _SegmentLocked(
|
|
16531
|
+
return new _SegmentLocked(truthyStrings5.has(rawValue.toLowerCase()));
|
|
15438
16532
|
}
|
|
15439
16533
|
return new _SegmentLocked(false);
|
|
15440
16534
|
}
|
|
@@ -15735,39 +16829,6 @@ var Segment = class _Segment extends SxClass {
|
|
|
15735
16829
|
};
|
|
15736
16830
|
SxClass.register(Segment);
|
|
15737
16831
|
|
|
15738
|
-
// lib/sexpr/classes/Layers.ts
|
|
15739
|
-
var Layers = class _Layers extends SxClass {
|
|
15740
|
-
static token = "layers";
|
|
15741
|
-
token = "layers";
|
|
15742
|
-
_names = [];
|
|
15743
|
-
constructor(names = []) {
|
|
15744
|
-
super();
|
|
15745
|
-
this.names = names;
|
|
15746
|
-
}
|
|
15747
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
15748
|
-
const names = primitiveSexprs.map(
|
|
15749
|
-
(primitive) => typeof primitive === "string" || typeof primitive === "number" ? String(primitive) : printSExpr(primitive)
|
|
15750
|
-
);
|
|
15751
|
-
return new _Layers(names);
|
|
15752
|
-
}
|
|
15753
|
-
get names() {
|
|
15754
|
-
return [...this._names];
|
|
15755
|
-
}
|
|
15756
|
-
set names(values) {
|
|
15757
|
-
this._names = values.map((value) => String(value));
|
|
15758
|
-
}
|
|
15759
|
-
getString() {
|
|
15760
|
-
const rendered = this._names.map((name) => {
|
|
15761
|
-
if (/^[^\s()"]+$/u.test(name) && !["nil", "#t", "#f"].includes(name)) {
|
|
15762
|
-
return name;
|
|
15763
|
-
}
|
|
15764
|
-
return quoteSExprString(name);
|
|
15765
|
-
}).join(" ");
|
|
15766
|
-
return `(layers ${rendered})`;
|
|
15767
|
-
}
|
|
15768
|
-
};
|
|
15769
|
-
SxClass.register(Layers);
|
|
15770
|
-
|
|
15771
16832
|
// lib/sexpr/classes/Setup/base.ts
|
|
15772
16833
|
var SingleValueProperty = class extends SxClass {
|
|
15773
16834
|
_value;
|
|
@@ -17887,7 +18948,7 @@ var PcbGeneralLegacyTeardrops = class _PcbGeneralLegacyTeardrops extends SxClass
|
|
|
17887
18948
|
SxClass.register(PcbGeneralLegacyTeardrops);
|
|
17888
18949
|
|
|
17889
18950
|
// lib/sexpr/classes/PcbGeneral.ts
|
|
17890
|
-
var
|
|
18951
|
+
var SINGLE_TOKENS6 = /* @__PURE__ */ new Set(["thickness", "legacy_teardrops"]);
|
|
17891
18952
|
var PcbGeneral = class _PcbGeneral extends SxClass {
|
|
17892
18953
|
static token = "general";
|
|
17893
18954
|
static parentToken = "kicad_pcb";
|
|
@@ -17898,14 +18959,14 @@ var PcbGeneral = class _PcbGeneral extends SxClass {
|
|
|
17898
18959
|
const general = new _PcbGeneral();
|
|
17899
18960
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
17900
18961
|
for (const token of Object.keys(propertyMap)) {
|
|
17901
|
-
if (!
|
|
18962
|
+
if (!SINGLE_TOKENS6.has(token)) {
|
|
17902
18963
|
throw new Error(
|
|
17903
18964
|
`general encountered unsupported child token "${token}"`
|
|
17904
18965
|
);
|
|
17905
18966
|
}
|
|
17906
18967
|
}
|
|
17907
18968
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
17908
|
-
if (!
|
|
18969
|
+
if (!SINGLE_TOKENS6.has(token)) {
|
|
17909
18970
|
throw new Error(
|
|
17910
18971
|
`general encountered unsupported child token "${token}"`
|
|
17911
18972
|
);
|
|
@@ -19068,6 +20129,7 @@ export {
|
|
|
19068
20129
|
GlobalLabel,
|
|
19069
20130
|
GrArc,
|
|
19070
20131
|
GrArcEnd,
|
|
20132
|
+
GrArcLocked,
|
|
19071
20133
|
GrArcMid,
|
|
19072
20134
|
GrArcStart,
|
|
19073
20135
|
GrCircle,
|
|
@@ -19364,6 +20426,36 @@ export {
|
|
|
19364
20426
|
Wire,
|
|
19365
20427
|
Xy,
|
|
19366
20428
|
Zone,
|
|
20429
|
+
ZoneAttr,
|
|
20430
|
+
ZoneAttrTeardrop,
|
|
20431
|
+
ZoneAttrTeardropType,
|
|
20432
|
+
ZoneConnectPads,
|
|
20433
|
+
ZoneConnectPadsClearance,
|
|
20434
|
+
ZoneFill,
|
|
20435
|
+
ZoneFillIslandAreaMin,
|
|
20436
|
+
ZoneFillIslandRemovalMode,
|
|
20437
|
+
ZoneFillRadius,
|
|
20438
|
+
ZoneFillSmoothing,
|
|
20439
|
+
ZoneFillThermalBridgeWidth,
|
|
20440
|
+
ZoneFillThermalGap,
|
|
20441
|
+
ZoneFilledAreasThickness,
|
|
20442
|
+
ZoneFilledPolygon,
|
|
20443
|
+
ZoneHatch,
|
|
20444
|
+
ZoneKeepout,
|
|
20445
|
+
ZoneKeepoutCopperpour,
|
|
20446
|
+
ZoneKeepoutFootprints,
|
|
20447
|
+
ZoneKeepoutPads,
|
|
20448
|
+
ZoneKeepoutTracks,
|
|
20449
|
+
ZoneKeepoutVias,
|
|
20450
|
+
ZoneMinThickness,
|
|
20451
|
+
ZoneName,
|
|
20452
|
+
ZoneNet,
|
|
20453
|
+
ZoneNetName,
|
|
20454
|
+
ZonePlacement,
|
|
20455
|
+
ZonePlacementEnabled,
|
|
20456
|
+
ZonePlacementSheetname,
|
|
20457
|
+
ZonePolygon,
|
|
20458
|
+
ZonePriority,
|
|
19367
20459
|
parseKicadMod,
|
|
19368
20460
|
parseKicadPcb,
|
|
19369
20461
|
parseKicadSch,
|