circuit-json 0.0.414 → 0.0.416
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.d.mts +186 -2
- package/dist/index.mjs +186 -159
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2798,6 +2798,7 @@ var pcb_note_text = z125.object({
|
|
|
2798
2798
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
2799
2799
|
anchor_alignment: z125.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2800
2800
|
layer: visible_layer.default("top"),
|
|
2801
|
+
is_mirrored_from_top_view: z125.boolean().optional(),
|
|
2801
2802
|
color: z125.string().optional()
|
|
2802
2803
|
}).describe("Defines a documentation note in text on the PCB");
|
|
2803
2804
|
expectTypesMatch(true);
|
|
@@ -3302,15 +3303,16 @@ var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
|
3302
3303
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
3303
3304
|
expectTypesMatch(true);
|
|
3304
3305
|
|
|
3305
|
-
// src/pcb/
|
|
3306
|
+
// src/pcb/pcb_via_trace_clearance_error.ts
|
|
3306
3307
|
import { z as z150 } from "zod";
|
|
3307
|
-
var
|
|
3308
|
-
type: z150.literal("
|
|
3309
|
-
|
|
3310
|
-
"
|
|
3308
|
+
var pcb_via_trace_clearance_error = base_circuit_json_error.extend({
|
|
3309
|
+
type: z150.literal("pcb_via_trace_clearance_error"),
|
|
3310
|
+
pcb_via_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3311
|
+
"pcb_via_trace_clearance_error"
|
|
3311
3312
|
),
|
|
3312
|
-
error_type: z150.literal("
|
|
3313
|
-
|
|
3313
|
+
error_type: z150.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),
|
|
3314
|
+
pcb_via_id: z150.string(),
|
|
3315
|
+
pcb_trace_id: z150.string(),
|
|
3314
3316
|
minimum_clearance: distance.optional(),
|
|
3315
3317
|
actual_clearance: distance.optional(),
|
|
3316
3318
|
center: z150.object({
|
|
@@ -3318,26 +3320,49 @@ var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
|
3318
3320
|
y: z150.number().optional()
|
|
3319
3321
|
}).optional(),
|
|
3320
3322
|
subcircuit_id: z150.string().optional()
|
|
3323
|
+
}).describe(
|
|
3324
|
+
"Error emitted when a via and trace are closer than the allowed clearance"
|
|
3325
|
+
);
|
|
3326
|
+
expectTypesMatch(
|
|
3327
|
+
true
|
|
3328
|
+
);
|
|
3329
|
+
|
|
3330
|
+
// src/pcb/pcb_pad_pad_clearance_error.ts
|
|
3331
|
+
import { z as z151 } from "zod";
|
|
3332
|
+
var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
3333
|
+
type: z151.literal("pcb_pad_pad_clearance_error"),
|
|
3334
|
+
pcb_pad_pad_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3335
|
+
"pcb_pad_pad_clearance_error"
|
|
3336
|
+
),
|
|
3337
|
+
error_type: z151.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),
|
|
3338
|
+
pcb_pad_ids: z151.array(z151.string()).min(2),
|
|
3339
|
+
minimum_clearance: distance.optional(),
|
|
3340
|
+
actual_clearance: distance.optional(),
|
|
3341
|
+
center: z151.object({
|
|
3342
|
+
x: z151.number().optional(),
|
|
3343
|
+
y: z151.number().optional()
|
|
3344
|
+
}).optional(),
|
|
3345
|
+
subcircuit_id: z151.string().optional()
|
|
3321
3346
|
}).describe("Error emitted when pads are closer than the allowed clearance");
|
|
3322
3347
|
expectTypesMatch(true);
|
|
3323
3348
|
|
|
3324
3349
|
// src/pcb/pcb_pad_trace_clearance_error.ts
|
|
3325
|
-
import { z as
|
|
3350
|
+
import { z as z152 } from "zod";
|
|
3326
3351
|
var pcb_pad_trace_clearance_error = base_circuit_json_error.extend({
|
|
3327
|
-
type:
|
|
3352
|
+
type: z152.literal("pcb_pad_trace_clearance_error"),
|
|
3328
3353
|
pcb_pad_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3329
3354
|
"pcb_pad_trace_clearance_error"
|
|
3330
3355
|
),
|
|
3331
|
-
error_type:
|
|
3332
|
-
pcb_pad_id:
|
|
3333
|
-
pcb_trace_id:
|
|
3356
|
+
error_type: z152.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),
|
|
3357
|
+
pcb_pad_id: z152.string(),
|
|
3358
|
+
pcb_trace_id: z152.string(),
|
|
3334
3359
|
minimum_clearance: distance.optional(),
|
|
3335
3360
|
actual_clearance: distance.optional(),
|
|
3336
|
-
center:
|
|
3337
|
-
x:
|
|
3338
|
-
y:
|
|
3361
|
+
center: z152.object({
|
|
3362
|
+
x: z152.number().optional(),
|
|
3363
|
+
y: z152.number().optional()
|
|
3339
3364
|
}).optional(),
|
|
3340
|
-
subcircuit_id:
|
|
3365
|
+
subcircuit_id: z152.string().optional()
|
|
3341
3366
|
}).describe(
|
|
3342
3367
|
"Error emitted when a pad and trace are closer than allowed clearance"
|
|
3343
3368
|
);
|
|
@@ -3346,72 +3371,72 @@ expectTypesMatch(
|
|
|
3346
3371
|
);
|
|
3347
3372
|
|
|
3348
3373
|
// src/pcb/pcb_courtyard_rect.ts
|
|
3349
|
-
import { z as
|
|
3350
|
-
var pcb_courtyard_rect =
|
|
3351
|
-
type:
|
|
3374
|
+
import { z as z153 } from "zod";
|
|
3375
|
+
var pcb_courtyard_rect = z153.object({
|
|
3376
|
+
type: z153.literal("pcb_courtyard_rect"),
|
|
3352
3377
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
3353
|
-
pcb_component_id:
|
|
3354
|
-
pcb_group_id:
|
|
3355
|
-
subcircuit_id:
|
|
3378
|
+
pcb_component_id: z153.string(),
|
|
3379
|
+
pcb_group_id: z153.string().optional(),
|
|
3380
|
+
subcircuit_id: z153.string().optional(),
|
|
3356
3381
|
center: point,
|
|
3357
3382
|
width: length,
|
|
3358
3383
|
height: length,
|
|
3359
3384
|
layer: visible_layer,
|
|
3360
3385
|
ccw_rotation: rotation.optional(),
|
|
3361
|
-
color:
|
|
3386
|
+
color: z153.string().optional()
|
|
3362
3387
|
}).describe("Defines a courtyard rectangle on the PCB");
|
|
3363
3388
|
expectTypesMatch(true);
|
|
3364
3389
|
|
|
3365
3390
|
// src/pcb/pcb_courtyard_outline.ts
|
|
3366
|
-
import { z as
|
|
3367
|
-
var pcb_courtyard_outline =
|
|
3368
|
-
type:
|
|
3391
|
+
import { z as z154 } from "zod";
|
|
3392
|
+
var pcb_courtyard_outline = z154.object({
|
|
3393
|
+
type: z154.literal("pcb_courtyard_outline"),
|
|
3369
3394
|
pcb_courtyard_outline_id: getZodPrefixedIdWithDefault(
|
|
3370
3395
|
"pcb_courtyard_outline"
|
|
3371
3396
|
),
|
|
3372
|
-
pcb_component_id:
|
|
3373
|
-
pcb_group_id:
|
|
3374
|
-
subcircuit_id:
|
|
3397
|
+
pcb_component_id: z154.string(),
|
|
3398
|
+
pcb_group_id: z154.string().optional(),
|
|
3399
|
+
subcircuit_id: z154.string().optional(),
|
|
3375
3400
|
layer: visible_layer,
|
|
3376
|
-
outline:
|
|
3401
|
+
outline: z154.array(point).min(2)
|
|
3377
3402
|
}).describe("Defines a courtyard outline on the PCB");
|
|
3378
3403
|
expectTypesMatch(true);
|
|
3379
3404
|
|
|
3380
3405
|
// src/pcb/pcb_courtyard_polygon.ts
|
|
3381
|
-
import { z as
|
|
3382
|
-
var pcb_courtyard_polygon =
|
|
3383
|
-
type:
|
|
3406
|
+
import { z as z155 } from "zod";
|
|
3407
|
+
var pcb_courtyard_polygon = z155.object({
|
|
3408
|
+
type: z155.literal("pcb_courtyard_polygon"),
|
|
3384
3409
|
pcb_courtyard_polygon_id: getZodPrefixedIdWithDefault(
|
|
3385
3410
|
"pcb_courtyard_polygon"
|
|
3386
3411
|
),
|
|
3387
|
-
pcb_component_id:
|
|
3388
|
-
pcb_group_id:
|
|
3389
|
-
subcircuit_id:
|
|
3412
|
+
pcb_component_id: z155.string(),
|
|
3413
|
+
pcb_group_id: z155.string().optional(),
|
|
3414
|
+
subcircuit_id: z155.string().optional(),
|
|
3390
3415
|
layer: visible_layer,
|
|
3391
|
-
points:
|
|
3392
|
-
color:
|
|
3416
|
+
points: z155.array(point).min(3),
|
|
3417
|
+
color: z155.string().optional()
|
|
3393
3418
|
}).describe("Defines a courtyard polygon on the PCB");
|
|
3394
3419
|
expectTypesMatch(true);
|
|
3395
3420
|
|
|
3396
3421
|
// src/pcb/pcb_courtyard_circle.ts
|
|
3397
|
-
import { z as
|
|
3398
|
-
var pcb_courtyard_circle =
|
|
3399
|
-
type:
|
|
3422
|
+
import { z as z156 } from "zod";
|
|
3423
|
+
var pcb_courtyard_circle = z156.object({
|
|
3424
|
+
type: z156.literal("pcb_courtyard_circle"),
|
|
3400
3425
|
pcb_courtyard_circle_id: getZodPrefixedIdWithDefault(
|
|
3401
3426
|
"pcb_courtyard_circle"
|
|
3402
3427
|
),
|
|
3403
|
-
pcb_component_id:
|
|
3404
|
-
pcb_group_id:
|
|
3405
|
-
subcircuit_id:
|
|
3428
|
+
pcb_component_id: z156.string(),
|
|
3429
|
+
pcb_group_id: z156.string().optional(),
|
|
3430
|
+
subcircuit_id: z156.string().optional(),
|
|
3406
3431
|
center: point,
|
|
3407
3432
|
radius: length,
|
|
3408
3433
|
layer: visible_layer,
|
|
3409
|
-
color:
|
|
3434
|
+
color: z156.string().optional()
|
|
3410
3435
|
}).describe("Defines a courtyard circle on the PCB");
|
|
3411
3436
|
expectTypesMatch(true);
|
|
3412
3437
|
|
|
3413
3438
|
// src/cad/cad_component.ts
|
|
3414
|
-
import { z as
|
|
3439
|
+
import { z as z157 } from "zod";
|
|
3415
3440
|
|
|
3416
3441
|
// src/cad/cad_model_conventions.ts
|
|
3417
3442
|
var cad_model_formats = [
|
|
@@ -3442,48 +3467,48 @@ var cadModelDefaultDirectionMap = {
|
|
|
3442
3467
|
};
|
|
3443
3468
|
|
|
3444
3469
|
// src/cad/cad_component.ts
|
|
3445
|
-
var cad_component =
|
|
3446
|
-
type:
|
|
3447
|
-
cad_component_id:
|
|
3448
|
-
pcb_component_id:
|
|
3449
|
-
source_component_id:
|
|
3470
|
+
var cad_component = z157.object({
|
|
3471
|
+
type: z157.literal("cad_component"),
|
|
3472
|
+
cad_component_id: z157.string(),
|
|
3473
|
+
pcb_component_id: z157.string(),
|
|
3474
|
+
source_component_id: z157.string(),
|
|
3450
3475
|
position: point3,
|
|
3451
3476
|
rotation: point3.optional(),
|
|
3452
3477
|
size: point3.optional(),
|
|
3453
3478
|
layer: layer_ref.optional(),
|
|
3454
|
-
subcircuit_id:
|
|
3479
|
+
subcircuit_id: z157.string().optional(),
|
|
3455
3480
|
// These are all ways to generate/load the 3d model
|
|
3456
|
-
footprinter_string:
|
|
3457
|
-
model_obj_url:
|
|
3458
|
-
model_stl_url:
|
|
3459
|
-
model_3mf_url:
|
|
3460
|
-
model_gltf_url:
|
|
3461
|
-
model_glb_url:
|
|
3462
|
-
model_step_url:
|
|
3463
|
-
model_wrl_url:
|
|
3481
|
+
footprinter_string: z157.string().optional(),
|
|
3482
|
+
model_obj_url: z157.string().optional(),
|
|
3483
|
+
model_stl_url: z157.string().optional(),
|
|
3484
|
+
model_3mf_url: z157.string().optional(),
|
|
3485
|
+
model_gltf_url: z157.string().optional(),
|
|
3486
|
+
model_glb_url: z157.string().optional(),
|
|
3487
|
+
model_step_url: z157.string().optional(),
|
|
3488
|
+
model_wrl_url: z157.string().optional(),
|
|
3464
3489
|
model_asset: asset.optional(),
|
|
3465
|
-
model_unit_to_mm_scale_factor:
|
|
3466
|
-
model_board_normal_direction:
|
|
3490
|
+
model_unit_to_mm_scale_factor: z157.number().optional(),
|
|
3491
|
+
model_board_normal_direction: z157.enum(cad_model_axis_directions).optional().describe(
|
|
3467
3492
|
`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`
|
|
3468
3493
|
),
|
|
3469
3494
|
model_origin_position: point3.optional(),
|
|
3470
|
-
model_origin_alignment:
|
|
3495
|
+
model_origin_alignment: z157.enum([
|
|
3471
3496
|
"unknown",
|
|
3472
3497
|
"center",
|
|
3473
3498
|
"center_of_component_on_board_surface",
|
|
3474
3499
|
"bottom_center_of_component"
|
|
3475
3500
|
]).optional(),
|
|
3476
|
-
model_object_fit:
|
|
3477
|
-
model_jscad:
|
|
3478
|
-
show_as_translucent_model:
|
|
3479
|
-
anchor_alignment:
|
|
3501
|
+
model_object_fit: z157.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
3502
|
+
model_jscad: z157.any().optional(),
|
|
3503
|
+
show_as_translucent_model: z157.boolean().optional(),
|
|
3504
|
+
anchor_alignment: z157.enum(["center", "center_of_component_on_board_surface"]).optional().default("center")
|
|
3480
3505
|
}).describe("Defines a component on the PCB");
|
|
3481
3506
|
expectTypesMatch(true);
|
|
3482
3507
|
|
|
3483
3508
|
// src/simulation/simulation_voltage_source.ts
|
|
3484
|
-
import { z as
|
|
3485
|
-
var wave_shape =
|
|
3486
|
-
var percentage =
|
|
3509
|
+
import { z as z158 } from "zod";
|
|
3510
|
+
var wave_shape = z158.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
3511
|
+
var percentage = z158.union([z158.string(), z158.number()]).transform((val) => {
|
|
3487
3512
|
if (typeof val === "string") {
|
|
3488
3513
|
if (val.endsWith("%")) {
|
|
3489
3514
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3492,30 +3517,30 @@ var percentage = z157.union([z157.string(), z157.number()]).transform((val) => {
|
|
|
3492
3517
|
}
|
|
3493
3518
|
return val;
|
|
3494
3519
|
}).pipe(
|
|
3495
|
-
|
|
3520
|
+
z158.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3496
3521
|
);
|
|
3497
|
-
var simulation_dc_voltage_source =
|
|
3498
|
-
type:
|
|
3522
|
+
var simulation_dc_voltage_source = z158.object({
|
|
3523
|
+
type: z158.literal("simulation_voltage_source"),
|
|
3499
3524
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3500
3525
|
"simulation_voltage_source"
|
|
3501
3526
|
),
|
|
3502
|
-
is_dc_source:
|
|
3503
|
-
positive_source_port_id:
|
|
3504
|
-
negative_source_port_id:
|
|
3505
|
-
positive_source_net_id:
|
|
3506
|
-
negative_source_net_id:
|
|
3527
|
+
is_dc_source: z158.literal(true).optional().default(true),
|
|
3528
|
+
positive_source_port_id: z158.string().optional(),
|
|
3529
|
+
negative_source_port_id: z158.string().optional(),
|
|
3530
|
+
positive_source_net_id: z158.string().optional(),
|
|
3531
|
+
negative_source_net_id: z158.string().optional(),
|
|
3507
3532
|
voltage
|
|
3508
3533
|
}).describe("Defines a DC voltage source for simulation");
|
|
3509
|
-
var simulation_ac_voltage_source =
|
|
3510
|
-
type:
|
|
3534
|
+
var simulation_ac_voltage_source = z158.object({
|
|
3535
|
+
type: z158.literal("simulation_voltage_source"),
|
|
3511
3536
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3512
3537
|
"simulation_voltage_source"
|
|
3513
3538
|
),
|
|
3514
|
-
is_dc_source:
|
|
3515
|
-
terminal1_source_port_id:
|
|
3516
|
-
terminal2_source_port_id:
|
|
3517
|
-
terminal1_source_net_id:
|
|
3518
|
-
terminal2_source_net_id:
|
|
3539
|
+
is_dc_source: z158.literal(false),
|
|
3540
|
+
terminal1_source_port_id: z158.string().optional(),
|
|
3541
|
+
terminal2_source_port_id: z158.string().optional(),
|
|
3542
|
+
terminal1_source_net_id: z158.string().optional(),
|
|
3543
|
+
terminal2_source_net_id: z158.string().optional(),
|
|
3519
3544
|
voltage: voltage.optional(),
|
|
3520
3545
|
frequency: frequency.optional(),
|
|
3521
3546
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -3523,14 +3548,14 @@ var simulation_ac_voltage_source = z157.object({
|
|
|
3523
3548
|
phase: rotation.optional(),
|
|
3524
3549
|
duty_cycle: percentage.optional()
|
|
3525
3550
|
}).describe("Defines an AC voltage source for simulation");
|
|
3526
|
-
var simulation_voltage_source =
|
|
3551
|
+
var simulation_voltage_source = z158.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
3527
3552
|
expectTypesMatch(true);
|
|
3528
3553
|
expectTypesMatch(true);
|
|
3529
3554
|
expectTypesMatch(true);
|
|
3530
3555
|
|
|
3531
3556
|
// src/simulation/simulation_current_source.ts
|
|
3532
|
-
import { z as
|
|
3533
|
-
var percentage2 =
|
|
3557
|
+
import { z as z159 } from "zod";
|
|
3558
|
+
var percentage2 = z159.union([z159.string(), z159.number()]).transform((val) => {
|
|
3534
3559
|
if (typeof val === "string") {
|
|
3535
3560
|
if (val.endsWith("%")) {
|
|
3536
3561
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3539,30 +3564,30 @@ var percentage2 = z158.union([z158.string(), z158.number()]).transform((val) =>
|
|
|
3539
3564
|
}
|
|
3540
3565
|
return val;
|
|
3541
3566
|
}).pipe(
|
|
3542
|
-
|
|
3567
|
+
z159.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3543
3568
|
);
|
|
3544
|
-
var simulation_dc_current_source =
|
|
3545
|
-
type:
|
|
3569
|
+
var simulation_dc_current_source = z159.object({
|
|
3570
|
+
type: z159.literal("simulation_current_source"),
|
|
3546
3571
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3547
3572
|
"simulation_current_source"
|
|
3548
3573
|
),
|
|
3549
|
-
is_dc_source:
|
|
3550
|
-
positive_source_port_id:
|
|
3551
|
-
negative_source_port_id:
|
|
3552
|
-
positive_source_net_id:
|
|
3553
|
-
negative_source_net_id:
|
|
3574
|
+
is_dc_source: z159.literal(true).optional().default(true),
|
|
3575
|
+
positive_source_port_id: z159.string().optional(),
|
|
3576
|
+
negative_source_port_id: z159.string().optional(),
|
|
3577
|
+
positive_source_net_id: z159.string().optional(),
|
|
3578
|
+
negative_source_net_id: z159.string().optional(),
|
|
3554
3579
|
current
|
|
3555
3580
|
}).describe("Defines a DC current source for simulation");
|
|
3556
|
-
var simulation_ac_current_source =
|
|
3557
|
-
type:
|
|
3581
|
+
var simulation_ac_current_source = z159.object({
|
|
3582
|
+
type: z159.literal("simulation_current_source"),
|
|
3558
3583
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3559
3584
|
"simulation_current_source"
|
|
3560
3585
|
),
|
|
3561
|
-
is_dc_source:
|
|
3562
|
-
terminal1_source_port_id:
|
|
3563
|
-
terminal2_source_port_id:
|
|
3564
|
-
terminal1_source_net_id:
|
|
3565
|
-
terminal2_source_net_id:
|
|
3586
|
+
is_dc_source: z159.literal(false),
|
|
3587
|
+
terminal1_source_port_id: z159.string().optional(),
|
|
3588
|
+
terminal2_source_port_id: z159.string().optional(),
|
|
3589
|
+
terminal1_source_net_id: z159.string().optional(),
|
|
3590
|
+
terminal2_source_net_id: z159.string().optional(),
|
|
3566
3591
|
current: current.optional(),
|
|
3567
3592
|
frequency: frequency.optional(),
|
|
3568
3593
|
peak_to_peak_current: current.optional(),
|
|
@@ -3570,25 +3595,25 @@ var simulation_ac_current_source = z158.object({
|
|
|
3570
3595
|
phase: rotation.optional(),
|
|
3571
3596
|
duty_cycle: percentage2.optional()
|
|
3572
3597
|
}).describe("Defines an AC current source for simulation");
|
|
3573
|
-
var simulation_current_source =
|
|
3598
|
+
var simulation_current_source = z159.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
3574
3599
|
expectTypesMatch(true);
|
|
3575
3600
|
expectTypesMatch(true);
|
|
3576
3601
|
expectTypesMatch(true);
|
|
3577
3602
|
|
|
3578
3603
|
// src/simulation/simulation_experiment.ts
|
|
3579
|
-
import { z as
|
|
3580
|
-
var experiment_type =
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3604
|
+
import { z as z160 } from "zod";
|
|
3605
|
+
var experiment_type = z160.union([
|
|
3606
|
+
z160.literal("spice_dc_sweep"),
|
|
3607
|
+
z160.literal("spice_dc_operating_point"),
|
|
3608
|
+
z160.literal("spice_transient_analysis"),
|
|
3609
|
+
z160.literal("spice_ac_analysis")
|
|
3585
3610
|
]);
|
|
3586
|
-
var simulation_experiment =
|
|
3587
|
-
type:
|
|
3611
|
+
var simulation_experiment = z160.object({
|
|
3612
|
+
type: z160.literal("simulation_experiment"),
|
|
3588
3613
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
3589
3614
|
"simulation_experiment"
|
|
3590
3615
|
),
|
|
3591
|
-
name:
|
|
3616
|
+
name: z160.string(),
|
|
3592
3617
|
experiment_type,
|
|
3593
3618
|
time_per_step: duration_ms.optional(),
|
|
3594
3619
|
start_time_ms: ms.optional(),
|
|
@@ -3597,53 +3622,53 @@ var simulation_experiment = z159.object({
|
|
|
3597
3622
|
expectTypesMatch(true);
|
|
3598
3623
|
|
|
3599
3624
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
3600
|
-
import { z as
|
|
3601
|
-
var simulation_transient_voltage_graph =
|
|
3602
|
-
type:
|
|
3625
|
+
import { z as z161 } from "zod";
|
|
3626
|
+
var simulation_transient_voltage_graph = z161.object({
|
|
3627
|
+
type: z161.literal("simulation_transient_voltage_graph"),
|
|
3603
3628
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
3604
3629
|
"simulation_transient_voltage_graph"
|
|
3605
3630
|
),
|
|
3606
|
-
simulation_experiment_id:
|
|
3607
|
-
timestamps_ms:
|
|
3608
|
-
voltage_levels:
|
|
3609
|
-
source_component_id:
|
|
3610
|
-
subcircuit_connectivity_map_key:
|
|
3631
|
+
simulation_experiment_id: z161.string(),
|
|
3632
|
+
timestamps_ms: z161.array(z161.number()).optional(),
|
|
3633
|
+
voltage_levels: z161.array(z161.number()),
|
|
3634
|
+
source_component_id: z161.string().optional(),
|
|
3635
|
+
subcircuit_connectivity_map_key: z161.string().optional(),
|
|
3611
3636
|
time_per_step: duration_ms,
|
|
3612
3637
|
start_time_ms: ms,
|
|
3613
3638
|
end_time_ms: ms,
|
|
3614
|
-
name:
|
|
3615
|
-
color:
|
|
3639
|
+
name: z161.string().optional(),
|
|
3640
|
+
color: z161.string().optional()
|
|
3616
3641
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
3617
3642
|
expectTypesMatch(true);
|
|
3618
3643
|
|
|
3619
3644
|
// src/simulation/simulation_switch.ts
|
|
3620
|
-
import { z as
|
|
3621
|
-
var simulation_switch =
|
|
3622
|
-
type:
|
|
3645
|
+
import { z as z162 } from "zod";
|
|
3646
|
+
var simulation_switch = z162.object({
|
|
3647
|
+
type: z162.literal("simulation_switch"),
|
|
3623
3648
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
3624
|
-
source_component_id:
|
|
3649
|
+
source_component_id: z162.string().optional(),
|
|
3625
3650
|
closes_at: ms.optional(),
|
|
3626
3651
|
opens_at: ms.optional(),
|
|
3627
|
-
starts_closed:
|
|
3652
|
+
starts_closed: z162.boolean().optional(),
|
|
3628
3653
|
switching_frequency: frequency.optional()
|
|
3629
3654
|
}).describe("Defines a switch for simulation timing control");
|
|
3630
3655
|
expectTypesMatch(true);
|
|
3631
3656
|
|
|
3632
3657
|
// src/simulation/simulation_voltage_probe.ts
|
|
3633
|
-
import { z as
|
|
3634
|
-
var simulation_voltage_probe =
|
|
3635
|
-
type:
|
|
3658
|
+
import { z as z163 } from "zod";
|
|
3659
|
+
var simulation_voltage_probe = z163.object({
|
|
3660
|
+
type: z163.literal("simulation_voltage_probe"),
|
|
3636
3661
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
3637
3662
|
"simulation_voltage_probe"
|
|
3638
3663
|
),
|
|
3639
|
-
source_component_id:
|
|
3640
|
-
name:
|
|
3641
|
-
signal_input_source_port_id:
|
|
3642
|
-
signal_input_source_net_id:
|
|
3643
|
-
reference_input_source_port_id:
|
|
3644
|
-
reference_input_source_net_id:
|
|
3645
|
-
subcircuit_id:
|
|
3646
|
-
color:
|
|
3664
|
+
source_component_id: z163.string().optional(),
|
|
3665
|
+
name: z163.string().optional(),
|
|
3666
|
+
signal_input_source_port_id: z163.string().optional(),
|
|
3667
|
+
signal_input_source_net_id: z163.string().optional(),
|
|
3668
|
+
reference_input_source_port_id: z163.string().optional(),
|
|
3669
|
+
reference_input_source_net_id: z163.string().optional(),
|
|
3670
|
+
subcircuit_id: z163.string().optional(),
|
|
3671
|
+
color: z163.string().optional()
|
|
3647
3672
|
}).describe(
|
|
3648
3673
|
"Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points."
|
|
3649
3674
|
).superRefine((data, ctx) => {
|
|
@@ -3653,20 +3678,20 @@ var simulation_voltage_probe = z162.object({
|
|
|
3653
3678
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
3654
3679
|
if (has_ports && has_nets) {
|
|
3655
3680
|
ctx.addIssue({
|
|
3656
|
-
code:
|
|
3681
|
+
code: z163.ZodIssueCode.custom,
|
|
3657
3682
|
message: "Cannot mix port and net connections in a differential probe."
|
|
3658
3683
|
});
|
|
3659
3684
|
} else if (has_ports) {
|
|
3660
3685
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
3661
3686
|
ctx.addIssue({
|
|
3662
|
-
code:
|
|
3687
|
+
code: z163.ZodIssueCode.custom,
|
|
3663
3688
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
3664
3689
|
});
|
|
3665
3690
|
}
|
|
3666
3691
|
} else if (has_nets) {
|
|
3667
3692
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
3668
3693
|
ctx.addIssue({
|
|
3669
|
-
code:
|
|
3694
|
+
code: z163.ZodIssueCode.custom,
|
|
3670
3695
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
3671
3696
|
});
|
|
3672
3697
|
}
|
|
@@ -3674,7 +3699,7 @@ var simulation_voltage_probe = z162.object({
|
|
|
3674
3699
|
} else {
|
|
3675
3700
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
3676
3701
|
ctx.addIssue({
|
|
3677
|
-
code:
|
|
3702
|
+
code: z163.ZodIssueCode.custom,
|
|
3678
3703
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
3679
3704
|
});
|
|
3680
3705
|
}
|
|
@@ -3683,35 +3708,35 @@ var simulation_voltage_probe = z162.object({
|
|
|
3683
3708
|
expectTypesMatch(true);
|
|
3684
3709
|
|
|
3685
3710
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
3686
|
-
import { z as
|
|
3711
|
+
import { z as z164 } from "zod";
|
|
3687
3712
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
3688
|
-
type:
|
|
3713
|
+
type: z164.literal("simulation_unknown_experiment_error"),
|
|
3689
3714
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
3690
3715
|
"simulation_unknown_experiment_error"
|
|
3691
3716
|
),
|
|
3692
|
-
error_type:
|
|
3693
|
-
simulation_experiment_id:
|
|
3694
|
-
subcircuit_id:
|
|
3717
|
+
error_type: z164.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
3718
|
+
simulation_experiment_id: z164.string().optional(),
|
|
3719
|
+
subcircuit_id: z164.string().optional()
|
|
3695
3720
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
3696
3721
|
expectTypesMatch(true);
|
|
3697
3722
|
|
|
3698
3723
|
// src/simulation/simulation_op_amp.ts
|
|
3699
|
-
import { z as
|
|
3700
|
-
var simulation_op_amp =
|
|
3701
|
-
type:
|
|
3724
|
+
import { z as z165 } from "zod";
|
|
3725
|
+
var simulation_op_amp = z165.object({
|
|
3726
|
+
type: z165.literal("simulation_op_amp"),
|
|
3702
3727
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
3703
|
-
source_component_id:
|
|
3704
|
-
inverting_input_source_port_id:
|
|
3705
|
-
non_inverting_input_source_port_id:
|
|
3706
|
-
output_source_port_id:
|
|
3707
|
-
positive_supply_source_port_id:
|
|
3708
|
-
negative_supply_source_port_id:
|
|
3728
|
+
source_component_id: z165.string().optional(),
|
|
3729
|
+
inverting_input_source_port_id: z165.string(),
|
|
3730
|
+
non_inverting_input_source_port_id: z165.string(),
|
|
3731
|
+
output_source_port_id: z165.string(),
|
|
3732
|
+
positive_supply_source_port_id: z165.string(),
|
|
3733
|
+
negative_supply_source_port_id: z165.string()
|
|
3709
3734
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
3710
3735
|
expectTypesMatch(true);
|
|
3711
3736
|
|
|
3712
3737
|
// src/any_circuit_element.ts
|
|
3713
|
-
import { z as
|
|
3714
|
-
var any_circuit_element =
|
|
3738
|
+
import { z as z166 } from "zod";
|
|
3739
|
+
var any_circuit_element = z166.union([
|
|
3715
3740
|
source_trace,
|
|
3716
3741
|
source_port,
|
|
3717
3742
|
source_component_internal_connection,
|
|
@@ -3787,6 +3812,7 @@ var any_circuit_element = z165.union([
|
|
|
3787
3812
|
pcb_port_not_matched_error,
|
|
3788
3813
|
pcb_port_not_connected_error,
|
|
3789
3814
|
pcb_via_clearance_error,
|
|
3815
|
+
pcb_via_trace_clearance_error,
|
|
3790
3816
|
pcb_pad_pad_clearance_error,
|
|
3791
3817
|
pcb_pad_trace_clearance_error,
|
|
3792
3818
|
pcb_fabrication_note_path,
|
|
@@ -3973,6 +3999,7 @@ export {
|
|
|
3973
3999
|
pcb_trace_warning,
|
|
3974
4000
|
pcb_via,
|
|
3975
4001
|
pcb_via_clearance_error,
|
|
4002
|
+
pcb_via_trace_clearance_error,
|
|
3976
4003
|
point,
|
|
3977
4004
|
point3,
|
|
3978
4005
|
point_with_bulge,
|