circuit-json 0.0.489 → 0.0.490
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 +24 -0
- package/dist/index.d.mts +167 -2
- package/dist/index.mjs +476 -453
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3415,110 +3415,131 @@ var pcb_autorouting_error = base_circuit_json_error.extend({
|
|
|
3415
3415
|
}).describe("The autorouting has failed to route a portion of the board");
|
|
3416
3416
|
expectTypesMatch(true);
|
|
3417
3417
|
|
|
3418
|
-
// src/pcb/
|
|
3418
|
+
// src/pcb/pcb_preflight_routing_error.ts
|
|
3419
3419
|
import { z as z158 } from "zod";
|
|
3420
|
-
var
|
|
3421
|
-
type: z158.literal("
|
|
3420
|
+
var pcb_preflight_routing_error = base_circuit_json_error.extend({
|
|
3421
|
+
type: z158.literal("pcb_preflight_routing_error"),
|
|
3422
|
+
pcb_preflight_routing_error_id: getZodPrefixedIdWithDefault(
|
|
3423
|
+
"pcb_preflight_routing_error"
|
|
3424
|
+
),
|
|
3425
|
+
error_type: z158.literal("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),
|
|
3426
|
+
error_code: z158.string(),
|
|
3427
|
+
subcircuit_id: z158.string().optional(),
|
|
3428
|
+
pcb_group_id: z158.string().optional(),
|
|
3429
|
+
routing_phase_index: z158.number().int().optional(),
|
|
3430
|
+
phase_name: z158.string().optional(),
|
|
3431
|
+
source_trace_ids: z158.array(z158.string()).optional(),
|
|
3432
|
+
pcb_component_ids: z158.array(z158.string()).optional(),
|
|
3433
|
+
pcb_port_ids: z158.array(z158.string()).optional(),
|
|
3434
|
+
related_error_ids: z158.array(z158.string()).optional(),
|
|
3435
|
+
measurements: z158.record(z158.number().finite()).optional()
|
|
3436
|
+
});
|
|
3437
|
+
expectTypesMatch(true);
|
|
3438
|
+
|
|
3439
|
+
// src/pcb/pcb_manual_edit_conflict_warning.ts
|
|
3440
|
+
import { z as z159 } from "zod";
|
|
3441
|
+
var pcb_manual_edit_conflict_warning = z159.object({
|
|
3442
|
+
type: z159.literal("pcb_manual_edit_conflict_warning"),
|
|
3422
3443
|
pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
|
|
3423
3444
|
"pcb_manual_edit_conflict_warning"
|
|
3424
3445
|
),
|
|
3425
|
-
warning_type:
|
|
3426
|
-
message:
|
|
3427
|
-
pcb_component_id:
|
|
3428
|
-
pcb_group_id:
|
|
3429
|
-
subcircuit_id:
|
|
3430
|
-
source_component_id:
|
|
3446
|
+
warning_type: z159.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
|
|
3447
|
+
message: z159.string(),
|
|
3448
|
+
pcb_component_id: z159.string(),
|
|
3449
|
+
pcb_group_id: z159.string().optional(),
|
|
3450
|
+
subcircuit_id: z159.string().optional(),
|
|
3451
|
+
source_component_id: z159.string()
|
|
3431
3452
|
}).describe(
|
|
3432
3453
|
"Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
3433
3454
|
);
|
|
3434
3455
|
expectTypesMatch(true);
|
|
3435
3456
|
|
|
3436
3457
|
// src/pcb/pcb_connector_not_in_accessible_orientation_warning.ts
|
|
3437
|
-
import { z as
|
|
3438
|
-
var connectorOrientationDirection =
|
|
3439
|
-
var pcb_connector_not_in_accessible_orientation_warning =
|
|
3440
|
-
type:
|
|
3458
|
+
import { z as z160 } from "zod";
|
|
3459
|
+
var connectorOrientationDirection = z160.enum(["x-", "x+", "y+", "y-"]);
|
|
3460
|
+
var pcb_connector_not_in_accessible_orientation_warning = z160.object({
|
|
3461
|
+
type: z160.literal("pcb_connector_not_in_accessible_orientation_warning"),
|
|
3441
3462
|
pcb_connector_not_in_accessible_orientation_warning_id: getZodPrefixedIdWithDefault(
|
|
3442
3463
|
"pcb_connector_not_in_accessible_orientation_warning"
|
|
3443
3464
|
),
|
|
3444
|
-
warning_type:
|
|
3445
|
-
message:
|
|
3446
|
-
pcb_component_id:
|
|
3447
|
-
source_component_id:
|
|
3448
|
-
pcb_board_id:
|
|
3465
|
+
warning_type: z160.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),
|
|
3466
|
+
message: z160.string(),
|
|
3467
|
+
pcb_component_id: z160.string(),
|
|
3468
|
+
source_component_id: z160.string().optional(),
|
|
3469
|
+
pcb_board_id: z160.string().optional(),
|
|
3449
3470
|
facing_direction: connectorOrientationDirection,
|
|
3450
3471
|
recommended_facing_direction: connectorOrientationDirection,
|
|
3451
|
-
subcircuit_id:
|
|
3472
|
+
subcircuit_id: z160.string().optional()
|
|
3452
3473
|
}).describe(
|
|
3453
3474
|
"Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"
|
|
3454
3475
|
);
|
|
3455
3476
|
expectTypesMatch(true);
|
|
3456
3477
|
|
|
3457
3478
|
// src/pcb/pcb_component_missing_courtyard_warning.ts
|
|
3458
|
-
import { z as
|
|
3459
|
-
var pcb_component_missing_courtyard_warning =
|
|
3460
|
-
type:
|
|
3479
|
+
import { z as z161 } from "zod";
|
|
3480
|
+
var pcb_component_missing_courtyard_warning = z161.object({
|
|
3481
|
+
type: z161.literal("pcb_component_missing_courtyard_warning"),
|
|
3461
3482
|
pcb_component_missing_courtyard_warning_id: getZodPrefixedIdWithDefault(
|
|
3462
3483
|
"pcb_component_missing_courtyard_warning"
|
|
3463
3484
|
),
|
|
3464
|
-
warning_type:
|
|
3465
|
-
message:
|
|
3466
|
-
pcb_component_id:
|
|
3467
|
-
source_component_id:
|
|
3468
|
-
subcircuit_id:
|
|
3485
|
+
warning_type: z161.literal("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),
|
|
3486
|
+
message: z161.string(),
|
|
3487
|
+
pcb_component_id: z161.string(),
|
|
3488
|
+
source_component_id: z161.string().optional(),
|
|
3489
|
+
subcircuit_id: z161.string().optional()
|
|
3469
3490
|
}).describe("Warning emitted when a PCB component has no courtyard geometry");
|
|
3470
3491
|
expectTypesMatch(true);
|
|
3471
3492
|
|
|
3472
3493
|
// src/pcb/supplier_footprint_mismatch_warning.ts
|
|
3473
|
-
import { z as
|
|
3474
|
-
var supplier_footprint_mismatch_warning =
|
|
3475
|
-
type:
|
|
3494
|
+
import { z as z162 } from "zod";
|
|
3495
|
+
var supplier_footprint_mismatch_warning = z162.object({
|
|
3496
|
+
type: z162.literal("supplier_footprint_mismatch_warning"),
|
|
3476
3497
|
supplier_footprint_mismatch_warning_id: getZodPrefixedIdWithDefault(
|
|
3477
3498
|
"supplier_footprint_mismatch_warning"
|
|
3478
3499
|
),
|
|
3479
|
-
warning_type:
|
|
3480
|
-
message:
|
|
3481
|
-
source_component_id:
|
|
3482
|
-
pcb_component_id:
|
|
3483
|
-
pcb_group_id:
|
|
3484
|
-
subcircuit_id:
|
|
3500
|
+
warning_type: z162.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),
|
|
3501
|
+
message: z162.string(),
|
|
3502
|
+
source_component_id: z162.string(),
|
|
3503
|
+
pcb_component_id: z162.string().optional(),
|
|
3504
|
+
pcb_group_id: z162.string().optional(),
|
|
3505
|
+
subcircuit_id: z162.string().optional(),
|
|
3485
3506
|
supplier_name: supplier_name.optional(),
|
|
3486
|
-
supplier_part_number:
|
|
3487
|
-
supplier_footprint_url:
|
|
3488
|
-
footprint_copper_intersection_over_union:
|
|
3507
|
+
supplier_part_number: z162.string().optional(),
|
|
3508
|
+
supplier_footprint_url: z162.string().optional(),
|
|
3509
|
+
footprint_copper_intersection_over_union: z162.number()
|
|
3489
3510
|
}).describe(
|
|
3490
3511
|
"Warning emitted when a supplier part footprint does not match the expected footprint"
|
|
3491
3512
|
);
|
|
3492
3513
|
expectTypesMatch(true);
|
|
3493
3514
|
|
|
3494
3515
|
// src/pcb/pcb_fabricator_extra_charge_warning.ts
|
|
3495
|
-
import { z as
|
|
3496
|
-
var pcb_fabricator_extra_charge_warning =
|
|
3497
|
-
type:
|
|
3516
|
+
import { z as z163 } from "zod";
|
|
3517
|
+
var pcb_fabricator_extra_charge_warning = z163.object({
|
|
3518
|
+
type: z163.literal("pcb_fabricator_extra_charge_warning"),
|
|
3498
3519
|
pcb_fabricator_extra_charge_warning_id: getZodPrefixedIdWithDefault(
|
|
3499
3520
|
"pcb_fabricator_extra_charge_warning"
|
|
3500
3521
|
),
|
|
3501
|
-
warning_type:
|
|
3502
|
-
message:
|
|
3503
|
-
fabricator_preset:
|
|
3504
|
-
pcb_board_id:
|
|
3505
|
-
pcb_via_ids:
|
|
3506
|
-
subcircuit_id:
|
|
3522
|
+
warning_type: z163.literal("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),
|
|
3523
|
+
message: z163.string(),
|
|
3524
|
+
fabricator_preset: z163.string(),
|
|
3525
|
+
pcb_board_id: z163.string().optional(),
|
|
3526
|
+
pcb_via_ids: z163.array(z163.string()).optional(),
|
|
3527
|
+
subcircuit_id: z163.string().optional()
|
|
3507
3528
|
}).describe(
|
|
3508
3529
|
"Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets."
|
|
3509
3530
|
);
|
|
3510
3531
|
expectTypesMatch(true);
|
|
3511
3532
|
|
|
3512
3533
|
// src/pcb/pcb_breakout_point.ts
|
|
3513
|
-
import { z as
|
|
3514
|
-
var pcb_breakout_point =
|
|
3515
|
-
type:
|
|
3534
|
+
import { z as z164 } from "zod";
|
|
3535
|
+
var pcb_breakout_point = z164.object({
|
|
3536
|
+
type: z164.literal("pcb_breakout_point"),
|
|
3516
3537
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
3517
|
-
pcb_group_id:
|
|
3518
|
-
subcircuit_id:
|
|
3519
|
-
source_trace_id:
|
|
3520
|
-
source_port_id:
|
|
3521
|
-
source_net_id:
|
|
3538
|
+
pcb_group_id: z164.string(),
|
|
3539
|
+
subcircuit_id: z164.string().optional(),
|
|
3540
|
+
source_trace_id: z164.string().optional(),
|
|
3541
|
+
source_port_id: z164.string().optional(),
|
|
3542
|
+
source_net_id: z164.string().optional(),
|
|
3522
3543
|
layer: layer_ref.optional(),
|
|
3523
3544
|
x: distance,
|
|
3524
3545
|
y: distance
|
|
@@ -3528,61 +3549,61 @@ var pcb_breakout_point = z163.object({
|
|
|
3528
3549
|
expectTypesMatch(true);
|
|
3529
3550
|
|
|
3530
3551
|
// src/pcb/pcb_ground_plane.ts
|
|
3531
|
-
import { z as
|
|
3532
|
-
var pcb_ground_plane =
|
|
3533
|
-
type:
|
|
3552
|
+
import { z as z165 } from "zod";
|
|
3553
|
+
var pcb_ground_plane = z165.object({
|
|
3554
|
+
type: z165.literal("pcb_ground_plane"),
|
|
3534
3555
|
pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
|
|
3535
|
-
source_pcb_ground_plane_id:
|
|
3536
|
-
source_net_id:
|
|
3537
|
-
pcb_group_id:
|
|
3538
|
-
subcircuit_id:
|
|
3556
|
+
source_pcb_ground_plane_id: z165.string(),
|
|
3557
|
+
source_net_id: z165.string(),
|
|
3558
|
+
pcb_group_id: z165.string().optional(),
|
|
3559
|
+
subcircuit_id: z165.string().optional()
|
|
3539
3560
|
}).describe("Defines a ground plane on the PCB");
|
|
3540
3561
|
expectTypesMatch(true);
|
|
3541
3562
|
|
|
3542
3563
|
// src/pcb/pcb_ground_plane_region.ts
|
|
3543
|
-
import { z as
|
|
3544
|
-
var pcb_ground_plane_region =
|
|
3545
|
-
type:
|
|
3564
|
+
import { z as z166 } from "zod";
|
|
3565
|
+
var pcb_ground_plane_region = z166.object({
|
|
3566
|
+
type: z166.literal("pcb_ground_plane_region"),
|
|
3546
3567
|
pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
|
|
3547
3568
|
"pcb_ground_plane_region"
|
|
3548
3569
|
),
|
|
3549
|
-
pcb_ground_plane_id:
|
|
3550
|
-
pcb_group_id:
|
|
3551
|
-
subcircuit_id:
|
|
3570
|
+
pcb_ground_plane_id: z166.string(),
|
|
3571
|
+
pcb_group_id: z166.string().optional(),
|
|
3572
|
+
subcircuit_id: z166.string().optional(),
|
|
3552
3573
|
layer: layer_ref,
|
|
3553
|
-
points:
|
|
3574
|
+
points: z166.array(point)
|
|
3554
3575
|
}).describe("Defines a polygon region of a ground plane");
|
|
3555
3576
|
expectTypesMatch(true);
|
|
3556
3577
|
|
|
3557
3578
|
// src/pcb/pcb_thermal_spoke.ts
|
|
3558
|
-
import { z as
|
|
3559
|
-
var pcb_thermal_spoke =
|
|
3560
|
-
type:
|
|
3579
|
+
import { z as z167 } from "zod";
|
|
3580
|
+
var pcb_thermal_spoke = z167.object({
|
|
3581
|
+
type: z167.literal("pcb_thermal_spoke"),
|
|
3561
3582
|
pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
|
|
3562
|
-
pcb_ground_plane_id:
|
|
3563
|
-
shape:
|
|
3564
|
-
spoke_count:
|
|
3583
|
+
pcb_ground_plane_id: z167.string(),
|
|
3584
|
+
shape: z167.string(),
|
|
3585
|
+
spoke_count: z167.number(),
|
|
3565
3586
|
spoke_thickness: distance,
|
|
3566
3587
|
spoke_inner_diameter: distance,
|
|
3567
3588
|
spoke_outer_diameter: distance,
|
|
3568
|
-
pcb_plated_hole_id:
|
|
3569
|
-
subcircuit_id:
|
|
3589
|
+
pcb_plated_hole_id: z167.string().optional(),
|
|
3590
|
+
subcircuit_id: z167.string().optional()
|
|
3570
3591
|
}).describe("Pattern for connecting a ground plane to a plated hole");
|
|
3571
3592
|
expectTypesMatch(true);
|
|
3572
3593
|
|
|
3573
3594
|
// src/pcb/pcb_copper_pour.ts
|
|
3574
|
-
import { z as
|
|
3575
|
-
var pcb_copper_pour_base =
|
|
3576
|
-
type:
|
|
3595
|
+
import { z as z168 } from "zod";
|
|
3596
|
+
var pcb_copper_pour_base = z168.object({
|
|
3597
|
+
type: z168.literal("pcb_copper_pour"),
|
|
3577
3598
|
pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
|
|
3578
|
-
pcb_group_id:
|
|
3579
|
-
subcircuit_id:
|
|
3599
|
+
pcb_group_id: z168.string().optional(),
|
|
3600
|
+
subcircuit_id: z168.string().optional(),
|
|
3580
3601
|
layer: layer_ref,
|
|
3581
|
-
source_net_id:
|
|
3582
|
-
covered_with_solder_mask:
|
|
3602
|
+
source_net_id: z168.string().optional(),
|
|
3603
|
+
covered_with_solder_mask: z168.boolean().optional().default(true)
|
|
3583
3604
|
});
|
|
3584
3605
|
var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
3585
|
-
shape:
|
|
3606
|
+
shape: z168.literal("rect"),
|
|
3586
3607
|
center: point,
|
|
3587
3608
|
width: length,
|
|
3588
3609
|
height: length,
|
|
@@ -3590,16 +3611,16 @@ var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
|
3590
3611
|
});
|
|
3591
3612
|
expectTypesMatch(true);
|
|
3592
3613
|
var pcb_copper_pour_brep = pcb_copper_pour_base.extend({
|
|
3593
|
-
shape:
|
|
3614
|
+
shape: z168.literal("brep"),
|
|
3594
3615
|
brep_shape
|
|
3595
3616
|
});
|
|
3596
3617
|
expectTypesMatch(true);
|
|
3597
3618
|
var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
|
|
3598
|
-
shape:
|
|
3599
|
-
points:
|
|
3619
|
+
shape: z168.literal("polygon"),
|
|
3620
|
+
points: z168.array(point)
|
|
3600
3621
|
});
|
|
3601
3622
|
expectTypesMatch(true);
|
|
3602
|
-
var pcb_copper_pour =
|
|
3623
|
+
var pcb_copper_pour = z168.discriminatedUnion("shape", [
|
|
3603
3624
|
pcb_copper_pour_rect,
|
|
3604
3625
|
pcb_copper_pour_brep,
|
|
3605
3626
|
pcb_copper_pour_polygon
|
|
@@ -3607,99 +3628,99 @@ var pcb_copper_pour = z167.discriminatedUnion("shape", [
|
|
|
3607
3628
|
expectTypesMatch(true);
|
|
3608
3629
|
|
|
3609
3630
|
// src/pcb/pcb_component_outside_board_error.ts
|
|
3610
|
-
import { z as
|
|
3631
|
+
import { z as z169 } from "zod";
|
|
3611
3632
|
var pcb_component_outside_board_error = base_circuit_json_error.extend({
|
|
3612
|
-
type:
|
|
3633
|
+
type: z169.literal("pcb_component_outside_board_error"),
|
|
3613
3634
|
pcb_component_outside_board_error_id: getZodPrefixedIdWithDefault(
|
|
3614
3635
|
"pcb_component_outside_board_error"
|
|
3615
3636
|
),
|
|
3616
|
-
error_type:
|
|
3617
|
-
pcb_component_id:
|
|
3618
|
-
pcb_board_id:
|
|
3637
|
+
error_type: z169.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),
|
|
3638
|
+
pcb_component_id: z169.string(),
|
|
3639
|
+
pcb_board_id: z169.string(),
|
|
3619
3640
|
component_center: point,
|
|
3620
|
-
component_bounds:
|
|
3621
|
-
min_x:
|
|
3622
|
-
max_x:
|
|
3623
|
-
min_y:
|
|
3624
|
-
max_y:
|
|
3641
|
+
component_bounds: z169.object({
|
|
3642
|
+
min_x: z169.number(),
|
|
3643
|
+
max_x: z169.number(),
|
|
3644
|
+
min_y: z169.number(),
|
|
3645
|
+
max_y: z169.number()
|
|
3625
3646
|
}),
|
|
3626
|
-
subcircuit_id:
|
|
3627
|
-
source_component_id:
|
|
3647
|
+
subcircuit_id: z169.string().optional(),
|
|
3648
|
+
source_component_id: z169.string().optional()
|
|
3628
3649
|
}).describe(
|
|
3629
3650
|
"Error emitted when a PCB component is placed outside the board boundaries"
|
|
3630
3651
|
);
|
|
3631
3652
|
expectTypesMatch(true);
|
|
3632
3653
|
|
|
3633
3654
|
// src/pcb/pcb_component_not_on_board_edge_error.ts
|
|
3634
|
-
import { z as
|
|
3655
|
+
import { z as z170 } from "zod";
|
|
3635
3656
|
var pcb_component_not_on_board_edge_error = base_circuit_json_error.extend({
|
|
3636
|
-
type:
|
|
3657
|
+
type: z170.literal("pcb_component_not_on_board_edge_error"),
|
|
3637
3658
|
pcb_component_not_on_board_edge_error_id: getZodPrefixedIdWithDefault(
|
|
3638
3659
|
"pcb_component_not_on_board_edge_error"
|
|
3639
3660
|
),
|
|
3640
|
-
error_type:
|
|
3641
|
-
pcb_component_id:
|
|
3642
|
-
pcb_board_id:
|
|
3661
|
+
error_type: z170.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),
|
|
3662
|
+
pcb_component_id: z170.string(),
|
|
3663
|
+
pcb_board_id: z170.string(),
|
|
3643
3664
|
component_center: point,
|
|
3644
|
-
pad_to_nearest_board_edge_distance:
|
|
3645
|
-
source_component_id:
|
|
3646
|
-
subcircuit_id:
|
|
3665
|
+
pad_to_nearest_board_edge_distance: z170.number(),
|
|
3666
|
+
source_component_id: z170.string().optional(),
|
|
3667
|
+
subcircuit_id: z170.string().optional()
|
|
3647
3668
|
}).describe(
|
|
3648
3669
|
"Error emitted when a component that must be placed on the board edge is centered away from the edge"
|
|
3649
3670
|
);
|
|
3650
3671
|
expectTypesMatch(true);
|
|
3651
3672
|
|
|
3652
3673
|
// src/pcb/pcb_component_invalid_layer_error.ts
|
|
3653
|
-
import { z as
|
|
3674
|
+
import { z as z171 } from "zod";
|
|
3654
3675
|
var pcb_component_invalid_layer_error = base_circuit_json_error.extend({
|
|
3655
|
-
type:
|
|
3676
|
+
type: z171.literal("pcb_component_invalid_layer_error"),
|
|
3656
3677
|
pcb_component_invalid_layer_error_id: getZodPrefixedIdWithDefault(
|
|
3657
3678
|
"pcb_component_invalid_layer_error"
|
|
3658
3679
|
),
|
|
3659
|
-
error_type:
|
|
3660
|
-
pcb_component_id:
|
|
3661
|
-
source_component_id:
|
|
3680
|
+
error_type: z171.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),
|
|
3681
|
+
pcb_component_id: z171.string().optional(),
|
|
3682
|
+
source_component_id: z171.string(),
|
|
3662
3683
|
layer: layer_ref,
|
|
3663
|
-
subcircuit_id:
|
|
3684
|
+
subcircuit_id: z171.string().optional()
|
|
3664
3685
|
}).describe(
|
|
3665
3686
|
"Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"
|
|
3666
3687
|
);
|
|
3667
3688
|
expectTypesMatch(true);
|
|
3668
3689
|
|
|
3669
3690
|
// src/pcb/pcb_via_clearance_error.ts
|
|
3670
|
-
import { z as
|
|
3691
|
+
import { z as z172 } from "zod";
|
|
3671
3692
|
var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
3672
|
-
type:
|
|
3693
|
+
type: z172.literal("pcb_via_clearance_error"),
|
|
3673
3694
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
3674
|
-
error_type:
|
|
3675
|
-
pcb_via_ids:
|
|
3695
|
+
error_type: z172.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),
|
|
3696
|
+
pcb_via_ids: z172.array(z172.string()).min(2),
|
|
3676
3697
|
minimum_clearance: distance.optional(),
|
|
3677
3698
|
actual_clearance: distance.optional(),
|
|
3678
|
-
pcb_center:
|
|
3679
|
-
x:
|
|
3680
|
-
y:
|
|
3699
|
+
pcb_center: z172.object({
|
|
3700
|
+
x: z172.number().optional(),
|
|
3701
|
+
y: z172.number().optional()
|
|
3681
3702
|
}).optional(),
|
|
3682
|
-
subcircuit_id:
|
|
3703
|
+
subcircuit_id: z172.string().optional()
|
|
3683
3704
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
3684
3705
|
expectTypesMatch(true);
|
|
3685
3706
|
|
|
3686
3707
|
// src/pcb/pcb_via_trace_clearance_error.ts
|
|
3687
|
-
import { z as
|
|
3708
|
+
import { z as z173 } from "zod";
|
|
3688
3709
|
var pcb_via_trace_clearance_error = base_circuit_json_error.extend({
|
|
3689
|
-
type:
|
|
3710
|
+
type: z173.literal("pcb_via_trace_clearance_error"),
|
|
3690
3711
|
pcb_via_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3691
3712
|
"pcb_via_trace_clearance_error"
|
|
3692
3713
|
),
|
|
3693
|
-
error_type:
|
|
3694
|
-
pcb_via_id:
|
|
3695
|
-
pcb_trace_id:
|
|
3714
|
+
error_type: z173.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),
|
|
3715
|
+
pcb_via_id: z173.string(),
|
|
3716
|
+
pcb_trace_id: z173.string(),
|
|
3696
3717
|
minimum_clearance: distance.optional(),
|
|
3697
3718
|
actual_clearance: distance.optional(),
|
|
3698
|
-
center:
|
|
3699
|
-
x:
|
|
3700
|
-
y:
|
|
3719
|
+
center: z173.object({
|
|
3720
|
+
x: z173.number().optional(),
|
|
3721
|
+
y: z173.number().optional()
|
|
3701
3722
|
}).optional(),
|
|
3702
|
-
subcircuit_id:
|
|
3723
|
+
subcircuit_id: z173.string().optional()
|
|
3703
3724
|
}).describe(
|
|
3704
3725
|
"Error emitted when a via and trace are closer than the allowed clearance"
|
|
3705
3726
|
);
|
|
@@ -3708,41 +3729,41 @@ expectTypesMatch(
|
|
|
3708
3729
|
);
|
|
3709
3730
|
|
|
3710
3731
|
// src/pcb/pcb_pad_pad_clearance_error.ts
|
|
3711
|
-
import { z as
|
|
3732
|
+
import { z as z174 } from "zod";
|
|
3712
3733
|
var pcb_pad_pad_clearance_error = base_circuit_json_error.extend({
|
|
3713
|
-
type:
|
|
3734
|
+
type: z174.literal("pcb_pad_pad_clearance_error"),
|
|
3714
3735
|
pcb_pad_pad_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3715
3736
|
"pcb_pad_pad_clearance_error"
|
|
3716
3737
|
),
|
|
3717
|
-
error_type:
|
|
3718
|
-
pcb_pad_ids:
|
|
3738
|
+
error_type: z174.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),
|
|
3739
|
+
pcb_pad_ids: z174.array(z174.string()).min(2),
|
|
3719
3740
|
minimum_clearance: distance.optional(),
|
|
3720
3741
|
actual_clearance: distance.optional(),
|
|
3721
|
-
center:
|
|
3722
|
-
x:
|
|
3723
|
-
y:
|
|
3742
|
+
center: z174.object({
|
|
3743
|
+
x: z174.number().optional(),
|
|
3744
|
+
y: z174.number().optional()
|
|
3724
3745
|
}).optional(),
|
|
3725
|
-
subcircuit_id:
|
|
3746
|
+
subcircuit_id: z174.string().optional()
|
|
3726
3747
|
}).describe("Error emitted when pads are closer than the allowed clearance");
|
|
3727
3748
|
expectTypesMatch(true);
|
|
3728
3749
|
|
|
3729
3750
|
// src/pcb/pcb_pad_trace_clearance_error.ts
|
|
3730
|
-
import { z as
|
|
3751
|
+
import { z as z175 } from "zod";
|
|
3731
3752
|
var pcb_pad_trace_clearance_error = base_circuit_json_error.extend({
|
|
3732
|
-
type:
|
|
3753
|
+
type: z175.literal("pcb_pad_trace_clearance_error"),
|
|
3733
3754
|
pcb_pad_trace_clearance_error_id: getZodPrefixedIdWithDefault(
|
|
3734
3755
|
"pcb_pad_trace_clearance_error"
|
|
3735
3756
|
),
|
|
3736
|
-
error_type:
|
|
3737
|
-
pcb_pad_id:
|
|
3738
|
-
pcb_trace_id:
|
|
3757
|
+
error_type: z175.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),
|
|
3758
|
+
pcb_pad_id: z175.string(),
|
|
3759
|
+
pcb_trace_id: z175.string(),
|
|
3739
3760
|
minimum_clearance: distance.optional(),
|
|
3740
3761
|
actual_clearance: distance.optional(),
|
|
3741
|
-
center:
|
|
3742
|
-
x:
|
|
3743
|
-
y:
|
|
3762
|
+
center: z175.object({
|
|
3763
|
+
x: z175.number().optional(),
|
|
3764
|
+
y: z175.number().optional()
|
|
3744
3765
|
}).optional(),
|
|
3745
|
-
subcircuit_id:
|
|
3766
|
+
subcircuit_id: z175.string().optional()
|
|
3746
3767
|
}).describe(
|
|
3747
3768
|
"Error emitted when a pad and trace are closer than allowed clearance"
|
|
3748
3769
|
);
|
|
@@ -3751,89 +3772,89 @@ expectTypesMatch(
|
|
|
3751
3772
|
);
|
|
3752
3773
|
|
|
3753
3774
|
// src/pcb/pcb_courtyard_rect.ts
|
|
3754
|
-
import { z as
|
|
3755
|
-
var pcb_courtyard_rect =
|
|
3756
|
-
type:
|
|
3775
|
+
import { z as z176 } from "zod";
|
|
3776
|
+
var pcb_courtyard_rect = z176.object({
|
|
3777
|
+
type: z176.literal("pcb_courtyard_rect"),
|
|
3757
3778
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
3758
|
-
pcb_component_id:
|
|
3759
|
-
pcb_group_id:
|
|
3760
|
-
subcircuit_id:
|
|
3779
|
+
pcb_component_id: z176.string(),
|
|
3780
|
+
pcb_group_id: z176.string().optional(),
|
|
3781
|
+
subcircuit_id: z176.string().optional(),
|
|
3761
3782
|
center: point,
|
|
3762
3783
|
width: length,
|
|
3763
3784
|
height: length,
|
|
3764
3785
|
layer: visible_layer,
|
|
3765
3786
|
ccw_rotation: rotation.optional(),
|
|
3766
|
-
color:
|
|
3787
|
+
color: z176.string().optional()
|
|
3767
3788
|
}).describe("Defines a courtyard rectangle on the PCB");
|
|
3768
3789
|
expectTypesMatch(true);
|
|
3769
3790
|
|
|
3770
3791
|
// src/pcb/pcb_courtyard_outline.ts
|
|
3771
|
-
import { z as
|
|
3772
|
-
var pcb_courtyard_outline =
|
|
3773
|
-
type:
|
|
3792
|
+
import { z as z177 } from "zod";
|
|
3793
|
+
var pcb_courtyard_outline = z177.object({
|
|
3794
|
+
type: z177.literal("pcb_courtyard_outline"),
|
|
3774
3795
|
pcb_courtyard_outline_id: getZodPrefixedIdWithDefault(
|
|
3775
3796
|
"pcb_courtyard_outline"
|
|
3776
3797
|
),
|
|
3777
|
-
pcb_component_id:
|
|
3778
|
-
pcb_group_id:
|
|
3779
|
-
subcircuit_id:
|
|
3798
|
+
pcb_component_id: z177.string(),
|
|
3799
|
+
pcb_group_id: z177.string().optional(),
|
|
3800
|
+
subcircuit_id: z177.string().optional(),
|
|
3780
3801
|
layer: visible_layer,
|
|
3781
|
-
outline:
|
|
3802
|
+
outline: z177.array(point).min(2)
|
|
3782
3803
|
}).describe("Defines a courtyard outline on the PCB");
|
|
3783
3804
|
expectTypesMatch(true);
|
|
3784
3805
|
|
|
3785
3806
|
// src/pcb/pcb_courtyard_polygon.ts
|
|
3786
|
-
import { z as
|
|
3787
|
-
var pcb_courtyard_polygon =
|
|
3788
|
-
type:
|
|
3807
|
+
import { z as z178 } from "zod";
|
|
3808
|
+
var pcb_courtyard_polygon = z178.object({
|
|
3809
|
+
type: z178.literal("pcb_courtyard_polygon"),
|
|
3789
3810
|
pcb_courtyard_polygon_id: getZodPrefixedIdWithDefault(
|
|
3790
3811
|
"pcb_courtyard_polygon"
|
|
3791
3812
|
),
|
|
3792
|
-
pcb_component_id:
|
|
3793
|
-
pcb_group_id:
|
|
3794
|
-
subcircuit_id:
|
|
3813
|
+
pcb_component_id: z178.string(),
|
|
3814
|
+
pcb_group_id: z178.string().optional(),
|
|
3815
|
+
subcircuit_id: z178.string().optional(),
|
|
3795
3816
|
layer: visible_layer,
|
|
3796
|
-
points:
|
|
3797
|
-
color:
|
|
3817
|
+
points: z178.array(point).min(3),
|
|
3818
|
+
color: z178.string().optional()
|
|
3798
3819
|
}).describe("Defines a courtyard polygon on the PCB");
|
|
3799
3820
|
expectTypesMatch(true);
|
|
3800
3821
|
|
|
3801
3822
|
// src/pcb/pcb_courtyard_circle.ts
|
|
3802
|
-
import { z as
|
|
3803
|
-
var pcb_courtyard_circle =
|
|
3804
|
-
type:
|
|
3823
|
+
import { z as z179 } from "zod";
|
|
3824
|
+
var pcb_courtyard_circle = z179.object({
|
|
3825
|
+
type: z179.literal("pcb_courtyard_circle"),
|
|
3805
3826
|
pcb_courtyard_circle_id: getZodPrefixedIdWithDefault(
|
|
3806
3827
|
"pcb_courtyard_circle"
|
|
3807
3828
|
),
|
|
3808
|
-
pcb_component_id:
|
|
3809
|
-
pcb_group_id:
|
|
3810
|
-
subcircuit_id:
|
|
3829
|
+
pcb_component_id: z179.string(),
|
|
3830
|
+
pcb_group_id: z179.string().optional(),
|
|
3831
|
+
subcircuit_id: z179.string().optional(),
|
|
3811
3832
|
center: point,
|
|
3812
3833
|
radius: length,
|
|
3813
3834
|
layer: visible_layer,
|
|
3814
|
-
color:
|
|
3835
|
+
color: z179.string().optional()
|
|
3815
3836
|
}).describe("Defines a courtyard circle on the PCB");
|
|
3816
3837
|
expectTypesMatch(true);
|
|
3817
3838
|
|
|
3818
3839
|
// src/pcb/pcb_courtyard_pill.ts
|
|
3819
|
-
import { z as
|
|
3820
|
-
var pcb_courtyard_pill =
|
|
3821
|
-
type:
|
|
3840
|
+
import { z as z180 } from "zod";
|
|
3841
|
+
var pcb_courtyard_pill = z180.object({
|
|
3842
|
+
type: z180.literal("pcb_courtyard_pill"),
|
|
3822
3843
|
pcb_courtyard_pill_id: getZodPrefixedIdWithDefault("pcb_courtyard_pill"),
|
|
3823
|
-
pcb_component_id:
|
|
3824
|
-
pcb_group_id:
|
|
3825
|
-
subcircuit_id:
|
|
3844
|
+
pcb_component_id: z180.string(),
|
|
3845
|
+
pcb_group_id: z180.string().optional(),
|
|
3846
|
+
subcircuit_id: z180.string().optional(),
|
|
3826
3847
|
center: point,
|
|
3827
3848
|
width: length,
|
|
3828
3849
|
height: length,
|
|
3829
3850
|
radius: length,
|
|
3830
3851
|
layer: visible_layer,
|
|
3831
|
-
color:
|
|
3852
|
+
color: z180.string().optional()
|
|
3832
3853
|
}).describe("Defines a courtyard pill on the PCB");
|
|
3833
3854
|
expectTypesMatch(true);
|
|
3834
3855
|
|
|
3835
3856
|
// src/cad/cad_component.ts
|
|
3836
|
-
import { z as
|
|
3857
|
+
import { z as z181 } from "zod";
|
|
3837
3858
|
|
|
3838
3859
|
// src/cad/cad_model_conventions.ts
|
|
3839
3860
|
var cad_model_formats = [
|
|
@@ -3864,50 +3885,50 @@ var cadModelDefaultDirectionMap = {
|
|
|
3864
3885
|
};
|
|
3865
3886
|
|
|
3866
3887
|
// src/cad/cad_component.ts
|
|
3867
|
-
var cad_component =
|
|
3868
|
-
type:
|
|
3869
|
-
cad_component_id:
|
|
3870
|
-
pcb_component_id:
|
|
3871
|
-
source_component_id:
|
|
3888
|
+
var cad_component = z181.object({
|
|
3889
|
+
type: z181.literal("cad_component"),
|
|
3890
|
+
cad_component_id: z181.string(),
|
|
3891
|
+
pcb_component_id: z181.string(),
|
|
3892
|
+
source_component_id: z181.string(),
|
|
3872
3893
|
position: point3,
|
|
3873
3894
|
rotation: point3.optional(),
|
|
3874
3895
|
size: point3.optional(),
|
|
3875
3896
|
layer: layer_ref.optional(),
|
|
3876
|
-
subcircuit_id:
|
|
3897
|
+
subcircuit_id: z181.string().optional(),
|
|
3877
3898
|
// These are all ways to generate/load the 3d model
|
|
3878
|
-
footprinter_string:
|
|
3879
|
-
model_obj_url:
|
|
3880
|
-
model_stl_url:
|
|
3881
|
-
model_3mf_url:
|
|
3882
|
-
model_gltf_url:
|
|
3883
|
-
model_glb_url:
|
|
3884
|
-
model_step_url:
|
|
3885
|
-
model_wrl_url:
|
|
3899
|
+
footprinter_string: z181.string().optional(),
|
|
3900
|
+
model_obj_url: z181.string().optional(),
|
|
3901
|
+
model_stl_url: z181.string().optional(),
|
|
3902
|
+
model_3mf_url: z181.string().optional(),
|
|
3903
|
+
model_gltf_url: z181.string().optional(),
|
|
3904
|
+
model_glb_url: z181.string().optional(),
|
|
3905
|
+
model_step_url: z181.string().optional(),
|
|
3906
|
+
model_wrl_url: z181.string().optional(),
|
|
3886
3907
|
model_asset: asset.optional(),
|
|
3887
|
-
model_unit_to_mm_scale_factor:
|
|
3888
|
-
model_board_normal_direction:
|
|
3908
|
+
model_unit_to_mm_scale_factor: z181.number().optional(),
|
|
3909
|
+
model_board_normal_direction: z181.enum(cad_model_axis_directions).optional().describe(
|
|
3889
3910
|
`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`
|
|
3890
3911
|
),
|
|
3891
3912
|
model_origin_position: point3.optional(),
|
|
3892
|
-
model_origin_alignment:
|
|
3913
|
+
model_origin_alignment: z181.enum([
|
|
3893
3914
|
"unknown",
|
|
3894
3915
|
"center",
|
|
3895
3916
|
"center_of_component_on_board_surface",
|
|
3896
3917
|
"bottom_center_of_component"
|
|
3897
3918
|
]).optional(),
|
|
3898
|
-
model_object_fit:
|
|
3899
|
-
model_jscad:
|
|
3900
|
-
show_as_translucent_model:
|
|
3901
|
-
show_as_bounding_box:
|
|
3902
|
-
show_hidden_edges:
|
|
3903
|
-
anchor_alignment:
|
|
3919
|
+
model_object_fit: z181.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
3920
|
+
model_jscad: z181.any().optional(),
|
|
3921
|
+
show_as_translucent_model: z181.boolean().optional(),
|
|
3922
|
+
show_as_bounding_box: z181.boolean().optional(),
|
|
3923
|
+
show_hidden_edges: z181.boolean().optional(),
|
|
3924
|
+
anchor_alignment: z181.enum(["center", "center_of_component_on_board_surface"]).optional().default("center")
|
|
3904
3925
|
}).describe("Defines a component on the PCB");
|
|
3905
3926
|
expectTypesMatch(true);
|
|
3906
3927
|
|
|
3907
3928
|
// src/simulation/simulation_voltage_source.ts
|
|
3908
|
-
import { z as
|
|
3909
|
-
var wave_shape =
|
|
3910
|
-
var percentage =
|
|
3929
|
+
import { z as z182 } from "zod";
|
|
3930
|
+
var wave_shape = z182.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
3931
|
+
var percentage = z182.union([z182.string(), z182.number()]).transform((val) => {
|
|
3911
3932
|
if (typeof val === "string") {
|
|
3912
3933
|
if (val.endsWith("%")) {
|
|
3913
3934
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3916,32 +3937,32 @@ var percentage = z181.union([z181.string(), z181.number()]).transform((val) => {
|
|
|
3916
3937
|
}
|
|
3917
3938
|
return val;
|
|
3918
3939
|
}).pipe(
|
|
3919
|
-
|
|
3940
|
+
z182.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3920
3941
|
);
|
|
3921
|
-
var simulation_dc_voltage_source =
|
|
3922
|
-
type:
|
|
3942
|
+
var simulation_dc_voltage_source = z182.object({
|
|
3943
|
+
type: z182.literal("simulation_voltage_source"),
|
|
3923
3944
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3924
3945
|
"simulation_voltage_source"
|
|
3925
3946
|
),
|
|
3926
|
-
is_dc_source:
|
|
3927
|
-
positive_source_port_id:
|
|
3928
|
-
negative_source_port_id:
|
|
3929
|
-
positive_source_net_id:
|
|
3930
|
-
negative_source_net_id:
|
|
3947
|
+
is_dc_source: z182.literal(true).optional().default(true),
|
|
3948
|
+
positive_source_port_id: z182.string().optional(),
|
|
3949
|
+
negative_source_port_id: z182.string().optional(),
|
|
3950
|
+
positive_source_net_id: z182.string().optional(),
|
|
3951
|
+
negative_source_net_id: z182.string().optional(),
|
|
3931
3952
|
voltage,
|
|
3932
3953
|
ac_magnitude: voltage.optional(),
|
|
3933
3954
|
ac_phase: rotation.optional()
|
|
3934
3955
|
}).describe("Defines a DC voltage source for simulation");
|
|
3935
|
-
var simulation_ac_voltage_source =
|
|
3936
|
-
type:
|
|
3956
|
+
var simulation_ac_voltage_source = z182.object({
|
|
3957
|
+
type: z182.literal("simulation_voltage_source"),
|
|
3937
3958
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3938
3959
|
"simulation_voltage_source"
|
|
3939
3960
|
),
|
|
3940
|
-
is_dc_source:
|
|
3941
|
-
terminal1_source_port_id:
|
|
3942
|
-
terminal2_source_port_id:
|
|
3943
|
-
terminal1_source_net_id:
|
|
3944
|
-
terminal2_source_net_id:
|
|
3961
|
+
is_dc_source: z182.literal(false),
|
|
3962
|
+
terminal1_source_port_id: z182.string().optional(),
|
|
3963
|
+
terminal2_source_port_id: z182.string().optional(),
|
|
3964
|
+
terminal1_source_net_id: z182.string().optional(),
|
|
3965
|
+
terminal2_source_net_id: z182.string().optional(),
|
|
3945
3966
|
voltage: voltage.optional(),
|
|
3946
3967
|
frequency: frequency.optional(),
|
|
3947
3968
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -3956,14 +3977,14 @@ var simulation_ac_voltage_source = z181.object({
|
|
|
3956
3977
|
ac_magnitude: voltage.optional(),
|
|
3957
3978
|
ac_phase: rotation.optional()
|
|
3958
3979
|
}).describe("Defines an AC voltage source for simulation");
|
|
3959
|
-
var simulation_voltage_source =
|
|
3980
|
+
var simulation_voltage_source = z182.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
3960
3981
|
expectTypesMatch(true);
|
|
3961
3982
|
expectTypesMatch(true);
|
|
3962
3983
|
expectTypesMatch(true);
|
|
3963
3984
|
|
|
3964
3985
|
// src/simulation/simulation_current_source.ts
|
|
3965
|
-
import { z as
|
|
3966
|
-
var percentage2 =
|
|
3986
|
+
import { z as z183 } from "zod";
|
|
3987
|
+
var percentage2 = z183.union([z183.string(), z183.number()]).transform((val) => {
|
|
3967
3988
|
if (typeof val === "string") {
|
|
3968
3989
|
if (val.endsWith("%")) {
|
|
3969
3990
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3972,32 +3993,32 @@ var percentage2 = z182.union([z182.string(), z182.number()]).transform((val) =>
|
|
|
3972
3993
|
}
|
|
3973
3994
|
return val;
|
|
3974
3995
|
}).pipe(
|
|
3975
|
-
|
|
3996
|
+
z183.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3976
3997
|
);
|
|
3977
|
-
var simulation_dc_current_source =
|
|
3978
|
-
type:
|
|
3998
|
+
var simulation_dc_current_source = z183.object({
|
|
3999
|
+
type: z183.literal("simulation_current_source"),
|
|
3979
4000
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3980
4001
|
"simulation_current_source"
|
|
3981
4002
|
),
|
|
3982
|
-
is_dc_source:
|
|
3983
|
-
positive_source_port_id:
|
|
3984
|
-
negative_source_port_id:
|
|
3985
|
-
positive_source_net_id:
|
|
3986
|
-
negative_source_net_id:
|
|
4003
|
+
is_dc_source: z183.literal(true).optional().default(true),
|
|
4004
|
+
positive_source_port_id: z183.string().optional(),
|
|
4005
|
+
negative_source_port_id: z183.string().optional(),
|
|
4006
|
+
positive_source_net_id: z183.string().optional(),
|
|
4007
|
+
negative_source_net_id: z183.string().optional(),
|
|
3987
4008
|
current,
|
|
3988
4009
|
ac_magnitude: current.optional(),
|
|
3989
4010
|
ac_phase: rotation.optional()
|
|
3990
4011
|
}).describe("Defines a DC current source for simulation");
|
|
3991
|
-
var simulation_ac_current_source =
|
|
3992
|
-
type:
|
|
4012
|
+
var simulation_ac_current_source = z183.object({
|
|
4013
|
+
type: z183.literal("simulation_current_source"),
|
|
3993
4014
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3994
4015
|
"simulation_current_source"
|
|
3995
4016
|
),
|
|
3996
|
-
is_dc_source:
|
|
3997
|
-
terminal1_source_port_id:
|
|
3998
|
-
terminal2_source_port_id:
|
|
3999
|
-
terminal1_source_net_id:
|
|
4000
|
-
terminal2_source_net_id:
|
|
4017
|
+
is_dc_source: z183.literal(false),
|
|
4018
|
+
terminal1_source_port_id: z183.string().optional(),
|
|
4019
|
+
terminal2_source_port_id: z183.string().optional(),
|
|
4020
|
+
terminal1_source_net_id: z183.string().optional(),
|
|
4021
|
+
terminal2_source_net_id: z183.string().optional(),
|
|
4001
4022
|
current: current.optional(),
|
|
4002
4023
|
frequency: frequency.optional(),
|
|
4003
4024
|
peak_to_peak_current: current.optional(),
|
|
@@ -4007,58 +4028,58 @@ var simulation_ac_current_source = z182.object({
|
|
|
4007
4028
|
ac_magnitude: current.optional(),
|
|
4008
4029
|
ac_phase: rotation.optional()
|
|
4009
4030
|
}).describe("Defines an AC current source for simulation");
|
|
4010
|
-
var simulation_current_source =
|
|
4031
|
+
var simulation_current_source = z183.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
4011
4032
|
expectTypesMatch(true);
|
|
4012
4033
|
expectTypesMatch(true);
|
|
4013
4034
|
expectTypesMatch(true);
|
|
4014
4035
|
|
|
4015
4036
|
// src/simulation/simulation_experiment.ts
|
|
4016
|
-
import { z as
|
|
4037
|
+
import { z as z185 } from "zod";
|
|
4017
4038
|
|
|
4018
4039
|
// src/simulation/simulation_units.ts
|
|
4019
|
-
import { z as
|
|
4020
|
-
var simulation_dc_sweep_unit =
|
|
4040
|
+
import { z as z184 } from "zod";
|
|
4041
|
+
var simulation_dc_sweep_unit = z184.custom(
|
|
4021
4042
|
(dcSweepUnit) => dcSweepUnit === "V" || dcSweepUnit === "A"
|
|
4022
4043
|
);
|
|
4023
|
-
var simulation_parameter_unit =
|
|
4044
|
+
var simulation_parameter_unit = z184.custom(
|
|
4024
4045
|
(parameterUnit) => parameterUnit === "\u03A9" || parameterUnit === "F" || parameterUnit === "H" || parameterUnit === "V" || parameterUnit === "A"
|
|
4025
4046
|
);
|
|
4026
4047
|
|
|
4027
4048
|
// src/simulation/simulation_experiment.ts
|
|
4028
|
-
var experiment_type =
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4049
|
+
var experiment_type = z185.union([
|
|
4050
|
+
z185.literal("spice_dc_sweep"),
|
|
4051
|
+
z185.literal("spice_dc_operating_point"),
|
|
4052
|
+
z185.literal("spice_transient_analysis"),
|
|
4053
|
+
z185.literal("spice_ac_analysis")
|
|
4033
4054
|
]);
|
|
4034
|
-
var spice_simulation_options =
|
|
4035
|
-
method:
|
|
4036
|
-
reltol:
|
|
4037
|
-
abstol:
|
|
4038
|
-
vntol:
|
|
4055
|
+
var spice_simulation_options = z185.object({
|
|
4056
|
+
method: z185.enum(["trap", "gear"]).optional(),
|
|
4057
|
+
reltol: z185.union([z185.number(), z185.string()]).optional(),
|
|
4058
|
+
abstol: z185.union([z185.number(), z185.string()]).optional(),
|
|
4059
|
+
vntol: z185.union([z185.number(), z185.string()]).optional()
|
|
4039
4060
|
}).describe("SPICE solver options for a simulation experiment");
|
|
4040
|
-
var simulation_experiment =
|
|
4041
|
-
type:
|
|
4061
|
+
var simulation_experiment = z185.object({
|
|
4062
|
+
type: z185.literal("simulation_experiment"),
|
|
4042
4063
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
4043
4064
|
"simulation_experiment"
|
|
4044
4065
|
),
|
|
4045
|
-
name:
|
|
4066
|
+
name: z185.string(),
|
|
4046
4067
|
experiment_type,
|
|
4047
4068
|
time_per_step: duration_ms.optional(),
|
|
4048
4069
|
start_time_ms: ms.optional(),
|
|
4049
4070
|
end_time_ms: ms.optional(),
|
|
4050
4071
|
spice_options: spice_simulation_options.optional(),
|
|
4051
|
-
dc_sweep_voltage_source_id:
|
|
4052
|
-
dc_sweep_current_source_id:
|
|
4053
|
-
dc_sweep_start:
|
|
4054
|
-
dc_sweep_stop:
|
|
4055
|
-
dc_sweep_step:
|
|
4072
|
+
dc_sweep_voltage_source_id: z185.string().optional(),
|
|
4073
|
+
dc_sweep_current_source_id: z185.string().optional(),
|
|
4074
|
+
dc_sweep_start: z185.number().optional(),
|
|
4075
|
+
dc_sweep_stop: z185.number().optional(),
|
|
4076
|
+
dc_sweep_step: z185.number().refine((dcSweepStep) => dcSweepStep !== 0).optional(),
|
|
4056
4077
|
dc_sweep_unit: simulation_dc_sweep_unit.optional(),
|
|
4057
|
-
ac_sweep_type:
|
|
4058
|
-
ac_samples_per_interval:
|
|
4059
|
-
ac_sample_count:
|
|
4060
|
-
ac_start_frequency_hz:
|
|
4061
|
-
ac_stop_frequency_hz:
|
|
4078
|
+
ac_sweep_type: z185.enum(["linear", "decade", "octave"]).optional(),
|
|
4079
|
+
ac_samples_per_interval: z185.number().int().positive().optional(),
|
|
4080
|
+
ac_sample_count: z185.number().int().positive().optional(),
|
|
4081
|
+
ac_start_frequency_hz: z185.number().positive().optional(),
|
|
4082
|
+
ac_stop_frequency_hz: z185.number().positive().optional()
|
|
4062
4083
|
}).superRefine((experiment, context) => {
|
|
4063
4084
|
if (experiment.experiment_type === "spice_dc_sweep") {
|
|
4064
4085
|
const requiredFields = [
|
|
@@ -4070,7 +4091,7 @@ var simulation_experiment = z184.object({
|
|
|
4070
4091
|
for (const field of requiredFields) {
|
|
4071
4092
|
if (experiment[field] === void 0) {
|
|
4072
4093
|
context.addIssue({
|
|
4073
|
-
code:
|
|
4094
|
+
code: z185.ZodIssueCode.custom,
|
|
4074
4095
|
path: [field],
|
|
4075
4096
|
message: `${field} is required for a DC sweep`
|
|
4076
4097
|
});
|
|
@@ -4080,7 +4101,7 @@ var simulation_experiment = z184.object({
|
|
|
4080
4101
|
const hasCurrentSource = experiment.dc_sweep_current_source_id !== void 0;
|
|
4081
4102
|
if (hasVoltageSource === hasCurrentSource) {
|
|
4082
4103
|
context.addIssue({
|
|
4083
|
-
code:
|
|
4104
|
+
code: z185.ZodIssueCode.custom,
|
|
4084
4105
|
path: ["dc_sweep_voltage_source_id"],
|
|
4085
4106
|
message: "Exactly one DC sweep voltage or current source ID is required"
|
|
4086
4107
|
});
|
|
@@ -4089,35 +4110,35 @@ var simulation_experiment = z184.object({
|
|
|
4089
4110
|
if (experiment.experiment_type === "spice_ac_analysis") {
|
|
4090
4111
|
if (experiment.ac_sweep_type === void 0) {
|
|
4091
4112
|
context.addIssue({
|
|
4092
|
-
code:
|
|
4113
|
+
code: z185.ZodIssueCode.custom,
|
|
4093
4114
|
path: ["ac_sweep_type"],
|
|
4094
4115
|
message: "ac_sweep_type is required for an AC analysis"
|
|
4095
4116
|
});
|
|
4096
4117
|
}
|
|
4097
4118
|
if (experiment.ac_start_frequency_hz === void 0) {
|
|
4098
4119
|
context.addIssue({
|
|
4099
|
-
code:
|
|
4120
|
+
code: z185.ZodIssueCode.custom,
|
|
4100
4121
|
path: ["ac_start_frequency_hz"],
|
|
4101
4122
|
message: "ac_start_frequency_hz is required for an AC analysis"
|
|
4102
4123
|
});
|
|
4103
4124
|
}
|
|
4104
4125
|
if (experiment.ac_stop_frequency_hz === void 0) {
|
|
4105
4126
|
context.addIssue({
|
|
4106
|
-
code:
|
|
4127
|
+
code: z185.ZodIssueCode.custom,
|
|
4107
4128
|
path: ["ac_stop_frequency_hz"],
|
|
4108
4129
|
message: "ac_stop_frequency_hz is required for an AC analysis"
|
|
4109
4130
|
});
|
|
4110
4131
|
}
|
|
4111
4132
|
if (experiment.ac_sweep_type === "linear" && experiment.ac_sample_count === void 0) {
|
|
4112
4133
|
context.addIssue({
|
|
4113
|
-
code:
|
|
4134
|
+
code: z185.ZodIssueCode.custom,
|
|
4114
4135
|
path: ["ac_sample_count"],
|
|
4115
4136
|
message: "ac_sample_count is required for a linear AC analysis"
|
|
4116
4137
|
});
|
|
4117
4138
|
}
|
|
4118
4139
|
if ((experiment.ac_sweep_type === "decade" || experiment.ac_sweep_type === "octave") && experiment.ac_samples_per_interval === void 0) {
|
|
4119
4140
|
context.addIssue({
|
|
4120
|
-
code:
|
|
4141
|
+
code: z185.ZodIssueCode.custom,
|
|
4121
4142
|
path: ["ac_samples_per_interval"],
|
|
4122
4143
|
message: "ac_samples_per_interval is required for decade and octave AC analyses"
|
|
4123
4144
|
});
|
|
@@ -4127,87 +4148,87 @@ var simulation_experiment = z184.object({
|
|
|
4127
4148
|
expectTypesMatch(true);
|
|
4128
4149
|
|
|
4129
4150
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4130
|
-
import { z as
|
|
4151
|
+
import { z as z187 } from "zod";
|
|
4131
4152
|
|
|
4132
4153
|
// src/simulation/simulation_parameter_sweep_coordinate.ts
|
|
4133
|
-
import { z as
|
|
4134
|
-
var simulation_parameter_sweep_coordinate =
|
|
4135
|
-
simulation_parameter_sweep_id:
|
|
4136
|
-
sweep_index:
|
|
4137
|
-
parameter_value:
|
|
4154
|
+
import { z as z186 } from "zod";
|
|
4155
|
+
var simulation_parameter_sweep_coordinate = z186.object({
|
|
4156
|
+
simulation_parameter_sweep_id: z186.string(),
|
|
4157
|
+
sweep_index: z186.number().int().nonnegative(),
|
|
4158
|
+
parameter_value: z186.number(),
|
|
4138
4159
|
parameter_unit: simulation_parameter_unit
|
|
4139
4160
|
});
|
|
4140
4161
|
expectTypesMatch(true);
|
|
4141
4162
|
|
|
4142
4163
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4143
|
-
var simulation_transient_voltage_graph =
|
|
4144
|
-
type:
|
|
4164
|
+
var simulation_transient_voltage_graph = z187.object({
|
|
4165
|
+
type: z187.literal("simulation_transient_voltage_graph"),
|
|
4145
4166
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4146
4167
|
"simulation_transient_voltage_graph"
|
|
4147
4168
|
),
|
|
4148
|
-
simulation_experiment_id:
|
|
4169
|
+
simulation_experiment_id: z187.string(),
|
|
4149
4170
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4150
|
-
timestamps_ms:
|
|
4151
|
-
voltage_levels:
|
|
4152
|
-
source_component_id:
|
|
4153
|
-
subcircuit_connectivity_map_key:
|
|
4171
|
+
timestamps_ms: z187.array(z187.number()).optional(),
|
|
4172
|
+
voltage_levels: z187.array(z187.number()),
|
|
4173
|
+
source_component_id: z187.string().optional(),
|
|
4174
|
+
subcircuit_connectivity_map_key: z187.string().optional(),
|
|
4154
4175
|
time_per_step: duration_ms,
|
|
4155
4176
|
start_time_ms: ms,
|
|
4156
4177
|
end_time_ms: ms,
|
|
4157
|
-
name:
|
|
4158
|
-
color:
|
|
4178
|
+
name: z187.string().optional(),
|
|
4179
|
+
color: z187.string().optional()
|
|
4159
4180
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
4160
4181
|
expectTypesMatch(true);
|
|
4161
4182
|
|
|
4162
4183
|
// src/simulation/simulation_transient_current_graph.ts
|
|
4163
|
-
import { z as
|
|
4164
|
-
var simulation_transient_current_graph =
|
|
4165
|
-
type:
|
|
4184
|
+
import { z as z188 } from "zod";
|
|
4185
|
+
var simulation_transient_current_graph = z188.object({
|
|
4186
|
+
type: z188.literal("simulation_transient_current_graph"),
|
|
4166
4187
|
simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4167
4188
|
"simulation_transient_current_graph"
|
|
4168
4189
|
),
|
|
4169
|
-
simulation_experiment_id:
|
|
4190
|
+
simulation_experiment_id: z188.string(),
|
|
4170
4191
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4171
|
-
timestamps_ms:
|
|
4172
|
-
current_levels:
|
|
4173
|
-
source_component_id:
|
|
4174
|
-
subcircuit_connectivity_map_key:
|
|
4192
|
+
timestamps_ms: z188.array(z188.number()).optional(),
|
|
4193
|
+
current_levels: z188.array(z188.number()),
|
|
4194
|
+
source_component_id: z188.string().optional(),
|
|
4195
|
+
subcircuit_connectivity_map_key: z188.string().optional(),
|
|
4175
4196
|
time_per_step: duration_ms,
|
|
4176
4197
|
start_time_ms: ms,
|
|
4177
4198
|
end_time_ms: ms,
|
|
4178
|
-
name:
|
|
4179
|
-
color:
|
|
4199
|
+
name: z188.string().optional(),
|
|
4200
|
+
color: z188.string().optional()
|
|
4180
4201
|
}).describe("Stores current measurements over time for a simulation");
|
|
4181
4202
|
expectTypesMatch(true);
|
|
4182
4203
|
|
|
4183
4204
|
// src/simulation/simulation_switch.ts
|
|
4184
|
-
import { z as
|
|
4185
|
-
var simulation_switch =
|
|
4186
|
-
type:
|
|
4205
|
+
import { z as z189 } from "zod";
|
|
4206
|
+
var simulation_switch = z189.object({
|
|
4207
|
+
type: z189.literal("simulation_switch"),
|
|
4187
4208
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
4188
|
-
source_component_id:
|
|
4209
|
+
source_component_id: z189.string().optional(),
|
|
4189
4210
|
closes_at: ms.optional(),
|
|
4190
4211
|
opens_at: ms.optional(),
|
|
4191
|
-
starts_closed:
|
|
4212
|
+
starts_closed: z189.boolean().optional(),
|
|
4192
4213
|
switching_frequency: frequency.optional()
|
|
4193
4214
|
}).describe("Defines a switch for simulation timing control");
|
|
4194
4215
|
expectTypesMatch(true);
|
|
4195
4216
|
|
|
4196
4217
|
// src/simulation/simulation_voltage_probe.ts
|
|
4197
|
-
import { z as
|
|
4198
|
-
var simulation_voltage_probe =
|
|
4199
|
-
type:
|
|
4218
|
+
import { z as z190 } from "zod";
|
|
4219
|
+
var simulation_voltage_probe = z190.object({
|
|
4220
|
+
type: z190.literal("simulation_voltage_probe"),
|
|
4200
4221
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
4201
4222
|
"simulation_voltage_probe"
|
|
4202
4223
|
),
|
|
4203
|
-
source_component_id:
|
|
4204
|
-
name:
|
|
4205
|
-
signal_input_source_port_id:
|
|
4206
|
-
signal_input_source_net_id:
|
|
4207
|
-
reference_input_source_port_id:
|
|
4208
|
-
reference_input_source_net_id:
|
|
4209
|
-
subcircuit_id:
|
|
4210
|
-
color:
|
|
4224
|
+
source_component_id: z190.string().optional(),
|
|
4225
|
+
name: z190.string().optional(),
|
|
4226
|
+
signal_input_source_port_id: z190.string().optional(),
|
|
4227
|
+
signal_input_source_net_id: z190.string().optional(),
|
|
4228
|
+
reference_input_source_port_id: z190.string().optional(),
|
|
4229
|
+
reference_input_source_net_id: z190.string().optional(),
|
|
4230
|
+
subcircuit_id: z190.string().optional(),
|
|
4231
|
+
color: z190.string().optional()
|
|
4211
4232
|
}).describe(
|
|
4212
4233
|
"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."
|
|
4213
4234
|
).superRefine((data, ctx) => {
|
|
@@ -4217,20 +4238,20 @@ var simulation_voltage_probe = z189.object({
|
|
|
4217
4238
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
4218
4239
|
if (has_ports && has_nets) {
|
|
4219
4240
|
ctx.addIssue({
|
|
4220
|
-
code:
|
|
4241
|
+
code: z190.ZodIssueCode.custom,
|
|
4221
4242
|
message: "Cannot mix port and net connections in a differential probe."
|
|
4222
4243
|
});
|
|
4223
4244
|
} else if (has_ports) {
|
|
4224
4245
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
4225
4246
|
ctx.addIssue({
|
|
4226
|
-
code:
|
|
4247
|
+
code: z190.ZodIssueCode.custom,
|
|
4227
4248
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
4228
4249
|
});
|
|
4229
4250
|
}
|
|
4230
4251
|
} else if (has_nets) {
|
|
4231
4252
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
4232
4253
|
ctx.addIssue({
|
|
4233
|
-
code:
|
|
4254
|
+
code: z190.ZodIssueCode.custom,
|
|
4234
4255
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
4235
4256
|
});
|
|
4236
4257
|
}
|
|
@@ -4238,7 +4259,7 @@ var simulation_voltage_probe = z189.object({
|
|
|
4238
4259
|
} else {
|
|
4239
4260
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
4240
4261
|
ctx.addIssue({
|
|
4241
|
-
code:
|
|
4262
|
+
code: z190.ZodIssueCode.custom,
|
|
4242
4263
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
4243
4264
|
});
|
|
4244
4265
|
}
|
|
@@ -4247,20 +4268,20 @@ var simulation_voltage_probe = z189.object({
|
|
|
4247
4268
|
expectTypesMatch(true);
|
|
4248
4269
|
|
|
4249
4270
|
// src/simulation/simulation_current_probe.ts
|
|
4250
|
-
import { z as
|
|
4251
|
-
var simulation_current_probe =
|
|
4252
|
-
type:
|
|
4271
|
+
import { z as z191 } from "zod";
|
|
4272
|
+
var simulation_current_probe = z191.object({
|
|
4273
|
+
type: z191.literal("simulation_current_probe"),
|
|
4253
4274
|
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
4254
4275
|
"simulation_current_probe"
|
|
4255
4276
|
),
|
|
4256
|
-
source_component_id:
|
|
4257
|
-
name:
|
|
4258
|
-
positive_source_port_id:
|
|
4259
|
-
negative_source_port_id:
|
|
4260
|
-
positive_source_net_id:
|
|
4261
|
-
negative_source_net_id:
|
|
4262
|
-
subcircuit_id:
|
|
4263
|
-
color:
|
|
4277
|
+
source_component_id: z191.string().optional(),
|
|
4278
|
+
name: z191.string().optional(),
|
|
4279
|
+
positive_source_port_id: z191.string().optional(),
|
|
4280
|
+
negative_source_port_id: z191.string().optional(),
|
|
4281
|
+
positive_source_net_id: z191.string().optional(),
|
|
4282
|
+
negative_source_net_id: z191.string().optional(),
|
|
4283
|
+
subcircuit_id: z191.string().optional(),
|
|
4284
|
+
color: z191.string().optional()
|
|
4264
4285
|
}).describe(
|
|
4265
4286
|
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
4266
4287
|
).superRefine((data, ctx) => {
|
|
@@ -4272,7 +4293,7 @@ var simulation_current_probe = z190.object({
|
|
|
4272
4293
|
const hasNets = hasPositiveNet || hasNegativeNet;
|
|
4273
4294
|
if (hasPorts && hasNets) {
|
|
4274
4295
|
ctx.addIssue({
|
|
4275
|
-
code:
|
|
4296
|
+
code: z191.ZodIssueCode.custom,
|
|
4276
4297
|
message: "Cannot mix port and net connections in a current probe."
|
|
4277
4298
|
});
|
|
4278
4299
|
return;
|
|
@@ -4280,7 +4301,7 @@ var simulation_current_probe = z190.object({
|
|
|
4280
4301
|
if (hasPorts) {
|
|
4281
4302
|
if (!hasPositivePort || !hasNegativePort) {
|
|
4282
4303
|
ctx.addIssue({
|
|
4283
|
-
code:
|
|
4304
|
+
code: z191.ZodIssueCode.custom,
|
|
4284
4305
|
message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
|
|
4285
4306
|
});
|
|
4286
4307
|
}
|
|
@@ -4289,71 +4310,71 @@ var simulation_current_probe = z190.object({
|
|
|
4289
4310
|
if (hasNets) {
|
|
4290
4311
|
if (!hasPositiveNet || !hasNegativeNet) {
|
|
4291
4312
|
ctx.addIssue({
|
|
4292
|
-
code:
|
|
4313
|
+
code: z191.ZodIssueCode.custom,
|
|
4293
4314
|
message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
|
|
4294
4315
|
});
|
|
4295
4316
|
}
|
|
4296
4317
|
return;
|
|
4297
4318
|
}
|
|
4298
4319
|
ctx.addIssue({
|
|
4299
|
-
code:
|
|
4320
|
+
code: z191.ZodIssueCode.custom,
|
|
4300
4321
|
message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
|
|
4301
4322
|
});
|
|
4302
4323
|
});
|
|
4303
4324
|
expectTypesMatch(true);
|
|
4304
4325
|
|
|
4305
4326
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
4306
|
-
import { z as
|
|
4327
|
+
import { z as z192 } from "zod";
|
|
4307
4328
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
4308
|
-
type:
|
|
4329
|
+
type: z192.literal("simulation_unknown_experiment_error"),
|
|
4309
4330
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
4310
4331
|
"simulation_unknown_experiment_error"
|
|
4311
4332
|
),
|
|
4312
|
-
error_type:
|
|
4313
|
-
simulation_experiment_id:
|
|
4314
|
-
subcircuit_id:
|
|
4333
|
+
error_type: z192.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
4334
|
+
simulation_experiment_id: z192.string().optional(),
|
|
4335
|
+
subcircuit_id: z192.string().optional()
|
|
4315
4336
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
4316
4337
|
expectTypesMatch(true);
|
|
4317
4338
|
|
|
4318
4339
|
// src/simulation/simulation_parameter_sweep.ts
|
|
4319
|
-
import { z as
|
|
4320
|
-
var simulation_parameter_type =
|
|
4340
|
+
import { z as z193 } from "zod";
|
|
4341
|
+
var simulation_parameter_type = z193.enum([
|
|
4321
4342
|
"resistance",
|
|
4322
4343
|
"capacitance",
|
|
4323
4344
|
"inductance",
|
|
4324
4345
|
"voltage",
|
|
4325
4346
|
"current"
|
|
4326
4347
|
]);
|
|
4327
|
-
var simulation_parameter_sweep_base =
|
|
4328
|
-
type:
|
|
4348
|
+
var simulation_parameter_sweep_base = z193.object({
|
|
4349
|
+
type: z193.literal("simulation_parameter_sweep"),
|
|
4329
4350
|
simulation_parameter_sweep_id: getZodPrefixedIdWithDefault(
|
|
4330
4351
|
"simulation_parameter_sweep"
|
|
4331
4352
|
),
|
|
4332
|
-
simulation_experiment_id:
|
|
4333
|
-
name:
|
|
4334
|
-
parameter_values:
|
|
4353
|
+
simulation_experiment_id: z193.string(),
|
|
4354
|
+
name: z193.string().optional(),
|
|
4355
|
+
parameter_values: z193.array(z193.number()).min(1),
|
|
4335
4356
|
parameter_unit: simulation_parameter_unit
|
|
4336
4357
|
});
|
|
4337
|
-
var simulation_parameter_sweep =
|
|
4358
|
+
var simulation_parameter_sweep = z193.discriminatedUnion("parameter_type", [
|
|
4338
4359
|
simulation_parameter_sweep_base.extend({
|
|
4339
|
-
parameter_type:
|
|
4340
|
-
resistor_source_component_id:
|
|
4360
|
+
parameter_type: z193.literal("resistance"),
|
|
4361
|
+
resistor_source_component_id: z193.string()
|
|
4341
4362
|
}),
|
|
4342
4363
|
simulation_parameter_sweep_base.extend({
|
|
4343
|
-
parameter_type:
|
|
4344
|
-
capacitor_source_component_id:
|
|
4364
|
+
parameter_type: z193.literal("capacitance"),
|
|
4365
|
+
capacitor_source_component_id: z193.string()
|
|
4345
4366
|
}),
|
|
4346
4367
|
simulation_parameter_sweep_base.extend({
|
|
4347
|
-
parameter_type:
|
|
4348
|
-
inductor_source_component_id:
|
|
4368
|
+
parameter_type: z193.literal("inductance"),
|
|
4369
|
+
inductor_source_component_id: z193.string()
|
|
4349
4370
|
}),
|
|
4350
4371
|
simulation_parameter_sweep_base.extend({
|
|
4351
|
-
parameter_type:
|
|
4352
|
-
source_net_id:
|
|
4372
|
+
parameter_type: z193.literal("voltage"),
|
|
4373
|
+
source_net_id: z193.string()
|
|
4353
4374
|
}),
|
|
4354
4375
|
simulation_parameter_sweep_base.extend({
|
|
4355
|
-
parameter_type:
|
|
4356
|
-
current_source_component_id:
|
|
4376
|
+
parameter_type: z193.literal("current"),
|
|
4377
|
+
current_source_component_id: z193.string()
|
|
4357
4378
|
})
|
|
4358
4379
|
]).describe("Repeats a simulation experiment over component parameter values");
|
|
4359
4380
|
expectTypesMatch(
|
|
@@ -4361,52 +4382,52 @@ expectTypesMatch(
|
|
|
4361
4382
|
);
|
|
4362
4383
|
|
|
4363
4384
|
// src/simulation/simulation_dc_operating_point_voltage.ts
|
|
4364
|
-
import { z as
|
|
4365
|
-
var simulation_dc_operating_point_voltage =
|
|
4366
|
-
type:
|
|
4385
|
+
import { z as z194 } from "zod";
|
|
4386
|
+
var simulation_dc_operating_point_voltage = z194.object({
|
|
4387
|
+
type: z194.literal("simulation_dc_operating_point_voltage"),
|
|
4367
4388
|
simulation_dc_operating_point_voltage_id: getZodPrefixedIdWithDefault(
|
|
4368
4389
|
"simulation_dc_operating_point_voltage"
|
|
4369
4390
|
),
|
|
4370
|
-
simulation_experiment_id:
|
|
4391
|
+
simulation_experiment_id: z194.string(),
|
|
4371
4392
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4372
|
-
simulation_voltage_probe_id:
|
|
4373
|
-
voltage:
|
|
4374
|
-
name:
|
|
4375
|
-
color:
|
|
4393
|
+
simulation_voltage_probe_id: z194.string(),
|
|
4394
|
+
voltage: z194.number(),
|
|
4395
|
+
name: z194.string().optional(),
|
|
4396
|
+
color: z194.string().optional()
|
|
4376
4397
|
});
|
|
4377
4398
|
expectTypesMatch(true);
|
|
4378
4399
|
|
|
4379
4400
|
// src/simulation/simulation_dc_operating_point_current.ts
|
|
4380
|
-
import { z as
|
|
4381
|
-
var simulation_dc_operating_point_current =
|
|
4382
|
-
type:
|
|
4401
|
+
import { z as z195 } from "zod";
|
|
4402
|
+
var simulation_dc_operating_point_current = z195.object({
|
|
4403
|
+
type: z195.literal("simulation_dc_operating_point_current"),
|
|
4383
4404
|
simulation_dc_operating_point_current_id: getZodPrefixedIdWithDefault(
|
|
4384
4405
|
"simulation_dc_operating_point_current"
|
|
4385
4406
|
),
|
|
4386
|
-
simulation_experiment_id:
|
|
4407
|
+
simulation_experiment_id: z195.string(),
|
|
4387
4408
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4388
|
-
simulation_current_probe_id:
|
|
4389
|
-
current:
|
|
4390
|
-
name:
|
|
4391
|
-
color:
|
|
4409
|
+
simulation_current_probe_id: z195.string(),
|
|
4410
|
+
current: z195.number(),
|
|
4411
|
+
name: z195.string().optional(),
|
|
4412
|
+
color: z195.string().optional()
|
|
4392
4413
|
});
|
|
4393
4414
|
expectTypesMatch(true);
|
|
4394
4415
|
|
|
4395
4416
|
// src/simulation/simulation_dc_sweep_voltage_graph.ts
|
|
4396
|
-
import { z as
|
|
4397
|
-
var simulation_dc_sweep_voltage_graph =
|
|
4398
|
-
type:
|
|
4417
|
+
import { z as z196 } from "zod";
|
|
4418
|
+
var simulation_dc_sweep_voltage_graph = z196.object({
|
|
4419
|
+
type: z196.literal("simulation_dc_sweep_voltage_graph"),
|
|
4399
4420
|
simulation_dc_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4400
4421
|
"simulation_dc_sweep_voltage_graph"
|
|
4401
4422
|
),
|
|
4402
|
-
simulation_experiment_id:
|
|
4423
|
+
simulation_experiment_id: z196.string(),
|
|
4403
4424
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4404
|
-
simulation_voltage_probe_id:
|
|
4405
|
-
sweep_values:
|
|
4425
|
+
simulation_voltage_probe_id: z196.string(),
|
|
4426
|
+
sweep_values: z196.array(z196.number()),
|
|
4406
4427
|
sweep_unit: simulation_dc_sweep_unit,
|
|
4407
|
-
voltage_levels:
|
|
4408
|
-
name:
|
|
4409
|
-
color:
|
|
4428
|
+
voltage_levels: z196.array(z196.number()),
|
|
4429
|
+
name: z196.string().optional(),
|
|
4430
|
+
color: z196.string().optional()
|
|
4410
4431
|
}).refine(
|
|
4411
4432
|
(graph) => graph.sweep_values.length === graph.voltage_levels.length,
|
|
4412
4433
|
{
|
|
@@ -4416,20 +4437,20 @@ var simulation_dc_sweep_voltage_graph = z195.object({
|
|
|
4416
4437
|
expectTypesMatch(true);
|
|
4417
4438
|
|
|
4418
4439
|
// src/simulation/simulation_dc_sweep_current_graph.ts
|
|
4419
|
-
import { z as
|
|
4420
|
-
var simulation_dc_sweep_current_graph =
|
|
4421
|
-
type:
|
|
4440
|
+
import { z as z197 } from "zod";
|
|
4441
|
+
var simulation_dc_sweep_current_graph = z197.object({
|
|
4442
|
+
type: z197.literal("simulation_dc_sweep_current_graph"),
|
|
4422
4443
|
simulation_dc_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4423
4444
|
"simulation_dc_sweep_current_graph"
|
|
4424
4445
|
),
|
|
4425
|
-
simulation_experiment_id:
|
|
4446
|
+
simulation_experiment_id: z197.string(),
|
|
4426
4447
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4427
|
-
simulation_current_probe_id:
|
|
4428
|
-
sweep_values:
|
|
4448
|
+
simulation_current_probe_id: z197.string(),
|
|
4449
|
+
sweep_values: z197.array(z197.number()),
|
|
4429
4450
|
sweep_unit: simulation_dc_sweep_unit,
|
|
4430
|
-
current_levels:
|
|
4431
|
-
name:
|
|
4432
|
-
color:
|
|
4451
|
+
current_levels: z197.array(z197.number()),
|
|
4452
|
+
name: z197.string().optional(),
|
|
4453
|
+
color: z197.string().optional()
|
|
4433
4454
|
}).refine(
|
|
4434
4455
|
(graph) => graph.sweep_values.length === graph.current_levels.length,
|
|
4435
4456
|
{
|
|
@@ -4439,29 +4460,29 @@ var simulation_dc_sweep_current_graph = z196.object({
|
|
|
4439
4460
|
expectTypesMatch(true);
|
|
4440
4461
|
|
|
4441
4462
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
4442
|
-
import { z as
|
|
4463
|
+
import { z as z199 } from "zod";
|
|
4443
4464
|
|
|
4444
4465
|
// src/simulation/simulation_complex_sample.ts
|
|
4445
|
-
import { z as
|
|
4446
|
-
var simulation_complex_sample =
|
|
4447
|
-
re:
|
|
4448
|
-
im:
|
|
4466
|
+
import { z as z198 } from "zod";
|
|
4467
|
+
var simulation_complex_sample = z198.object({
|
|
4468
|
+
re: z198.number(),
|
|
4469
|
+
im: z198.number()
|
|
4449
4470
|
});
|
|
4450
4471
|
expectTypesMatch(true);
|
|
4451
4472
|
|
|
4452
4473
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
4453
|
-
var simulation_ac_sweep_voltage_graph =
|
|
4454
|
-
type:
|
|
4474
|
+
var simulation_ac_sweep_voltage_graph = z199.object({
|
|
4475
|
+
type: z199.literal("simulation_ac_sweep_voltage_graph"),
|
|
4455
4476
|
simulation_ac_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4456
4477
|
"simulation_ac_sweep_voltage_graph"
|
|
4457
4478
|
),
|
|
4458
|
-
simulation_experiment_id:
|
|
4479
|
+
simulation_experiment_id: z199.string(),
|
|
4459
4480
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4460
|
-
simulation_voltage_probe_id:
|
|
4461
|
-
frequencies_hz:
|
|
4462
|
-
complex_voltages:
|
|
4463
|
-
name:
|
|
4464
|
-
color:
|
|
4481
|
+
simulation_voltage_probe_id: z199.string(),
|
|
4482
|
+
frequencies_hz: z199.array(z199.number()),
|
|
4483
|
+
complex_voltages: z199.array(simulation_complex_sample),
|
|
4484
|
+
name: z199.string().optional(),
|
|
4485
|
+
color: z199.string().optional()
|
|
4465
4486
|
}).refine(
|
|
4466
4487
|
(graph) => graph.frequencies_hz.length === graph.complex_voltages.length,
|
|
4467
4488
|
{
|
|
@@ -4471,19 +4492,19 @@ var simulation_ac_sweep_voltage_graph = z198.object({
|
|
|
4471
4492
|
expectTypesMatch(true);
|
|
4472
4493
|
|
|
4473
4494
|
// src/simulation/simulation_ac_sweep_current_graph.ts
|
|
4474
|
-
import { z as
|
|
4475
|
-
var simulation_ac_sweep_current_graph =
|
|
4476
|
-
type:
|
|
4495
|
+
import { z as z200 } from "zod";
|
|
4496
|
+
var simulation_ac_sweep_current_graph = z200.object({
|
|
4497
|
+
type: z200.literal("simulation_ac_sweep_current_graph"),
|
|
4477
4498
|
simulation_ac_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4478
4499
|
"simulation_ac_sweep_current_graph"
|
|
4479
4500
|
),
|
|
4480
|
-
simulation_experiment_id:
|
|
4501
|
+
simulation_experiment_id: z200.string(),
|
|
4481
4502
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4482
|
-
simulation_current_probe_id:
|
|
4483
|
-
frequencies_hz:
|
|
4484
|
-
complex_currents:
|
|
4485
|
-
name:
|
|
4486
|
-
color:
|
|
4503
|
+
simulation_current_probe_id: z200.string(),
|
|
4504
|
+
frequencies_hz: z200.array(z200.number()),
|
|
4505
|
+
complex_currents: z200.array(simulation_complex_sample),
|
|
4506
|
+
name: z200.string().optional(),
|
|
4507
|
+
color: z200.string().optional()
|
|
4487
4508
|
}).refine(
|
|
4488
4509
|
(graph) => graph.frequencies_hz.length === graph.complex_currents.length,
|
|
4489
4510
|
{
|
|
@@ -4493,52 +4514,52 @@ var simulation_ac_sweep_current_graph = z199.object({
|
|
|
4493
4514
|
expectTypesMatch(true);
|
|
4494
4515
|
|
|
4495
4516
|
// src/simulation/simulation_op_amp.ts
|
|
4496
|
-
import { z as
|
|
4497
|
-
var simulation_op_amp =
|
|
4498
|
-
type:
|
|
4517
|
+
import { z as z201 } from "zod";
|
|
4518
|
+
var simulation_op_amp = z201.object({
|
|
4519
|
+
type: z201.literal("simulation_op_amp"),
|
|
4499
4520
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
4500
|
-
source_component_id:
|
|
4501
|
-
inverting_input_source_port_id:
|
|
4502
|
-
non_inverting_input_source_port_id:
|
|
4503
|
-
output_source_port_id:
|
|
4504
|
-
positive_supply_source_port_id:
|
|
4505
|
-
negative_supply_source_port_id:
|
|
4521
|
+
source_component_id: z201.string().optional(),
|
|
4522
|
+
inverting_input_source_port_id: z201.string(),
|
|
4523
|
+
non_inverting_input_source_port_id: z201.string(),
|
|
4524
|
+
output_source_port_id: z201.string(),
|
|
4525
|
+
positive_supply_source_port_id: z201.string(),
|
|
4526
|
+
negative_supply_source_port_id: z201.string()
|
|
4506
4527
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
4507
4528
|
expectTypesMatch(true);
|
|
4508
4529
|
|
|
4509
4530
|
// src/simulation/simulation_spice_subcircuit.ts
|
|
4510
|
-
import { z as
|
|
4511
|
-
var simulation_spice_subcircuit =
|
|
4512
|
-
type:
|
|
4531
|
+
import { z as z202 } from "zod";
|
|
4532
|
+
var simulation_spice_subcircuit = z202.object({
|
|
4533
|
+
type: z202.literal("simulation_spice_subcircuit"),
|
|
4513
4534
|
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
4514
4535
|
"simulation_spice_subcircuit"
|
|
4515
4536
|
),
|
|
4516
|
-
source_component_id:
|
|
4517
|
-
spice_pin_to_source_port_map:
|
|
4518
|
-
subcircuit_source:
|
|
4537
|
+
source_component_id: z202.string(),
|
|
4538
|
+
spice_pin_to_source_port_map: z202.record(z202.string(), z202.string()),
|
|
4539
|
+
subcircuit_source: z202.string()
|
|
4519
4540
|
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
4520
4541
|
expectTypesMatch(
|
|
4521
4542
|
true
|
|
4522
4543
|
);
|
|
4523
4544
|
|
|
4524
4545
|
// src/simulation/simulation_oscilloscope_trace.ts
|
|
4525
|
-
import { z as
|
|
4546
|
+
import { z as z203 } from "zod";
|
|
4526
4547
|
var hasValue = (value) => value !== void 0;
|
|
4527
|
-
var simulation_oscilloscope_trace =
|
|
4528
|
-
type:
|
|
4548
|
+
var simulation_oscilloscope_trace = z203.object({
|
|
4549
|
+
type: z203.literal("simulation_oscilloscope_trace"),
|
|
4529
4550
|
simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
|
|
4530
4551
|
"simulation_oscilloscope_trace"
|
|
4531
4552
|
),
|
|
4532
|
-
simulation_transient_voltage_graph_id:
|
|
4533
|
-
simulation_transient_current_graph_id:
|
|
4534
|
-
simulation_voltage_probe_id:
|
|
4535
|
-
simulation_current_probe_id:
|
|
4536
|
-
display_name:
|
|
4537
|
-
color:
|
|
4538
|
-
display_center_value:
|
|
4539
|
-
display_center_offset_divs:
|
|
4540
|
-
volts_per_div:
|
|
4541
|
-
amps_per_div:
|
|
4553
|
+
simulation_transient_voltage_graph_id: z203.string().optional(),
|
|
4554
|
+
simulation_transient_current_graph_id: z203.string().optional(),
|
|
4555
|
+
simulation_voltage_probe_id: z203.string().optional(),
|
|
4556
|
+
simulation_current_probe_id: z203.string().optional(),
|
|
4557
|
+
display_name: z203.string().optional(),
|
|
4558
|
+
color: z203.string().optional(),
|
|
4559
|
+
display_center_value: z203.number().optional(),
|
|
4560
|
+
display_center_offset_divs: z203.number().optional(),
|
|
4561
|
+
volts_per_div: z203.number().positive().optional(),
|
|
4562
|
+
amps_per_div: z203.number().positive().optional()
|
|
4542
4563
|
}).describe(
|
|
4543
4564
|
"Defines how a simulation measurement is rendered as an oscilloscope-style trace."
|
|
4544
4565
|
).superRefine((data, ctx) => {
|
|
@@ -4552,19 +4573,19 @@ var simulation_oscilloscope_trace = z202.object({
|
|
|
4552
4573
|
].filter(hasValue).length;
|
|
4553
4574
|
if (voltageReferences + currentReferences !== 1) {
|
|
4554
4575
|
ctx.addIssue({
|
|
4555
|
-
code:
|
|
4576
|
+
code: z203.ZodIssueCode.custom,
|
|
4556
4577
|
message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
|
|
4557
4578
|
});
|
|
4558
4579
|
}
|
|
4559
4580
|
if (voltageReferences > 0 && data.amps_per_div !== void 0) {
|
|
4560
4581
|
ctx.addIssue({
|
|
4561
|
-
code:
|
|
4582
|
+
code: z203.ZodIssueCode.custom,
|
|
4562
4583
|
message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
|
|
4563
4584
|
});
|
|
4564
4585
|
}
|
|
4565
4586
|
if (currentReferences > 0 && data.volts_per_div !== void 0) {
|
|
4566
4587
|
ctx.addIssue({
|
|
4567
|
-
code:
|
|
4588
|
+
code: z203.ZodIssueCode.custom,
|
|
4568
4589
|
message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
|
|
4569
4590
|
});
|
|
4570
4591
|
}
|
|
@@ -4572,8 +4593,8 @@ var simulation_oscilloscope_trace = z202.object({
|
|
|
4572
4593
|
expectTypesMatch(true);
|
|
4573
4594
|
|
|
4574
4595
|
// src/any_circuit_element.ts
|
|
4575
|
-
import { z as
|
|
4576
|
-
var any_circuit_element =
|
|
4596
|
+
import { z as z204 } from "zod";
|
|
4597
|
+
var any_circuit_element = z204.union([
|
|
4577
4598
|
source_trace,
|
|
4578
4599
|
source_port,
|
|
4579
4600
|
source_component_internal_connection,
|
|
@@ -4675,6 +4696,7 @@ var any_circuit_element = z203.union([
|
|
|
4675
4696
|
pcb_note_line,
|
|
4676
4697
|
pcb_note_dimension,
|
|
4677
4698
|
pcb_autorouting_error,
|
|
4699
|
+
pcb_preflight_routing_error,
|
|
4678
4700
|
pcb_footprint_overlap_error,
|
|
4679
4701
|
pcb_courtyard_overlap_error,
|
|
4680
4702
|
pcb_breakout_point,
|
|
@@ -4858,6 +4880,7 @@ export {
|
|
|
4858
4880
|
pcb_port,
|
|
4859
4881
|
pcb_port_not_connected_error,
|
|
4860
4882
|
pcb_port_not_matched_error,
|
|
4883
|
+
pcb_preflight_routing_error,
|
|
4861
4884
|
pcb_route_hint,
|
|
4862
4885
|
pcb_route_hints,
|
|
4863
4886
|
pcb_silkscreen_circle,
|