easyeda 0.0.270 → 0.0.272
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/browser/index.js +938 -231
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +2528 -1801
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +5776 -2546
- package/dist/main.cjs.map +1 -1
- package/package.json +5 -4
package/dist/browser/index.js
CHANGED
|
@@ -47,8 +47,10 @@ __export(dist_exports, {
|
|
|
47
47
|
layer_ref: () => layer_ref,
|
|
48
48
|
layer_string: () => layer_string,
|
|
49
49
|
length: () => length,
|
|
50
|
+
manufacturing_drc_properties: () => manufacturing_drc_properties,
|
|
50
51
|
ms: () => ms,
|
|
51
52
|
ninePointAnchor: () => ninePointAnchor,
|
|
53
|
+
parseAndConvertSiUnit: () => parseAndConvertSiUnit,
|
|
52
54
|
pcbRenderLayer: () => pcbRenderLayer,
|
|
53
55
|
pcb_autorouting_error: () => pcb_autorouting_error,
|
|
54
56
|
pcb_board: () => pcb_board,
|
|
@@ -66,6 +68,7 @@ __export(dist_exports, {
|
|
|
66
68
|
pcb_courtyard_circle: () => pcb_courtyard_circle,
|
|
67
69
|
pcb_courtyard_outline: () => pcb_courtyard_outline,
|
|
68
70
|
pcb_courtyard_overlap_error: () => pcb_courtyard_overlap_error,
|
|
71
|
+
pcb_courtyard_pill: () => pcb_courtyard_pill,
|
|
69
72
|
pcb_courtyard_polygon: () => pcb_courtyard_polygon,
|
|
70
73
|
pcb_courtyard_rect: () => pcb_courtyard_rect,
|
|
71
74
|
pcb_cutout: () => pcb_cutout,
|
|
@@ -97,6 +100,8 @@ __export(dist_exports, {
|
|
|
97
100
|
pcb_note_path: () => pcb_note_path,
|
|
98
101
|
pcb_note_rect: () => pcb_note_rect,
|
|
99
102
|
pcb_note_text: () => pcb_note_text,
|
|
103
|
+
pcb_pad_pad_clearance_error: () => pcb_pad_pad_clearance_error,
|
|
104
|
+
pcb_pad_trace_clearance_error: () => pcb_pad_trace_clearance_error,
|
|
100
105
|
pcb_panel: () => pcb_panel,
|
|
101
106
|
pcb_panelization_placement_error: () => pcb_panelization_placement_error,
|
|
102
107
|
pcb_placement_error: () => pcb_placement_error,
|
|
@@ -107,6 +112,8 @@ __export(dist_exports, {
|
|
|
107
112
|
pcb_route_hint: () => pcb_route_hint,
|
|
108
113
|
pcb_route_hints: () => pcb_route_hints,
|
|
109
114
|
pcb_silkscreen_circle: () => pcb_silkscreen_circle,
|
|
115
|
+
pcb_silkscreen_graphic: () => pcb_silkscreen_graphic,
|
|
116
|
+
pcb_silkscreen_graphic_brep: () => pcb_silkscreen_graphic_brep,
|
|
110
117
|
pcb_silkscreen_line: () => pcb_silkscreen_line,
|
|
111
118
|
pcb_silkscreen_oval: () => pcb_silkscreen_oval,
|
|
112
119
|
pcb_silkscreen_path: () => pcb_silkscreen_path,
|
|
@@ -123,10 +130,13 @@ __export(dist_exports, {
|
|
|
123
130
|
pcb_trace_hint: () => pcb_trace_hint,
|
|
124
131
|
pcb_trace_missing_error: () => pcb_trace_missing_error,
|
|
125
132
|
pcb_trace_route_point: () => pcb_trace_route_point,
|
|
133
|
+
pcb_trace_route_point_through_pad: () => pcb_trace_route_point_through_pad,
|
|
126
134
|
pcb_trace_route_point_via: () => pcb_trace_route_point_via,
|
|
127
135
|
pcb_trace_route_point_wire: () => pcb_trace_route_point_wire,
|
|
136
|
+
pcb_trace_warning: () => pcb_trace_warning,
|
|
128
137
|
pcb_via: () => pcb_via,
|
|
129
138
|
pcb_via_clearance_error: () => pcb_via_clearance_error,
|
|
139
|
+
pcb_via_trace_clearance_error: () => pcb_via_trace_clearance_error,
|
|
130
140
|
point: () => point,
|
|
131
141
|
point3: () => point3,
|
|
132
142
|
point_with_bulge: () => point_with_bulge,
|
|
@@ -167,12 +177,16 @@ __export(dist_exports, {
|
|
|
167
177
|
schematic_voltage_probe: () => schematic_voltage_probe,
|
|
168
178
|
simulation_ac_current_source: () => simulation_ac_current_source,
|
|
169
179
|
simulation_ac_voltage_source: () => simulation_ac_voltage_source,
|
|
180
|
+
simulation_current_probe: () => simulation_current_probe,
|
|
170
181
|
simulation_current_source: () => simulation_current_source,
|
|
171
182
|
simulation_dc_current_source: () => simulation_dc_current_source,
|
|
172
183
|
simulation_dc_voltage_source: () => simulation_dc_voltage_source,
|
|
173
184
|
simulation_experiment: () => simulation_experiment,
|
|
174
185
|
simulation_op_amp: () => simulation_op_amp,
|
|
186
|
+
simulation_oscilloscope_trace: () => simulation_oscilloscope_trace,
|
|
187
|
+
simulation_spice_subcircuit: () => simulation_spice_subcircuit,
|
|
175
188
|
simulation_switch: () => simulation_switch,
|
|
189
|
+
simulation_transient_current_graph: () => simulation_transient_current_graph,
|
|
176
190
|
simulation_transient_voltage_graph: () => simulation_transient_voltage_graph,
|
|
177
191
|
simulation_unknown_experiment_error: () => simulation_unknown_experiment_error,
|
|
178
192
|
simulation_voltage_probe: () => simulation_voltage_probe,
|
|
@@ -182,6 +196,7 @@ __export(dist_exports, {
|
|
|
182
196
|
source_board: () => source_board,
|
|
183
197
|
source_component_base: () => source_component_base,
|
|
184
198
|
source_component_internal_connection: () => source_component_internal_connection,
|
|
199
|
+
source_component_misconfigured_error: () => source_component_misconfigured_error,
|
|
185
200
|
source_component_pins_underspecified_warning: () => source_component_pins_underspecified_warning,
|
|
186
201
|
source_failed_to_create_component_error: () => source_failed_to_create_component_error,
|
|
187
202
|
source_group: () => source_group,
|
|
@@ -189,10 +204,12 @@ __export(dist_exports, {
|
|
|
189
204
|
source_interconnect: () => source_interconnect,
|
|
190
205
|
source_invalid_component_property_error: () => source_invalid_component_property_error,
|
|
191
206
|
source_manually_placed_via: () => source_manually_placed_via,
|
|
207
|
+
source_missing_manufacturer_part_number_warning: () => source_missing_manufacturer_part_number_warning,
|
|
192
208
|
source_missing_property_error: () => source_missing_property_error,
|
|
193
209
|
source_net: () => source_net,
|
|
194
210
|
source_no_ground_pin_defined_warning: () => source_no_ground_pin_defined_warning,
|
|
195
211
|
source_no_power_pin_defined_warning: () => source_no_power_pin_defined_warning,
|
|
212
|
+
source_part_not_found_warning: () => source_part_not_found_warning,
|
|
196
213
|
source_pcb_ground_plane: () => source_pcb_ground_plane,
|
|
197
214
|
source_pin_attributes: () => source_pin_attributes,
|
|
198
215
|
source_pin_missing_trace_warning: () => source_pin_missing_trace_warning,
|
|
@@ -200,6 +217,8 @@ __export(dist_exports, {
|
|
|
200
217
|
source_port: () => source_port,
|
|
201
218
|
source_project_metadata: () => source_project_metadata,
|
|
202
219
|
source_property_ignored_warning: () => source_property_ignored_warning,
|
|
220
|
+
source_refdes_convention_warning: () => source_refdes_convention_warning,
|
|
221
|
+
source_simple_ammeter: () => source_simple_ammeter,
|
|
203
222
|
source_simple_battery: () => source_simple_battery,
|
|
204
223
|
source_simple_capacitor: () => source_simple_capacitor,
|
|
205
224
|
source_simple_chip: () => source_simple_chip,
|
|
@@ -208,6 +227,7 @@ __export(dist_exports, {
|
|
|
208
227
|
source_simple_current_source: () => source_simple_current_source,
|
|
209
228
|
source_simple_diode: () => source_simple_diode,
|
|
210
229
|
source_simple_fiducial: () => source_simple_fiducial,
|
|
230
|
+
source_simple_fuse: () => source_simple_fuse,
|
|
211
231
|
source_simple_ground: () => source_simple_ground,
|
|
212
232
|
source_simple_inductor: () => source_simple_inductor,
|
|
213
233
|
source_simple_led: () => source_simple_led,
|
|
@@ -227,6 +247,9 @@ __export(dist_exports, {
|
|
|
227
247
|
source_simple_voltage_source: () => source_simple_voltage_source,
|
|
228
248
|
source_trace: () => source_trace,
|
|
229
249
|
source_trace_not_connected_error: () => source_trace_not_connected_error,
|
|
250
|
+
source_unnamed_trace_warning: () => source_unnamed_trace_warning,
|
|
251
|
+
spice_simulation_options: () => spice_simulation_options,
|
|
252
|
+
supplier_footprint_mismatch_warning: () => supplier_footprint_mismatch_warning,
|
|
230
253
|
supplier_name: () => supplier_name,
|
|
231
254
|
time: () => time,
|
|
232
255
|
timestamp: () => timestamp,
|
|
@@ -236,6 +259,273 @@ __export(dist_exports, {
|
|
|
236
259
|
wave_shape: () => wave_shape
|
|
237
260
|
});
|
|
238
261
|
|
|
262
|
+
// node_modules/format-si-unit/dist/index.js
|
|
263
|
+
var SI_PREFIX_VALUES = /* @__PURE__ */ new Map([
|
|
264
|
+
["T", 1e12],
|
|
265
|
+
["G", 1e9],
|
|
266
|
+
["M", 1e6],
|
|
267
|
+
["K", 1e3],
|
|
268
|
+
["k", 1e3],
|
|
269
|
+
["", 1],
|
|
270
|
+
["m", 1e-3],
|
|
271
|
+
["\xB5", 1e-6],
|
|
272
|
+
["u", 1e-6],
|
|
273
|
+
["n", 1e-9],
|
|
274
|
+
["p", 1e-12],
|
|
275
|
+
["f", 1e-15]
|
|
276
|
+
]);
|
|
277
|
+
var SI_PREFIXES = [...SI_PREFIX_VALUES.keys()];
|
|
278
|
+
function getSiPrefixMultiplier(prefix) {
|
|
279
|
+
return SI_PREFIX_VALUES.get(prefix);
|
|
280
|
+
}
|
|
281
|
+
var unitMappings = {
|
|
282
|
+
Hz: {
|
|
283
|
+
baseUnit: "Hz",
|
|
284
|
+
variants: {
|
|
285
|
+
MHz: 1e6,
|
|
286
|
+
kHz: 1e3,
|
|
287
|
+
Hz: 1
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
g: {
|
|
291
|
+
baseUnit: "g",
|
|
292
|
+
variants: {
|
|
293
|
+
kg: 1e3,
|
|
294
|
+
g: 1
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
\u03A9: {
|
|
298
|
+
baseUnit: "\u03A9",
|
|
299
|
+
variants: {
|
|
300
|
+
m\u03A9: 1e-3,
|
|
301
|
+
mohm: 1e-3,
|
|
302
|
+
mOhm: 1e-3,
|
|
303
|
+
milliohm: 1e-3,
|
|
304
|
+
\u03A9: 1,
|
|
305
|
+
ohm: 1,
|
|
306
|
+
Ohm: 1,
|
|
307
|
+
k\u03A9: 1e3,
|
|
308
|
+
K\u03A9: 1e3,
|
|
309
|
+
kohm: 1e3,
|
|
310
|
+
kOhm: 1e3,
|
|
311
|
+
KOhm: 1e3,
|
|
312
|
+
Kohm: 1e3,
|
|
313
|
+
M\u03A9: 1e6,
|
|
314
|
+
Mohm: 1e6,
|
|
315
|
+
MOhm: 1e6,
|
|
316
|
+
megohm: 1e6,
|
|
317
|
+
Megohm: 1e6,
|
|
318
|
+
G\u03A9: 1e9,
|
|
319
|
+
Gohm: 1e9,
|
|
320
|
+
GOhm: 1e9,
|
|
321
|
+
T\u03A9: 1e12,
|
|
322
|
+
Tohm: 1e12,
|
|
323
|
+
TOhm: 1e12
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
V: {
|
|
327
|
+
baseUnit: "V",
|
|
328
|
+
variants: {
|
|
329
|
+
mV: 1e-3,
|
|
330
|
+
V: 1,
|
|
331
|
+
kV: 1e3,
|
|
332
|
+
KV: 1e3,
|
|
333
|
+
MV: 1e6,
|
|
334
|
+
GV: 1e9,
|
|
335
|
+
TV: 1e12
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
A: {
|
|
339
|
+
baseUnit: "A",
|
|
340
|
+
variants: {
|
|
341
|
+
\u00B5A: 1e-6,
|
|
342
|
+
mA: 1e-3,
|
|
343
|
+
ma: 1e-3,
|
|
344
|
+
A: 1,
|
|
345
|
+
kA: 1e3,
|
|
346
|
+
MA: 1e6
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
F: {
|
|
350
|
+
baseUnit: "F",
|
|
351
|
+
variants: {
|
|
352
|
+
pF: 1e-12,
|
|
353
|
+
nF: 1e-9,
|
|
354
|
+
\u00B5F: 1e-6,
|
|
355
|
+
uF: 1e-6,
|
|
356
|
+
mF: 1e-3,
|
|
357
|
+
F: 1,
|
|
358
|
+
kF: 1e3,
|
|
359
|
+
KF: 1e3,
|
|
360
|
+
MF: 1e6
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
H: {
|
|
364
|
+
baseUnit: "H",
|
|
365
|
+
variants: {
|
|
366
|
+
pH: 1e-12,
|
|
367
|
+
nH: 1e-9,
|
|
368
|
+
\u00B5H: 1e-6,
|
|
369
|
+
uH: 1e-6,
|
|
370
|
+
mH: 1e-3,
|
|
371
|
+
H: 1,
|
|
372
|
+
kH: 1e3,
|
|
373
|
+
KH: 1e3,
|
|
374
|
+
MH: 1e6
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
ml: {
|
|
378
|
+
baseUnit: "ml",
|
|
379
|
+
variants: {
|
|
380
|
+
ml: 1,
|
|
381
|
+
mL: 1,
|
|
382
|
+
l: 1e3,
|
|
383
|
+
L: 1e3
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
deg: {
|
|
387
|
+
baseUnit: "deg",
|
|
388
|
+
variants: {
|
|
389
|
+
rad: 180 / Math.PI
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
ms: {
|
|
393
|
+
baseUnit: "ms",
|
|
394
|
+
variants: {
|
|
395
|
+
fs: 1e-12,
|
|
396
|
+
ps: 1e-9,
|
|
397
|
+
ns: 1e-6,
|
|
398
|
+
us: 1e-3,
|
|
399
|
+
\u00B5s: 1e-3,
|
|
400
|
+
ms: 1,
|
|
401
|
+
s: 1e3
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
mm: {
|
|
405
|
+
baseUnit: "mm",
|
|
406
|
+
variants: {
|
|
407
|
+
nm: 1e-6,
|
|
408
|
+
\u00B5m: 1e-3,
|
|
409
|
+
um: 1e-3,
|
|
410
|
+
mm: 1,
|
|
411
|
+
cm: 10,
|
|
412
|
+
dm: 100,
|
|
413
|
+
m: 1e3,
|
|
414
|
+
km: 1e6,
|
|
415
|
+
in: 25.4,
|
|
416
|
+
ft: 304.8,
|
|
417
|
+
IN: 25.4,
|
|
418
|
+
FT: 304.8,
|
|
419
|
+
yd: 914.4,
|
|
420
|
+
mi: 1609344,
|
|
421
|
+
mil: 0.0254
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
|
|
426
|
+
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
427
|
+
unitMappingAndVariantSuffixes.add(baseUnit);
|
|
428
|
+
for (const variant of Object.keys(info.variants)) {
|
|
429
|
+
unitMappingAndVariantSuffixes.add(variant);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
function getBaseTscircuitUnit(unit) {
|
|
433
|
+
for (const info of Object.values(unitMappings)) {
|
|
434
|
+
if (unit in info.variants) {
|
|
435
|
+
return {
|
|
436
|
+
baseUnit: info.baseUnit,
|
|
437
|
+
conversionFactor: info.variants[unit]
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
for (const [variant, conversionFactor] of Object.entries(info.variants)) {
|
|
441
|
+
if (!unit.endsWith(variant)) continue;
|
|
442
|
+
const prefix = unit.slice(0, -variant.length);
|
|
443
|
+
const prefixMultiplier = getSiPrefixMultiplier(prefix);
|
|
444
|
+
if (prefixMultiplier == null) continue;
|
|
445
|
+
return {
|
|
446
|
+
baseUnit: info.baseUnit,
|
|
447
|
+
conversionFactor: prefixMultiplier * conversionFactor
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return {
|
|
452
|
+
baseUnit: unit,
|
|
453
|
+
conversionFactor: 1
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function parseAndConvertSiUnit(v, unitOfValue) {
|
|
457
|
+
if (v === void 0 || v === null)
|
|
458
|
+
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
459
|
+
if (typeof v === "string" && v.match(/^-?[\d.]+$/))
|
|
460
|
+
return {
|
|
461
|
+
value: Number.parseFloat(v),
|
|
462
|
+
parsedUnit: null,
|
|
463
|
+
unitOfValue: null
|
|
464
|
+
};
|
|
465
|
+
if (typeof v === "number")
|
|
466
|
+
return { value: v, parsedUnit: null, unitOfValue: null };
|
|
467
|
+
if (typeof v === "object" && "x" in v && "y" in v) {
|
|
468
|
+
const firstResult = parseAndConvertSiUnit(v.x, unitOfValue);
|
|
469
|
+
const xResult = parseAndConvertSiUnit(v.x, unitOfValue);
|
|
470
|
+
const yResult = parseAndConvertSiUnit(v.y, unitOfValue);
|
|
471
|
+
if (xResult.value === null || yResult.value === null) {
|
|
472
|
+
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
parsedUnit: firstResult.parsedUnit,
|
|
476
|
+
unitOfValue: firstResult.unitOfValue,
|
|
477
|
+
value: {
|
|
478
|
+
x: xResult.value,
|
|
479
|
+
y: yResult.value
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
const reversedInputString = v.toString().split("").reverse().join("");
|
|
484
|
+
const unitReversed = reversedInputString.match(/[^\d\s]+/)?.[0];
|
|
485
|
+
if (!unitReversed) {
|
|
486
|
+
throw new Error(`Could not determine unit: "${v}"`);
|
|
487
|
+
}
|
|
488
|
+
const unit = unitReversed.split("").reverse().join("");
|
|
489
|
+
const numberPart = v.slice(0, -unit.length);
|
|
490
|
+
const bareSiPrefixMultiplier = getSiPrefixMultiplier(unit);
|
|
491
|
+
if (unitOfValue && bareSiPrefixMultiplier != null) {
|
|
492
|
+
return {
|
|
493
|
+
parsedUnit: null,
|
|
494
|
+
unitOfValue,
|
|
495
|
+
value: Number.parseFloat(numberPart) * bareSiPrefixMultiplier
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
if (bareSiPrefixMultiplier != null && !unitMappingAndVariantSuffixes.has(unit)) {
|
|
499
|
+
return {
|
|
500
|
+
parsedUnit: null,
|
|
501
|
+
unitOfValue: null,
|
|
502
|
+
value: Number.parseFloat(numberPart) * bareSiPrefixMultiplier
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
|
|
506
|
+
return {
|
|
507
|
+
parsedUnit: unit,
|
|
508
|
+
unitOfValue: baseUnit,
|
|
509
|
+
value: conversionFactor * Number.parseFloat(numberPart)
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
var SI_PREFIX_PATTERN = SI_PREFIXES.filter((prefix) => prefix !== "").sort((a, b) => b.length - a.length).map((prefix) => prefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
513
|
+
var SI_UNIT_PATTERN = new RegExp(
|
|
514
|
+
`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${SI_PREFIX_PATTERN}))?$`
|
|
515
|
+
);
|
|
516
|
+
var SI_PREFIXES2 = [
|
|
517
|
+
{ value: 1e12, symbol: "T" },
|
|
518
|
+
{ value: 1e9, symbol: "G" },
|
|
519
|
+
{ value: 1e6, symbol: "M" },
|
|
520
|
+
{ value: 1e3, symbol: "k" },
|
|
521
|
+
{ value: 1, symbol: "" },
|
|
522
|
+
{ value: 1e-3, symbol: "m" },
|
|
523
|
+
{ value: 1e-6, symbol: "\xB5" },
|
|
524
|
+
{ value: 1e-9, symbol: "n" },
|
|
525
|
+
{ value: 1e-12, symbol: "p" }
|
|
526
|
+
];
|
|
527
|
+
var FALLBACK_PREFIX = SI_PREFIXES2[SI_PREFIXES2.length - 1];
|
|
528
|
+
|
|
239
529
|
// node_modules/zod/v3/external.js
|
|
240
530
|
var external_exports = {};
|
|
241
531
|
__export(external_exports, {
|
|
@@ -4278,220 +4568,16 @@ var coerce = {
|
|
|
4278
4568
|
var NEVER = INVALID;
|
|
4279
4569
|
|
|
4280
4570
|
// node_modules/circuit-json/dist/index.mjs
|
|
4281
|
-
var
|
|
4282
|
-
|
|
4283
|
-
baseUnit: "Hz",
|
|
4284
|
-
variants: {
|
|
4285
|
-
MHz: 1e6,
|
|
4286
|
-
kHz: 1e3,
|
|
4287
|
-
Hz: 1
|
|
4288
|
-
}
|
|
4289
|
-
},
|
|
4290
|
-
g: {
|
|
4291
|
-
baseUnit: "g",
|
|
4292
|
-
variants: {
|
|
4293
|
-
kg: 1e3,
|
|
4294
|
-
g: 1
|
|
4295
|
-
}
|
|
4296
|
-
},
|
|
4297
|
-
\u03A9: {
|
|
4298
|
-
baseUnit: "\u03A9",
|
|
4299
|
-
variants: {
|
|
4300
|
-
m\u03A9: 1e-3,
|
|
4301
|
-
\u03A9: 1,
|
|
4302
|
-
k\u03A9: 1e3,
|
|
4303
|
-
K\u03A9: 1e3,
|
|
4304
|
-
kohm: 1e3,
|
|
4305
|
-
M\u03A9: 1e6,
|
|
4306
|
-
G\u03A9: 1e9,
|
|
4307
|
-
T\u03A9: 1e12
|
|
4308
|
-
}
|
|
4309
|
-
},
|
|
4310
|
-
V: {
|
|
4311
|
-
baseUnit: "V",
|
|
4312
|
-
variants: {
|
|
4313
|
-
mV: 1e-3,
|
|
4314
|
-
V: 1,
|
|
4315
|
-
kV: 1e3,
|
|
4316
|
-
KV: 1e3,
|
|
4317
|
-
MV: 1e6,
|
|
4318
|
-
GV: 1e9,
|
|
4319
|
-
TV: 1e12
|
|
4320
|
-
}
|
|
4321
|
-
},
|
|
4322
|
-
A: {
|
|
4323
|
-
baseUnit: "A",
|
|
4324
|
-
variants: {
|
|
4325
|
-
\u00B5A: 1e-6,
|
|
4326
|
-
mA: 1e-3,
|
|
4327
|
-
ma: 1e-3,
|
|
4328
|
-
A: 1,
|
|
4329
|
-
kA: 1e3,
|
|
4330
|
-
MA: 1e6
|
|
4331
|
-
}
|
|
4332
|
-
},
|
|
4333
|
-
F: {
|
|
4334
|
-
baseUnit: "F",
|
|
4335
|
-
variants: {
|
|
4336
|
-
pF: 1e-12,
|
|
4337
|
-
nF: 1e-9,
|
|
4338
|
-
\u00B5F: 1e-6,
|
|
4339
|
-
uF: 1e-6,
|
|
4340
|
-
mF: 1e-3,
|
|
4341
|
-
F: 1
|
|
4342
|
-
}
|
|
4343
|
-
},
|
|
4344
|
-
ml: {
|
|
4345
|
-
baseUnit: "ml",
|
|
4346
|
-
variants: {
|
|
4347
|
-
ml: 1,
|
|
4348
|
-
mL: 1,
|
|
4349
|
-
l: 1e3,
|
|
4350
|
-
L: 1e3
|
|
4351
|
-
}
|
|
4352
|
-
},
|
|
4353
|
-
deg: {
|
|
4354
|
-
baseUnit: "deg",
|
|
4355
|
-
variants: {
|
|
4356
|
-
rad: 180 / Math.PI
|
|
4357
|
-
}
|
|
4358
|
-
},
|
|
4359
|
-
ms: {
|
|
4360
|
-
baseUnit: "ms",
|
|
4361
|
-
variants: {
|
|
4362
|
-
fs: 1e-12,
|
|
4363
|
-
ps: 1e-9,
|
|
4364
|
-
ns: 1e-6,
|
|
4365
|
-
us: 1e-3,
|
|
4366
|
-
\u00B5s: 1e-3,
|
|
4367
|
-
ms: 1,
|
|
4368
|
-
s: 1e3
|
|
4369
|
-
}
|
|
4370
|
-
},
|
|
4371
|
-
mm: {
|
|
4372
|
-
baseUnit: "mm",
|
|
4373
|
-
variants: {
|
|
4374
|
-
nm: 1e-6,
|
|
4375
|
-
\u00B5m: 1e-3,
|
|
4376
|
-
um: 1e-3,
|
|
4377
|
-
mm: 1,
|
|
4378
|
-
cm: 10,
|
|
4379
|
-
dm: 100,
|
|
4380
|
-
m: 1e3,
|
|
4381
|
-
km: 1e6,
|
|
4382
|
-
in: 25.4,
|
|
4383
|
-
ft: 304.8,
|
|
4384
|
-
IN: 25.4,
|
|
4385
|
-
FT: 304.8,
|
|
4386
|
-
yd: 914.4,
|
|
4387
|
-
mi: 1609344,
|
|
4388
|
-
mil: 0.0254
|
|
4389
|
-
}
|
|
4390
|
-
}
|
|
4391
|
-
};
|
|
4392
|
-
var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
|
|
4393
|
-
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
4394
|
-
unitMappingAndVariantSuffixes.add(baseUnit);
|
|
4395
|
-
for (const variant of Object.keys(info.variants)) {
|
|
4396
|
-
unitMappingAndVariantSuffixes.add(variant);
|
|
4397
|
-
}
|
|
4398
|
-
}
|
|
4399
|
-
function getBaseTscircuitUnit(unit) {
|
|
4400
|
-
for (const [baseUnit, info] of Object.entries(unitMappings)) {
|
|
4401
|
-
if (unit in info.variants) {
|
|
4402
|
-
return {
|
|
4403
|
-
baseUnit: info.baseUnit,
|
|
4404
|
-
conversionFactor: info.variants[unit]
|
|
4405
|
-
};
|
|
4406
|
-
}
|
|
4407
|
-
}
|
|
4408
|
-
return {
|
|
4409
|
-
baseUnit: unit,
|
|
4410
|
-
conversionFactor: 1
|
|
4411
|
-
};
|
|
4412
|
-
}
|
|
4413
|
-
var si_prefix_multiplier = {
|
|
4414
|
-
tera: 1e12,
|
|
4415
|
-
T: 1e12,
|
|
4416
|
-
giga: 1e9,
|
|
4417
|
-
G: 1e9,
|
|
4418
|
-
mega: 1e6,
|
|
4419
|
-
M: 1e6,
|
|
4420
|
-
kilo: 1e3,
|
|
4421
|
-
k: 1e3,
|
|
4422
|
-
deci: 0.1,
|
|
4423
|
-
d: 0.1,
|
|
4424
|
-
centi: 0.01,
|
|
4425
|
-
c: 0.01,
|
|
4426
|
-
milli: 1e-3,
|
|
4427
|
-
m: 1e-3,
|
|
4428
|
-
micro: 1e-6,
|
|
4429
|
-
u: 1e-6,
|
|
4430
|
-
\u00B5: 1e-6,
|
|
4431
|
-
nano: 1e-9,
|
|
4432
|
-
n: 1e-9,
|
|
4433
|
-
pico: 1e-12,
|
|
4434
|
-
p: 1e-12
|
|
4435
|
-
};
|
|
4436
|
-
function parseAndConvertSiUnit(v) {
|
|
4437
|
-
if (v === void 0 || v === null)
|
|
4438
|
-
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
4439
|
-
if (typeof v === "string" && v.match(/^-?[\d\.]+$/))
|
|
4440
|
-
return {
|
|
4441
|
-
value: Number.parseFloat(v),
|
|
4442
|
-
parsedUnit: null,
|
|
4443
|
-
unitOfValue: null
|
|
4444
|
-
};
|
|
4445
|
-
if (typeof v === "number")
|
|
4446
|
-
return { value: v, parsedUnit: null, unitOfValue: null };
|
|
4447
|
-
if (typeof v === "object" && "x" in v && "y" in v) {
|
|
4448
|
-
const { parsedUnit, unitOfValue } = parseAndConvertSiUnit(v.x);
|
|
4449
|
-
const xResult = parseAndConvertSiUnit(v.x);
|
|
4450
|
-
const yResult = parseAndConvertSiUnit(v.y);
|
|
4451
|
-
if (xResult.value === null || yResult.value === null) {
|
|
4452
|
-
return { parsedUnit: null, unitOfValue: null, value: null };
|
|
4453
|
-
}
|
|
4454
|
-
return {
|
|
4455
|
-
parsedUnit,
|
|
4456
|
-
unitOfValue,
|
|
4457
|
-
value: {
|
|
4458
|
-
x: xResult.value,
|
|
4459
|
-
y: yResult.value
|
|
4460
|
-
}
|
|
4461
|
-
};
|
|
4462
|
-
}
|
|
4463
|
-
const reversed_input_string = v.toString().split("").reverse().join("");
|
|
4464
|
-
const unit_reversed = reversed_input_string.match(/[^\d\s]+/)?.[0];
|
|
4465
|
-
if (!unit_reversed) {
|
|
4466
|
-
throw new Error(`Could not determine unit: "${v}"`);
|
|
4467
|
-
}
|
|
4468
|
-
const unit = unit_reversed.split("").reverse().join("");
|
|
4469
|
-
const numberPart = v.slice(0, -unit.length);
|
|
4470
|
-
if (unit in si_prefix_multiplier && !unitMappingAndVariantSuffixes.has(unit)) {
|
|
4471
|
-
const siMultiplier = si_prefix_multiplier[unit];
|
|
4472
|
-
return {
|
|
4473
|
-
parsedUnit: null,
|
|
4474
|
-
unitOfValue: null,
|
|
4475
|
-
value: Number.parseFloat(numberPart) * siMultiplier
|
|
4476
|
-
};
|
|
4477
|
-
}
|
|
4478
|
-
const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
|
|
4479
|
-
return {
|
|
4480
|
-
parsedUnit: unit,
|
|
4481
|
-
unitOfValue: baseUnit,
|
|
4482
|
-
value: conversionFactor * Number.parseFloat(numberPart)
|
|
4483
|
-
};
|
|
4484
|
-
}
|
|
4485
|
-
var resistance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4486
|
-
var capacitance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value).transform((value) => {
|
|
4571
|
+
var resistance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "\u03A9").value);
|
|
4572
|
+
var capacitance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "F").value).transform((value) => {
|
|
4487
4573
|
return Number.parseFloat(value.toPrecision(12));
|
|
4488
4574
|
});
|
|
4489
|
-
var inductance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4490
|
-
var voltage = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4575
|
+
var inductance = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "H").value);
|
|
4576
|
+
var voltage = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "V").value);
|
|
4491
4577
|
var length = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4492
|
-
var frequency = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4578
|
+
var frequency = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "Hz").value);
|
|
4493
4579
|
var distance = length;
|
|
4494
|
-
var current = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4580
|
+
var current = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "A").value);
|
|
4495
4581
|
var duration_ms = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
|
|
4496
4582
|
var time = duration_ms;
|
|
4497
4583
|
var ms = duration_ms;
|
|
@@ -4804,6 +4890,16 @@ var source_simple_current_source = source_component_base.extend({
|
|
|
4804
4890
|
expectTypesMatch(
|
|
4805
4891
|
true
|
|
4806
4892
|
);
|
|
4893
|
+
var source_simple_fuse = source_component_base.extend({
|
|
4894
|
+
ftype: external_exports.literal("simple_fuse"),
|
|
4895
|
+
current_rating_amps: external_exports.number().describe("Nominal current in amps the fuse is rated for"),
|
|
4896
|
+
voltage_rating_volts: external_exports.number().describe("Voltage rating in volts, e.g. \xB15V would be 5")
|
|
4897
|
+
});
|
|
4898
|
+
expectTypesMatch(true);
|
|
4899
|
+
var source_simple_ammeter = source_component_base.extend({
|
|
4900
|
+
ftype: external_exports.literal("simple_ammeter")
|
|
4901
|
+
});
|
|
4902
|
+
expectTypesMatch(true);
|
|
4807
4903
|
var source_pin_attributes = external_exports.object({
|
|
4808
4904
|
must_be_connected: external_exports.boolean().optional(),
|
|
4809
4905
|
provides_power: external_exports.boolean().optional(),
|
|
@@ -4844,12 +4940,6 @@ var source_pin_attributes = external_exports.object({
|
|
|
4844
4940
|
supports_uart_rx: external_exports.boolean().optional()
|
|
4845
4941
|
});
|
|
4846
4942
|
expectTypesMatch(true);
|
|
4847
|
-
var source_simple_fuse = source_component_base.extend({
|
|
4848
|
-
ftype: external_exports.literal("simple_fuse"),
|
|
4849
|
-
current_rating_amps: external_exports.number().describe("Nominal current in amps the fuse is rated for"),
|
|
4850
|
-
voltage_rating_volts: external_exports.number().describe("Voltage rating in volts, e.g. \xB15V would be 5")
|
|
4851
|
-
});
|
|
4852
|
-
expectTypesMatch(true);
|
|
4853
4943
|
var source_simple_battery = source_component_base.extend({
|
|
4854
4944
|
ftype: external_exports.literal("simple_battery"),
|
|
4855
4945
|
capacity: battery_capacity
|
|
@@ -4858,6 +4948,7 @@ expectTypesMatch(true);
|
|
|
4858
4948
|
var source_simple_inductor = source_component_base.extend({
|
|
4859
4949
|
ftype: external_exports.literal("simple_inductor"),
|
|
4860
4950
|
inductance,
|
|
4951
|
+
display_inductance: external_exports.string().optional(),
|
|
4861
4952
|
max_current_rating: external_exports.number().optional()
|
|
4862
4953
|
});
|
|
4863
4954
|
expectTypesMatch(true);
|
|
@@ -5021,6 +5112,37 @@ var source_pin_missing_trace_warning = external_exports.object({
|
|
|
5021
5112
|
"Warning emitted when a source component pin is missing a trace connection"
|
|
5022
5113
|
);
|
|
5023
5114
|
expectTypesMatch(true);
|
|
5115
|
+
var source_missing_manufacturer_part_number_warning = external_exports.object({
|
|
5116
|
+
type: external_exports.literal("source_missing_manufacturer_part_number_warning"),
|
|
5117
|
+
source_missing_manufacturer_part_number_warning_id: getZodPrefixedIdWithDefault(
|
|
5118
|
+
"source_missing_manufacturer_part_number_warning"
|
|
5119
|
+
),
|
|
5120
|
+
warning_type: external_exports.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),
|
|
5121
|
+
message: external_exports.string(),
|
|
5122
|
+
source_component_id: external_exports.string(),
|
|
5123
|
+
standard: external_exports.string(),
|
|
5124
|
+
subcircuit_id: external_exports.string().optional()
|
|
5125
|
+
}).describe(
|
|
5126
|
+
"Warning emitted when a standard connector is missing manufacturer part number"
|
|
5127
|
+
);
|
|
5128
|
+
expectTypesMatch(true);
|
|
5129
|
+
var source_refdes_convention_warning = external_exports.object({
|
|
5130
|
+
type: external_exports.literal("source_refdes_convention_warning"),
|
|
5131
|
+
source_refdes_convention_warning_id: getZodPrefixedIdWithDefault(
|
|
5132
|
+
"source_refdes_convention_warning"
|
|
5133
|
+
),
|
|
5134
|
+
warning_type: external_exports.literal("source_refdes_convention_warning").default("source_refdes_convention_warning"),
|
|
5135
|
+
message: external_exports.string(),
|
|
5136
|
+
source_component_id: external_exports.string(),
|
|
5137
|
+
refdes: external_exports.string(),
|
|
5138
|
+
source_component_ftype: external_exports.string(),
|
|
5139
|
+
expected_prefixes: external_exports.array(external_exports.string()),
|
|
5140
|
+
actual_prefix: external_exports.string().optional(),
|
|
5141
|
+
subcircuit_id: external_exports.string().optional()
|
|
5142
|
+
}).describe(
|
|
5143
|
+
"Warning emitted when a source component reference designator does not match the component type convention"
|
|
5144
|
+
);
|
|
5145
|
+
expectTypesMatch(true);
|
|
5024
5146
|
var source_simple_voltage_probe = source_component_base.extend({
|
|
5025
5147
|
ftype: external_exports.literal("simple_voltage_probe")
|
|
5026
5148
|
});
|
|
@@ -5042,6 +5164,18 @@ var source_i2c_misconfigured_error = base_circuit_json_error.extend({
|
|
|
5042
5164
|
"Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"
|
|
5043
5165
|
);
|
|
5044
5166
|
expectTypesMatch(true);
|
|
5167
|
+
var source_component_misconfigured_error = base_circuit_json_error.extend({
|
|
5168
|
+
type: external_exports.literal("source_component_misconfigured_error"),
|
|
5169
|
+
source_component_misconfigured_error_id: getZodPrefixedIdWithDefault(
|
|
5170
|
+
"source_component_misconfigured_error"
|
|
5171
|
+
),
|
|
5172
|
+
error_type: external_exports.literal("source_component_misconfigured_error").default("source_component_misconfigured_error"),
|
|
5173
|
+
source_component_ids: external_exports.array(external_exports.string()),
|
|
5174
|
+
source_port_ids: external_exports.array(external_exports.string()).optional()
|
|
5175
|
+
}).describe(
|
|
5176
|
+
"Error emitted when one or more source components have an invalid or conflicting configuration"
|
|
5177
|
+
);
|
|
5178
|
+
expectTypesMatch(true);
|
|
5045
5179
|
var source_simple_voltage_source = source_component_base.extend({
|
|
5046
5180
|
ftype: external_exports.literal("simple_voltage_source"),
|
|
5047
5181
|
voltage,
|
|
@@ -5049,7 +5183,12 @@ var source_simple_voltage_source = source_component_base.extend({
|
|
|
5049
5183
|
peak_to_peak_voltage: voltage.optional(),
|
|
5050
5184
|
wave_shape: external_exports.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
5051
5185
|
phase: rotation.optional(),
|
|
5052
|
-
duty_cycle: external_exports.number().optional().describe("Duty cycle as a fraction (0 to 1)")
|
|
5186
|
+
duty_cycle: external_exports.number().optional().describe("Duty cycle as a fraction (0 to 1)"),
|
|
5187
|
+
pulse_delay: ms.optional(),
|
|
5188
|
+
rise_time: ms.optional(),
|
|
5189
|
+
fall_time: ms.optional(),
|
|
5190
|
+
pulse_width: ms.optional(),
|
|
5191
|
+
period: ms.optional()
|
|
5053
5192
|
});
|
|
5054
5193
|
expectTypesMatch(
|
|
5055
5194
|
true
|
|
@@ -5064,6 +5203,7 @@ var any_source_component = external_exports.union([
|
|
|
5064
5203
|
source_simple_chip,
|
|
5065
5204
|
source_simple_power_source,
|
|
5066
5205
|
source_simple_current_source,
|
|
5206
|
+
source_simple_ammeter,
|
|
5067
5207
|
source_simple_battery,
|
|
5068
5208
|
source_simple_inductor,
|
|
5069
5209
|
source_simple_push_button,
|
|
@@ -5089,7 +5229,10 @@ var any_source_component = external_exports.union([
|
|
|
5089
5229
|
source_trace_not_connected_error,
|
|
5090
5230
|
source_property_ignored_warning,
|
|
5091
5231
|
source_pin_missing_trace_warning,
|
|
5092
|
-
|
|
5232
|
+
source_missing_manufacturer_part_number_warning,
|
|
5233
|
+
source_refdes_convention_warning,
|
|
5234
|
+
source_i2c_misconfigured_error,
|
|
5235
|
+
source_component_misconfigured_error
|
|
5093
5236
|
]);
|
|
5094
5237
|
expectTypesMatch(true);
|
|
5095
5238
|
var source_port = external_exports.object({
|
|
@@ -5121,6 +5264,7 @@ var source_trace = external_exports.object({
|
|
|
5121
5264
|
subcircuit_id: external_exports.string().optional(),
|
|
5122
5265
|
subcircuit_connectivity_map_key: external_exports.string().optional(),
|
|
5123
5266
|
max_length: external_exports.number().optional(),
|
|
5267
|
+
name: external_exports.string().optional(),
|
|
5124
5268
|
min_trace_thickness: external_exports.number().optional(),
|
|
5125
5269
|
display_name: external_exports.string().optional()
|
|
5126
5270
|
});
|
|
@@ -5211,6 +5355,19 @@ var source_manually_placed_via = external_exports.object({
|
|
|
5211
5355
|
source_trace_id: external_exports.string().optional()
|
|
5212
5356
|
}).describe("Defines a via that is manually placed in the source domain");
|
|
5213
5357
|
expectTypesMatch(true);
|
|
5358
|
+
var source_unnamed_trace_warning = external_exports.object({
|
|
5359
|
+
type: external_exports.literal("source_unnamed_trace_warning"),
|
|
5360
|
+
source_unnamed_trace_warning_id: getZodPrefixedIdWithDefault(
|
|
5361
|
+
"source_unnamed_trace_warning"
|
|
5362
|
+
),
|
|
5363
|
+
warning_type: external_exports.literal("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),
|
|
5364
|
+
message: external_exports.string(),
|
|
5365
|
+
source_trace_id: external_exports.string(),
|
|
5366
|
+
subcircuit_id: external_exports.string().optional()
|
|
5367
|
+
}).describe("Warning emitted when a source trace is missing a name");
|
|
5368
|
+
expectTypesMatch(
|
|
5369
|
+
true
|
|
5370
|
+
);
|
|
5214
5371
|
var source_no_power_pin_defined_warning = external_exports.object({
|
|
5215
5372
|
type: external_exports.literal("source_no_power_pin_defined_warning"),
|
|
5216
5373
|
source_no_power_pin_defined_warning_id: getZodPrefixedIdWithDefault(
|
|
@@ -5278,8 +5435,26 @@ var unknown_error_finding_part = base_circuit_json_error.extend({
|
|
|
5278
5435
|
"Error emitted when an unexpected error occurs while finding a part"
|
|
5279
5436
|
);
|
|
5280
5437
|
expectTypesMatch(true);
|
|
5438
|
+
var source_part_not_found_warning = external_exports.object({
|
|
5439
|
+
type: external_exports.literal("source_part_not_found_warning"),
|
|
5440
|
+
source_part_not_found_warning_id: getZodPrefixedIdWithDefault(
|
|
5441
|
+
"source_part_not_found_warning"
|
|
5442
|
+
),
|
|
5443
|
+
warning_type: external_exports.literal("source_part_not_found_warning").default("source_part_not_found_warning"),
|
|
5444
|
+
message: external_exports.string(),
|
|
5445
|
+
source_component_id: external_exports.string().optional(),
|
|
5446
|
+
subcircuit_id: external_exports.string().optional(),
|
|
5447
|
+
supplier_name: supplier_name.optional(),
|
|
5448
|
+
manufacturer_part_number: external_exports.string().optional(),
|
|
5449
|
+
supplier_part_number: external_exports.string().optional(),
|
|
5450
|
+
part_name: external_exports.string().optional()
|
|
5451
|
+
}).describe("Warning emitted when a requested part can not be found");
|
|
5452
|
+
expectTypesMatch(
|
|
5453
|
+
true
|
|
5454
|
+
);
|
|
5281
5455
|
var schematic_box = external_exports.object({
|
|
5282
5456
|
type: external_exports.literal("schematic_box"),
|
|
5457
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5283
5458
|
schematic_component_id: external_exports.string().optional(),
|
|
5284
5459
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5285
5460
|
width: distance,
|
|
@@ -5293,12 +5468,16 @@ expectTypesMatch(true);
|
|
|
5293
5468
|
var schematic_path = external_exports.object({
|
|
5294
5469
|
type: external_exports.literal("schematic_path"),
|
|
5295
5470
|
schematic_path_id: getZodPrefixedIdWithDefault("schematic_path"),
|
|
5471
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5296
5472
|
schematic_component_id: external_exports.string().optional(),
|
|
5297
5473
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5298
5474
|
fill_color: external_exports.string().optional(),
|
|
5299
5475
|
is_filled: external_exports.boolean().optional(),
|
|
5476
|
+
is_dashed: external_exports.boolean().default(false),
|
|
5300
5477
|
stroke_width: distance.nullable().optional(),
|
|
5301
5478
|
stroke_color: external_exports.string().optional(),
|
|
5479
|
+
dash_length: distance.optional(),
|
|
5480
|
+
dash_gap: distance.optional(),
|
|
5302
5481
|
points: external_exports.array(point),
|
|
5303
5482
|
subcircuit_id: external_exports.string().optional()
|
|
5304
5483
|
});
|
|
@@ -5351,6 +5530,7 @@ var schematic_component = external_exports.object({
|
|
|
5351
5530
|
center: point,
|
|
5352
5531
|
source_component_id: external_exports.string().optional(),
|
|
5353
5532
|
schematic_component_id: external_exports.string(),
|
|
5533
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5354
5534
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5355
5535
|
pin_spacing: length.optional(),
|
|
5356
5536
|
pin_styles: schematic_pin_styles.optional(),
|
|
@@ -5381,6 +5561,7 @@ expectTypesMatch(true);
|
|
|
5381
5561
|
var schematic_line = external_exports.object({
|
|
5382
5562
|
type: external_exports.literal("schematic_line"),
|
|
5383
5563
|
schematic_line_id: getZodPrefixedIdWithDefault("schematic_line"),
|
|
5564
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5384
5565
|
schematic_component_id: external_exports.string().optional(),
|
|
5385
5566
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5386
5567
|
x1: distance,
|
|
@@ -5390,12 +5571,15 @@ var schematic_line = external_exports.object({
|
|
|
5390
5571
|
stroke_width: distance.nullable().optional(),
|
|
5391
5572
|
color: external_exports.string().default("#000000"),
|
|
5392
5573
|
is_dashed: external_exports.boolean().default(false),
|
|
5574
|
+
dash_length: distance.optional(),
|
|
5575
|
+
dash_gap: distance.optional(),
|
|
5393
5576
|
subcircuit_id: external_exports.string().optional()
|
|
5394
5577
|
}).describe("Draws a styled line on the schematic");
|
|
5395
5578
|
expectTypesMatch(true);
|
|
5396
5579
|
var schematic_rect = external_exports.object({
|
|
5397
5580
|
type: external_exports.literal("schematic_rect"),
|
|
5398
5581
|
schematic_rect_id: getZodPrefixedIdWithDefault("schematic_rect"),
|
|
5582
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5399
5583
|
schematic_component_id: external_exports.string().optional(),
|
|
5400
5584
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5401
5585
|
center: point,
|
|
@@ -5413,6 +5597,7 @@ expectTypesMatch(true);
|
|
|
5413
5597
|
var schematic_circle = external_exports.object({
|
|
5414
5598
|
type: external_exports.literal("schematic_circle"),
|
|
5415
5599
|
schematic_circle_id: getZodPrefixedIdWithDefault("schematic_circle"),
|
|
5600
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5416
5601
|
schematic_component_id: external_exports.string().optional(),
|
|
5417
5602
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5418
5603
|
center: point,
|
|
@@ -5428,6 +5613,7 @@ expectTypesMatch(true);
|
|
|
5428
5613
|
var schematic_arc = external_exports.object({
|
|
5429
5614
|
type: external_exports.literal("schematic_arc"),
|
|
5430
5615
|
schematic_arc_id: getZodPrefixedIdWithDefault("schematic_arc"),
|
|
5616
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5431
5617
|
schematic_component_id: external_exports.string().optional(),
|
|
5432
5618
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5433
5619
|
center: point,
|
|
@@ -5444,6 +5630,7 @@ expectTypesMatch(true);
|
|
|
5444
5630
|
var schematic_trace = external_exports.object({
|
|
5445
5631
|
type: external_exports.literal("schematic_trace"),
|
|
5446
5632
|
schematic_trace_id: external_exports.string(),
|
|
5633
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5447
5634
|
source_trace_id: external_exports.string().optional(),
|
|
5448
5635
|
junctions: external_exports.array(
|
|
5449
5636
|
external_exports.object({
|
|
@@ -5481,6 +5668,7 @@ var fivePointAnchor = external_exports.enum([
|
|
|
5481
5668
|
expectTypesMatch(true);
|
|
5482
5669
|
var schematic_text = external_exports.object({
|
|
5483
5670
|
type: external_exports.literal("schematic_text"),
|
|
5671
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5484
5672
|
schematic_component_id: external_exports.string().optional(),
|
|
5485
5673
|
schematic_symbol_id: external_exports.string().optional(),
|
|
5486
5674
|
schematic_text_id: external_exports.string(),
|
|
@@ -5500,6 +5688,7 @@ var schematic_port = external_exports.object({
|
|
|
5500
5688
|
type: external_exports.literal("schematic_port"),
|
|
5501
5689
|
schematic_port_id: external_exports.string(),
|
|
5502
5690
|
source_port_id: external_exports.string(),
|
|
5691
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5503
5692
|
schematic_component_id: external_exports.string().optional(),
|
|
5504
5693
|
center: point,
|
|
5505
5694
|
facing_direction: external_exports.enum(["up", "down", "left", "right"]).optional(),
|
|
@@ -5518,6 +5707,7 @@ expectTypesMatch(true);
|
|
|
5518
5707
|
var schematic_net_label = external_exports.object({
|
|
5519
5708
|
type: external_exports.literal("schematic_net_label"),
|
|
5520
5709
|
schematic_net_label_id: getZodPrefixedIdWithDefault("schematic_net_label"),
|
|
5710
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5521
5711
|
schematic_trace_id: external_exports.string().optional(),
|
|
5522
5712
|
source_trace_id: external_exports.string().optional(),
|
|
5523
5713
|
source_net_id: external_exports.string(),
|
|
@@ -5577,6 +5767,7 @@ expectTypesMatch(true);
|
|
|
5577
5767
|
var schematic_voltage_probe = external_exports.object({
|
|
5578
5768
|
type: external_exports.literal("schematic_voltage_probe"),
|
|
5579
5769
|
schematic_voltage_probe_id: external_exports.string(),
|
|
5770
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5580
5771
|
source_component_id: external_exports.string().optional(),
|
|
5581
5772
|
name: external_exports.string().optional(),
|
|
5582
5773
|
position: point,
|
|
@@ -5605,6 +5796,7 @@ expectTypesMatch(true);
|
|
|
5605
5796
|
var schematic_group = external_exports.object({
|
|
5606
5797
|
type: external_exports.literal("schematic_group"),
|
|
5607
5798
|
schematic_group_id: getZodPrefixedIdWithDefault("schematic_group"),
|
|
5799
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5608
5800
|
source_group_id: external_exports.string(),
|
|
5609
5801
|
is_subcircuit: external_exports.boolean().optional(),
|
|
5610
5802
|
subcircuit_id: external_exports.string().optional(),
|
|
@@ -5620,6 +5812,7 @@ expectTypesMatch(true);
|
|
|
5620
5812
|
var schematic_table = external_exports.object({
|
|
5621
5813
|
type: external_exports.literal("schematic_table"),
|
|
5622
5814
|
schematic_table_id: getZodPrefixedIdWithDefault("schematic_table"),
|
|
5815
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5623
5816
|
anchor_position: point,
|
|
5624
5817
|
column_widths: external_exports.array(distance),
|
|
5625
5818
|
row_heights: external_exports.array(distance),
|
|
@@ -5635,6 +5828,7 @@ var schematic_table_cell = external_exports.object({
|
|
|
5635
5828
|
schematic_table_cell_id: getZodPrefixedIdWithDefault(
|
|
5636
5829
|
"schematic_table_cell"
|
|
5637
5830
|
),
|
|
5831
|
+
schematic_sheet_id: external_exports.string().optional(),
|
|
5638
5832
|
schematic_table_id: external_exports.string(),
|
|
5639
5833
|
start_row_index: external_exports.number(),
|
|
5640
5834
|
end_row_index: external_exports.number(),
|
|
@@ -5654,7 +5848,9 @@ var schematic_sheet = external_exports.object({
|
|
|
5654
5848
|
type: external_exports.literal("schematic_sheet"),
|
|
5655
5849
|
schematic_sheet_id: getZodPrefixedIdWithDefault("schematic_sheet"),
|
|
5656
5850
|
name: external_exports.string().optional(),
|
|
5657
|
-
|
|
5851
|
+
sheet_index: external_exports.number().optional(),
|
|
5852
|
+
subcircuit_id: external_exports.string().optional(),
|
|
5853
|
+
outline_color: external_exports.string().optional()
|
|
5658
5854
|
}).describe(
|
|
5659
5855
|
"Defines a schematic sheet or page that components can be placed on"
|
|
5660
5856
|
);
|
|
@@ -5691,6 +5887,19 @@ var route_hint_point = external_exports.object({
|
|
|
5691
5887
|
trace_width: distance.optional()
|
|
5692
5888
|
});
|
|
5693
5889
|
expectTypesMatch(true);
|
|
5890
|
+
var manufacturing_drc_properties = external_exports.object({
|
|
5891
|
+
min_trace_width: length.optional(),
|
|
5892
|
+
min_board_edge_clearance: length.optional(),
|
|
5893
|
+
min_via_hole_edge_to_via_hole_edge_clearance: length.optional(),
|
|
5894
|
+
min_plated_hole_drill_edge_to_drill_edge_clearance: length.optional(),
|
|
5895
|
+
min_trace_to_pad_edge_clearance: length.optional(),
|
|
5896
|
+
min_pad_edge_to_pad_edge_clearance: length.optional(),
|
|
5897
|
+
min_same_net_trace_edge_to_trace_edge_clearance: length.optional(),
|
|
5898
|
+
min_different_net_trace_edge_to_trace_edge_clearance: length.optional(),
|
|
5899
|
+
min_via_edge_to_pad_edge_clearance: length.optional(),
|
|
5900
|
+
min_via_hole_diameter: length.optional(),
|
|
5901
|
+
min_via_pad_diameter: length.optional()
|
|
5902
|
+
});
|
|
5694
5903
|
var pcb_component = external_exports.object({
|
|
5695
5904
|
type: external_exports.literal("pcb_component"),
|
|
5696
5905
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
@@ -5721,6 +5930,13 @@ var pcb_component = external_exports.object({
|
|
|
5721
5930
|
positioned_relative_to_pcb_group_id: external_exports.string().optional(),
|
|
5722
5931
|
positioned_relative_to_pcb_board_id: external_exports.string().optional(),
|
|
5723
5932
|
cable_insertion_center: point.optional(),
|
|
5933
|
+
insertion_direction: external_exports.enum([
|
|
5934
|
+
"from_above",
|
|
5935
|
+
"from_left",
|
|
5936
|
+
"from_right",
|
|
5937
|
+
"from_front",
|
|
5938
|
+
"from_back"
|
|
5939
|
+
]).optional(),
|
|
5724
5940
|
metadata: external_exports.object({
|
|
5725
5941
|
kicad_footprint: kicadFootprintMetadata.optional()
|
|
5726
5942
|
}).optional(),
|
|
@@ -6252,12 +6468,23 @@ var pcb_trace_route_point_via = external_exports.object({
|
|
|
6252
6468
|
is_inside_copper_pour: external_exports.boolean().optional(),
|
|
6253
6469
|
hole_diameter: distance.optional(),
|
|
6254
6470
|
outer_diameter: distance.optional(),
|
|
6255
|
-
from_layer:
|
|
6256
|
-
to_layer:
|
|
6471
|
+
from_layer: layer_ref,
|
|
6472
|
+
to_layer: layer_ref
|
|
6473
|
+
});
|
|
6474
|
+
var pcb_trace_route_point_through_pad = external_exports.object({
|
|
6475
|
+
route_type: external_exports.literal("through_pad"),
|
|
6476
|
+
start: point,
|
|
6477
|
+
end: point,
|
|
6478
|
+
width: distance,
|
|
6479
|
+
start_layer: layer_ref,
|
|
6480
|
+
end_layer: layer_ref,
|
|
6481
|
+
pcb_smtpad_id: external_exports.string().optional(),
|
|
6482
|
+
pcb_plated_hole_id: external_exports.string().optional()
|
|
6257
6483
|
});
|
|
6258
6484
|
var pcb_trace_route_point = external_exports.union([
|
|
6259
6485
|
pcb_trace_route_point_wire,
|
|
6260
|
-
pcb_trace_route_point_via
|
|
6486
|
+
pcb_trace_route_point_via,
|
|
6487
|
+
pcb_trace_route_point_through_pad
|
|
6261
6488
|
]);
|
|
6262
6489
|
var pcb_trace = external_exports.object({
|
|
6263
6490
|
type: external_exports.literal("pcb_trace"),
|
|
@@ -6275,6 +6502,19 @@ var pcb_trace = external_exports.object({
|
|
|
6275
6502
|
}).describe("Defines a trace on the PCB");
|
|
6276
6503
|
expectTypesMatch(true);
|
|
6277
6504
|
expectTypesMatch(true);
|
|
6505
|
+
var pcb_trace_warning = external_exports.object({
|
|
6506
|
+
type: external_exports.literal("pcb_trace_warning"),
|
|
6507
|
+
pcb_trace_warning_id: getZodPrefixedIdWithDefault("pcb_trace_warning"),
|
|
6508
|
+
warning_type: external_exports.literal("pcb_trace_warning").default("pcb_trace_warning"),
|
|
6509
|
+
message: external_exports.string(),
|
|
6510
|
+
center: point.optional(),
|
|
6511
|
+
pcb_trace_id: external_exports.string(),
|
|
6512
|
+
source_trace_id: external_exports.string(),
|
|
6513
|
+
pcb_component_ids: external_exports.array(external_exports.string()),
|
|
6514
|
+
pcb_port_ids: external_exports.array(external_exports.string()),
|
|
6515
|
+
subcircuit_id: external_exports.string().optional()
|
|
6516
|
+
}).describe("Defines a trace warning on the PCB");
|
|
6517
|
+
expectTypesMatch(true);
|
|
6278
6518
|
var pcb_trace_error = base_circuit_json_error.extend({
|
|
6279
6519
|
type: external_exports.literal("pcb_trace_error"),
|
|
6280
6520
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
@@ -6373,10 +6613,12 @@ var pcb_board = external_exports.object({
|
|
|
6373
6613
|
outline: external_exports.array(point).optional(),
|
|
6374
6614
|
shape: external_exports.enum(["rect", "polygon"]).optional(),
|
|
6375
6615
|
material: external_exports.enum(["fr4", "fr1"]).default("fr4"),
|
|
6616
|
+
solder_mask_color: external_exports.string().optional(),
|
|
6617
|
+
silkscreen_color: external_exports.string().optional(),
|
|
6376
6618
|
anchor_position: point.optional(),
|
|
6377
6619
|
anchor_alignment: ninePointAnchor.optional(),
|
|
6378
6620
|
position_mode: external_exports.enum(["relative_to_panel_anchor", "none"]).optional()
|
|
6379
|
-
}).describe("Defines the board outline of the PCB");
|
|
6621
|
+
}).merge(manufacturing_drc_properties).describe("Defines the board outline of the PCB");
|
|
6380
6622
|
expectTypesMatch(true);
|
|
6381
6623
|
var pcb_panel = external_exports.object({
|
|
6382
6624
|
type: external_exports.literal("pcb_panel"),
|
|
@@ -6384,6 +6626,7 @@ var pcb_panel = external_exports.object({
|
|
|
6384
6626
|
width: length,
|
|
6385
6627
|
height: length,
|
|
6386
6628
|
center: point,
|
|
6629
|
+
thickness: length.optional().default(1.4),
|
|
6387
6630
|
covered_with_solder_mask: external_exports.boolean().optional().default(true)
|
|
6388
6631
|
}).describe("Defines a PCB panel that can contain multiple boards");
|
|
6389
6632
|
expectTypesMatch(true);
|
|
@@ -6524,7 +6767,8 @@ var pcb_silkscreen_circle = external_exports.object({
|
|
|
6524
6767
|
center: point,
|
|
6525
6768
|
radius: length,
|
|
6526
6769
|
layer: visible_layer,
|
|
6527
|
-
stroke_width: length.default("1mm")
|
|
6770
|
+
stroke_width: length.default("1mm"),
|
|
6771
|
+
is_filled: external_exports.boolean().optional()
|
|
6528
6772
|
}).describe("Defines a silkscreen circle on the PCB");
|
|
6529
6773
|
expectTypesMatch(true);
|
|
6530
6774
|
var pcb_silkscreen_oval = external_exports.object({
|
|
@@ -6540,6 +6784,26 @@ var pcb_silkscreen_oval = external_exports.object({
|
|
|
6540
6784
|
ccw_rotation: rotation.optional()
|
|
6541
6785
|
}).describe("Defines a silkscreen oval on the PCB");
|
|
6542
6786
|
expectTypesMatch(true);
|
|
6787
|
+
var pcb_silkscreen_graphic_base = external_exports.object({
|
|
6788
|
+
type: external_exports.literal("pcb_silkscreen_graphic"),
|
|
6789
|
+
pcb_silkscreen_graphic_id: getZodPrefixedIdWithDefault(
|
|
6790
|
+
"pcb_silkscreen_graphic"
|
|
6791
|
+
),
|
|
6792
|
+
pcb_component_id: external_exports.string(),
|
|
6793
|
+
pcb_group_id: external_exports.string().optional(),
|
|
6794
|
+
subcircuit_id: external_exports.string().optional(),
|
|
6795
|
+
layer: visible_layer,
|
|
6796
|
+
image_asset: asset.optional()
|
|
6797
|
+
});
|
|
6798
|
+
var pcb_silkscreen_graphic_brep = pcb_silkscreen_graphic_base.extend({
|
|
6799
|
+
shape: external_exports.literal("brep"),
|
|
6800
|
+
brep_shape
|
|
6801
|
+
}).describe("Defines a BRep silkscreen graphic on the PCB");
|
|
6802
|
+
expectTypesMatch(
|
|
6803
|
+
true
|
|
6804
|
+
);
|
|
6805
|
+
var pcb_silkscreen_graphic = external_exports.discriminatedUnion("shape", [pcb_silkscreen_graphic_brep]).describe("Defines a silkscreen graphic on the PCB");
|
|
6806
|
+
expectTypesMatch(true);
|
|
6543
6807
|
var pcb_silkscreen_pill = external_exports.object({
|
|
6544
6808
|
type: external_exports.literal("pcb_silkscreen_pill"),
|
|
6545
6809
|
pcb_silkscreen_pill_id: getZodPrefixedIdWithDefault("pcb_silkscreen_pill"),
|
|
@@ -6564,6 +6828,7 @@ var pcb_fabrication_note_text = external_exports.object({
|
|
|
6564
6828
|
font_size: distance.default("1mm"),
|
|
6565
6829
|
pcb_component_id: external_exports.string(),
|
|
6566
6830
|
text: external_exports.string(),
|
|
6831
|
+
ccw_rotation: external_exports.number().optional(),
|
|
6567
6832
|
layer: visible_layer,
|
|
6568
6833
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
6569
6834
|
anchor_alignment: external_exports.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
@@ -6644,6 +6909,8 @@ var pcb_note_text = external_exports.object({
|
|
|
6644
6909
|
text: external_exports.string().optional(),
|
|
6645
6910
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
6646
6911
|
anchor_alignment: external_exports.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
6912
|
+
layer: visible_layer.default("top"),
|
|
6913
|
+
is_mirrored_from_top_view: external_exports.boolean().optional(),
|
|
6647
6914
|
color: external_exports.string().optional()
|
|
6648
6915
|
}).describe("Defines a documentation note in text on the PCB");
|
|
6649
6916
|
expectTypesMatch(true);
|
|
@@ -6658,6 +6925,7 @@ var pcb_note_rect = external_exports.object({
|
|
|
6658
6925
|
center: point,
|
|
6659
6926
|
width: length,
|
|
6660
6927
|
height: length,
|
|
6928
|
+
layer: visible_layer.default("top"),
|
|
6661
6929
|
stroke_width: length.default("0.1mm"),
|
|
6662
6930
|
corner_radius: length.optional(),
|
|
6663
6931
|
is_filled: external_exports.boolean().optional(),
|
|
@@ -6675,6 +6943,7 @@ var pcb_note_path = external_exports.object({
|
|
|
6675
6943
|
name: external_exports.string().optional(),
|
|
6676
6944
|
text: external_exports.string().optional(),
|
|
6677
6945
|
route: external_exports.array(point),
|
|
6946
|
+
layer: visible_layer.default("top"),
|
|
6678
6947
|
stroke_width: length.default("0.1mm"),
|
|
6679
6948
|
color: external_exports.string().optional()
|
|
6680
6949
|
}).describe("Defines a polyline documentation note on the PCB");
|
|
@@ -6691,6 +6960,7 @@ var pcb_note_line = external_exports.object({
|
|
|
6691
6960
|
y1: distance,
|
|
6692
6961
|
x2: distance,
|
|
6693
6962
|
y2: distance,
|
|
6963
|
+
layer: visible_layer.default("top"),
|
|
6694
6964
|
stroke_width: distance.default("0.1mm"),
|
|
6695
6965
|
color: external_exports.string().optional(),
|
|
6696
6966
|
is_dashed: external_exports.boolean().optional()
|
|
@@ -6714,6 +6984,7 @@ var pcb_note_dimension = external_exports.object({
|
|
|
6714
6984
|
}).optional(),
|
|
6715
6985
|
font: external_exports.literal("tscircuit2024").default("tscircuit2024"),
|
|
6716
6986
|
font_size: length.default("1mm"),
|
|
6987
|
+
layer: visible_layer.default("top"),
|
|
6717
6988
|
color: external_exports.string().optional(),
|
|
6718
6989
|
arrow_size: length.default("1mm")
|
|
6719
6990
|
}).describe("Defines a measurement annotation within PCB documentation notes");
|
|
@@ -6925,6 +7196,25 @@ var pcb_connector_not_in_accessible_orientation_warning = external_exports.objec
|
|
|
6925
7196
|
"Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"
|
|
6926
7197
|
);
|
|
6927
7198
|
expectTypesMatch(true);
|
|
7199
|
+
var supplier_footprint_mismatch_warning = external_exports.object({
|
|
7200
|
+
type: external_exports.literal("supplier_footprint_mismatch_warning"),
|
|
7201
|
+
supplier_footprint_mismatch_warning_id: getZodPrefixedIdWithDefault(
|
|
7202
|
+
"supplier_footprint_mismatch_warning"
|
|
7203
|
+
),
|
|
7204
|
+
warning_type: external_exports.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),
|
|
7205
|
+
message: external_exports.string(),
|
|
7206
|
+
source_component_id: external_exports.string(),
|
|
7207
|
+
pcb_component_id: external_exports.string().optional(),
|
|
7208
|
+
pcb_group_id: external_exports.string().optional(),
|
|
7209
|
+
subcircuit_id: external_exports.string().optional(),
|
|
7210
|
+
supplier_name: supplier_name.optional(),
|
|
7211
|
+
supplier_part_number: external_exports.string().optional(),
|
|
7212
|
+
supplier_footprint_url: external_exports.string().optional(),
|
|
7213
|
+
footprint_copper_intersection_over_union: external_exports.number()
|
|
7214
|
+
}).describe(
|
|
7215
|
+
"Warning emitted when a supplier part footprint does not match the expected footprint"
|
|
7216
|
+
);
|
|
7217
|
+
expectTypesMatch(true);
|
|
6928
7218
|
var pcb_breakout_point = external_exports.object({
|
|
6929
7219
|
type: external_exports.literal("pcb_breakout_point"),
|
|
6930
7220
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
@@ -7071,6 +7361,64 @@ var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
|
7071
7361
|
subcircuit_id: external_exports.string().optional()
|
|
7072
7362
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
7073
7363
|
expectTypesMatch(true);
|
|
7364
|
+
var pcb_via_trace_clearance_error = base_circuit_json_error.extend({
|
|
7365
|
+
type: external_exports.literal("pcb_via_trace_clearance_error"),
|
|
7366
|
+
pcb_via_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
7367
|
+
"pcb_via_trace_clearance_error"
|
|
7368
|
+
),
|
|
7369
|
+
error_type: external_exports.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),
|
|
7370
|
+
pcb_via_id: external_exports.string(),
|
|
7371
|
+
pcb_trace_id: external_exports.string(),
|
|
7372
|
+
minimum_clearance: distance.optional(),
|
|
7373
|
+
actual_clearance: distance.optional(),
|
|
7374
|
+
center: external_exports.object({
|
|
7375
|
+
x: external_exports.number().optional(),
|
|
7376
|
+
y: external_exports.number().optional()
|
|
7377
|
+
}).optional(),
|
|
7378
|
+
subcircuit_id: external_exports.string().optional()
|
|
7379
|
+
}).describe(
|
|
7380
|
+
"Error emitted when a via and trace are closer than the allowed clearance"
|
|
7381
|
+
);
|
|
7382
|
+
expectTypesMatch(
|
|
7383
|
+
true
|
|
7384
|
+
);
|
|
7385
|
+
var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
7386
|
+
type: external_exports.literal("pcb_pad_pad_clearance_error"),
|
|
7387
|
+
pcb_pad_pad_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
7388
|
+
"pcb_pad_pad_clearance_error"
|
|
7389
|
+
),
|
|
7390
|
+
error_type: external_exports.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),
|
|
7391
|
+
pcb_pad_ids: external_exports.array(external_exports.string()).min(2),
|
|
7392
|
+
minimum_clearance: distance.optional(),
|
|
7393
|
+
actual_clearance: distance.optional(),
|
|
7394
|
+
center: external_exports.object({
|
|
7395
|
+
x: external_exports.number().optional(),
|
|
7396
|
+
y: external_exports.number().optional()
|
|
7397
|
+
}).optional(),
|
|
7398
|
+
subcircuit_id: external_exports.string().optional()
|
|
7399
|
+
}).describe("Error emitted when pads are closer than the allowed clearance");
|
|
7400
|
+
expectTypesMatch(true);
|
|
7401
|
+
var pcb_pad_trace_clearance_error = base_circuit_json_error.extend({
|
|
7402
|
+
type: external_exports.literal("pcb_pad_trace_clearance_error"),
|
|
7403
|
+
pcb_pad_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
7404
|
+
"pcb_pad_trace_clearance_error"
|
|
7405
|
+
),
|
|
7406
|
+
error_type: external_exports.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),
|
|
7407
|
+
pcb_pad_id: external_exports.string(),
|
|
7408
|
+
pcb_trace_id: external_exports.string(),
|
|
7409
|
+
minimum_clearance: distance.optional(),
|
|
7410
|
+
actual_clearance: distance.optional(),
|
|
7411
|
+
center: external_exports.object({
|
|
7412
|
+
x: external_exports.number().optional(),
|
|
7413
|
+
y: external_exports.number().optional()
|
|
7414
|
+
}).optional(),
|
|
7415
|
+
subcircuit_id: external_exports.string().optional()
|
|
7416
|
+
}).describe(
|
|
7417
|
+
"Error emitted when a pad and trace are closer than allowed clearance"
|
|
7418
|
+
);
|
|
7419
|
+
expectTypesMatch(
|
|
7420
|
+
true
|
|
7421
|
+
);
|
|
7074
7422
|
var pcb_courtyard_rect = external_exports.object({
|
|
7075
7423
|
type: external_exports.literal("pcb_courtyard_rect"),
|
|
7076
7424
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
@@ -7124,6 +7472,20 @@ var pcb_courtyard_circle = external_exports.object({
|
|
|
7124
7472
|
color: external_exports.string().optional()
|
|
7125
7473
|
}).describe("Defines a courtyard circle on the PCB");
|
|
7126
7474
|
expectTypesMatch(true);
|
|
7475
|
+
var pcb_courtyard_pill = external_exports.object({
|
|
7476
|
+
type: external_exports.literal("pcb_courtyard_pill"),
|
|
7477
|
+
pcb_courtyard_pill_id: getZodPrefixedIdWithDefault("pcb_courtyard_pill"),
|
|
7478
|
+
pcb_component_id: external_exports.string(),
|
|
7479
|
+
pcb_group_id: external_exports.string().optional(),
|
|
7480
|
+
subcircuit_id: external_exports.string().optional(),
|
|
7481
|
+
center: point,
|
|
7482
|
+
width: length,
|
|
7483
|
+
height: length,
|
|
7484
|
+
radius: length,
|
|
7485
|
+
layer: visible_layer,
|
|
7486
|
+
color: external_exports.string().optional()
|
|
7487
|
+
}).describe("Defines a courtyard pill on the PCB");
|
|
7488
|
+
expectTypesMatch(true);
|
|
7127
7489
|
var cad_model_formats = [
|
|
7128
7490
|
"obj",
|
|
7129
7491
|
"stl",
|
|
@@ -7184,6 +7546,7 @@ var cad_component = external_exports.object({
|
|
|
7184
7546
|
model_object_fit: external_exports.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
7185
7547
|
model_jscad: external_exports.any().optional(),
|
|
7186
7548
|
show_as_translucent_model: external_exports.boolean().optional(),
|
|
7549
|
+
show_as_bounding_box: external_exports.boolean().optional(),
|
|
7187
7550
|
anchor_alignment: external_exports.enum(["center", "center_of_component_on_board_surface"]).optional().default("center")
|
|
7188
7551
|
}).describe("Defines a component on the PCB");
|
|
7189
7552
|
expectTypesMatch(true);
|
|
@@ -7226,7 +7589,12 @@ var simulation_ac_voltage_source = external_exports.object({
|
|
|
7226
7589
|
peak_to_peak_voltage: voltage.optional(),
|
|
7227
7590
|
wave_shape: wave_shape.optional(),
|
|
7228
7591
|
phase: rotation.optional(),
|
|
7229
|
-
duty_cycle: percentage.optional()
|
|
7592
|
+
duty_cycle: percentage.optional(),
|
|
7593
|
+
pulse_delay: ms.optional(),
|
|
7594
|
+
rise_time: ms.optional(),
|
|
7595
|
+
fall_time: ms.optional(),
|
|
7596
|
+
pulse_width: ms.optional(),
|
|
7597
|
+
period: ms.optional()
|
|
7230
7598
|
}).describe("Defines an AC voltage source for simulation");
|
|
7231
7599
|
var simulation_voltage_source = external_exports.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
7232
7600
|
expectTypesMatch(true);
|
|
@@ -7282,6 +7650,12 @@ var experiment_type = external_exports.union([
|
|
|
7282
7650
|
external_exports.literal("spice_transient_analysis"),
|
|
7283
7651
|
external_exports.literal("spice_ac_analysis")
|
|
7284
7652
|
]);
|
|
7653
|
+
var spice_simulation_options = external_exports.object({
|
|
7654
|
+
method: external_exports.enum(["trap", "gear"]).optional(),
|
|
7655
|
+
reltol: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
7656
|
+
abstol: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
7657
|
+
vntol: external_exports.union([external_exports.number(), external_exports.string()]).optional()
|
|
7658
|
+
}).describe("SPICE solver options for a simulation experiment");
|
|
7285
7659
|
var simulation_experiment = external_exports.object({
|
|
7286
7660
|
type: external_exports.literal("simulation_experiment"),
|
|
7287
7661
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
@@ -7291,7 +7665,8 @@ var simulation_experiment = external_exports.object({
|
|
|
7291
7665
|
experiment_type,
|
|
7292
7666
|
time_per_step: duration_ms.optional(),
|
|
7293
7667
|
start_time_ms: ms.optional(),
|
|
7294
|
-
end_time_ms: ms.optional()
|
|
7668
|
+
end_time_ms: ms.optional(),
|
|
7669
|
+
spice_options: spice_simulation_options.optional()
|
|
7295
7670
|
}).describe("Defines a simulation experiment configuration");
|
|
7296
7671
|
expectTypesMatch(true);
|
|
7297
7672
|
var simulation_transient_voltage_graph = external_exports.object({
|
|
@@ -7311,6 +7686,23 @@ var simulation_transient_voltage_graph = external_exports.object({
|
|
|
7311
7686
|
color: external_exports.string().optional()
|
|
7312
7687
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
7313
7688
|
expectTypesMatch(true);
|
|
7689
|
+
var simulation_transient_current_graph = external_exports.object({
|
|
7690
|
+
type: external_exports.literal("simulation_transient_current_graph"),
|
|
7691
|
+
simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
|
|
7692
|
+
"simulation_transient_current_graph"
|
|
7693
|
+
),
|
|
7694
|
+
simulation_experiment_id: external_exports.string(),
|
|
7695
|
+
timestamps_ms: external_exports.array(external_exports.number()).optional(),
|
|
7696
|
+
current_levels: external_exports.array(external_exports.number()),
|
|
7697
|
+
source_component_id: external_exports.string().optional(),
|
|
7698
|
+
subcircuit_connectivity_map_key: external_exports.string().optional(),
|
|
7699
|
+
time_per_step: duration_ms,
|
|
7700
|
+
start_time_ms: ms,
|
|
7701
|
+
end_time_ms: ms,
|
|
7702
|
+
name: external_exports.string().optional(),
|
|
7703
|
+
color: external_exports.string().optional()
|
|
7704
|
+
}).describe("Stores current measurements over time for a simulation");
|
|
7705
|
+
expectTypesMatch(true);
|
|
7314
7706
|
var simulation_switch = external_exports.object({
|
|
7315
7707
|
type: external_exports.literal("simulation_switch"),
|
|
7316
7708
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
@@ -7371,6 +7763,59 @@ var simulation_voltage_probe = external_exports.object({
|
|
|
7371
7763
|
}
|
|
7372
7764
|
});
|
|
7373
7765
|
expectTypesMatch(true);
|
|
7766
|
+
var simulation_current_probe = external_exports.object({
|
|
7767
|
+
type: external_exports.literal("simulation_current_probe"),
|
|
7768
|
+
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
7769
|
+
"simulation_current_probe"
|
|
7770
|
+
),
|
|
7771
|
+
source_component_id: external_exports.string().optional(),
|
|
7772
|
+
name: external_exports.string().optional(),
|
|
7773
|
+
positive_source_port_id: external_exports.string().optional(),
|
|
7774
|
+
negative_source_port_id: external_exports.string().optional(),
|
|
7775
|
+
positive_source_net_id: external_exports.string().optional(),
|
|
7776
|
+
negative_source_net_id: external_exports.string().optional(),
|
|
7777
|
+
subcircuit_id: external_exports.string().optional(),
|
|
7778
|
+
color: external_exports.string().optional()
|
|
7779
|
+
}).describe(
|
|
7780
|
+
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
7781
|
+
).superRefine((data, ctx) => {
|
|
7782
|
+
const hasPositivePort = !!data.positive_source_port_id;
|
|
7783
|
+
const hasNegativePort = !!data.negative_source_port_id;
|
|
7784
|
+
const hasPositiveNet = !!data.positive_source_net_id;
|
|
7785
|
+
const hasNegativeNet = !!data.negative_source_net_id;
|
|
7786
|
+
const hasPorts = hasPositivePort || hasNegativePort;
|
|
7787
|
+
const hasNets = hasPositiveNet || hasNegativeNet;
|
|
7788
|
+
if (hasPorts && hasNets) {
|
|
7789
|
+
ctx.addIssue({
|
|
7790
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7791
|
+
message: "Cannot mix port and net connections in a current probe."
|
|
7792
|
+
});
|
|
7793
|
+
return;
|
|
7794
|
+
}
|
|
7795
|
+
if (hasPorts) {
|
|
7796
|
+
if (!hasPositivePort || !hasNegativePort) {
|
|
7797
|
+
ctx.addIssue({
|
|
7798
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7799
|
+
message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
|
|
7800
|
+
});
|
|
7801
|
+
}
|
|
7802
|
+
return;
|
|
7803
|
+
}
|
|
7804
|
+
if (hasNets) {
|
|
7805
|
+
if (!hasPositiveNet || !hasNegativeNet) {
|
|
7806
|
+
ctx.addIssue({
|
|
7807
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7808
|
+
message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
|
|
7809
|
+
});
|
|
7810
|
+
}
|
|
7811
|
+
return;
|
|
7812
|
+
}
|
|
7813
|
+
ctx.addIssue({
|
|
7814
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7815
|
+
message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
|
|
7816
|
+
});
|
|
7817
|
+
});
|
|
7818
|
+
expectTypesMatch(true);
|
|
7374
7819
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
7375
7820
|
type: external_exports.literal("simulation_unknown_experiment_error"),
|
|
7376
7821
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
@@ -7392,6 +7837,65 @@ var simulation_op_amp = external_exports.object({
|
|
|
7392
7837
|
negative_supply_source_port_id: external_exports.string()
|
|
7393
7838
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
7394
7839
|
expectTypesMatch(true);
|
|
7840
|
+
var simulation_spice_subcircuit = external_exports.object({
|
|
7841
|
+
type: external_exports.literal("simulation_spice_subcircuit"),
|
|
7842
|
+
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
7843
|
+
"simulation_spice_subcircuit"
|
|
7844
|
+
),
|
|
7845
|
+
source_component_id: external_exports.string(),
|
|
7846
|
+
spice_pin_to_source_port_map: external_exports.record(external_exports.string(), external_exports.string()),
|
|
7847
|
+
subcircuit_source: external_exports.string()
|
|
7848
|
+
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
7849
|
+
expectTypesMatch(
|
|
7850
|
+
true
|
|
7851
|
+
);
|
|
7852
|
+
var hasValue = (value) => value !== void 0;
|
|
7853
|
+
var simulation_oscilloscope_trace = external_exports.object({
|
|
7854
|
+
type: external_exports.literal("simulation_oscilloscope_trace"),
|
|
7855
|
+
simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
|
|
7856
|
+
"simulation_oscilloscope_trace"
|
|
7857
|
+
),
|
|
7858
|
+
simulation_transient_voltage_graph_id: external_exports.string().optional(),
|
|
7859
|
+
simulation_transient_current_graph_id: external_exports.string().optional(),
|
|
7860
|
+
simulation_voltage_probe_id: external_exports.string().optional(),
|
|
7861
|
+
simulation_current_probe_id: external_exports.string().optional(),
|
|
7862
|
+
display_name: external_exports.string().optional(),
|
|
7863
|
+
color: external_exports.string().optional(),
|
|
7864
|
+
display_center_value: external_exports.number().optional(),
|
|
7865
|
+
display_center_offset_divs: external_exports.number().optional(),
|
|
7866
|
+
volts_per_div: external_exports.number().positive().optional(),
|
|
7867
|
+
amps_per_div: external_exports.number().positive().optional()
|
|
7868
|
+
}).describe(
|
|
7869
|
+
"Defines how a simulation measurement is rendered as an oscilloscope-style trace."
|
|
7870
|
+
).superRefine((data, ctx) => {
|
|
7871
|
+
const voltageReferences = [
|
|
7872
|
+
data.simulation_transient_voltage_graph_id,
|
|
7873
|
+
data.simulation_voltage_probe_id
|
|
7874
|
+
].filter(hasValue).length;
|
|
7875
|
+
const currentReferences = [
|
|
7876
|
+
data.simulation_transient_current_graph_id,
|
|
7877
|
+
data.simulation_current_probe_id
|
|
7878
|
+
].filter(hasValue).length;
|
|
7879
|
+
if (voltageReferences + currentReferences !== 1) {
|
|
7880
|
+
ctx.addIssue({
|
|
7881
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7882
|
+
message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
|
|
7883
|
+
});
|
|
7884
|
+
}
|
|
7885
|
+
if (voltageReferences > 0 && data.amps_per_div !== void 0) {
|
|
7886
|
+
ctx.addIssue({
|
|
7887
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7888
|
+
message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
|
|
7889
|
+
});
|
|
7890
|
+
}
|
|
7891
|
+
if (currentReferences > 0 && data.volts_per_div !== void 0) {
|
|
7892
|
+
ctx.addIssue({
|
|
7893
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7894
|
+
message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
|
|
7895
|
+
});
|
|
7896
|
+
}
|
|
7897
|
+
});
|
|
7898
|
+
expectTypesMatch(true);
|
|
7395
7899
|
var any_circuit_element = external_exports.union([
|
|
7396
7900
|
source_trace,
|
|
7397
7901
|
source_port,
|
|
@@ -7424,12 +7928,17 @@ var any_circuit_element = external_exports.union([
|
|
|
7424
7928
|
source_invalid_component_property_error,
|
|
7425
7929
|
source_trace_not_connected_error,
|
|
7426
7930
|
source_pin_missing_trace_warning,
|
|
7931
|
+
source_unnamed_trace_warning,
|
|
7932
|
+
source_missing_manufacturer_part_number_warning,
|
|
7933
|
+
source_refdes_convention_warning,
|
|
7427
7934
|
source_no_power_pin_defined_warning,
|
|
7428
7935
|
source_no_ground_pin_defined_warning,
|
|
7429
7936
|
source_component_pins_underspecified_warning,
|
|
7430
7937
|
source_pin_must_be_connected_error,
|
|
7431
7938
|
unknown_error_finding_part,
|
|
7939
|
+
source_part_not_found_warning,
|
|
7432
7940
|
source_i2c_misconfigured_error,
|
|
7941
|
+
source_component_misconfigured_error,
|
|
7433
7942
|
source_ambiguous_port_reference,
|
|
7434
7943
|
pcb_component,
|
|
7435
7944
|
pcb_hole,
|
|
@@ -7438,12 +7947,14 @@ var any_circuit_element = external_exports.union([
|
|
|
7438
7947
|
circuit_json_footprint_load_error,
|
|
7439
7948
|
pcb_manual_edit_conflict_warning,
|
|
7440
7949
|
pcb_connector_not_in_accessible_orientation_warning,
|
|
7950
|
+
supplier_footprint_mismatch_warning,
|
|
7441
7951
|
pcb_plated_hole,
|
|
7442
7952
|
pcb_keepout,
|
|
7443
7953
|
pcb_port,
|
|
7444
7954
|
pcb_net,
|
|
7445
7955
|
pcb_text,
|
|
7446
7956
|
pcb_trace,
|
|
7957
|
+
pcb_trace_warning,
|
|
7447
7958
|
pcb_via,
|
|
7448
7959
|
pcb_smtpad,
|
|
7449
7960
|
pcb_solder_paste,
|
|
@@ -7459,6 +7970,7 @@ var any_circuit_element = external_exports.union([
|
|
|
7459
7970
|
pcb_silkscreen_rect,
|
|
7460
7971
|
pcb_silkscreen_circle,
|
|
7461
7972
|
pcb_silkscreen_oval,
|
|
7973
|
+
pcb_silkscreen_graphic,
|
|
7462
7974
|
pcb_trace_error,
|
|
7463
7975
|
pcb_trace_missing_error,
|
|
7464
7976
|
pcb_placement_error,
|
|
@@ -7466,6 +7978,9 @@ var any_circuit_element = external_exports.union([
|
|
|
7466
7978
|
pcb_port_not_matched_error,
|
|
7467
7979
|
pcb_port_not_connected_error,
|
|
7468
7980
|
pcb_via_clearance_error,
|
|
7981
|
+
pcb_via_trace_clearance_error,
|
|
7982
|
+
pcb_pad_pad_clearance_error,
|
|
7983
|
+
pcb_pad_trace_clearance_error,
|
|
7469
7984
|
pcb_fabrication_note_path,
|
|
7470
7985
|
pcb_fabrication_note_text,
|
|
7471
7986
|
pcb_fabrication_note_rect,
|
|
@@ -7491,6 +8006,7 @@ var any_circuit_element = external_exports.union([
|
|
|
7491
8006
|
pcb_courtyard_outline,
|
|
7492
8007
|
pcb_courtyard_polygon,
|
|
7493
8008
|
pcb_courtyard_circle,
|
|
8009
|
+
pcb_courtyard_pill,
|
|
7494
8010
|
schematic_box,
|
|
7495
8011
|
schematic_text,
|
|
7496
8012
|
schematic_line,
|
|
@@ -7517,10 +8033,14 @@ var any_circuit_element = external_exports.union([
|
|
|
7517
8033
|
simulation_current_source,
|
|
7518
8034
|
simulation_experiment,
|
|
7519
8035
|
simulation_transient_voltage_graph,
|
|
8036
|
+
simulation_transient_current_graph,
|
|
7520
8037
|
simulation_switch,
|
|
7521
8038
|
simulation_voltage_probe,
|
|
8039
|
+
simulation_current_probe,
|
|
8040
|
+
simulation_oscilloscope_trace,
|
|
7522
8041
|
simulation_unknown_experiment_error,
|
|
7523
|
-
simulation_op_amp
|
|
8042
|
+
simulation_op_amp,
|
|
8043
|
+
simulation_spice_subcircuit
|
|
7524
8044
|
]);
|
|
7525
8045
|
var any_soup_element = any_circuit_element;
|
|
7526
8046
|
expectTypesMatch(true);
|
|
@@ -8590,9 +9110,52 @@ var cjuIndexed = ((soup, options = {}) => {
|
|
|
8590
9110
|
return suIndexed;
|
|
8591
9111
|
});
|
|
8592
9112
|
cjuIndexed.unparsed = cjuIndexed;
|
|
9113
|
+
var getQuarterTurns = (angleRadians) => Math.round(angleRadians / (Math.PI / 2));
|
|
9114
|
+
var insertionDirectionToVec = (direction) => {
|
|
9115
|
+
switch (direction) {
|
|
9116
|
+
case "from_left":
|
|
9117
|
+
return { x: -1, y: 0 };
|
|
9118
|
+
case "from_right":
|
|
9119
|
+
return { x: 1, y: 0 };
|
|
9120
|
+
case "from_front":
|
|
9121
|
+
return { x: 0, y: 1 };
|
|
9122
|
+
case "from_back":
|
|
9123
|
+
return { x: 0, y: -1 };
|
|
9124
|
+
}
|
|
9125
|
+
};
|
|
9126
|
+
var vecToInsertionDirection = ({
|
|
9127
|
+
x,
|
|
9128
|
+
y
|
|
9129
|
+
}) => {
|
|
9130
|
+
if (x > 0) return "from_right";
|
|
9131
|
+
if (x < 0) return "from_left";
|
|
9132
|
+
if (y > 0) return "from_front";
|
|
9133
|
+
return "from_back";
|
|
9134
|
+
};
|
|
9135
|
+
var transformInsertionDirection = (direction, opts) => {
|
|
9136
|
+
if (!direction || direction === "from_above") return direction;
|
|
9137
|
+
let { x, y } = insertionDirectionToVec(direction);
|
|
9138
|
+
let quarterTurns = Math.round(opts.rotationDegrees / 90);
|
|
9139
|
+
while (quarterTurns > 0) {
|
|
9140
|
+
;
|
|
9141
|
+
[x, y] = [-y, x];
|
|
9142
|
+
quarterTurns--;
|
|
9143
|
+
}
|
|
9144
|
+
while (quarterTurns < 0) {
|
|
9145
|
+
;
|
|
9146
|
+
[x, y] = [y, -x];
|
|
9147
|
+
quarterTurns++;
|
|
9148
|
+
}
|
|
9149
|
+
if (opts.isFlipped) {
|
|
9150
|
+
y = -y;
|
|
9151
|
+
}
|
|
9152
|
+
return vecToInsertionDirection({ x, y });
|
|
9153
|
+
};
|
|
8593
9154
|
var transformPCBElement = (elm, matrix) => {
|
|
8594
9155
|
const tsr = decomposeTSR(matrix);
|
|
8595
|
-
const flipPadWidthHeight = Math.
|
|
9156
|
+
const flipPadWidthHeight = Math.abs(getQuarterTurns(tsr.rotation.angle)) % 2 === 1;
|
|
9157
|
+
const rotationDegrees = tsr.rotation.angle / Math.PI * 180;
|
|
9158
|
+
const isFlipped = tsr.scale.sy < 0;
|
|
8596
9159
|
if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_port") {
|
|
8597
9160
|
const { x, y } = applyToPoint(matrix, {
|
|
8598
9161
|
x: Number(elm.x),
|
|
@@ -8613,12 +9176,28 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
8613
9176
|
elm.center = applyToPoint(matrix, elm.center);
|
|
8614
9177
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
8615
9178
|
elm.anchor_position = applyToPoint(matrix, elm.anchor_position);
|
|
8616
|
-
} else if (elm.type === "
|
|
9179
|
+
} else if (elm.type === "pcb_courtyard_rect") {
|
|
9180
|
+
elm.center = applyToPoint(matrix, elm.center);
|
|
9181
|
+
elm.ccw_rotation = ((elm.ccw_rotation ?? 0) + rotationDegrees) % 360;
|
|
9182
|
+
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_circle") {
|
|
8617
9183
|
elm.center = applyToPoint(matrix, elm.center);
|
|
8618
9184
|
} else if (elm.type === "pcb_component") {
|
|
8619
9185
|
elm.center = applyToPoint(matrix, elm.center);
|
|
8620
|
-
elm.rotation = elm.rotation +
|
|
9186
|
+
elm.rotation = elm.rotation + rotationDegrees;
|
|
8621
9187
|
elm.rotation = elm.rotation % 360;
|
|
9188
|
+
if (elm.cable_insertion_center) {
|
|
9189
|
+
elm.cable_insertion_center = applyToPoint(
|
|
9190
|
+
matrix,
|
|
9191
|
+
elm.cable_insertion_center
|
|
9192
|
+
);
|
|
9193
|
+
}
|
|
9194
|
+
elm.insertion_direction = transformInsertionDirection(
|
|
9195
|
+
elm.insertion_direction,
|
|
9196
|
+
{
|
|
9197
|
+
rotationDegrees,
|
|
9198
|
+
isFlipped
|
|
9199
|
+
}
|
|
9200
|
+
);
|
|
8622
9201
|
if (flipPadWidthHeight) {
|
|
8623
9202
|
;
|
|
8624
9203
|
[elm.width, elm.height] = [elm.height, elm.width];
|
|
@@ -8665,7 +9244,7 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
8665
9244
|
};
|
|
8666
9245
|
var transformPCBElements = (elms, matrix) => {
|
|
8667
9246
|
const tsr = decomposeTSR(matrix);
|
|
8668
|
-
const quarterTurns =
|
|
9247
|
+
const quarterTurns = getQuarterTurns(tsr.rotation.angle);
|
|
8669
9248
|
const flipPadWidthHeight = Math.abs(quarterTurns) % 2 === 1;
|
|
8670
9249
|
let transformedElms = elms.map((elm) => transformPCBElement(elm, matrix));
|
|
8671
9250
|
if (flipPadWidthHeight) {
|
|
@@ -8828,6 +9407,16 @@ var getDebugLayoutObject = (lo) => {
|
|
|
8828
9407
|
if ("outer_diameter" in lo) {
|
|
8829
9408
|
width = lo.outer_diameter;
|
|
8830
9409
|
height = lo.outer_diameter;
|
|
9410
|
+
} else if ("rect_pad_width" in lo && "rect_pad_height" in lo) {
|
|
9411
|
+
width = lo.rect_pad_width;
|
|
9412
|
+
height = lo.rect_pad_height;
|
|
9413
|
+
if ("hole_diameter" in lo) {
|
|
9414
|
+
width = Math.max(width, lo.hole_diameter);
|
|
9415
|
+
height = Math.max(height, lo.hole_diameter);
|
|
9416
|
+
}
|
|
9417
|
+
} else if ("hole_diameter" in lo) {
|
|
9418
|
+
width = lo.hole_diameter;
|
|
9419
|
+
height = lo.hole_diameter;
|
|
8831
9420
|
}
|
|
8832
9421
|
}
|
|
8833
9422
|
if (width === void 0 || height === void 0) {
|
|
@@ -10833,6 +11422,60 @@ ${cadModelLines}
|
|
|
10833
11422
|
/>
|
|
10834
11423
|
)
|
|
10835
11424
|
}
|
|
11425
|
+
`.trim();
|
|
11426
|
+
}
|
|
11427
|
+
if (componentType === "pushbutton") {
|
|
11428
|
+
return `
|
|
11429
|
+
import type { PushButtonProps } from "@tscircuit/props"
|
|
11430
|
+
|
|
11431
|
+
const pinLabels = {
|
|
11432
|
+
${pinLabelsString}
|
|
11433
|
+
} as const
|
|
11434
|
+
|
|
11435
|
+
export const ${componentName} = (props: PushButtonProps<typeof pinLabels>) => {
|
|
11436
|
+
const { name = "SW1", ...restProps } = props
|
|
11437
|
+
|
|
11438
|
+
return (
|
|
11439
|
+
<pushbutton
|
|
11440
|
+
name={name}
|
|
11441
|
+
pinLabels={pinLabels}
|
|
11442
|
+
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
11443
|
+
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
11444
|
+
footprint={${footprintTsx}}
|
|
11445
|
+
${objUrl || stepUrl ? `cadModel={{
|
|
11446
|
+
${cadModelLines}
|
|
11447
|
+
}}` : ""}
|
|
11448
|
+
{...restProps}
|
|
11449
|
+
/>
|
|
11450
|
+
)
|
|
11451
|
+
}
|
|
11452
|
+
`.trim();
|
|
11453
|
+
}
|
|
11454
|
+
if (componentType === "switch") {
|
|
11455
|
+
return `
|
|
11456
|
+
import type { SwitchProps } from "@tscircuit/props"
|
|
11457
|
+
|
|
11458
|
+
const pinLabels = {
|
|
11459
|
+
${pinLabelsString}
|
|
11460
|
+
} as const
|
|
11461
|
+
|
|
11462
|
+
export const ${componentName} = (props: SwitchProps) => {
|
|
11463
|
+
const { name = "SW1", ...restProps } = props
|
|
11464
|
+
|
|
11465
|
+
return (
|
|
11466
|
+
<switch
|
|
11467
|
+
name={name}
|
|
11468
|
+
pinLabels={pinLabels}
|
|
11469
|
+
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
11470
|
+
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
11471
|
+
footprint={${footprintTsx}}
|
|
11472
|
+
${objUrl || stepUrl ? `cadModel={{
|
|
11473
|
+
${cadModelLines}
|
|
11474
|
+
}}` : ""}
|
|
11475
|
+
{...restProps}
|
|
11476
|
+
/>
|
|
11477
|
+
)
|
|
11478
|
+
}
|
|
10836
11479
|
`.trim();
|
|
10837
11480
|
}
|
|
10838
11481
|
return `
|
|
@@ -10913,10 +11556,74 @@ var isLedCategoryComponent = (betterEasy) => {
|
|
|
10913
11556
|
].some(categoryValueContainsLed);
|
|
10914
11557
|
};
|
|
10915
11558
|
|
|
11559
|
+
// lib/websafe/convert-to-typescript-component/category-value-contains-pushbutton.ts
|
|
11560
|
+
var categoryValueContainsPushbutton = (value) => {
|
|
11561
|
+
if (typeof value === "string") {
|
|
11562
|
+
const normalized = value.toLowerCase();
|
|
11563
|
+
if (/analog\s+switch/.test(normalized) || /multiplex/.test(normalized) || /switching\s+diodes?/.test(normalized) || /\bics?\b/.test(normalized)) {
|
|
11564
|
+
return false;
|
|
11565
|
+
}
|
|
11566
|
+
return /push\s*buttons?/.test(normalized) || /pushbuttons?/.test(normalized) || /tact(?:ile)?\s+switch(?:es)?/.test(normalized) || /keyboard\s+(?:switch(?:es)?|shaft)/.test(normalized) || /mechanical\s+keyboard\s+shaft/.test(normalized);
|
|
11567
|
+
}
|
|
11568
|
+
if (Array.isArray(value)) {
|
|
11569
|
+
return value.some(categoryValueContainsPushbutton);
|
|
11570
|
+
}
|
|
11571
|
+
if (value && typeof value === "object") {
|
|
11572
|
+
return Object.values(value).some(categoryValueContainsPushbutton);
|
|
11573
|
+
}
|
|
11574
|
+
return false;
|
|
11575
|
+
};
|
|
11576
|
+
|
|
11577
|
+
// lib/websafe/convert-to-typescript-component/is-pushbutton-category-component.ts
|
|
11578
|
+
var isPushbuttonCategoryComponent = (betterEasy) => {
|
|
11579
|
+
const cPara = betterEasy.dataStr.head.c_para;
|
|
11580
|
+
return [
|
|
11581
|
+
betterEasy.tags,
|
|
11582
|
+
cPara.category,
|
|
11583
|
+
cPara.Category,
|
|
11584
|
+
cPara["LCSC Category"],
|
|
11585
|
+
cPara["JLCPCB Category"],
|
|
11586
|
+
betterEasy.category
|
|
11587
|
+
].some(categoryValueContainsPushbutton);
|
|
11588
|
+
};
|
|
11589
|
+
|
|
11590
|
+
// lib/websafe/convert-to-typescript-component/category-value-contains-switch.ts
|
|
11591
|
+
var categoryValueContainsSwitch = (value) => {
|
|
11592
|
+
if (typeof value === "string") {
|
|
11593
|
+
const normalized = value.toLowerCase();
|
|
11594
|
+
if (/analog\s+switch/.test(normalized) || /multiplex/.test(normalized) || /switching\s+diodes?/.test(normalized) || /\bics?\b/.test(normalized)) {
|
|
11595
|
+
return false;
|
|
11596
|
+
}
|
|
11597
|
+
return /(?:slide|toggle|dip|key|micro|limit)\s+switch(?:es)?/.test(normalized) || /(^|[^a-z])switch(?:es)?([^a-z]|$)/.test(normalized);
|
|
11598
|
+
}
|
|
11599
|
+
if (Array.isArray(value)) {
|
|
11600
|
+
return value.some(categoryValueContainsSwitch);
|
|
11601
|
+
}
|
|
11602
|
+
if (value && typeof value === "object") {
|
|
11603
|
+
return Object.values(value).some(categoryValueContainsSwitch);
|
|
11604
|
+
}
|
|
11605
|
+
return false;
|
|
11606
|
+
};
|
|
11607
|
+
|
|
11608
|
+
// lib/websafe/convert-to-typescript-component/is-switch-category-component.ts
|
|
11609
|
+
var isSwitchCategoryComponent = (betterEasy) => {
|
|
11610
|
+
const cPara = betterEasy.dataStr.head.c_para;
|
|
11611
|
+
return [
|
|
11612
|
+
betterEasy.tags,
|
|
11613
|
+
cPara.category,
|
|
11614
|
+
cPara.Category,
|
|
11615
|
+
cPara["LCSC Category"],
|
|
11616
|
+
cPara["JLCPCB Category"],
|
|
11617
|
+
betterEasy.category
|
|
11618
|
+
].some(categoryValueContainsSwitch);
|
|
11619
|
+
};
|
|
11620
|
+
|
|
10916
11621
|
// lib/websafe/convert-to-typescript-component/index.tsx
|
|
10917
11622
|
var getGeneratedComponentType = (betterEasy) => {
|
|
10918
11623
|
if (isLedCategoryComponent(betterEasy)) return "led";
|
|
10919
11624
|
if (isDiodeCategoryComponent(betterEasy)) return "diode";
|
|
11625
|
+
if (isPushbuttonCategoryComponent(betterEasy)) return "pushbutton";
|
|
11626
|
+
if (isSwitchCategoryComponent(betterEasy)) return "switch";
|
|
10920
11627
|
return "chip";
|
|
10921
11628
|
};
|
|
10922
11629
|
var convertRawEasyToTsx = async ({ rawEasy }) => {
|