circuit-json 0.0.437 → 0.0.439
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 +87 -8
- package/dist/index.d.mts +528 -583
- package/dist/index.mjs +57 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -855,6 +855,7 @@ var source_trace = z56.object({
|
|
|
855
855
|
subcircuit_id: z56.string().optional(),
|
|
856
856
|
subcircuit_connectivity_map_key: z56.string().optional(),
|
|
857
857
|
max_length: z56.number().optional(),
|
|
858
|
+
name: z56.string().optional(),
|
|
858
859
|
min_trace_thickness: z56.number().optional(),
|
|
859
860
|
display_name: z56.string().optional()
|
|
860
861
|
});
|
|
@@ -3603,12 +3604,6 @@ expectTypesMatch(true);
|
|
|
3603
3604
|
|
|
3604
3605
|
// src/simulation/simulation_voltage_probe.ts
|
|
3605
3606
|
import { z as z169 } from "zod";
|
|
3606
|
-
var simulation_voltage_probe_display_options = z169.object({
|
|
3607
|
-
label: z169.string().optional(),
|
|
3608
|
-
center: z169.number().optional(),
|
|
3609
|
-
offset_divs: z169.number().optional(),
|
|
3610
|
-
units_per_div: z169.number().optional()
|
|
3611
|
-
});
|
|
3612
3607
|
var simulation_voltage_probe = z169.object({
|
|
3613
3608
|
type: z169.literal("simulation_voltage_probe"),
|
|
3614
3609
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
@@ -3621,8 +3616,7 @@ var simulation_voltage_probe = z169.object({
|
|
|
3621
3616
|
reference_input_source_port_id: z169.string().optional(),
|
|
3622
3617
|
reference_input_source_net_id: z169.string().optional(),
|
|
3623
3618
|
subcircuit_id: z169.string().optional(),
|
|
3624
|
-
color: z169.string().optional()
|
|
3625
|
-
display_options: simulation_voltage_probe_display_options.optional()
|
|
3619
|
+
color: z169.string().optional()
|
|
3626
3620
|
}).describe(
|
|
3627
3621
|
"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."
|
|
3628
3622
|
).superRefine((data, ctx) => {
|
|
@@ -3660,16 +3654,9 @@ var simulation_voltage_probe = z169.object({
|
|
|
3660
3654
|
}
|
|
3661
3655
|
});
|
|
3662
3656
|
expectTypesMatch(true);
|
|
3663
|
-
expectTypesMatch(true);
|
|
3664
3657
|
|
|
3665
3658
|
// src/simulation/simulation_current_probe.ts
|
|
3666
3659
|
import { z as z170 } from "zod";
|
|
3667
|
-
var simulation_current_probe_display_options = z170.object({
|
|
3668
|
-
label: z170.string().optional(),
|
|
3669
|
-
center: z170.number().optional(),
|
|
3670
|
-
offset_divs: z170.number().optional(),
|
|
3671
|
-
units_per_div: z170.number().optional()
|
|
3672
|
-
});
|
|
3673
3660
|
var simulation_current_probe = z170.object({
|
|
3674
3661
|
type: z170.literal("simulation_current_probe"),
|
|
3675
3662
|
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
@@ -3682,8 +3669,7 @@ var simulation_current_probe = z170.object({
|
|
|
3682
3669
|
positive_source_net_id: z170.string().optional(),
|
|
3683
3670
|
negative_source_net_id: z170.string().optional(),
|
|
3684
3671
|
subcircuit_id: z170.string().optional(),
|
|
3685
|
-
color: z170.string().optional()
|
|
3686
|
-
display_options: simulation_current_probe_display_options.optional()
|
|
3672
|
+
color: z170.string().optional()
|
|
3687
3673
|
}).describe(
|
|
3688
3674
|
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
3689
3675
|
).superRefine((data, ctx) => {
|
|
@@ -3724,7 +3710,6 @@ var simulation_current_probe = z170.object({
|
|
|
3724
3710
|
});
|
|
3725
3711
|
});
|
|
3726
3712
|
expectTypesMatch(true);
|
|
3727
|
-
expectTypesMatch(true);
|
|
3728
3713
|
|
|
3729
3714
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
3730
3715
|
import { z as z171 } from "zod";
|
|
@@ -3768,9 +3753,59 @@ expectTypesMatch(
|
|
|
3768
3753
|
true
|
|
3769
3754
|
);
|
|
3770
3755
|
|
|
3771
|
-
// src/
|
|
3756
|
+
// src/simulation/simulation_oscilloscope_trace.ts
|
|
3772
3757
|
import { z as z174 } from "zod";
|
|
3773
|
-
var
|
|
3758
|
+
var hasValue = (value) => value !== void 0;
|
|
3759
|
+
var simulation_oscilloscope_trace = z174.object({
|
|
3760
|
+
type: z174.literal("simulation_oscilloscope_trace"),
|
|
3761
|
+
simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
|
|
3762
|
+
"simulation_oscilloscope_trace"
|
|
3763
|
+
),
|
|
3764
|
+
simulation_transient_voltage_graph_id: z174.string().optional(),
|
|
3765
|
+
simulation_transient_current_graph_id: z174.string().optional(),
|
|
3766
|
+
simulation_voltage_probe_id: z174.string().optional(),
|
|
3767
|
+
simulation_current_probe_id: z174.string().optional(),
|
|
3768
|
+
display_name: z174.string().optional(),
|
|
3769
|
+
color: z174.string().optional(),
|
|
3770
|
+
display_center_value: z174.number().optional(),
|
|
3771
|
+
display_center_offset_divs: z174.number().optional(),
|
|
3772
|
+
volts_per_div: z174.number().positive().optional(),
|
|
3773
|
+
amps_per_div: z174.number().positive().optional()
|
|
3774
|
+
}).describe(
|
|
3775
|
+
"Defines how a simulation measurement is rendered as an oscilloscope-style trace."
|
|
3776
|
+
).superRefine((data, ctx) => {
|
|
3777
|
+
const voltageReferences = [
|
|
3778
|
+
data.simulation_transient_voltage_graph_id,
|
|
3779
|
+
data.simulation_voltage_probe_id
|
|
3780
|
+
].filter(hasValue).length;
|
|
3781
|
+
const currentReferences = [
|
|
3782
|
+
data.simulation_transient_current_graph_id,
|
|
3783
|
+
data.simulation_current_probe_id
|
|
3784
|
+
].filter(hasValue).length;
|
|
3785
|
+
if (voltageReferences + currentReferences !== 1) {
|
|
3786
|
+
ctx.addIssue({
|
|
3787
|
+
code: z174.ZodIssueCode.custom,
|
|
3788
|
+
message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
|
|
3789
|
+
});
|
|
3790
|
+
}
|
|
3791
|
+
if (voltageReferences > 0 && data.amps_per_div !== void 0) {
|
|
3792
|
+
ctx.addIssue({
|
|
3793
|
+
code: z174.ZodIssueCode.custom,
|
|
3794
|
+
message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
|
|
3795
|
+
});
|
|
3796
|
+
}
|
|
3797
|
+
if (currentReferences > 0 && data.volts_per_div !== void 0) {
|
|
3798
|
+
ctx.addIssue({
|
|
3799
|
+
code: z174.ZodIssueCode.custom,
|
|
3800
|
+
message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
});
|
|
3804
|
+
expectTypesMatch(true);
|
|
3805
|
+
|
|
3806
|
+
// src/any_circuit_element.ts
|
|
3807
|
+
import { z as z175 } from "zod";
|
|
3808
|
+
var any_circuit_element = z175.union([
|
|
3774
3809
|
source_trace,
|
|
3775
3810
|
source_port,
|
|
3776
3811
|
source_component_internal_connection,
|
|
@@ -3908,6 +3943,7 @@ var any_circuit_element = z174.union([
|
|
|
3908
3943
|
simulation_switch,
|
|
3909
3944
|
simulation_voltage_probe,
|
|
3910
3945
|
simulation_current_probe,
|
|
3946
|
+
simulation_oscilloscope_trace,
|
|
3911
3947
|
simulation_unknown_experiment_error,
|
|
3912
3948
|
simulation_op_amp,
|
|
3913
3949
|
simulation_spice_subcircuit
|
|
@@ -4087,19 +4123,18 @@ export {
|
|
|
4087
4123
|
simulation_ac_current_source,
|
|
4088
4124
|
simulation_ac_voltage_source,
|
|
4089
4125
|
simulation_current_probe,
|
|
4090
|
-
simulation_current_probe_display_options,
|
|
4091
4126
|
simulation_current_source,
|
|
4092
4127
|
simulation_dc_current_source,
|
|
4093
4128
|
simulation_dc_voltage_source,
|
|
4094
4129
|
simulation_experiment,
|
|
4095
4130
|
simulation_op_amp,
|
|
4131
|
+
simulation_oscilloscope_trace,
|
|
4096
4132
|
simulation_spice_subcircuit,
|
|
4097
4133
|
simulation_switch,
|
|
4098
4134
|
simulation_transient_current_graph,
|
|
4099
4135
|
simulation_transient_voltage_graph,
|
|
4100
4136
|
simulation_unknown_experiment_error,
|
|
4101
4137
|
simulation_voltage_probe,
|
|
4102
|
-
simulation_voltage_probe_display_options,
|
|
4103
4138
|
simulation_voltage_source,
|
|
4104
4139
|
size,
|
|
4105
4140
|
source_ambiguous_port_reference,
|