circuit-json 0.0.398 → 0.0.400
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +101 -24
- package/dist/index.mjs +356 -329
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2845,50 +2845,64 @@ expectTypesMatch(
|
|
|
2845
2845
|
true
|
|
2846
2846
|
);
|
|
2847
2847
|
|
|
2848
|
-
// src/pcb/
|
|
2848
|
+
// src/pcb/pcb_courtyard_overlap_error.ts
|
|
2849
2849
|
import { z as z128 } from "zod";
|
|
2850
|
-
var
|
|
2851
|
-
type: z128.literal("
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2850
|
+
var pcb_courtyard_overlap_error = base_circuit_json_error.extend({
|
|
2851
|
+
type: z128.literal("pcb_courtyard_overlap_error"),
|
|
2852
|
+
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
2853
|
+
error_type: z128.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),
|
|
2854
|
+
pcb_component_ids: z128.tuple([z128.string(), z128.string()])
|
|
2855
|
+
}).describe(
|
|
2856
|
+
"Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"
|
|
2857
|
+
);
|
|
2858
|
+
expectTypesMatch(
|
|
2859
|
+
true
|
|
2860
|
+
);
|
|
2861
|
+
|
|
2862
|
+
// src/pcb/pcb_keepout.ts
|
|
2863
|
+
import { z as z129 } from "zod";
|
|
2864
|
+
var pcb_keepout = z129.object({
|
|
2865
|
+
type: z129.literal("pcb_keepout"),
|
|
2866
|
+
shape: z129.literal("rect"),
|
|
2867
|
+
pcb_group_id: z129.string().optional(),
|
|
2868
|
+
subcircuit_id: z129.string().optional(),
|
|
2855
2869
|
center: point,
|
|
2856
2870
|
width: distance,
|
|
2857
2871
|
height: distance,
|
|
2858
|
-
pcb_keepout_id:
|
|
2859
|
-
layers:
|
|
2872
|
+
pcb_keepout_id: z129.string(),
|
|
2873
|
+
layers: z129.array(z129.string()),
|
|
2860
2874
|
// Specify layers where the keepout applies
|
|
2861
|
-
description:
|
|
2875
|
+
description: z129.string().optional()
|
|
2862
2876
|
// Optional description of the keepout
|
|
2863
2877
|
}).or(
|
|
2864
|
-
|
|
2865
|
-
type:
|
|
2866
|
-
shape:
|
|
2867
|
-
pcb_group_id:
|
|
2868
|
-
subcircuit_id:
|
|
2878
|
+
z129.object({
|
|
2879
|
+
type: z129.literal("pcb_keepout"),
|
|
2880
|
+
shape: z129.literal("circle"),
|
|
2881
|
+
pcb_group_id: z129.string().optional(),
|
|
2882
|
+
subcircuit_id: z129.string().optional(),
|
|
2869
2883
|
center: point,
|
|
2870
2884
|
radius: distance,
|
|
2871
|
-
pcb_keepout_id:
|
|
2872
|
-
layers:
|
|
2885
|
+
pcb_keepout_id: z129.string(),
|
|
2886
|
+
layers: z129.array(z129.string()),
|
|
2873
2887
|
// Specify layers where the keepout applies
|
|
2874
|
-
description:
|
|
2888
|
+
description: z129.string().optional()
|
|
2875
2889
|
// Optional description of the keepout
|
|
2876
2890
|
})
|
|
2877
2891
|
);
|
|
2878
2892
|
expectTypesMatch(true);
|
|
2879
2893
|
|
|
2880
2894
|
// src/pcb/pcb_cutout.ts
|
|
2881
|
-
import { z as
|
|
2882
|
-
var pcb_cutout_base =
|
|
2883
|
-
type:
|
|
2895
|
+
import { z as z130 } from "zod";
|
|
2896
|
+
var pcb_cutout_base = z130.object({
|
|
2897
|
+
type: z130.literal("pcb_cutout"),
|
|
2884
2898
|
pcb_cutout_id: getZodPrefixedIdWithDefault("pcb_cutout"),
|
|
2885
|
-
pcb_group_id:
|
|
2886
|
-
subcircuit_id:
|
|
2887
|
-
pcb_board_id:
|
|
2888
|
-
pcb_panel_id:
|
|
2899
|
+
pcb_group_id: z130.string().optional(),
|
|
2900
|
+
subcircuit_id: z130.string().optional(),
|
|
2901
|
+
pcb_board_id: z130.string().optional(),
|
|
2902
|
+
pcb_panel_id: z130.string().optional()
|
|
2889
2903
|
});
|
|
2890
2904
|
var pcb_cutout_rect = pcb_cutout_base.extend({
|
|
2891
|
-
shape:
|
|
2905
|
+
shape: z130.literal("rect"),
|
|
2892
2906
|
center: point,
|
|
2893
2907
|
width: length,
|
|
2894
2908
|
height: length,
|
|
@@ -2897,26 +2911,26 @@ var pcb_cutout_rect = pcb_cutout_base.extend({
|
|
|
2897
2911
|
});
|
|
2898
2912
|
expectTypesMatch(true);
|
|
2899
2913
|
var pcb_cutout_circle = pcb_cutout_base.extend({
|
|
2900
|
-
shape:
|
|
2914
|
+
shape: z130.literal("circle"),
|
|
2901
2915
|
center: point,
|
|
2902
2916
|
radius: length
|
|
2903
2917
|
});
|
|
2904
2918
|
expectTypesMatch(true);
|
|
2905
2919
|
var pcb_cutout_polygon = pcb_cutout_base.extend({
|
|
2906
|
-
shape:
|
|
2907
|
-
points:
|
|
2920
|
+
shape: z130.literal("polygon"),
|
|
2921
|
+
points: z130.array(point)
|
|
2908
2922
|
});
|
|
2909
2923
|
expectTypesMatch(true);
|
|
2910
2924
|
var pcb_cutout_path = pcb_cutout_base.extend({
|
|
2911
|
-
shape:
|
|
2912
|
-
route:
|
|
2925
|
+
shape: z130.literal("path"),
|
|
2926
|
+
route: z130.array(point),
|
|
2913
2927
|
slot_width: length,
|
|
2914
2928
|
slot_length: length.optional(),
|
|
2915
2929
|
space_between_slots: length.optional(),
|
|
2916
2930
|
slot_corner_radius: length.optional()
|
|
2917
2931
|
});
|
|
2918
2932
|
expectTypesMatch(true);
|
|
2919
|
-
var pcb_cutout =
|
|
2933
|
+
var pcb_cutout = z130.discriminatedUnion("shape", [
|
|
2920
2934
|
pcb_cutout_rect,
|
|
2921
2935
|
pcb_cutout_circle,
|
|
2922
2936
|
pcb_cutout_polygon,
|
|
@@ -2925,147 +2939,147 @@ var pcb_cutout = z129.discriminatedUnion("shape", [
|
|
|
2925
2939
|
expectTypesMatch(true);
|
|
2926
2940
|
|
|
2927
2941
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
2928
|
-
import { z as
|
|
2942
|
+
import { z as z131 } from "zod";
|
|
2929
2943
|
var pcb_missing_footprint_error = base_circuit_json_error.extend({
|
|
2930
|
-
type:
|
|
2944
|
+
type: z131.literal("pcb_missing_footprint_error"),
|
|
2931
2945
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
2932
2946
|
"pcb_missing_footprint_error"
|
|
2933
2947
|
),
|
|
2934
|
-
pcb_group_id:
|
|
2935
|
-
subcircuit_id:
|
|
2936
|
-
error_type:
|
|
2937
|
-
source_component_id:
|
|
2948
|
+
pcb_group_id: z131.string().optional(),
|
|
2949
|
+
subcircuit_id: z131.string().optional(),
|
|
2950
|
+
error_type: z131.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),
|
|
2951
|
+
source_component_id: z131.string()
|
|
2938
2952
|
}).describe("Defines a missing footprint error on the PCB");
|
|
2939
2953
|
expectTypesMatch(
|
|
2940
2954
|
true
|
|
2941
2955
|
);
|
|
2942
2956
|
|
|
2943
2957
|
// src/pcb/external_footprint_load_error.ts
|
|
2944
|
-
import { z as
|
|
2958
|
+
import { z as z132 } from "zod";
|
|
2945
2959
|
var external_footprint_load_error = base_circuit_json_error.extend({
|
|
2946
|
-
type:
|
|
2960
|
+
type: z132.literal("external_footprint_load_error"),
|
|
2947
2961
|
external_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
2948
2962
|
"external_footprint_load_error"
|
|
2949
2963
|
),
|
|
2950
|
-
pcb_component_id:
|
|
2951
|
-
source_component_id:
|
|
2952
|
-
pcb_group_id:
|
|
2953
|
-
subcircuit_id:
|
|
2954
|
-
footprinter_string:
|
|
2955
|
-
error_type:
|
|
2964
|
+
pcb_component_id: z132.string(),
|
|
2965
|
+
source_component_id: z132.string(),
|
|
2966
|
+
pcb_group_id: z132.string().optional(),
|
|
2967
|
+
subcircuit_id: z132.string().optional(),
|
|
2968
|
+
footprinter_string: z132.string().optional(),
|
|
2969
|
+
error_type: z132.literal("external_footprint_load_error").default("external_footprint_load_error")
|
|
2956
2970
|
}).describe("Defines an error when an external footprint fails to load");
|
|
2957
2971
|
expectTypesMatch(true);
|
|
2958
2972
|
|
|
2959
2973
|
// src/pcb/circuit_json_footprint_load_error.ts
|
|
2960
|
-
import { z as
|
|
2974
|
+
import { z as z133 } from "zod";
|
|
2961
2975
|
var circuit_json_footprint_load_error = base_circuit_json_error.extend({
|
|
2962
|
-
type:
|
|
2976
|
+
type: z133.literal("circuit_json_footprint_load_error"),
|
|
2963
2977
|
circuit_json_footprint_load_error_id: getZodPrefixedIdWithDefault(
|
|
2964
2978
|
"circuit_json_footprint_load_error"
|
|
2965
2979
|
),
|
|
2966
|
-
pcb_component_id:
|
|
2967
|
-
source_component_id:
|
|
2968
|
-
pcb_group_id:
|
|
2969
|
-
subcircuit_id:
|
|
2970
|
-
error_type:
|
|
2971
|
-
circuit_json:
|
|
2980
|
+
pcb_component_id: z133.string(),
|
|
2981
|
+
source_component_id: z133.string(),
|
|
2982
|
+
pcb_group_id: z133.string().optional(),
|
|
2983
|
+
subcircuit_id: z133.string().optional(),
|
|
2984
|
+
error_type: z133.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),
|
|
2985
|
+
circuit_json: z133.array(z133.any()).optional()
|
|
2972
2986
|
}).describe("Defines an error when a circuit JSON footprint fails to load");
|
|
2973
2987
|
expectTypesMatch(true);
|
|
2974
2988
|
|
|
2975
2989
|
// src/pcb/pcb_group.ts
|
|
2976
|
-
import { z as
|
|
2977
|
-
var pcb_group =
|
|
2978
|
-
type:
|
|
2990
|
+
import { z as z134 } from "zod";
|
|
2991
|
+
var pcb_group = z134.object({
|
|
2992
|
+
type: z134.literal("pcb_group"),
|
|
2979
2993
|
pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
|
|
2980
|
-
source_group_id:
|
|
2981
|
-
is_subcircuit:
|
|
2982
|
-
subcircuit_id:
|
|
2994
|
+
source_group_id: z134.string(),
|
|
2995
|
+
is_subcircuit: z134.boolean().optional(),
|
|
2996
|
+
subcircuit_id: z134.string().optional(),
|
|
2983
2997
|
width: length.optional(),
|
|
2984
2998
|
height: length.optional(),
|
|
2985
2999
|
center: point,
|
|
2986
|
-
display_offset_x:
|
|
3000
|
+
display_offset_x: z134.string().optional().describe(
|
|
2987
3001
|
"How to display the x offset for this group, usually corresponding with how the user specified it"
|
|
2988
3002
|
),
|
|
2989
|
-
display_offset_y:
|
|
3003
|
+
display_offset_y: z134.string().optional().describe(
|
|
2990
3004
|
"How to display the y offset for this group, usually corresponding with how the user specified it"
|
|
2991
3005
|
),
|
|
2992
|
-
outline:
|
|
3006
|
+
outline: z134.array(point).optional(),
|
|
2993
3007
|
anchor_position: point.optional(),
|
|
2994
3008
|
anchor_alignment: ninePointAnchor.default("center"),
|
|
2995
|
-
position_mode:
|
|
2996
|
-
positioned_relative_to_pcb_group_id:
|
|
2997
|
-
positioned_relative_to_pcb_board_id:
|
|
2998
|
-
pcb_component_ids:
|
|
2999
|
-
child_layout_mode:
|
|
3000
|
-
name:
|
|
3001
|
-
description:
|
|
3002
|
-
layout_mode:
|
|
3003
|
-
autorouter_configuration:
|
|
3009
|
+
position_mode: z134.enum(["packed", "relative_to_group_anchor", "none"]).optional(),
|
|
3010
|
+
positioned_relative_to_pcb_group_id: z134.string().optional(),
|
|
3011
|
+
positioned_relative_to_pcb_board_id: z134.string().optional(),
|
|
3012
|
+
pcb_component_ids: z134.array(z134.string()),
|
|
3013
|
+
child_layout_mode: z134.enum(["packed", "none"]).optional(),
|
|
3014
|
+
name: z134.string().optional(),
|
|
3015
|
+
description: z134.string().optional(),
|
|
3016
|
+
layout_mode: z134.string().optional(),
|
|
3017
|
+
autorouter_configuration: z134.object({
|
|
3004
3018
|
trace_clearance: length
|
|
3005
3019
|
}).optional(),
|
|
3006
|
-
autorouter_used_string:
|
|
3020
|
+
autorouter_used_string: z134.string().optional()
|
|
3007
3021
|
}).describe("Defines a group of components on the PCB");
|
|
3008
3022
|
expectTypesMatch(true);
|
|
3009
3023
|
|
|
3010
3024
|
// src/pcb/pcb_autorouting_error.ts
|
|
3011
|
-
import { z as
|
|
3025
|
+
import { z as z135 } from "zod";
|
|
3012
3026
|
var pcb_autorouting_error = base_circuit_json_error.extend({
|
|
3013
|
-
type:
|
|
3027
|
+
type: z135.literal("pcb_autorouting_error"),
|
|
3014
3028
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_autorouting_error"),
|
|
3015
|
-
error_type:
|
|
3016
|
-
subcircuit_id:
|
|
3029
|
+
error_type: z135.literal("pcb_autorouting_error").default("pcb_autorouting_error"),
|
|
3030
|
+
subcircuit_id: z135.string().optional()
|
|
3017
3031
|
}).describe("The autorouting has failed to route a portion of the board");
|
|
3018
3032
|
expectTypesMatch(true);
|
|
3019
3033
|
|
|
3020
3034
|
// src/pcb/pcb_manual_edit_conflict_warning.ts
|
|
3021
|
-
import { z as
|
|
3022
|
-
var pcb_manual_edit_conflict_warning =
|
|
3023
|
-
type:
|
|
3035
|
+
import { z as z136 } from "zod";
|
|
3036
|
+
var pcb_manual_edit_conflict_warning = z136.object({
|
|
3037
|
+
type: z136.literal("pcb_manual_edit_conflict_warning"),
|
|
3024
3038
|
pcb_manual_edit_conflict_warning_id: getZodPrefixedIdWithDefault(
|
|
3025
3039
|
"pcb_manual_edit_conflict_warning"
|
|
3026
3040
|
),
|
|
3027
|
-
warning_type:
|
|
3028
|
-
message:
|
|
3029
|
-
pcb_component_id:
|
|
3030
|
-
pcb_group_id:
|
|
3031
|
-
subcircuit_id:
|
|
3032
|
-
source_component_id:
|
|
3041
|
+
warning_type: z136.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),
|
|
3042
|
+
message: z136.string(),
|
|
3043
|
+
pcb_component_id: z136.string(),
|
|
3044
|
+
pcb_group_id: z136.string().optional(),
|
|
3045
|
+
subcircuit_id: z136.string().optional(),
|
|
3046
|
+
source_component_id: z136.string()
|
|
3033
3047
|
}).describe(
|
|
3034
3048
|
"Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
3035
3049
|
);
|
|
3036
3050
|
expectTypesMatch(true);
|
|
3037
3051
|
|
|
3038
3052
|
// src/pcb/pcb_connector_not_in_accessible_orientation_warning.ts
|
|
3039
|
-
import { z as
|
|
3040
|
-
var connectorOrientationDirection =
|
|
3041
|
-
var pcb_connector_not_in_accessible_orientation_warning =
|
|
3042
|
-
type:
|
|
3053
|
+
import { z as z137 } from "zod";
|
|
3054
|
+
var connectorOrientationDirection = z137.enum(["x-", "x+", "y+", "y-"]);
|
|
3055
|
+
var pcb_connector_not_in_accessible_orientation_warning = z137.object({
|
|
3056
|
+
type: z137.literal("pcb_connector_not_in_accessible_orientation_warning"),
|
|
3043
3057
|
pcb_connector_not_in_accessible_orientation_warning_id: getZodPrefixedIdWithDefault(
|
|
3044
3058
|
"pcb_connector_not_in_accessible_orientation_warning"
|
|
3045
3059
|
),
|
|
3046
|
-
warning_type:
|
|
3047
|
-
message:
|
|
3048
|
-
pcb_component_id:
|
|
3049
|
-
source_component_id:
|
|
3050
|
-
pcb_board_id:
|
|
3060
|
+
warning_type: z137.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),
|
|
3061
|
+
message: z137.string(),
|
|
3062
|
+
pcb_component_id: z137.string(),
|
|
3063
|
+
source_component_id: z137.string().optional(),
|
|
3064
|
+
pcb_board_id: z137.string().optional(),
|
|
3051
3065
|
facing_direction: connectorOrientationDirection,
|
|
3052
3066
|
recommended_facing_direction: connectorOrientationDirection,
|
|
3053
|
-
subcircuit_id:
|
|
3067
|
+
subcircuit_id: z137.string().optional()
|
|
3054
3068
|
}).describe(
|
|
3055
3069
|
"Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"
|
|
3056
3070
|
);
|
|
3057
3071
|
expectTypesMatch(true);
|
|
3058
3072
|
|
|
3059
3073
|
// src/pcb/pcb_breakout_point.ts
|
|
3060
|
-
import { z as
|
|
3061
|
-
var pcb_breakout_point =
|
|
3062
|
-
type:
|
|
3074
|
+
import { z as z138 } from "zod";
|
|
3075
|
+
var pcb_breakout_point = z138.object({
|
|
3076
|
+
type: z138.literal("pcb_breakout_point"),
|
|
3063
3077
|
pcb_breakout_point_id: getZodPrefixedIdWithDefault("pcb_breakout_point"),
|
|
3064
|
-
pcb_group_id:
|
|
3065
|
-
subcircuit_id:
|
|
3066
|
-
source_trace_id:
|
|
3067
|
-
source_port_id:
|
|
3068
|
-
source_net_id:
|
|
3078
|
+
pcb_group_id: z138.string(),
|
|
3079
|
+
subcircuit_id: z138.string().optional(),
|
|
3080
|
+
source_trace_id: z138.string().optional(),
|
|
3081
|
+
source_port_id: z138.string().optional(),
|
|
3082
|
+
source_net_id: z138.string().optional(),
|
|
3069
3083
|
x: distance,
|
|
3070
3084
|
y: distance
|
|
3071
3085
|
}).describe(
|
|
@@ -3074,61 +3088,61 @@ var pcb_breakout_point = z137.object({
|
|
|
3074
3088
|
expectTypesMatch(true);
|
|
3075
3089
|
|
|
3076
3090
|
// src/pcb/pcb_ground_plane.ts
|
|
3077
|
-
import { z as
|
|
3078
|
-
var pcb_ground_plane =
|
|
3079
|
-
type:
|
|
3091
|
+
import { z as z139 } from "zod";
|
|
3092
|
+
var pcb_ground_plane = z139.object({
|
|
3093
|
+
type: z139.literal("pcb_ground_plane"),
|
|
3080
3094
|
pcb_ground_plane_id: getZodPrefixedIdWithDefault("pcb_ground_plane"),
|
|
3081
|
-
source_pcb_ground_plane_id:
|
|
3082
|
-
source_net_id:
|
|
3083
|
-
pcb_group_id:
|
|
3084
|
-
subcircuit_id:
|
|
3095
|
+
source_pcb_ground_plane_id: z139.string(),
|
|
3096
|
+
source_net_id: z139.string(),
|
|
3097
|
+
pcb_group_id: z139.string().optional(),
|
|
3098
|
+
subcircuit_id: z139.string().optional()
|
|
3085
3099
|
}).describe("Defines a ground plane on the PCB");
|
|
3086
3100
|
expectTypesMatch(true);
|
|
3087
3101
|
|
|
3088
3102
|
// src/pcb/pcb_ground_plane_region.ts
|
|
3089
|
-
import { z as
|
|
3090
|
-
var pcb_ground_plane_region =
|
|
3091
|
-
type:
|
|
3103
|
+
import { z as z140 } from "zod";
|
|
3104
|
+
var pcb_ground_plane_region = z140.object({
|
|
3105
|
+
type: z140.literal("pcb_ground_plane_region"),
|
|
3092
3106
|
pcb_ground_plane_region_id: getZodPrefixedIdWithDefault(
|
|
3093
3107
|
"pcb_ground_plane_region"
|
|
3094
3108
|
),
|
|
3095
|
-
pcb_ground_plane_id:
|
|
3096
|
-
pcb_group_id:
|
|
3097
|
-
subcircuit_id:
|
|
3109
|
+
pcb_ground_plane_id: z140.string(),
|
|
3110
|
+
pcb_group_id: z140.string().optional(),
|
|
3111
|
+
subcircuit_id: z140.string().optional(),
|
|
3098
3112
|
layer: layer_ref,
|
|
3099
|
-
points:
|
|
3113
|
+
points: z140.array(point)
|
|
3100
3114
|
}).describe("Defines a polygon region of a ground plane");
|
|
3101
3115
|
expectTypesMatch(true);
|
|
3102
3116
|
|
|
3103
3117
|
// src/pcb/pcb_thermal_spoke.ts
|
|
3104
|
-
import { z as
|
|
3105
|
-
var pcb_thermal_spoke =
|
|
3106
|
-
type:
|
|
3118
|
+
import { z as z141 } from "zod";
|
|
3119
|
+
var pcb_thermal_spoke = z141.object({
|
|
3120
|
+
type: z141.literal("pcb_thermal_spoke"),
|
|
3107
3121
|
pcb_thermal_spoke_id: getZodPrefixedIdWithDefault("pcb_thermal_spoke"),
|
|
3108
|
-
pcb_ground_plane_id:
|
|
3109
|
-
shape:
|
|
3110
|
-
spoke_count:
|
|
3122
|
+
pcb_ground_plane_id: z141.string(),
|
|
3123
|
+
shape: z141.string(),
|
|
3124
|
+
spoke_count: z141.number(),
|
|
3111
3125
|
spoke_thickness: distance,
|
|
3112
3126
|
spoke_inner_diameter: distance,
|
|
3113
3127
|
spoke_outer_diameter: distance,
|
|
3114
|
-
pcb_plated_hole_id:
|
|
3115
|
-
subcircuit_id:
|
|
3128
|
+
pcb_plated_hole_id: z141.string().optional(),
|
|
3129
|
+
subcircuit_id: z141.string().optional()
|
|
3116
3130
|
}).describe("Pattern for connecting a ground plane to a plated hole");
|
|
3117
3131
|
expectTypesMatch(true);
|
|
3118
3132
|
|
|
3119
3133
|
// src/pcb/pcb_copper_pour.ts
|
|
3120
|
-
import { z as
|
|
3121
|
-
var pcb_copper_pour_base =
|
|
3122
|
-
type:
|
|
3134
|
+
import { z as z142 } from "zod";
|
|
3135
|
+
var pcb_copper_pour_base = z142.object({
|
|
3136
|
+
type: z142.literal("pcb_copper_pour"),
|
|
3123
3137
|
pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
|
|
3124
|
-
pcb_group_id:
|
|
3125
|
-
subcircuit_id:
|
|
3138
|
+
pcb_group_id: z142.string().optional(),
|
|
3139
|
+
subcircuit_id: z142.string().optional(),
|
|
3126
3140
|
layer: layer_ref,
|
|
3127
|
-
source_net_id:
|
|
3128
|
-
covered_with_solder_mask:
|
|
3141
|
+
source_net_id: z142.string().optional(),
|
|
3142
|
+
covered_with_solder_mask: z142.boolean().optional().default(true)
|
|
3129
3143
|
});
|
|
3130
3144
|
var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
3131
|
-
shape:
|
|
3145
|
+
shape: z142.literal("rect"),
|
|
3132
3146
|
center: point,
|
|
3133
3147
|
width: length,
|
|
3134
3148
|
height: length,
|
|
@@ -3136,16 +3150,16 @@ var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
|
3136
3150
|
});
|
|
3137
3151
|
expectTypesMatch(true);
|
|
3138
3152
|
var pcb_copper_pour_brep = pcb_copper_pour_base.extend({
|
|
3139
|
-
shape:
|
|
3153
|
+
shape: z142.literal("brep"),
|
|
3140
3154
|
brep_shape
|
|
3141
3155
|
});
|
|
3142
3156
|
expectTypesMatch(true);
|
|
3143
3157
|
var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
|
|
3144
|
-
shape:
|
|
3145
|
-
points:
|
|
3158
|
+
shape: z142.literal("polygon"),
|
|
3159
|
+
points: z142.array(point)
|
|
3146
3160
|
});
|
|
3147
3161
|
expectTypesMatch(true);
|
|
3148
|
-
var pcb_copper_pour =
|
|
3162
|
+
var pcb_copper_pour = z142.discriminatedUnion("shape", [
|
|
3149
3163
|
pcb_copper_pour_rect,
|
|
3150
3164
|
pcb_copper_pour_brep,
|
|
3151
3165
|
pcb_copper_pour_polygon
|
|
@@ -3153,184 +3167,148 @@ var pcb_copper_pour = z141.discriminatedUnion("shape", [
|
|
|
3153
3167
|
expectTypesMatch(true);
|
|
3154
3168
|
|
|
3155
3169
|
// src/pcb/pcb_component_outside_board_error.ts
|
|
3156
|
-
import { z as
|
|
3170
|
+
import { z as z143 } from "zod";
|
|
3157
3171
|
var pcb_component_outside_board_error = base_circuit_json_error.extend({
|
|
3158
|
-
type:
|
|
3172
|
+
type: z143.literal("pcb_component_outside_board_error"),
|
|
3159
3173
|
pcb_component_outside_board_error_id: getZodPrefixedIdWithDefault(
|
|
3160
3174
|
"pcb_component_outside_board_error"
|
|
3161
3175
|
),
|
|
3162
|
-
error_type:
|
|
3163
|
-
pcb_component_id:
|
|
3164
|
-
pcb_board_id:
|
|
3176
|
+
error_type: z143.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),
|
|
3177
|
+
pcb_component_id: z143.string(),
|
|
3178
|
+
pcb_board_id: z143.string(),
|
|
3165
3179
|
component_center: point,
|
|
3166
|
-
component_bounds:
|
|
3167
|
-
min_x:
|
|
3168
|
-
max_x:
|
|
3169
|
-
min_y:
|
|
3170
|
-
max_y:
|
|
3180
|
+
component_bounds: z143.object({
|
|
3181
|
+
min_x: z143.number(),
|
|
3182
|
+
max_x: z143.number(),
|
|
3183
|
+
min_y: z143.number(),
|
|
3184
|
+
max_y: z143.number()
|
|
3171
3185
|
}),
|
|
3172
|
-
subcircuit_id:
|
|
3173
|
-
source_component_id:
|
|
3186
|
+
subcircuit_id: z143.string().optional(),
|
|
3187
|
+
source_component_id: z143.string().optional()
|
|
3174
3188
|
}).describe(
|
|
3175
3189
|
"Error emitted when a PCB component is placed outside the board boundaries"
|
|
3176
3190
|
);
|
|
3177
3191
|
expectTypesMatch(true);
|
|
3178
3192
|
|
|
3179
3193
|
// src/pcb/pcb_component_not_on_board_edge_error.ts
|
|
3180
|
-
import { z as
|
|
3194
|
+
import { z as z144 } from "zod";
|
|
3181
3195
|
var pcb_component_not_on_board_edge_error = base_circuit_json_error.extend({
|
|
3182
|
-
type:
|
|
3196
|
+
type: z144.literal("pcb_component_not_on_board_edge_error"),
|
|
3183
3197
|
pcb_component_not_on_board_edge_error_id: getZodPrefixedIdWithDefault(
|
|
3184
3198
|
"pcb_component_not_on_board_edge_error"
|
|
3185
3199
|
),
|
|
3186
|
-
error_type:
|
|
3187
|
-
pcb_component_id:
|
|
3188
|
-
pcb_board_id:
|
|
3200
|
+
error_type: z144.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),
|
|
3201
|
+
pcb_component_id: z144.string(),
|
|
3202
|
+
pcb_board_id: z144.string(),
|
|
3189
3203
|
component_center: point,
|
|
3190
|
-
pad_to_nearest_board_edge_distance:
|
|
3191
|
-
source_component_id:
|
|
3192
|
-
subcircuit_id:
|
|
3204
|
+
pad_to_nearest_board_edge_distance: z144.number(),
|
|
3205
|
+
source_component_id: z144.string().optional(),
|
|
3206
|
+
subcircuit_id: z144.string().optional()
|
|
3193
3207
|
}).describe(
|
|
3194
3208
|
"Error emitted when a component that must be placed on the board edge is centered away from the edge"
|
|
3195
3209
|
);
|
|
3196
3210
|
expectTypesMatch(true);
|
|
3197
3211
|
|
|
3198
3212
|
// src/pcb/pcb_component_invalid_layer_error.ts
|
|
3199
|
-
import { z as
|
|
3213
|
+
import { z as z145 } from "zod";
|
|
3200
3214
|
var pcb_component_invalid_layer_error = base_circuit_json_error.extend({
|
|
3201
|
-
type:
|
|
3215
|
+
type: z145.literal("pcb_component_invalid_layer_error"),
|
|
3202
3216
|
pcb_component_invalid_layer_error_id: getZodPrefixedIdWithDefault(
|
|
3203
3217
|
"pcb_component_invalid_layer_error"
|
|
3204
3218
|
),
|
|
3205
|
-
error_type:
|
|
3206
|
-
pcb_component_id:
|
|
3207
|
-
source_component_id:
|
|
3219
|
+
error_type: z145.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),
|
|
3220
|
+
pcb_component_id: z145.string().optional(),
|
|
3221
|
+
source_component_id: z145.string(),
|
|
3208
3222
|
layer: layer_ref,
|
|
3209
|
-
subcircuit_id:
|
|
3223
|
+
subcircuit_id: z145.string().optional()
|
|
3210
3224
|
}).describe(
|
|
3211
3225
|
"Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"
|
|
3212
3226
|
);
|
|
3213
3227
|
expectTypesMatch(true);
|
|
3214
3228
|
|
|
3215
3229
|
// src/pcb/pcb_via_clearance_error.ts
|
|
3216
|
-
import { z as
|
|
3230
|
+
import { z as z146 } from "zod";
|
|
3217
3231
|
var pcb_via_clearance_error = base_circuit_json_error.extend({
|
|
3218
|
-
type:
|
|
3232
|
+
type: z146.literal("pcb_via_clearance_error"),
|
|
3219
3233
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
3220
|
-
error_type:
|
|
3221
|
-
pcb_via_ids:
|
|
3234
|
+
error_type: z146.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),
|
|
3235
|
+
pcb_via_ids: z146.array(z146.string()).min(2),
|
|
3222
3236
|
minimum_clearance: distance.optional(),
|
|
3223
3237
|
actual_clearance: distance.optional(),
|
|
3224
|
-
pcb_center:
|
|
3225
|
-
x:
|
|
3226
|
-
y:
|
|
3238
|
+
pcb_center: z146.object({
|
|
3239
|
+
x: z146.number().optional(),
|
|
3240
|
+
y: z146.number().optional()
|
|
3227
3241
|
}).optional(),
|
|
3228
|
-
subcircuit_id:
|
|
3242
|
+
subcircuit_id: z146.string().optional()
|
|
3229
3243
|
}).describe("Error emitted when vias are closer than the allowed clearance");
|
|
3230
3244
|
expectTypesMatch(true);
|
|
3231
3245
|
|
|
3232
3246
|
// src/pcb/pcb_courtyard_rect.ts
|
|
3233
|
-
import { z as
|
|
3234
|
-
var pcb_courtyard_rect =
|
|
3235
|
-
type:
|
|
3247
|
+
import { z as z147 } from "zod";
|
|
3248
|
+
var pcb_courtyard_rect = z147.object({
|
|
3249
|
+
type: z147.literal("pcb_courtyard_rect"),
|
|
3236
3250
|
pcb_courtyard_rect_id: getZodPrefixedIdWithDefault("pcb_courtyard_rect"),
|
|
3237
|
-
pcb_component_id:
|
|
3238
|
-
pcb_group_id:
|
|
3239
|
-
subcircuit_id:
|
|
3251
|
+
pcb_component_id: z147.string(),
|
|
3252
|
+
pcb_group_id: z147.string().optional(),
|
|
3253
|
+
subcircuit_id: z147.string().optional(),
|
|
3240
3254
|
center: point,
|
|
3241
3255
|
width: length,
|
|
3242
3256
|
height: length,
|
|
3243
3257
|
layer: visible_layer,
|
|
3244
|
-
color:
|
|
3258
|
+
color: z147.string().optional()
|
|
3245
3259
|
}).describe("Defines a courtyard rectangle on the PCB");
|
|
3246
3260
|
expectTypesMatch(true);
|
|
3247
3261
|
|
|
3248
3262
|
// src/pcb/pcb_courtyard_outline.ts
|
|
3249
|
-
import { z as
|
|
3250
|
-
var pcb_courtyard_outline =
|
|
3251
|
-
type:
|
|
3263
|
+
import { z as z148 } from "zod";
|
|
3264
|
+
var pcb_courtyard_outline = z148.object({
|
|
3265
|
+
type: z148.literal("pcb_courtyard_outline"),
|
|
3252
3266
|
pcb_courtyard_outline_id: getZodPrefixedIdWithDefault(
|
|
3253
3267
|
"pcb_courtyard_outline"
|
|
3254
3268
|
),
|
|
3255
|
-
pcb_component_id:
|
|
3256
|
-
pcb_group_id:
|
|
3257
|
-
subcircuit_id:
|
|
3269
|
+
pcb_component_id: z148.string(),
|
|
3270
|
+
pcb_group_id: z148.string().optional(),
|
|
3271
|
+
subcircuit_id: z148.string().optional(),
|
|
3258
3272
|
layer: visible_layer,
|
|
3259
|
-
outline:
|
|
3273
|
+
outline: z148.array(point).min(2)
|
|
3260
3274
|
}).describe("Defines a courtyard outline on the PCB");
|
|
3261
3275
|
expectTypesMatch(true);
|
|
3262
3276
|
|
|
3263
3277
|
// src/pcb/pcb_courtyard_polygon.ts
|
|
3264
|
-
import { z as
|
|
3265
|
-
var pcb_courtyard_polygon =
|
|
3266
|
-
type:
|
|
3278
|
+
import { z as z149 } from "zod";
|
|
3279
|
+
var pcb_courtyard_polygon = z149.object({
|
|
3280
|
+
type: z149.literal("pcb_courtyard_polygon"),
|
|
3267
3281
|
pcb_courtyard_polygon_id: getZodPrefixedIdWithDefault(
|
|
3268
3282
|
"pcb_courtyard_polygon"
|
|
3269
3283
|
),
|
|
3270
|
-
pcb_component_id:
|
|
3271
|
-
pcb_group_id:
|
|
3272
|
-
subcircuit_id:
|
|
3284
|
+
pcb_component_id: z149.string(),
|
|
3285
|
+
pcb_group_id: z149.string().optional(),
|
|
3286
|
+
subcircuit_id: z149.string().optional(),
|
|
3273
3287
|
layer: visible_layer,
|
|
3274
|
-
points:
|
|
3275
|
-
color:
|
|
3288
|
+
points: z149.array(point).min(3),
|
|
3289
|
+
color: z149.string().optional()
|
|
3276
3290
|
}).describe("Defines a courtyard polygon on the PCB");
|
|
3277
3291
|
expectTypesMatch(true);
|
|
3278
3292
|
|
|
3279
3293
|
// src/pcb/pcb_courtyard_circle.ts
|
|
3280
|
-
import { z as
|
|
3281
|
-
var pcb_courtyard_circle =
|
|
3282
|
-
type:
|
|
3294
|
+
import { z as z150 } from "zod";
|
|
3295
|
+
var pcb_courtyard_circle = z150.object({
|
|
3296
|
+
type: z150.literal("pcb_courtyard_circle"),
|
|
3283
3297
|
pcb_courtyard_circle_id: getZodPrefixedIdWithDefault(
|
|
3284
3298
|
"pcb_courtyard_circle"
|
|
3285
3299
|
),
|
|
3286
|
-
pcb_component_id:
|
|
3287
|
-
pcb_group_id:
|
|
3288
|
-
subcircuit_id:
|
|
3300
|
+
pcb_component_id: z150.string(),
|
|
3301
|
+
pcb_group_id: z150.string().optional(),
|
|
3302
|
+
subcircuit_id: z150.string().optional(),
|
|
3289
3303
|
center: point,
|
|
3290
3304
|
radius: length,
|
|
3291
3305
|
layer: visible_layer,
|
|
3292
|
-
color:
|
|
3306
|
+
color: z150.string().optional()
|
|
3293
3307
|
}).describe("Defines a courtyard circle on the PCB");
|
|
3294
3308
|
expectTypesMatch(true);
|
|
3295
3309
|
|
|
3296
3310
|
// src/cad/cad_component.ts
|
|
3297
|
-
import { z as
|
|
3298
|
-
var cad_component = z150.object({
|
|
3299
|
-
type: z150.literal("cad_component"),
|
|
3300
|
-
cad_component_id: z150.string(),
|
|
3301
|
-
pcb_component_id: z150.string(),
|
|
3302
|
-
source_component_id: z150.string(),
|
|
3303
|
-
position: point3,
|
|
3304
|
-
rotation: point3.optional(),
|
|
3305
|
-
size: point3.optional(),
|
|
3306
|
-
layer: layer_ref.optional(),
|
|
3307
|
-
subcircuit_id: z150.string().optional(),
|
|
3308
|
-
// These are all ways to generate/load the 3d model
|
|
3309
|
-
footprinter_string: z150.string().optional(),
|
|
3310
|
-
model_obj_url: z150.string().optional(),
|
|
3311
|
-
model_stl_url: z150.string().optional(),
|
|
3312
|
-
model_3mf_url: z150.string().optional(),
|
|
3313
|
-
model_gltf_url: z150.string().optional(),
|
|
3314
|
-
model_glb_url: z150.string().optional(),
|
|
3315
|
-
model_step_url: z150.string().optional(),
|
|
3316
|
-
model_wrl_url: z150.string().optional(),
|
|
3317
|
-
model_asset: asset.optional(),
|
|
3318
|
-
model_unit_to_mm_scale_factor: z150.number().optional(),
|
|
3319
|
-
model_board_normal_direction: z150.enum(["y+", "z+"]).optional().describe(
|
|
3320
|
-
`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`
|
|
3321
|
-
),
|
|
3322
|
-
model_origin_position: point3.optional(),
|
|
3323
|
-
model_origin_alignment: z150.enum([
|
|
3324
|
-
"unknown",
|
|
3325
|
-
"center",
|
|
3326
|
-
"center_of_component_on_board_surface"
|
|
3327
|
-
]).optional(),
|
|
3328
|
-
model_object_fit: z150.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
3329
|
-
model_jscad: z150.any().optional(),
|
|
3330
|
-
show_as_translucent_model: z150.boolean().optional(),
|
|
3331
|
-
anchor_alignment: z150.enum(["center", "xy_center_z_board"]).optional().default("center")
|
|
3332
|
-
}).describe("Defines a component on the PCB");
|
|
3333
|
-
expectTypesMatch(true);
|
|
3311
|
+
import { z as z151 } from "zod";
|
|
3334
3312
|
|
|
3335
3313
|
// src/cad/cad_model_conventions.ts
|
|
3336
3314
|
var cad_model_formats = [
|
|
@@ -3342,6 +3320,14 @@ var cad_model_formats = [
|
|
|
3342
3320
|
"step",
|
|
3343
3321
|
"wrl"
|
|
3344
3322
|
];
|
|
3323
|
+
var cad_model_axis_directions = [
|
|
3324
|
+
"x+",
|
|
3325
|
+
"x-",
|
|
3326
|
+
"y+",
|
|
3327
|
+
"y-",
|
|
3328
|
+
"z+",
|
|
3329
|
+
"z-"
|
|
3330
|
+
];
|
|
3345
3331
|
var cadModelDefaultDirectionMap = {
|
|
3346
3332
|
obj: "z+",
|
|
3347
3333
|
stl: "z+",
|
|
@@ -3352,10 +3338,48 @@ var cadModelDefaultDirectionMap = {
|
|
|
3352
3338
|
wrl: "y+"
|
|
3353
3339
|
};
|
|
3354
3340
|
|
|
3341
|
+
// src/cad/cad_component.ts
|
|
3342
|
+
var cad_component = z151.object({
|
|
3343
|
+
type: z151.literal("cad_component"),
|
|
3344
|
+
cad_component_id: z151.string(),
|
|
3345
|
+
pcb_component_id: z151.string(),
|
|
3346
|
+
source_component_id: z151.string(),
|
|
3347
|
+
position: point3,
|
|
3348
|
+
rotation: point3.optional(),
|
|
3349
|
+
size: point3.optional(),
|
|
3350
|
+
layer: layer_ref.optional(),
|
|
3351
|
+
subcircuit_id: z151.string().optional(),
|
|
3352
|
+
// These are all ways to generate/load the 3d model
|
|
3353
|
+
footprinter_string: z151.string().optional(),
|
|
3354
|
+
model_obj_url: z151.string().optional(),
|
|
3355
|
+
model_stl_url: z151.string().optional(),
|
|
3356
|
+
model_3mf_url: z151.string().optional(),
|
|
3357
|
+
model_gltf_url: z151.string().optional(),
|
|
3358
|
+
model_glb_url: z151.string().optional(),
|
|
3359
|
+
model_step_url: z151.string().optional(),
|
|
3360
|
+
model_wrl_url: z151.string().optional(),
|
|
3361
|
+
model_asset: asset.optional(),
|
|
3362
|
+
model_unit_to_mm_scale_factor: z151.number().optional(),
|
|
3363
|
+
model_board_normal_direction: z151.enum(cad_model_axis_directions).optional().describe(
|
|
3364
|
+
`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`
|
|
3365
|
+
),
|
|
3366
|
+
model_origin_position: point3.optional(),
|
|
3367
|
+
model_origin_alignment: z151.enum([
|
|
3368
|
+
"unknown",
|
|
3369
|
+
"center",
|
|
3370
|
+
"center_of_component_on_board_surface"
|
|
3371
|
+
]).optional(),
|
|
3372
|
+
model_object_fit: z151.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
|
|
3373
|
+
model_jscad: z151.any().optional(),
|
|
3374
|
+
show_as_translucent_model: z151.boolean().optional(),
|
|
3375
|
+
anchor_alignment: z151.enum(["center", "xy_center_z_board"]).optional().default("center")
|
|
3376
|
+
}).describe("Defines a component on the PCB");
|
|
3377
|
+
expectTypesMatch(true);
|
|
3378
|
+
|
|
3355
3379
|
// src/simulation/simulation_voltage_source.ts
|
|
3356
|
-
import { z as
|
|
3357
|
-
var wave_shape =
|
|
3358
|
-
var percentage =
|
|
3380
|
+
import { z as z152 } from "zod";
|
|
3381
|
+
var wave_shape = z152.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
3382
|
+
var percentage = z152.union([z152.string(), z152.number()]).transform((val) => {
|
|
3359
3383
|
if (typeof val === "string") {
|
|
3360
3384
|
if (val.endsWith("%")) {
|
|
3361
3385
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3364,30 +3388,30 @@ var percentage = z151.union([z151.string(), z151.number()]).transform((val) => {
|
|
|
3364
3388
|
}
|
|
3365
3389
|
return val;
|
|
3366
3390
|
}).pipe(
|
|
3367
|
-
|
|
3391
|
+
z152.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3368
3392
|
);
|
|
3369
|
-
var simulation_dc_voltage_source =
|
|
3370
|
-
type:
|
|
3393
|
+
var simulation_dc_voltage_source = z152.object({
|
|
3394
|
+
type: z152.literal("simulation_voltage_source"),
|
|
3371
3395
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3372
3396
|
"simulation_voltage_source"
|
|
3373
3397
|
),
|
|
3374
|
-
is_dc_source:
|
|
3375
|
-
positive_source_port_id:
|
|
3376
|
-
negative_source_port_id:
|
|
3377
|
-
positive_source_net_id:
|
|
3378
|
-
negative_source_net_id:
|
|
3398
|
+
is_dc_source: z152.literal(true).optional().default(true),
|
|
3399
|
+
positive_source_port_id: z152.string().optional(),
|
|
3400
|
+
negative_source_port_id: z152.string().optional(),
|
|
3401
|
+
positive_source_net_id: z152.string().optional(),
|
|
3402
|
+
negative_source_net_id: z152.string().optional(),
|
|
3379
3403
|
voltage
|
|
3380
3404
|
}).describe("Defines a DC voltage source for simulation");
|
|
3381
|
-
var simulation_ac_voltage_source =
|
|
3382
|
-
type:
|
|
3405
|
+
var simulation_ac_voltage_source = z152.object({
|
|
3406
|
+
type: z152.literal("simulation_voltage_source"),
|
|
3383
3407
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
3384
3408
|
"simulation_voltage_source"
|
|
3385
3409
|
),
|
|
3386
|
-
is_dc_source:
|
|
3387
|
-
terminal1_source_port_id:
|
|
3388
|
-
terminal2_source_port_id:
|
|
3389
|
-
terminal1_source_net_id:
|
|
3390
|
-
terminal2_source_net_id:
|
|
3410
|
+
is_dc_source: z152.literal(false),
|
|
3411
|
+
terminal1_source_port_id: z152.string().optional(),
|
|
3412
|
+
terminal2_source_port_id: z152.string().optional(),
|
|
3413
|
+
terminal1_source_net_id: z152.string().optional(),
|
|
3414
|
+
terminal2_source_net_id: z152.string().optional(),
|
|
3391
3415
|
voltage: voltage.optional(),
|
|
3392
3416
|
frequency: frequency.optional(),
|
|
3393
3417
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -3395,14 +3419,14 @@ var simulation_ac_voltage_source = z151.object({
|
|
|
3395
3419
|
phase: rotation.optional(),
|
|
3396
3420
|
duty_cycle: percentage.optional()
|
|
3397
3421
|
}).describe("Defines an AC voltage source for simulation");
|
|
3398
|
-
var simulation_voltage_source =
|
|
3422
|
+
var simulation_voltage_source = z152.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
3399
3423
|
expectTypesMatch(true);
|
|
3400
3424
|
expectTypesMatch(true);
|
|
3401
3425
|
expectTypesMatch(true);
|
|
3402
3426
|
|
|
3403
3427
|
// src/simulation/simulation_current_source.ts
|
|
3404
|
-
import { z as
|
|
3405
|
-
var percentage2 =
|
|
3428
|
+
import { z as z153 } from "zod";
|
|
3429
|
+
var percentage2 = z153.union([z153.string(), z153.number()]).transform((val) => {
|
|
3406
3430
|
if (typeof val === "string") {
|
|
3407
3431
|
if (val.endsWith("%")) {
|
|
3408
3432
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -3411,30 +3435,30 @@ var percentage2 = z152.union([z152.string(), z152.number()]).transform((val) =>
|
|
|
3411
3435
|
}
|
|
3412
3436
|
return val;
|
|
3413
3437
|
}).pipe(
|
|
3414
|
-
|
|
3438
|
+
z153.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
3415
3439
|
);
|
|
3416
|
-
var simulation_dc_current_source =
|
|
3417
|
-
type:
|
|
3440
|
+
var simulation_dc_current_source = z153.object({
|
|
3441
|
+
type: z153.literal("simulation_current_source"),
|
|
3418
3442
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3419
3443
|
"simulation_current_source"
|
|
3420
3444
|
),
|
|
3421
|
-
is_dc_source:
|
|
3422
|
-
positive_source_port_id:
|
|
3423
|
-
negative_source_port_id:
|
|
3424
|
-
positive_source_net_id:
|
|
3425
|
-
negative_source_net_id:
|
|
3445
|
+
is_dc_source: z153.literal(true).optional().default(true),
|
|
3446
|
+
positive_source_port_id: z153.string().optional(),
|
|
3447
|
+
negative_source_port_id: z153.string().optional(),
|
|
3448
|
+
positive_source_net_id: z153.string().optional(),
|
|
3449
|
+
negative_source_net_id: z153.string().optional(),
|
|
3426
3450
|
current
|
|
3427
3451
|
}).describe("Defines a DC current source for simulation");
|
|
3428
|
-
var simulation_ac_current_source =
|
|
3429
|
-
type:
|
|
3452
|
+
var simulation_ac_current_source = z153.object({
|
|
3453
|
+
type: z153.literal("simulation_current_source"),
|
|
3430
3454
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
3431
3455
|
"simulation_current_source"
|
|
3432
3456
|
),
|
|
3433
|
-
is_dc_source:
|
|
3434
|
-
terminal1_source_port_id:
|
|
3435
|
-
terminal2_source_port_id:
|
|
3436
|
-
terminal1_source_net_id:
|
|
3437
|
-
terminal2_source_net_id:
|
|
3457
|
+
is_dc_source: z153.literal(false),
|
|
3458
|
+
terminal1_source_port_id: z153.string().optional(),
|
|
3459
|
+
terminal2_source_port_id: z153.string().optional(),
|
|
3460
|
+
terminal1_source_net_id: z153.string().optional(),
|
|
3461
|
+
terminal2_source_net_id: z153.string().optional(),
|
|
3438
3462
|
current: current.optional(),
|
|
3439
3463
|
frequency: frequency.optional(),
|
|
3440
3464
|
peak_to_peak_current: current.optional(),
|
|
@@ -3442,25 +3466,25 @@ var simulation_ac_current_source = z152.object({
|
|
|
3442
3466
|
phase: rotation.optional(),
|
|
3443
3467
|
duty_cycle: percentage2.optional()
|
|
3444
3468
|
}).describe("Defines an AC current source for simulation");
|
|
3445
|
-
var simulation_current_source =
|
|
3469
|
+
var simulation_current_source = z153.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
3446
3470
|
expectTypesMatch(true);
|
|
3447
3471
|
expectTypesMatch(true);
|
|
3448
3472
|
expectTypesMatch(true);
|
|
3449
3473
|
|
|
3450
3474
|
// src/simulation/simulation_experiment.ts
|
|
3451
|
-
import { z as
|
|
3452
|
-
var experiment_type =
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3475
|
+
import { z as z154 } from "zod";
|
|
3476
|
+
var experiment_type = z154.union([
|
|
3477
|
+
z154.literal("spice_dc_sweep"),
|
|
3478
|
+
z154.literal("spice_dc_operating_point"),
|
|
3479
|
+
z154.literal("spice_transient_analysis"),
|
|
3480
|
+
z154.literal("spice_ac_analysis")
|
|
3457
3481
|
]);
|
|
3458
|
-
var simulation_experiment =
|
|
3459
|
-
type:
|
|
3482
|
+
var simulation_experiment = z154.object({
|
|
3483
|
+
type: z154.literal("simulation_experiment"),
|
|
3460
3484
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
3461
3485
|
"simulation_experiment"
|
|
3462
3486
|
),
|
|
3463
|
-
name:
|
|
3487
|
+
name: z154.string(),
|
|
3464
3488
|
experiment_type,
|
|
3465
3489
|
time_per_step: duration_ms.optional(),
|
|
3466
3490
|
start_time_ms: ms.optional(),
|
|
@@ -3469,53 +3493,53 @@ var simulation_experiment = z153.object({
|
|
|
3469
3493
|
expectTypesMatch(true);
|
|
3470
3494
|
|
|
3471
3495
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
3472
|
-
import { z as
|
|
3473
|
-
var simulation_transient_voltage_graph =
|
|
3474
|
-
type:
|
|
3496
|
+
import { z as z155 } from "zod";
|
|
3497
|
+
var simulation_transient_voltage_graph = z155.object({
|
|
3498
|
+
type: z155.literal("simulation_transient_voltage_graph"),
|
|
3475
3499
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
3476
3500
|
"simulation_transient_voltage_graph"
|
|
3477
3501
|
),
|
|
3478
|
-
simulation_experiment_id:
|
|
3479
|
-
timestamps_ms:
|
|
3480
|
-
voltage_levels:
|
|
3481
|
-
source_component_id:
|
|
3482
|
-
subcircuit_connectivity_map_key:
|
|
3502
|
+
simulation_experiment_id: z155.string(),
|
|
3503
|
+
timestamps_ms: z155.array(z155.number()).optional(),
|
|
3504
|
+
voltage_levels: z155.array(z155.number()),
|
|
3505
|
+
source_component_id: z155.string().optional(),
|
|
3506
|
+
subcircuit_connectivity_map_key: z155.string().optional(),
|
|
3483
3507
|
time_per_step: duration_ms,
|
|
3484
3508
|
start_time_ms: ms,
|
|
3485
3509
|
end_time_ms: ms,
|
|
3486
|
-
name:
|
|
3487
|
-
color:
|
|
3510
|
+
name: z155.string().optional(),
|
|
3511
|
+
color: z155.string().optional()
|
|
3488
3512
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
3489
3513
|
expectTypesMatch(true);
|
|
3490
3514
|
|
|
3491
3515
|
// src/simulation/simulation_switch.ts
|
|
3492
|
-
import { z as
|
|
3493
|
-
var simulation_switch =
|
|
3494
|
-
type:
|
|
3516
|
+
import { z as z156 } from "zod";
|
|
3517
|
+
var simulation_switch = z156.object({
|
|
3518
|
+
type: z156.literal("simulation_switch"),
|
|
3495
3519
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
3496
|
-
source_component_id:
|
|
3520
|
+
source_component_id: z156.string().optional(),
|
|
3497
3521
|
closes_at: ms.optional(),
|
|
3498
3522
|
opens_at: ms.optional(),
|
|
3499
|
-
starts_closed:
|
|
3523
|
+
starts_closed: z156.boolean().optional(),
|
|
3500
3524
|
switching_frequency: frequency.optional()
|
|
3501
3525
|
}).describe("Defines a switch for simulation timing control");
|
|
3502
3526
|
expectTypesMatch(true);
|
|
3503
3527
|
|
|
3504
3528
|
// src/simulation/simulation_voltage_probe.ts
|
|
3505
|
-
import { z as
|
|
3506
|
-
var simulation_voltage_probe =
|
|
3507
|
-
type:
|
|
3529
|
+
import { z as z157 } from "zod";
|
|
3530
|
+
var simulation_voltage_probe = z157.object({
|
|
3531
|
+
type: z157.literal("simulation_voltage_probe"),
|
|
3508
3532
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
3509
3533
|
"simulation_voltage_probe"
|
|
3510
3534
|
),
|
|
3511
|
-
source_component_id:
|
|
3512
|
-
name:
|
|
3513
|
-
signal_input_source_port_id:
|
|
3514
|
-
signal_input_source_net_id:
|
|
3515
|
-
reference_input_source_port_id:
|
|
3516
|
-
reference_input_source_net_id:
|
|
3517
|
-
subcircuit_id:
|
|
3518
|
-
color:
|
|
3535
|
+
source_component_id: z157.string().optional(),
|
|
3536
|
+
name: z157.string().optional(),
|
|
3537
|
+
signal_input_source_port_id: z157.string().optional(),
|
|
3538
|
+
signal_input_source_net_id: z157.string().optional(),
|
|
3539
|
+
reference_input_source_port_id: z157.string().optional(),
|
|
3540
|
+
reference_input_source_net_id: z157.string().optional(),
|
|
3541
|
+
subcircuit_id: z157.string().optional(),
|
|
3542
|
+
color: z157.string().optional()
|
|
3519
3543
|
}).describe(
|
|
3520
3544
|
"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."
|
|
3521
3545
|
).superRefine((data, ctx) => {
|
|
@@ -3525,20 +3549,20 @@ var simulation_voltage_probe = z156.object({
|
|
|
3525
3549
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
3526
3550
|
if (has_ports && has_nets) {
|
|
3527
3551
|
ctx.addIssue({
|
|
3528
|
-
code:
|
|
3552
|
+
code: z157.ZodIssueCode.custom,
|
|
3529
3553
|
message: "Cannot mix port and net connections in a differential probe."
|
|
3530
3554
|
});
|
|
3531
3555
|
} else if (has_ports) {
|
|
3532
3556
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
3533
3557
|
ctx.addIssue({
|
|
3534
|
-
code:
|
|
3558
|
+
code: z157.ZodIssueCode.custom,
|
|
3535
3559
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
3536
3560
|
});
|
|
3537
3561
|
}
|
|
3538
3562
|
} else if (has_nets) {
|
|
3539
3563
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
3540
3564
|
ctx.addIssue({
|
|
3541
|
-
code:
|
|
3565
|
+
code: z157.ZodIssueCode.custom,
|
|
3542
3566
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
3543
3567
|
});
|
|
3544
3568
|
}
|
|
@@ -3546,7 +3570,7 @@ var simulation_voltage_probe = z156.object({
|
|
|
3546
3570
|
} else {
|
|
3547
3571
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
3548
3572
|
ctx.addIssue({
|
|
3549
|
-
code:
|
|
3573
|
+
code: z157.ZodIssueCode.custom,
|
|
3550
3574
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
3551
3575
|
});
|
|
3552
3576
|
}
|
|
@@ -3555,35 +3579,35 @@ var simulation_voltage_probe = z156.object({
|
|
|
3555
3579
|
expectTypesMatch(true);
|
|
3556
3580
|
|
|
3557
3581
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
3558
|
-
import { z as
|
|
3582
|
+
import { z as z158 } from "zod";
|
|
3559
3583
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
3560
|
-
type:
|
|
3584
|
+
type: z158.literal("simulation_unknown_experiment_error"),
|
|
3561
3585
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
3562
3586
|
"simulation_unknown_experiment_error"
|
|
3563
3587
|
),
|
|
3564
|
-
error_type:
|
|
3565
|
-
simulation_experiment_id:
|
|
3566
|
-
subcircuit_id:
|
|
3588
|
+
error_type: z158.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
3589
|
+
simulation_experiment_id: z158.string().optional(),
|
|
3590
|
+
subcircuit_id: z158.string().optional()
|
|
3567
3591
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
3568
3592
|
expectTypesMatch(true);
|
|
3569
3593
|
|
|
3570
3594
|
// src/simulation/simulation_op_amp.ts
|
|
3571
|
-
import { z as
|
|
3572
|
-
var simulation_op_amp =
|
|
3573
|
-
type:
|
|
3595
|
+
import { z as z159 } from "zod";
|
|
3596
|
+
var simulation_op_amp = z159.object({
|
|
3597
|
+
type: z159.literal("simulation_op_amp"),
|
|
3574
3598
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
3575
|
-
source_component_id:
|
|
3576
|
-
inverting_input_source_port_id:
|
|
3577
|
-
non_inverting_input_source_port_id:
|
|
3578
|
-
output_source_port_id:
|
|
3579
|
-
positive_supply_source_port_id:
|
|
3580
|
-
negative_supply_source_port_id:
|
|
3599
|
+
source_component_id: z159.string().optional(),
|
|
3600
|
+
inverting_input_source_port_id: z159.string(),
|
|
3601
|
+
non_inverting_input_source_port_id: z159.string(),
|
|
3602
|
+
output_source_port_id: z159.string(),
|
|
3603
|
+
positive_supply_source_port_id: z159.string(),
|
|
3604
|
+
negative_supply_source_port_id: z159.string()
|
|
3581
3605
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
3582
3606
|
expectTypesMatch(true);
|
|
3583
3607
|
|
|
3584
3608
|
// src/any_circuit_element.ts
|
|
3585
|
-
import { z as
|
|
3586
|
-
var any_circuit_element =
|
|
3609
|
+
import { z as z160 } from "zod";
|
|
3610
|
+
var any_circuit_element = z160.union([
|
|
3587
3611
|
source_trace,
|
|
3588
3612
|
source_port,
|
|
3589
3613
|
source_component_internal_connection,
|
|
@@ -3668,6 +3692,7 @@ var any_circuit_element = z159.union([
|
|
|
3668
3692
|
pcb_note_dimension,
|
|
3669
3693
|
pcb_autorouting_error,
|
|
3670
3694
|
pcb_footprint_overlap_error,
|
|
3695
|
+
pcb_courtyard_overlap_error,
|
|
3671
3696
|
pcb_breakout_point,
|
|
3672
3697
|
pcb_cutout,
|
|
3673
3698
|
pcb_ground_plane,
|
|
@@ -3726,6 +3751,7 @@ export {
|
|
|
3726
3751
|
brep_shape,
|
|
3727
3752
|
cadModelDefaultDirectionMap,
|
|
3728
3753
|
cad_component,
|
|
3754
|
+
cad_model_axis_directions,
|
|
3729
3755
|
cad_model_formats,
|
|
3730
3756
|
capacitance,
|
|
3731
3757
|
circuit_json_footprint_load_error,
|
|
@@ -3773,6 +3799,7 @@ export {
|
|
|
3773
3799
|
pcb_copper_text,
|
|
3774
3800
|
pcb_courtyard_circle,
|
|
3775
3801
|
pcb_courtyard_outline,
|
|
3802
|
+
pcb_courtyard_overlap_error,
|
|
3776
3803
|
pcb_courtyard_polygon,
|
|
3777
3804
|
pcb_courtyard_rect,
|
|
3778
3805
|
pcb_cutout,
|