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