circuit-json 0.0.515 → 0.0.516
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 +20 -0
- package/dist/index.d.mts +173 -1
- package/dist/index.mjs +273 -243
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4433,10 +4433,38 @@ var cad_collision_error = base_circuit_json_error.extend({
|
|
|
4433
4433
|
);
|
|
4434
4434
|
expectTypesMatch(true);
|
|
4435
4435
|
|
|
4436
|
-
// src/
|
|
4436
|
+
// src/cad/cad_cable.ts
|
|
4437
4437
|
import { z as z197 } from "zod";
|
|
4438
|
-
var
|
|
4439
|
-
|
|
4438
|
+
var cad_cable = z197.object({
|
|
4439
|
+
type: z197.literal("cad_cable"),
|
|
4440
|
+
cad_cable_id: z197.string(),
|
|
4441
|
+
name: z197.string().min(1),
|
|
4442
|
+
from_source_component_id: z197.string(),
|
|
4443
|
+
to_source_component_id: z197.string(),
|
|
4444
|
+
cableprinter_string: z197.string().min(1).describe(
|
|
4445
|
+
'Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'
|
|
4446
|
+
),
|
|
4447
|
+
path: z197.array(point3).min(2).refine(
|
|
4448
|
+
(path) => path.every(
|
|
4449
|
+
(point2, i) => [point2.x, point2.y, point2.z].every(Number.isFinite) && (i === 0 || Math.hypot(
|
|
4450
|
+
point2.x - path[i - 1].x,
|
|
4451
|
+
point2.y - path[i - 1].y,
|
|
4452
|
+
point2.z - path[i - 1].z
|
|
4453
|
+
) > 1e-8)
|
|
4454
|
+
),
|
|
4455
|
+
"Cable paths require finite, distinct consecutive points"
|
|
4456
|
+
).describe(
|
|
4457
|
+
"Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path."
|
|
4458
|
+
)
|
|
4459
|
+
}).describe(
|
|
4460
|
+
"A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping."
|
|
4461
|
+
);
|
|
4462
|
+
expectTypesMatch(true);
|
|
4463
|
+
|
|
4464
|
+
// src/simulation/simulation_voltage_source.ts
|
|
4465
|
+
import { z as z198 } from "zod";
|
|
4466
|
+
var wave_shape = z198.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
4467
|
+
var percentage = z198.union([z198.string(), z198.number()]).transform((val) => {
|
|
4440
4468
|
if (typeof val === "string") {
|
|
4441
4469
|
if (val.endsWith("%")) {
|
|
4442
4470
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -4445,32 +4473,32 @@ var percentage = z197.union([z197.string(), z197.number()]).transform((val) => {
|
|
|
4445
4473
|
}
|
|
4446
4474
|
return val;
|
|
4447
4475
|
}).pipe(
|
|
4448
|
-
|
|
4476
|
+
z198.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
4449
4477
|
);
|
|
4450
|
-
var simulation_dc_voltage_source =
|
|
4451
|
-
type:
|
|
4478
|
+
var simulation_dc_voltage_source = z198.object({
|
|
4479
|
+
type: z198.literal("simulation_voltage_source"),
|
|
4452
4480
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
4453
4481
|
"simulation_voltage_source"
|
|
4454
4482
|
),
|
|
4455
|
-
is_dc_source:
|
|
4456
|
-
positive_source_port_id:
|
|
4457
|
-
negative_source_port_id:
|
|
4458
|
-
positive_source_net_id:
|
|
4459
|
-
negative_source_net_id:
|
|
4483
|
+
is_dc_source: z198.literal(true).optional().default(true),
|
|
4484
|
+
positive_source_port_id: z198.string().optional(),
|
|
4485
|
+
negative_source_port_id: z198.string().optional(),
|
|
4486
|
+
positive_source_net_id: z198.string().optional(),
|
|
4487
|
+
negative_source_net_id: z198.string().optional(),
|
|
4460
4488
|
voltage,
|
|
4461
4489
|
ac_magnitude: voltage.optional(),
|
|
4462
4490
|
ac_phase: rotation.optional()
|
|
4463
4491
|
}).describe("Defines a DC voltage source for simulation");
|
|
4464
|
-
var simulation_ac_voltage_source =
|
|
4465
|
-
type:
|
|
4492
|
+
var simulation_ac_voltage_source = z198.object({
|
|
4493
|
+
type: z198.literal("simulation_voltage_source"),
|
|
4466
4494
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
4467
4495
|
"simulation_voltage_source"
|
|
4468
4496
|
),
|
|
4469
|
-
is_dc_source:
|
|
4470
|
-
terminal1_source_port_id:
|
|
4471
|
-
terminal2_source_port_id:
|
|
4472
|
-
terminal1_source_net_id:
|
|
4473
|
-
terminal2_source_net_id:
|
|
4497
|
+
is_dc_source: z198.literal(false),
|
|
4498
|
+
terminal1_source_port_id: z198.string().optional(),
|
|
4499
|
+
terminal2_source_port_id: z198.string().optional(),
|
|
4500
|
+
terminal1_source_net_id: z198.string().optional(),
|
|
4501
|
+
terminal2_source_net_id: z198.string().optional(),
|
|
4474
4502
|
voltage: voltage.optional(),
|
|
4475
4503
|
frequency: frequency.optional(),
|
|
4476
4504
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -4485,14 +4513,14 @@ var simulation_ac_voltage_source = z197.object({
|
|
|
4485
4513
|
ac_magnitude: voltage.optional(),
|
|
4486
4514
|
ac_phase: rotation.optional()
|
|
4487
4515
|
}).describe("Defines an AC voltage source for simulation");
|
|
4488
|
-
var simulation_voltage_source =
|
|
4516
|
+
var simulation_voltage_source = z198.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
4489
4517
|
expectTypesMatch(true);
|
|
4490
4518
|
expectTypesMatch(true);
|
|
4491
4519
|
expectTypesMatch(true);
|
|
4492
4520
|
|
|
4493
4521
|
// src/simulation/simulation_current_source.ts
|
|
4494
|
-
import { z as
|
|
4495
|
-
var percentage2 =
|
|
4522
|
+
import { z as z199 } from "zod";
|
|
4523
|
+
var percentage2 = z199.union([z199.string(), z199.number()]).transform((val) => {
|
|
4496
4524
|
if (typeof val === "string") {
|
|
4497
4525
|
if (val.endsWith("%")) {
|
|
4498
4526
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -4501,32 +4529,32 @@ var percentage2 = z198.union([z198.string(), z198.number()]).transform((val) =>
|
|
|
4501
4529
|
}
|
|
4502
4530
|
return val;
|
|
4503
4531
|
}).pipe(
|
|
4504
|
-
|
|
4532
|
+
z199.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
4505
4533
|
);
|
|
4506
|
-
var simulation_dc_current_source =
|
|
4507
|
-
type:
|
|
4534
|
+
var simulation_dc_current_source = z199.object({
|
|
4535
|
+
type: z199.literal("simulation_current_source"),
|
|
4508
4536
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
4509
4537
|
"simulation_current_source"
|
|
4510
4538
|
),
|
|
4511
|
-
is_dc_source:
|
|
4512
|
-
positive_source_port_id:
|
|
4513
|
-
negative_source_port_id:
|
|
4514
|
-
positive_source_net_id:
|
|
4515
|
-
negative_source_net_id:
|
|
4539
|
+
is_dc_source: z199.literal(true).optional().default(true),
|
|
4540
|
+
positive_source_port_id: z199.string().optional(),
|
|
4541
|
+
negative_source_port_id: z199.string().optional(),
|
|
4542
|
+
positive_source_net_id: z199.string().optional(),
|
|
4543
|
+
negative_source_net_id: z199.string().optional(),
|
|
4516
4544
|
current,
|
|
4517
4545
|
ac_magnitude: current.optional(),
|
|
4518
4546
|
ac_phase: rotation.optional()
|
|
4519
4547
|
}).describe("Defines a DC current source for simulation");
|
|
4520
|
-
var simulation_ac_current_source =
|
|
4521
|
-
type:
|
|
4548
|
+
var simulation_ac_current_source = z199.object({
|
|
4549
|
+
type: z199.literal("simulation_current_source"),
|
|
4522
4550
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
4523
4551
|
"simulation_current_source"
|
|
4524
4552
|
),
|
|
4525
|
-
is_dc_source:
|
|
4526
|
-
terminal1_source_port_id:
|
|
4527
|
-
terminal2_source_port_id:
|
|
4528
|
-
terminal1_source_net_id:
|
|
4529
|
-
terminal2_source_net_id:
|
|
4553
|
+
is_dc_source: z199.literal(false),
|
|
4554
|
+
terminal1_source_port_id: z199.string().optional(),
|
|
4555
|
+
terminal2_source_port_id: z199.string().optional(),
|
|
4556
|
+
terminal1_source_net_id: z199.string().optional(),
|
|
4557
|
+
terminal2_source_net_id: z199.string().optional(),
|
|
4530
4558
|
current: current.optional(),
|
|
4531
4559
|
frequency: frequency.optional(),
|
|
4532
4560
|
peak_to_peak_current: current.optional(),
|
|
@@ -4536,58 +4564,58 @@ var simulation_ac_current_source = z198.object({
|
|
|
4536
4564
|
ac_magnitude: current.optional(),
|
|
4537
4565
|
ac_phase: rotation.optional()
|
|
4538
4566
|
}).describe("Defines an AC current source for simulation");
|
|
4539
|
-
var simulation_current_source =
|
|
4567
|
+
var simulation_current_source = z199.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
4540
4568
|
expectTypesMatch(true);
|
|
4541
4569
|
expectTypesMatch(true);
|
|
4542
4570
|
expectTypesMatch(true);
|
|
4543
4571
|
|
|
4544
4572
|
// src/simulation/simulation_experiment.ts
|
|
4545
|
-
import { z as
|
|
4573
|
+
import { z as z201 } from "zod";
|
|
4546
4574
|
|
|
4547
4575
|
// src/simulation/simulation_units.ts
|
|
4548
|
-
import { z as
|
|
4549
|
-
var simulation_dc_sweep_unit =
|
|
4576
|
+
import { z as z200 } from "zod";
|
|
4577
|
+
var simulation_dc_sweep_unit = z200.custom(
|
|
4550
4578
|
(dcSweepUnit) => dcSweepUnit === "V" || dcSweepUnit === "A"
|
|
4551
4579
|
);
|
|
4552
|
-
var simulation_parameter_unit =
|
|
4580
|
+
var simulation_parameter_unit = z200.custom(
|
|
4553
4581
|
(parameterUnit) => parameterUnit === "\u03A9" || parameterUnit === "F" || parameterUnit === "H" || parameterUnit === "V" || parameterUnit === "A"
|
|
4554
4582
|
);
|
|
4555
4583
|
|
|
4556
4584
|
// src/simulation/simulation_experiment.ts
|
|
4557
|
-
var experiment_type =
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4585
|
+
var experiment_type = z201.union([
|
|
4586
|
+
z201.literal("spice_dc_sweep"),
|
|
4587
|
+
z201.literal("spice_dc_operating_point"),
|
|
4588
|
+
z201.literal("spice_transient_analysis"),
|
|
4589
|
+
z201.literal("spice_ac_analysis")
|
|
4562
4590
|
]);
|
|
4563
|
-
var spice_simulation_options =
|
|
4564
|
-
method:
|
|
4565
|
-
reltol:
|
|
4566
|
-
abstol:
|
|
4567
|
-
vntol:
|
|
4591
|
+
var spice_simulation_options = z201.object({
|
|
4592
|
+
method: z201.enum(["trap", "gear"]).optional(),
|
|
4593
|
+
reltol: z201.union([z201.number(), z201.string()]).optional(),
|
|
4594
|
+
abstol: z201.union([z201.number(), z201.string()]).optional(),
|
|
4595
|
+
vntol: z201.union([z201.number(), z201.string()]).optional()
|
|
4568
4596
|
}).describe("SPICE solver options for a simulation experiment");
|
|
4569
|
-
var simulation_experiment =
|
|
4570
|
-
type:
|
|
4597
|
+
var simulation_experiment = z201.object({
|
|
4598
|
+
type: z201.literal("simulation_experiment"),
|
|
4571
4599
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
4572
4600
|
"simulation_experiment"
|
|
4573
4601
|
),
|
|
4574
|
-
name:
|
|
4602
|
+
name: z201.string(),
|
|
4575
4603
|
experiment_type,
|
|
4576
4604
|
time_per_step: duration_ms.optional(),
|
|
4577
4605
|
start_time_ms: ms.optional(),
|
|
4578
4606
|
end_time_ms: ms.optional(),
|
|
4579
4607
|
spice_options: spice_simulation_options.optional(),
|
|
4580
|
-
dc_sweep_voltage_source_id:
|
|
4581
|
-
dc_sweep_current_source_id:
|
|
4582
|
-
dc_sweep_start:
|
|
4583
|
-
dc_sweep_stop:
|
|
4584
|
-
dc_sweep_step:
|
|
4608
|
+
dc_sweep_voltage_source_id: z201.string().optional(),
|
|
4609
|
+
dc_sweep_current_source_id: z201.string().optional(),
|
|
4610
|
+
dc_sweep_start: z201.number().optional(),
|
|
4611
|
+
dc_sweep_stop: z201.number().optional(),
|
|
4612
|
+
dc_sweep_step: z201.number().refine((dcSweepStep) => dcSweepStep !== 0).optional(),
|
|
4585
4613
|
dc_sweep_unit: simulation_dc_sweep_unit.optional(),
|
|
4586
|
-
ac_sweep_type:
|
|
4587
|
-
ac_samples_per_interval:
|
|
4588
|
-
ac_sample_count:
|
|
4589
|
-
ac_start_frequency_hz:
|
|
4590
|
-
ac_stop_frequency_hz:
|
|
4614
|
+
ac_sweep_type: z201.enum(["linear", "decade", "octave"]).optional(),
|
|
4615
|
+
ac_samples_per_interval: z201.number().int().positive().optional(),
|
|
4616
|
+
ac_sample_count: z201.number().int().positive().optional(),
|
|
4617
|
+
ac_start_frequency_hz: z201.number().positive().optional(),
|
|
4618
|
+
ac_stop_frequency_hz: z201.number().positive().optional()
|
|
4591
4619
|
}).superRefine((experiment, context) => {
|
|
4592
4620
|
if (experiment.experiment_type === "spice_dc_sweep") {
|
|
4593
4621
|
const requiredFields = [
|
|
@@ -4599,7 +4627,7 @@ var simulation_experiment = z200.object({
|
|
|
4599
4627
|
for (const field of requiredFields) {
|
|
4600
4628
|
if (experiment[field] === void 0) {
|
|
4601
4629
|
context.addIssue({
|
|
4602
|
-
code:
|
|
4630
|
+
code: z201.ZodIssueCode.custom,
|
|
4603
4631
|
path: [field],
|
|
4604
4632
|
message: `${field} is required for a DC sweep`
|
|
4605
4633
|
});
|
|
@@ -4609,7 +4637,7 @@ var simulation_experiment = z200.object({
|
|
|
4609
4637
|
const hasCurrentSource = experiment.dc_sweep_current_source_id !== void 0;
|
|
4610
4638
|
if (hasVoltageSource === hasCurrentSource) {
|
|
4611
4639
|
context.addIssue({
|
|
4612
|
-
code:
|
|
4640
|
+
code: z201.ZodIssueCode.custom,
|
|
4613
4641
|
path: ["dc_sweep_voltage_source_id"],
|
|
4614
4642
|
message: "Exactly one DC sweep voltage or current source ID is required"
|
|
4615
4643
|
});
|
|
@@ -4618,35 +4646,35 @@ var simulation_experiment = z200.object({
|
|
|
4618
4646
|
if (experiment.experiment_type === "spice_ac_analysis") {
|
|
4619
4647
|
if (experiment.ac_sweep_type === void 0) {
|
|
4620
4648
|
context.addIssue({
|
|
4621
|
-
code:
|
|
4649
|
+
code: z201.ZodIssueCode.custom,
|
|
4622
4650
|
path: ["ac_sweep_type"],
|
|
4623
4651
|
message: "ac_sweep_type is required for an AC analysis"
|
|
4624
4652
|
});
|
|
4625
4653
|
}
|
|
4626
4654
|
if (experiment.ac_start_frequency_hz === void 0) {
|
|
4627
4655
|
context.addIssue({
|
|
4628
|
-
code:
|
|
4656
|
+
code: z201.ZodIssueCode.custom,
|
|
4629
4657
|
path: ["ac_start_frequency_hz"],
|
|
4630
4658
|
message: "ac_start_frequency_hz is required for an AC analysis"
|
|
4631
4659
|
});
|
|
4632
4660
|
}
|
|
4633
4661
|
if (experiment.ac_stop_frequency_hz === void 0) {
|
|
4634
4662
|
context.addIssue({
|
|
4635
|
-
code:
|
|
4663
|
+
code: z201.ZodIssueCode.custom,
|
|
4636
4664
|
path: ["ac_stop_frequency_hz"],
|
|
4637
4665
|
message: "ac_stop_frequency_hz is required for an AC analysis"
|
|
4638
4666
|
});
|
|
4639
4667
|
}
|
|
4640
4668
|
if (experiment.ac_sweep_type === "linear" && experiment.ac_sample_count === void 0) {
|
|
4641
4669
|
context.addIssue({
|
|
4642
|
-
code:
|
|
4670
|
+
code: z201.ZodIssueCode.custom,
|
|
4643
4671
|
path: ["ac_sample_count"],
|
|
4644
4672
|
message: "ac_sample_count is required for a linear AC analysis"
|
|
4645
4673
|
});
|
|
4646
4674
|
}
|
|
4647
4675
|
if ((experiment.ac_sweep_type === "decade" || experiment.ac_sweep_type === "octave") && experiment.ac_samples_per_interval === void 0) {
|
|
4648
4676
|
context.addIssue({
|
|
4649
|
-
code:
|
|
4677
|
+
code: z201.ZodIssueCode.custom,
|
|
4650
4678
|
path: ["ac_samples_per_interval"],
|
|
4651
4679
|
message: "ac_samples_per_interval is required for decade and octave AC analyses"
|
|
4652
4680
|
});
|
|
@@ -4656,87 +4684,87 @@ var simulation_experiment = z200.object({
|
|
|
4656
4684
|
expectTypesMatch(true);
|
|
4657
4685
|
|
|
4658
4686
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4659
|
-
import { z as
|
|
4687
|
+
import { z as z203 } from "zod";
|
|
4660
4688
|
|
|
4661
4689
|
// src/simulation/simulation_parameter_sweep_coordinate.ts
|
|
4662
|
-
import { z as
|
|
4663
|
-
var simulation_parameter_sweep_coordinate =
|
|
4664
|
-
simulation_parameter_sweep_id:
|
|
4665
|
-
sweep_index:
|
|
4666
|
-
parameter_value:
|
|
4690
|
+
import { z as z202 } from "zod";
|
|
4691
|
+
var simulation_parameter_sweep_coordinate = z202.object({
|
|
4692
|
+
simulation_parameter_sweep_id: z202.string(),
|
|
4693
|
+
sweep_index: z202.number().int().nonnegative(),
|
|
4694
|
+
parameter_value: z202.number(),
|
|
4667
4695
|
parameter_unit: simulation_parameter_unit
|
|
4668
4696
|
});
|
|
4669
4697
|
expectTypesMatch(true);
|
|
4670
4698
|
|
|
4671
4699
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4672
|
-
var simulation_transient_voltage_graph =
|
|
4673
|
-
type:
|
|
4700
|
+
var simulation_transient_voltage_graph = z203.object({
|
|
4701
|
+
type: z203.literal("simulation_transient_voltage_graph"),
|
|
4674
4702
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4675
4703
|
"simulation_transient_voltage_graph"
|
|
4676
4704
|
),
|
|
4677
|
-
simulation_experiment_id:
|
|
4705
|
+
simulation_experiment_id: z203.string(),
|
|
4678
4706
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4679
|
-
timestamps_ms:
|
|
4680
|
-
voltage_levels:
|
|
4681
|
-
source_component_id:
|
|
4682
|
-
subcircuit_connectivity_map_key:
|
|
4707
|
+
timestamps_ms: z203.array(z203.number()).optional(),
|
|
4708
|
+
voltage_levels: z203.array(z203.number()),
|
|
4709
|
+
source_component_id: z203.string().optional(),
|
|
4710
|
+
subcircuit_connectivity_map_key: z203.string().optional(),
|
|
4683
4711
|
time_per_step: duration_ms,
|
|
4684
4712
|
start_time_ms: ms,
|
|
4685
4713
|
end_time_ms: ms,
|
|
4686
|
-
name:
|
|
4687
|
-
color:
|
|
4714
|
+
name: z203.string().optional(),
|
|
4715
|
+
color: z203.string().optional()
|
|
4688
4716
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
4689
4717
|
expectTypesMatch(true);
|
|
4690
4718
|
|
|
4691
4719
|
// src/simulation/simulation_transient_current_graph.ts
|
|
4692
|
-
import { z as
|
|
4693
|
-
var simulation_transient_current_graph =
|
|
4694
|
-
type:
|
|
4720
|
+
import { z as z204 } from "zod";
|
|
4721
|
+
var simulation_transient_current_graph = z204.object({
|
|
4722
|
+
type: z204.literal("simulation_transient_current_graph"),
|
|
4695
4723
|
simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4696
4724
|
"simulation_transient_current_graph"
|
|
4697
4725
|
),
|
|
4698
|
-
simulation_experiment_id:
|
|
4726
|
+
simulation_experiment_id: z204.string(),
|
|
4699
4727
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4700
|
-
timestamps_ms:
|
|
4701
|
-
current_levels:
|
|
4702
|
-
source_component_id:
|
|
4703
|
-
subcircuit_connectivity_map_key:
|
|
4728
|
+
timestamps_ms: z204.array(z204.number()).optional(),
|
|
4729
|
+
current_levels: z204.array(z204.number()),
|
|
4730
|
+
source_component_id: z204.string().optional(),
|
|
4731
|
+
subcircuit_connectivity_map_key: z204.string().optional(),
|
|
4704
4732
|
time_per_step: duration_ms,
|
|
4705
4733
|
start_time_ms: ms,
|
|
4706
4734
|
end_time_ms: ms,
|
|
4707
|
-
name:
|
|
4708
|
-
color:
|
|
4735
|
+
name: z204.string().optional(),
|
|
4736
|
+
color: z204.string().optional()
|
|
4709
4737
|
}).describe("Stores current measurements over time for a simulation");
|
|
4710
4738
|
expectTypesMatch(true);
|
|
4711
4739
|
|
|
4712
4740
|
// src/simulation/simulation_switch.ts
|
|
4713
|
-
import { z as
|
|
4714
|
-
var simulation_switch =
|
|
4715
|
-
type:
|
|
4741
|
+
import { z as z205 } from "zod";
|
|
4742
|
+
var simulation_switch = z205.object({
|
|
4743
|
+
type: z205.literal("simulation_switch"),
|
|
4716
4744
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
4717
|
-
source_component_id:
|
|
4745
|
+
source_component_id: z205.string().optional(),
|
|
4718
4746
|
closes_at: ms.optional(),
|
|
4719
4747
|
opens_at: ms.optional(),
|
|
4720
|
-
starts_closed:
|
|
4748
|
+
starts_closed: z205.boolean().optional(),
|
|
4721
4749
|
switching_frequency: frequency.optional()
|
|
4722
4750
|
}).describe("Defines a switch for simulation timing control");
|
|
4723
4751
|
expectTypesMatch(true);
|
|
4724
4752
|
|
|
4725
4753
|
// src/simulation/simulation_voltage_probe.ts
|
|
4726
|
-
import { z as
|
|
4727
|
-
var simulation_voltage_probe =
|
|
4728
|
-
type:
|
|
4754
|
+
import { z as z206 } from "zod";
|
|
4755
|
+
var simulation_voltage_probe = z206.object({
|
|
4756
|
+
type: z206.literal("simulation_voltage_probe"),
|
|
4729
4757
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
4730
4758
|
"simulation_voltage_probe"
|
|
4731
4759
|
),
|
|
4732
|
-
source_component_id:
|
|
4733
|
-
name:
|
|
4734
|
-
signal_input_source_port_id:
|
|
4735
|
-
signal_input_source_net_id:
|
|
4736
|
-
reference_input_source_port_id:
|
|
4737
|
-
reference_input_source_net_id:
|
|
4738
|
-
subcircuit_id:
|
|
4739
|
-
color:
|
|
4760
|
+
source_component_id: z206.string().optional(),
|
|
4761
|
+
name: z206.string().optional(),
|
|
4762
|
+
signal_input_source_port_id: z206.string().optional(),
|
|
4763
|
+
signal_input_source_net_id: z206.string().optional(),
|
|
4764
|
+
reference_input_source_port_id: z206.string().optional(),
|
|
4765
|
+
reference_input_source_net_id: z206.string().optional(),
|
|
4766
|
+
subcircuit_id: z206.string().optional(),
|
|
4767
|
+
color: z206.string().optional()
|
|
4740
4768
|
}).describe(
|
|
4741
4769
|
"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."
|
|
4742
4770
|
).superRefine((data, ctx) => {
|
|
@@ -4746,20 +4774,20 @@ var simulation_voltage_probe = z205.object({
|
|
|
4746
4774
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
4747
4775
|
if (has_ports && has_nets) {
|
|
4748
4776
|
ctx.addIssue({
|
|
4749
|
-
code:
|
|
4777
|
+
code: z206.ZodIssueCode.custom,
|
|
4750
4778
|
message: "Cannot mix port and net connections in a differential probe."
|
|
4751
4779
|
});
|
|
4752
4780
|
} else if (has_ports) {
|
|
4753
4781
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
4754
4782
|
ctx.addIssue({
|
|
4755
|
-
code:
|
|
4783
|
+
code: z206.ZodIssueCode.custom,
|
|
4756
4784
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
4757
4785
|
});
|
|
4758
4786
|
}
|
|
4759
4787
|
} else if (has_nets) {
|
|
4760
4788
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
4761
4789
|
ctx.addIssue({
|
|
4762
|
-
code:
|
|
4790
|
+
code: z206.ZodIssueCode.custom,
|
|
4763
4791
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
4764
4792
|
});
|
|
4765
4793
|
}
|
|
@@ -4767,7 +4795,7 @@ var simulation_voltage_probe = z205.object({
|
|
|
4767
4795
|
} else {
|
|
4768
4796
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
4769
4797
|
ctx.addIssue({
|
|
4770
|
-
code:
|
|
4798
|
+
code: z206.ZodIssueCode.custom,
|
|
4771
4799
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
4772
4800
|
});
|
|
4773
4801
|
}
|
|
@@ -4776,20 +4804,20 @@ var simulation_voltage_probe = z205.object({
|
|
|
4776
4804
|
expectTypesMatch(true);
|
|
4777
4805
|
|
|
4778
4806
|
// src/simulation/simulation_current_probe.ts
|
|
4779
|
-
import { z as
|
|
4780
|
-
var simulation_current_probe =
|
|
4781
|
-
type:
|
|
4807
|
+
import { z as z207 } from "zod";
|
|
4808
|
+
var simulation_current_probe = z207.object({
|
|
4809
|
+
type: z207.literal("simulation_current_probe"),
|
|
4782
4810
|
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
4783
4811
|
"simulation_current_probe"
|
|
4784
4812
|
),
|
|
4785
|
-
source_component_id:
|
|
4786
|
-
name:
|
|
4787
|
-
positive_source_port_id:
|
|
4788
|
-
negative_source_port_id:
|
|
4789
|
-
positive_source_net_id:
|
|
4790
|
-
negative_source_net_id:
|
|
4791
|
-
subcircuit_id:
|
|
4792
|
-
color:
|
|
4813
|
+
source_component_id: z207.string().optional(),
|
|
4814
|
+
name: z207.string().optional(),
|
|
4815
|
+
positive_source_port_id: z207.string().optional(),
|
|
4816
|
+
negative_source_port_id: z207.string().optional(),
|
|
4817
|
+
positive_source_net_id: z207.string().optional(),
|
|
4818
|
+
negative_source_net_id: z207.string().optional(),
|
|
4819
|
+
subcircuit_id: z207.string().optional(),
|
|
4820
|
+
color: z207.string().optional()
|
|
4793
4821
|
}).describe(
|
|
4794
4822
|
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
4795
4823
|
).superRefine((data, ctx) => {
|
|
@@ -4801,7 +4829,7 @@ var simulation_current_probe = z206.object({
|
|
|
4801
4829
|
const hasNets = hasPositiveNet || hasNegativeNet;
|
|
4802
4830
|
if (hasPorts && hasNets) {
|
|
4803
4831
|
ctx.addIssue({
|
|
4804
|
-
code:
|
|
4832
|
+
code: z207.ZodIssueCode.custom,
|
|
4805
4833
|
message: "Cannot mix port and net connections in a current probe."
|
|
4806
4834
|
});
|
|
4807
4835
|
return;
|
|
@@ -4809,7 +4837,7 @@ var simulation_current_probe = z206.object({
|
|
|
4809
4837
|
if (hasPorts) {
|
|
4810
4838
|
if (!hasPositivePort || !hasNegativePort) {
|
|
4811
4839
|
ctx.addIssue({
|
|
4812
|
-
code:
|
|
4840
|
+
code: z207.ZodIssueCode.custom,
|
|
4813
4841
|
message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
|
|
4814
4842
|
});
|
|
4815
4843
|
}
|
|
@@ -4818,71 +4846,71 @@ var simulation_current_probe = z206.object({
|
|
|
4818
4846
|
if (hasNets) {
|
|
4819
4847
|
if (!hasPositiveNet || !hasNegativeNet) {
|
|
4820
4848
|
ctx.addIssue({
|
|
4821
|
-
code:
|
|
4849
|
+
code: z207.ZodIssueCode.custom,
|
|
4822
4850
|
message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
|
|
4823
4851
|
});
|
|
4824
4852
|
}
|
|
4825
4853
|
return;
|
|
4826
4854
|
}
|
|
4827
4855
|
ctx.addIssue({
|
|
4828
|
-
code:
|
|
4856
|
+
code: z207.ZodIssueCode.custom,
|
|
4829
4857
|
message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
|
|
4830
4858
|
});
|
|
4831
4859
|
});
|
|
4832
4860
|
expectTypesMatch(true);
|
|
4833
4861
|
|
|
4834
4862
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
4835
|
-
import { z as
|
|
4863
|
+
import { z as z208 } from "zod";
|
|
4836
4864
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
4837
|
-
type:
|
|
4865
|
+
type: z208.literal("simulation_unknown_experiment_error"),
|
|
4838
4866
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
4839
4867
|
"simulation_unknown_experiment_error"
|
|
4840
4868
|
),
|
|
4841
|
-
error_type:
|
|
4842
|
-
simulation_experiment_id:
|
|
4843
|
-
subcircuit_id:
|
|
4869
|
+
error_type: z208.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
4870
|
+
simulation_experiment_id: z208.string().optional(),
|
|
4871
|
+
subcircuit_id: z208.string().optional()
|
|
4844
4872
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
4845
4873
|
expectTypesMatch(true);
|
|
4846
4874
|
|
|
4847
4875
|
// src/simulation/simulation_parameter_sweep.ts
|
|
4848
|
-
import { z as
|
|
4849
|
-
var simulation_parameter_type =
|
|
4876
|
+
import { z as z209 } from "zod";
|
|
4877
|
+
var simulation_parameter_type = z209.enum([
|
|
4850
4878
|
"resistance",
|
|
4851
4879
|
"capacitance",
|
|
4852
4880
|
"inductance",
|
|
4853
4881
|
"voltage",
|
|
4854
4882
|
"current"
|
|
4855
4883
|
]);
|
|
4856
|
-
var simulation_parameter_sweep_base =
|
|
4857
|
-
type:
|
|
4884
|
+
var simulation_parameter_sweep_base = z209.object({
|
|
4885
|
+
type: z209.literal("simulation_parameter_sweep"),
|
|
4858
4886
|
simulation_parameter_sweep_id: getZodPrefixedIdWithDefault(
|
|
4859
4887
|
"simulation_parameter_sweep"
|
|
4860
4888
|
),
|
|
4861
|
-
simulation_experiment_id:
|
|
4862
|
-
name:
|
|
4863
|
-
parameter_values:
|
|
4889
|
+
simulation_experiment_id: z209.string(),
|
|
4890
|
+
name: z209.string().optional(),
|
|
4891
|
+
parameter_values: z209.array(z209.number()).min(1),
|
|
4864
4892
|
parameter_unit: simulation_parameter_unit
|
|
4865
4893
|
});
|
|
4866
|
-
var simulation_parameter_sweep =
|
|
4894
|
+
var simulation_parameter_sweep = z209.discriminatedUnion("parameter_type", [
|
|
4867
4895
|
simulation_parameter_sweep_base.extend({
|
|
4868
|
-
parameter_type:
|
|
4869
|
-
resistor_source_component_id:
|
|
4896
|
+
parameter_type: z209.literal("resistance"),
|
|
4897
|
+
resistor_source_component_id: z209.string()
|
|
4870
4898
|
}),
|
|
4871
4899
|
simulation_parameter_sweep_base.extend({
|
|
4872
|
-
parameter_type:
|
|
4873
|
-
capacitor_source_component_id:
|
|
4900
|
+
parameter_type: z209.literal("capacitance"),
|
|
4901
|
+
capacitor_source_component_id: z209.string()
|
|
4874
4902
|
}),
|
|
4875
4903
|
simulation_parameter_sweep_base.extend({
|
|
4876
|
-
parameter_type:
|
|
4877
|
-
inductor_source_component_id:
|
|
4904
|
+
parameter_type: z209.literal("inductance"),
|
|
4905
|
+
inductor_source_component_id: z209.string()
|
|
4878
4906
|
}),
|
|
4879
4907
|
simulation_parameter_sweep_base.extend({
|
|
4880
|
-
parameter_type:
|
|
4881
|
-
source_net_id:
|
|
4908
|
+
parameter_type: z209.literal("voltage"),
|
|
4909
|
+
source_net_id: z209.string()
|
|
4882
4910
|
}),
|
|
4883
4911
|
simulation_parameter_sweep_base.extend({
|
|
4884
|
-
parameter_type:
|
|
4885
|
-
current_source_component_id:
|
|
4912
|
+
parameter_type: z209.literal("current"),
|
|
4913
|
+
current_source_component_id: z209.string()
|
|
4886
4914
|
})
|
|
4887
4915
|
]).describe("Repeats a simulation experiment over component parameter values");
|
|
4888
4916
|
expectTypesMatch(
|
|
@@ -4890,52 +4918,52 @@ expectTypesMatch(
|
|
|
4890
4918
|
);
|
|
4891
4919
|
|
|
4892
4920
|
// src/simulation/simulation_dc_operating_point_voltage.ts
|
|
4893
|
-
import { z as
|
|
4894
|
-
var simulation_dc_operating_point_voltage =
|
|
4895
|
-
type:
|
|
4921
|
+
import { z as z210 } from "zod";
|
|
4922
|
+
var simulation_dc_operating_point_voltage = z210.object({
|
|
4923
|
+
type: z210.literal("simulation_dc_operating_point_voltage"),
|
|
4896
4924
|
simulation_dc_operating_point_voltage_id: getZodPrefixedIdWithDefault(
|
|
4897
4925
|
"simulation_dc_operating_point_voltage"
|
|
4898
4926
|
),
|
|
4899
|
-
simulation_experiment_id:
|
|
4927
|
+
simulation_experiment_id: z210.string(),
|
|
4900
4928
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4901
|
-
simulation_voltage_probe_id:
|
|
4902
|
-
voltage:
|
|
4903
|
-
name:
|
|
4904
|
-
color:
|
|
4929
|
+
simulation_voltage_probe_id: z210.string(),
|
|
4930
|
+
voltage: z210.number(),
|
|
4931
|
+
name: z210.string().optional(),
|
|
4932
|
+
color: z210.string().optional()
|
|
4905
4933
|
});
|
|
4906
4934
|
expectTypesMatch(true);
|
|
4907
4935
|
|
|
4908
4936
|
// src/simulation/simulation_dc_operating_point_current.ts
|
|
4909
|
-
import { z as
|
|
4910
|
-
var simulation_dc_operating_point_current =
|
|
4911
|
-
type:
|
|
4937
|
+
import { z as z211 } from "zod";
|
|
4938
|
+
var simulation_dc_operating_point_current = z211.object({
|
|
4939
|
+
type: z211.literal("simulation_dc_operating_point_current"),
|
|
4912
4940
|
simulation_dc_operating_point_current_id: getZodPrefixedIdWithDefault(
|
|
4913
4941
|
"simulation_dc_operating_point_current"
|
|
4914
4942
|
),
|
|
4915
|
-
simulation_experiment_id:
|
|
4943
|
+
simulation_experiment_id: z211.string(),
|
|
4916
4944
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4917
|
-
simulation_current_probe_id:
|
|
4918
|
-
current:
|
|
4919
|
-
name:
|
|
4920
|
-
color:
|
|
4945
|
+
simulation_current_probe_id: z211.string(),
|
|
4946
|
+
current: z211.number(),
|
|
4947
|
+
name: z211.string().optional(),
|
|
4948
|
+
color: z211.string().optional()
|
|
4921
4949
|
});
|
|
4922
4950
|
expectTypesMatch(true);
|
|
4923
4951
|
|
|
4924
4952
|
// src/simulation/simulation_dc_sweep_voltage_graph.ts
|
|
4925
|
-
import { z as
|
|
4926
|
-
var simulation_dc_sweep_voltage_graph =
|
|
4927
|
-
type:
|
|
4953
|
+
import { z as z212 } from "zod";
|
|
4954
|
+
var simulation_dc_sweep_voltage_graph = z212.object({
|
|
4955
|
+
type: z212.literal("simulation_dc_sweep_voltage_graph"),
|
|
4928
4956
|
simulation_dc_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4929
4957
|
"simulation_dc_sweep_voltage_graph"
|
|
4930
4958
|
),
|
|
4931
|
-
simulation_experiment_id:
|
|
4959
|
+
simulation_experiment_id: z212.string(),
|
|
4932
4960
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4933
|
-
simulation_voltage_probe_id:
|
|
4934
|
-
sweep_values:
|
|
4961
|
+
simulation_voltage_probe_id: z212.string(),
|
|
4962
|
+
sweep_values: z212.array(z212.number()),
|
|
4935
4963
|
sweep_unit: simulation_dc_sweep_unit,
|
|
4936
|
-
voltage_levels:
|
|
4937
|
-
name:
|
|
4938
|
-
color:
|
|
4964
|
+
voltage_levels: z212.array(z212.number()),
|
|
4965
|
+
name: z212.string().optional(),
|
|
4966
|
+
color: z212.string().optional()
|
|
4939
4967
|
}).refine(
|
|
4940
4968
|
(graph) => graph.sweep_values.length === graph.voltage_levels.length,
|
|
4941
4969
|
{
|
|
@@ -4945,20 +4973,20 @@ var simulation_dc_sweep_voltage_graph = z211.object({
|
|
|
4945
4973
|
expectTypesMatch(true);
|
|
4946
4974
|
|
|
4947
4975
|
// src/simulation/simulation_dc_sweep_current_graph.ts
|
|
4948
|
-
import { z as
|
|
4949
|
-
var simulation_dc_sweep_current_graph =
|
|
4950
|
-
type:
|
|
4976
|
+
import { z as z213 } from "zod";
|
|
4977
|
+
var simulation_dc_sweep_current_graph = z213.object({
|
|
4978
|
+
type: z213.literal("simulation_dc_sweep_current_graph"),
|
|
4951
4979
|
simulation_dc_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4952
4980
|
"simulation_dc_sweep_current_graph"
|
|
4953
4981
|
),
|
|
4954
|
-
simulation_experiment_id:
|
|
4982
|
+
simulation_experiment_id: z213.string(),
|
|
4955
4983
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4956
|
-
simulation_current_probe_id:
|
|
4957
|
-
sweep_values:
|
|
4984
|
+
simulation_current_probe_id: z213.string(),
|
|
4985
|
+
sweep_values: z213.array(z213.number()),
|
|
4958
4986
|
sweep_unit: simulation_dc_sweep_unit,
|
|
4959
|
-
current_levels:
|
|
4960
|
-
name:
|
|
4961
|
-
color:
|
|
4987
|
+
current_levels: z213.array(z213.number()),
|
|
4988
|
+
name: z213.string().optional(),
|
|
4989
|
+
color: z213.string().optional()
|
|
4962
4990
|
}).refine(
|
|
4963
4991
|
(graph) => graph.sweep_values.length === graph.current_levels.length,
|
|
4964
4992
|
{
|
|
@@ -4968,29 +4996,29 @@ var simulation_dc_sweep_current_graph = z212.object({
|
|
|
4968
4996
|
expectTypesMatch(true);
|
|
4969
4997
|
|
|
4970
4998
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
4971
|
-
import { z as
|
|
4999
|
+
import { z as z215 } from "zod";
|
|
4972
5000
|
|
|
4973
5001
|
// src/simulation/simulation_complex_sample.ts
|
|
4974
|
-
import { z as
|
|
4975
|
-
var simulation_complex_sample =
|
|
4976
|
-
re:
|
|
4977
|
-
im:
|
|
5002
|
+
import { z as z214 } from "zod";
|
|
5003
|
+
var simulation_complex_sample = z214.object({
|
|
5004
|
+
re: z214.number(),
|
|
5005
|
+
im: z214.number()
|
|
4978
5006
|
});
|
|
4979
5007
|
expectTypesMatch(true);
|
|
4980
5008
|
|
|
4981
5009
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
4982
|
-
var simulation_ac_sweep_voltage_graph =
|
|
4983
|
-
type:
|
|
5010
|
+
var simulation_ac_sweep_voltage_graph = z215.object({
|
|
5011
|
+
type: z215.literal("simulation_ac_sweep_voltage_graph"),
|
|
4984
5012
|
simulation_ac_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4985
5013
|
"simulation_ac_sweep_voltage_graph"
|
|
4986
5014
|
),
|
|
4987
|
-
simulation_experiment_id:
|
|
5015
|
+
simulation_experiment_id: z215.string(),
|
|
4988
5016
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4989
|
-
simulation_voltage_probe_id:
|
|
4990
|
-
frequencies_hz:
|
|
4991
|
-
complex_voltages:
|
|
4992
|
-
name:
|
|
4993
|
-
color:
|
|
5017
|
+
simulation_voltage_probe_id: z215.string(),
|
|
5018
|
+
frequencies_hz: z215.array(z215.number()),
|
|
5019
|
+
complex_voltages: z215.array(simulation_complex_sample),
|
|
5020
|
+
name: z215.string().optional(),
|
|
5021
|
+
color: z215.string().optional()
|
|
4994
5022
|
}).refine(
|
|
4995
5023
|
(graph) => graph.frequencies_hz.length === graph.complex_voltages.length,
|
|
4996
5024
|
{
|
|
@@ -5000,19 +5028,19 @@ var simulation_ac_sweep_voltage_graph = z214.object({
|
|
|
5000
5028
|
expectTypesMatch(true);
|
|
5001
5029
|
|
|
5002
5030
|
// src/simulation/simulation_ac_sweep_current_graph.ts
|
|
5003
|
-
import { z as
|
|
5004
|
-
var simulation_ac_sweep_current_graph =
|
|
5005
|
-
type:
|
|
5031
|
+
import { z as z216 } from "zod";
|
|
5032
|
+
var simulation_ac_sweep_current_graph = z216.object({
|
|
5033
|
+
type: z216.literal("simulation_ac_sweep_current_graph"),
|
|
5006
5034
|
simulation_ac_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
5007
5035
|
"simulation_ac_sweep_current_graph"
|
|
5008
5036
|
),
|
|
5009
|
-
simulation_experiment_id:
|
|
5037
|
+
simulation_experiment_id: z216.string(),
|
|
5010
5038
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
5011
|
-
simulation_current_probe_id:
|
|
5012
|
-
frequencies_hz:
|
|
5013
|
-
complex_currents:
|
|
5014
|
-
name:
|
|
5015
|
-
color:
|
|
5039
|
+
simulation_current_probe_id: z216.string(),
|
|
5040
|
+
frequencies_hz: z216.array(z216.number()),
|
|
5041
|
+
complex_currents: z216.array(simulation_complex_sample),
|
|
5042
|
+
name: z216.string().optional(),
|
|
5043
|
+
color: z216.string().optional()
|
|
5016
5044
|
}).refine(
|
|
5017
5045
|
(graph) => graph.frequencies_hz.length === graph.complex_currents.length,
|
|
5018
5046
|
{
|
|
@@ -5022,52 +5050,52 @@ var simulation_ac_sweep_current_graph = z215.object({
|
|
|
5022
5050
|
expectTypesMatch(true);
|
|
5023
5051
|
|
|
5024
5052
|
// src/simulation/simulation_op_amp.ts
|
|
5025
|
-
import { z as
|
|
5026
|
-
var simulation_op_amp =
|
|
5027
|
-
type:
|
|
5053
|
+
import { z as z217 } from "zod";
|
|
5054
|
+
var simulation_op_amp = z217.object({
|
|
5055
|
+
type: z217.literal("simulation_op_amp"),
|
|
5028
5056
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
5029
|
-
source_component_id:
|
|
5030
|
-
inverting_input_source_port_id:
|
|
5031
|
-
non_inverting_input_source_port_id:
|
|
5032
|
-
output_source_port_id:
|
|
5033
|
-
positive_supply_source_port_id:
|
|
5034
|
-
negative_supply_source_port_id:
|
|
5057
|
+
source_component_id: z217.string().optional(),
|
|
5058
|
+
inverting_input_source_port_id: z217.string(),
|
|
5059
|
+
non_inverting_input_source_port_id: z217.string(),
|
|
5060
|
+
output_source_port_id: z217.string(),
|
|
5061
|
+
positive_supply_source_port_id: z217.string(),
|
|
5062
|
+
negative_supply_source_port_id: z217.string()
|
|
5035
5063
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
5036
5064
|
expectTypesMatch(true);
|
|
5037
5065
|
|
|
5038
5066
|
// src/simulation/simulation_spice_subcircuit.ts
|
|
5039
|
-
import { z as
|
|
5040
|
-
var simulation_spice_subcircuit =
|
|
5041
|
-
type:
|
|
5067
|
+
import { z as z218 } from "zod";
|
|
5068
|
+
var simulation_spice_subcircuit = z218.object({
|
|
5069
|
+
type: z218.literal("simulation_spice_subcircuit"),
|
|
5042
5070
|
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
5043
5071
|
"simulation_spice_subcircuit"
|
|
5044
5072
|
),
|
|
5045
|
-
source_component_id:
|
|
5046
|
-
spice_pin_to_source_port_map:
|
|
5047
|
-
subcircuit_source:
|
|
5073
|
+
source_component_id: z218.string(),
|
|
5074
|
+
spice_pin_to_source_port_map: z218.record(z218.string(), z218.string()),
|
|
5075
|
+
subcircuit_source: z218.string()
|
|
5048
5076
|
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
5049
5077
|
expectTypesMatch(
|
|
5050
5078
|
true
|
|
5051
5079
|
);
|
|
5052
5080
|
|
|
5053
5081
|
// src/simulation/simulation_oscilloscope_trace.ts
|
|
5054
|
-
import { z as
|
|
5082
|
+
import { z as z219 } from "zod";
|
|
5055
5083
|
var hasValue = (value) => value !== void 0;
|
|
5056
|
-
var simulation_oscilloscope_trace =
|
|
5057
|
-
type:
|
|
5084
|
+
var simulation_oscilloscope_trace = z219.object({
|
|
5085
|
+
type: z219.literal("simulation_oscilloscope_trace"),
|
|
5058
5086
|
simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
|
|
5059
5087
|
"simulation_oscilloscope_trace"
|
|
5060
5088
|
),
|
|
5061
|
-
simulation_transient_voltage_graph_id:
|
|
5062
|
-
simulation_transient_current_graph_id:
|
|
5063
|
-
simulation_voltage_probe_id:
|
|
5064
|
-
simulation_current_probe_id:
|
|
5065
|
-
display_name:
|
|
5066
|
-
color:
|
|
5067
|
-
display_center_value:
|
|
5068
|
-
display_center_offset_divs:
|
|
5069
|
-
volts_per_div:
|
|
5070
|
-
amps_per_div:
|
|
5089
|
+
simulation_transient_voltage_graph_id: z219.string().optional(),
|
|
5090
|
+
simulation_transient_current_graph_id: z219.string().optional(),
|
|
5091
|
+
simulation_voltage_probe_id: z219.string().optional(),
|
|
5092
|
+
simulation_current_probe_id: z219.string().optional(),
|
|
5093
|
+
display_name: z219.string().optional(),
|
|
5094
|
+
color: z219.string().optional(),
|
|
5095
|
+
display_center_value: z219.number().optional(),
|
|
5096
|
+
display_center_offset_divs: z219.number().optional(),
|
|
5097
|
+
volts_per_div: z219.number().positive().optional(),
|
|
5098
|
+
amps_per_div: z219.number().positive().optional()
|
|
5071
5099
|
}).describe(
|
|
5072
5100
|
"Defines how a simulation measurement is rendered as an oscilloscope-style trace."
|
|
5073
5101
|
).superRefine((data, ctx) => {
|
|
@@ -5081,19 +5109,19 @@ var simulation_oscilloscope_trace = z218.object({
|
|
|
5081
5109
|
].filter(hasValue).length;
|
|
5082
5110
|
if (voltageReferences + currentReferences !== 1) {
|
|
5083
5111
|
ctx.addIssue({
|
|
5084
|
-
code:
|
|
5112
|
+
code: z219.ZodIssueCode.custom,
|
|
5085
5113
|
message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
|
|
5086
5114
|
});
|
|
5087
5115
|
}
|
|
5088
5116
|
if (voltageReferences > 0 && data.amps_per_div !== void 0) {
|
|
5089
5117
|
ctx.addIssue({
|
|
5090
|
-
code:
|
|
5118
|
+
code: z219.ZodIssueCode.custom,
|
|
5091
5119
|
message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
|
|
5092
5120
|
});
|
|
5093
5121
|
}
|
|
5094
5122
|
if (currentReferences > 0 && data.volts_per_div !== void 0) {
|
|
5095
5123
|
ctx.addIssue({
|
|
5096
|
-
code:
|
|
5124
|
+
code: z219.ZodIssueCode.custom,
|
|
5097
5125
|
message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
|
|
5098
5126
|
});
|
|
5099
5127
|
}
|
|
@@ -5101,8 +5129,8 @@ var simulation_oscilloscope_trace = z218.object({
|
|
|
5101
5129
|
expectTypesMatch(true);
|
|
5102
5130
|
|
|
5103
5131
|
// src/any_circuit_element.ts
|
|
5104
|
-
import { z as
|
|
5105
|
-
var any_circuit_element =
|
|
5132
|
+
import { z as z220 } from "zod";
|
|
5133
|
+
var any_circuit_element = z220.union([
|
|
5106
5134
|
source_runtime_error,
|
|
5107
5135
|
source_trace,
|
|
5108
5136
|
source_bus,
|
|
@@ -5258,6 +5286,7 @@ var any_circuit_element = z219.union([
|
|
|
5258
5286
|
schematic_table,
|
|
5259
5287
|
schematic_table_cell,
|
|
5260
5288
|
cad_component,
|
|
5289
|
+
cad_cable,
|
|
5261
5290
|
cad_collision_error,
|
|
5262
5291
|
simulation_voltage_source,
|
|
5263
5292
|
simulation_current_source,
|
|
@@ -5292,6 +5321,7 @@ export {
|
|
|
5292
5321
|
battery_capacity,
|
|
5293
5322
|
brep_shape,
|
|
5294
5323
|
cadModelDefaultDirectionMap,
|
|
5324
|
+
cad_cable,
|
|
5295
5325
|
cad_collision_error,
|
|
5296
5326
|
cad_component,
|
|
5297
5327
|
cad_model_axis_directions,
|