circuit-json 0.0.507 → 0.0.509
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 +12 -0
- package/dist/index.d.mts +273 -1
- package/dist/index.mjs +273 -243
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -417,6 +417,18 @@ expectTypesMatch(true);
|
|
|
417
417
|
// src/source/properties/source_pin_attributes.ts
|
|
418
418
|
import { z as z25 } from "zod";
|
|
419
419
|
var source_pin_attributes = z25.object({
|
|
420
|
+
is_input: z25.boolean().optional(),
|
|
421
|
+
is_output: z25.boolean().optional(),
|
|
422
|
+
is_bidirectional: z25.boolean().optional(),
|
|
423
|
+
is_passive: z25.boolean().optional(),
|
|
424
|
+
can_use_tri_state: z25.boolean().optional(),
|
|
425
|
+
is_using_tri_state: z25.boolean().optional(),
|
|
426
|
+
can_use_open_collector: z25.boolean().optional(),
|
|
427
|
+
is_using_open_collector: z25.boolean().optional(),
|
|
428
|
+
can_use_open_emitter: z25.boolean().optional(),
|
|
429
|
+
is_using_open_emitter: z25.boolean().optional(),
|
|
430
|
+
is_gpio: z25.boolean().optional(),
|
|
431
|
+
highlight_color: z25.string().optional(),
|
|
420
432
|
must_be_connected: z25.boolean().optional(),
|
|
421
433
|
provides_power: z25.boolean().optional(),
|
|
422
434
|
requires_power: z25.boolean().optional(),
|
|
@@ -4162,10 +4174,26 @@ var cad_component = z188.object({
|
|
|
4162
4174
|
}).describe("Defines CAD geometry, optionally associated with a PCB component");
|
|
4163
4175
|
expectTypesMatch(true);
|
|
4164
4176
|
|
|
4165
|
-
// src/
|
|
4177
|
+
// src/cad/cad_collision_error.ts
|
|
4166
4178
|
import { z as z189 } from "zod";
|
|
4167
|
-
var
|
|
4168
|
-
|
|
4179
|
+
var cad_collision_error = base_circuit_json_error.extend({
|
|
4180
|
+
type: z189.literal("cad_collision_error"),
|
|
4181
|
+
cad_collision_error_id: getZodPrefixedIdWithDefault("cad_collision_error"),
|
|
4182
|
+
error_type: z189.literal("cad_collision_error").default("cad_collision_error"),
|
|
4183
|
+
cad_component_ids: z189.array(z189.string()).min(1),
|
|
4184
|
+
pcb_component_ids: z189.array(z189.string()).optional(),
|
|
4185
|
+
source_component_ids: z189.array(z189.string()).min(1),
|
|
4186
|
+
intersection_area_mm2: z189.number().finite().nonnegative(),
|
|
4187
|
+
threshold_area_mm2: z189.number().finite().nonnegative()
|
|
4188
|
+
}).describe(
|
|
4189
|
+
"An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies."
|
|
4190
|
+
);
|
|
4191
|
+
expectTypesMatch(true);
|
|
4192
|
+
|
|
4193
|
+
// src/simulation/simulation_voltage_source.ts
|
|
4194
|
+
import { z as z190 } from "zod";
|
|
4195
|
+
var wave_shape = z190.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
4196
|
+
var percentage = z190.union([z190.string(), z190.number()]).transform((val) => {
|
|
4169
4197
|
if (typeof val === "string") {
|
|
4170
4198
|
if (val.endsWith("%")) {
|
|
4171
4199
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -4174,32 +4202,32 @@ var percentage = z189.union([z189.string(), z189.number()]).transform((val) => {
|
|
|
4174
4202
|
}
|
|
4175
4203
|
return val;
|
|
4176
4204
|
}).pipe(
|
|
4177
|
-
|
|
4205
|
+
z190.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
4178
4206
|
);
|
|
4179
|
-
var simulation_dc_voltage_source =
|
|
4180
|
-
type:
|
|
4207
|
+
var simulation_dc_voltage_source = z190.object({
|
|
4208
|
+
type: z190.literal("simulation_voltage_source"),
|
|
4181
4209
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
4182
4210
|
"simulation_voltage_source"
|
|
4183
4211
|
),
|
|
4184
|
-
is_dc_source:
|
|
4185
|
-
positive_source_port_id:
|
|
4186
|
-
negative_source_port_id:
|
|
4187
|
-
positive_source_net_id:
|
|
4188
|
-
negative_source_net_id:
|
|
4212
|
+
is_dc_source: z190.literal(true).optional().default(true),
|
|
4213
|
+
positive_source_port_id: z190.string().optional(),
|
|
4214
|
+
negative_source_port_id: z190.string().optional(),
|
|
4215
|
+
positive_source_net_id: z190.string().optional(),
|
|
4216
|
+
negative_source_net_id: z190.string().optional(),
|
|
4189
4217
|
voltage,
|
|
4190
4218
|
ac_magnitude: voltage.optional(),
|
|
4191
4219
|
ac_phase: rotation.optional()
|
|
4192
4220
|
}).describe("Defines a DC voltage source for simulation");
|
|
4193
|
-
var simulation_ac_voltage_source =
|
|
4194
|
-
type:
|
|
4221
|
+
var simulation_ac_voltage_source = z190.object({
|
|
4222
|
+
type: z190.literal("simulation_voltage_source"),
|
|
4195
4223
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
4196
4224
|
"simulation_voltage_source"
|
|
4197
4225
|
),
|
|
4198
|
-
is_dc_source:
|
|
4199
|
-
terminal1_source_port_id:
|
|
4200
|
-
terminal2_source_port_id:
|
|
4201
|
-
terminal1_source_net_id:
|
|
4202
|
-
terminal2_source_net_id:
|
|
4226
|
+
is_dc_source: z190.literal(false),
|
|
4227
|
+
terminal1_source_port_id: z190.string().optional(),
|
|
4228
|
+
terminal2_source_port_id: z190.string().optional(),
|
|
4229
|
+
terminal1_source_net_id: z190.string().optional(),
|
|
4230
|
+
terminal2_source_net_id: z190.string().optional(),
|
|
4203
4231
|
voltage: voltage.optional(),
|
|
4204
4232
|
frequency: frequency.optional(),
|
|
4205
4233
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -4214,14 +4242,14 @@ var simulation_ac_voltage_source = z189.object({
|
|
|
4214
4242
|
ac_magnitude: voltage.optional(),
|
|
4215
4243
|
ac_phase: rotation.optional()
|
|
4216
4244
|
}).describe("Defines an AC voltage source for simulation");
|
|
4217
|
-
var simulation_voltage_source =
|
|
4245
|
+
var simulation_voltage_source = z190.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
4218
4246
|
expectTypesMatch(true);
|
|
4219
4247
|
expectTypesMatch(true);
|
|
4220
4248
|
expectTypesMatch(true);
|
|
4221
4249
|
|
|
4222
4250
|
// src/simulation/simulation_current_source.ts
|
|
4223
|
-
import { z as
|
|
4224
|
-
var percentage2 =
|
|
4251
|
+
import { z as z191 } from "zod";
|
|
4252
|
+
var percentage2 = z191.union([z191.string(), z191.number()]).transform((val) => {
|
|
4225
4253
|
if (typeof val === "string") {
|
|
4226
4254
|
if (val.endsWith("%")) {
|
|
4227
4255
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -4230,32 +4258,32 @@ var percentage2 = z190.union([z190.string(), z190.number()]).transform((val) =>
|
|
|
4230
4258
|
}
|
|
4231
4259
|
return val;
|
|
4232
4260
|
}).pipe(
|
|
4233
|
-
|
|
4261
|
+
z191.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
4234
4262
|
);
|
|
4235
|
-
var simulation_dc_current_source =
|
|
4236
|
-
type:
|
|
4263
|
+
var simulation_dc_current_source = z191.object({
|
|
4264
|
+
type: z191.literal("simulation_current_source"),
|
|
4237
4265
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
4238
4266
|
"simulation_current_source"
|
|
4239
4267
|
),
|
|
4240
|
-
is_dc_source:
|
|
4241
|
-
positive_source_port_id:
|
|
4242
|
-
negative_source_port_id:
|
|
4243
|
-
positive_source_net_id:
|
|
4244
|
-
negative_source_net_id:
|
|
4268
|
+
is_dc_source: z191.literal(true).optional().default(true),
|
|
4269
|
+
positive_source_port_id: z191.string().optional(),
|
|
4270
|
+
negative_source_port_id: z191.string().optional(),
|
|
4271
|
+
positive_source_net_id: z191.string().optional(),
|
|
4272
|
+
negative_source_net_id: z191.string().optional(),
|
|
4245
4273
|
current,
|
|
4246
4274
|
ac_magnitude: current.optional(),
|
|
4247
4275
|
ac_phase: rotation.optional()
|
|
4248
4276
|
}).describe("Defines a DC current source for simulation");
|
|
4249
|
-
var simulation_ac_current_source =
|
|
4250
|
-
type:
|
|
4277
|
+
var simulation_ac_current_source = z191.object({
|
|
4278
|
+
type: z191.literal("simulation_current_source"),
|
|
4251
4279
|
simulation_current_source_id: getZodPrefixedIdWithDefault(
|
|
4252
4280
|
"simulation_current_source"
|
|
4253
4281
|
),
|
|
4254
|
-
is_dc_source:
|
|
4255
|
-
terminal1_source_port_id:
|
|
4256
|
-
terminal2_source_port_id:
|
|
4257
|
-
terminal1_source_net_id:
|
|
4258
|
-
terminal2_source_net_id:
|
|
4282
|
+
is_dc_source: z191.literal(false),
|
|
4283
|
+
terminal1_source_port_id: z191.string().optional(),
|
|
4284
|
+
terminal2_source_port_id: z191.string().optional(),
|
|
4285
|
+
terminal1_source_net_id: z191.string().optional(),
|
|
4286
|
+
terminal2_source_net_id: z191.string().optional(),
|
|
4259
4287
|
current: current.optional(),
|
|
4260
4288
|
frequency: frequency.optional(),
|
|
4261
4289
|
peak_to_peak_current: current.optional(),
|
|
@@ -4265,58 +4293,58 @@ var simulation_ac_current_source = z190.object({
|
|
|
4265
4293
|
ac_magnitude: current.optional(),
|
|
4266
4294
|
ac_phase: rotation.optional()
|
|
4267
4295
|
}).describe("Defines an AC current source for simulation");
|
|
4268
|
-
var simulation_current_source =
|
|
4296
|
+
var simulation_current_source = z191.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
|
|
4269
4297
|
expectTypesMatch(true);
|
|
4270
4298
|
expectTypesMatch(true);
|
|
4271
4299
|
expectTypesMatch(true);
|
|
4272
4300
|
|
|
4273
4301
|
// src/simulation/simulation_experiment.ts
|
|
4274
|
-
import { z as
|
|
4302
|
+
import { z as z193 } from "zod";
|
|
4275
4303
|
|
|
4276
4304
|
// src/simulation/simulation_units.ts
|
|
4277
|
-
import { z as
|
|
4278
|
-
var simulation_dc_sweep_unit =
|
|
4305
|
+
import { z as z192 } from "zod";
|
|
4306
|
+
var simulation_dc_sweep_unit = z192.custom(
|
|
4279
4307
|
(dcSweepUnit) => dcSweepUnit === "V" || dcSweepUnit === "A"
|
|
4280
4308
|
);
|
|
4281
|
-
var simulation_parameter_unit =
|
|
4309
|
+
var simulation_parameter_unit = z192.custom(
|
|
4282
4310
|
(parameterUnit) => parameterUnit === "\u03A9" || parameterUnit === "F" || parameterUnit === "H" || parameterUnit === "V" || parameterUnit === "A"
|
|
4283
4311
|
);
|
|
4284
4312
|
|
|
4285
4313
|
// src/simulation/simulation_experiment.ts
|
|
4286
|
-
var experiment_type =
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4314
|
+
var experiment_type = z193.union([
|
|
4315
|
+
z193.literal("spice_dc_sweep"),
|
|
4316
|
+
z193.literal("spice_dc_operating_point"),
|
|
4317
|
+
z193.literal("spice_transient_analysis"),
|
|
4318
|
+
z193.literal("spice_ac_analysis")
|
|
4291
4319
|
]);
|
|
4292
|
-
var spice_simulation_options =
|
|
4293
|
-
method:
|
|
4294
|
-
reltol:
|
|
4295
|
-
abstol:
|
|
4296
|
-
vntol:
|
|
4320
|
+
var spice_simulation_options = z193.object({
|
|
4321
|
+
method: z193.enum(["trap", "gear"]).optional(),
|
|
4322
|
+
reltol: z193.union([z193.number(), z193.string()]).optional(),
|
|
4323
|
+
abstol: z193.union([z193.number(), z193.string()]).optional(),
|
|
4324
|
+
vntol: z193.union([z193.number(), z193.string()]).optional()
|
|
4297
4325
|
}).describe("SPICE solver options for a simulation experiment");
|
|
4298
|
-
var simulation_experiment =
|
|
4299
|
-
type:
|
|
4326
|
+
var simulation_experiment = z193.object({
|
|
4327
|
+
type: z193.literal("simulation_experiment"),
|
|
4300
4328
|
simulation_experiment_id: getZodPrefixedIdWithDefault(
|
|
4301
4329
|
"simulation_experiment"
|
|
4302
4330
|
),
|
|
4303
|
-
name:
|
|
4331
|
+
name: z193.string(),
|
|
4304
4332
|
experiment_type,
|
|
4305
4333
|
time_per_step: duration_ms.optional(),
|
|
4306
4334
|
start_time_ms: ms.optional(),
|
|
4307
4335
|
end_time_ms: ms.optional(),
|
|
4308
4336
|
spice_options: spice_simulation_options.optional(),
|
|
4309
|
-
dc_sweep_voltage_source_id:
|
|
4310
|
-
dc_sweep_current_source_id:
|
|
4311
|
-
dc_sweep_start:
|
|
4312
|
-
dc_sweep_stop:
|
|
4313
|
-
dc_sweep_step:
|
|
4337
|
+
dc_sweep_voltage_source_id: z193.string().optional(),
|
|
4338
|
+
dc_sweep_current_source_id: z193.string().optional(),
|
|
4339
|
+
dc_sweep_start: z193.number().optional(),
|
|
4340
|
+
dc_sweep_stop: z193.number().optional(),
|
|
4341
|
+
dc_sweep_step: z193.number().refine((dcSweepStep) => dcSweepStep !== 0).optional(),
|
|
4314
4342
|
dc_sweep_unit: simulation_dc_sweep_unit.optional(),
|
|
4315
|
-
ac_sweep_type:
|
|
4316
|
-
ac_samples_per_interval:
|
|
4317
|
-
ac_sample_count:
|
|
4318
|
-
ac_start_frequency_hz:
|
|
4319
|
-
ac_stop_frequency_hz:
|
|
4343
|
+
ac_sweep_type: z193.enum(["linear", "decade", "octave"]).optional(),
|
|
4344
|
+
ac_samples_per_interval: z193.number().int().positive().optional(),
|
|
4345
|
+
ac_sample_count: z193.number().int().positive().optional(),
|
|
4346
|
+
ac_start_frequency_hz: z193.number().positive().optional(),
|
|
4347
|
+
ac_stop_frequency_hz: z193.number().positive().optional()
|
|
4320
4348
|
}).superRefine((experiment, context) => {
|
|
4321
4349
|
if (experiment.experiment_type === "spice_dc_sweep") {
|
|
4322
4350
|
const requiredFields = [
|
|
@@ -4328,7 +4356,7 @@ var simulation_experiment = z192.object({
|
|
|
4328
4356
|
for (const field of requiredFields) {
|
|
4329
4357
|
if (experiment[field] === void 0) {
|
|
4330
4358
|
context.addIssue({
|
|
4331
|
-
code:
|
|
4359
|
+
code: z193.ZodIssueCode.custom,
|
|
4332
4360
|
path: [field],
|
|
4333
4361
|
message: `${field} is required for a DC sweep`
|
|
4334
4362
|
});
|
|
@@ -4338,7 +4366,7 @@ var simulation_experiment = z192.object({
|
|
|
4338
4366
|
const hasCurrentSource = experiment.dc_sweep_current_source_id !== void 0;
|
|
4339
4367
|
if (hasVoltageSource === hasCurrentSource) {
|
|
4340
4368
|
context.addIssue({
|
|
4341
|
-
code:
|
|
4369
|
+
code: z193.ZodIssueCode.custom,
|
|
4342
4370
|
path: ["dc_sweep_voltage_source_id"],
|
|
4343
4371
|
message: "Exactly one DC sweep voltage or current source ID is required"
|
|
4344
4372
|
});
|
|
@@ -4347,35 +4375,35 @@ var simulation_experiment = z192.object({
|
|
|
4347
4375
|
if (experiment.experiment_type === "spice_ac_analysis") {
|
|
4348
4376
|
if (experiment.ac_sweep_type === void 0) {
|
|
4349
4377
|
context.addIssue({
|
|
4350
|
-
code:
|
|
4378
|
+
code: z193.ZodIssueCode.custom,
|
|
4351
4379
|
path: ["ac_sweep_type"],
|
|
4352
4380
|
message: "ac_sweep_type is required for an AC analysis"
|
|
4353
4381
|
});
|
|
4354
4382
|
}
|
|
4355
4383
|
if (experiment.ac_start_frequency_hz === void 0) {
|
|
4356
4384
|
context.addIssue({
|
|
4357
|
-
code:
|
|
4385
|
+
code: z193.ZodIssueCode.custom,
|
|
4358
4386
|
path: ["ac_start_frequency_hz"],
|
|
4359
4387
|
message: "ac_start_frequency_hz is required for an AC analysis"
|
|
4360
4388
|
});
|
|
4361
4389
|
}
|
|
4362
4390
|
if (experiment.ac_stop_frequency_hz === void 0) {
|
|
4363
4391
|
context.addIssue({
|
|
4364
|
-
code:
|
|
4392
|
+
code: z193.ZodIssueCode.custom,
|
|
4365
4393
|
path: ["ac_stop_frequency_hz"],
|
|
4366
4394
|
message: "ac_stop_frequency_hz is required for an AC analysis"
|
|
4367
4395
|
});
|
|
4368
4396
|
}
|
|
4369
4397
|
if (experiment.ac_sweep_type === "linear" && experiment.ac_sample_count === void 0) {
|
|
4370
4398
|
context.addIssue({
|
|
4371
|
-
code:
|
|
4399
|
+
code: z193.ZodIssueCode.custom,
|
|
4372
4400
|
path: ["ac_sample_count"],
|
|
4373
4401
|
message: "ac_sample_count is required for a linear AC analysis"
|
|
4374
4402
|
});
|
|
4375
4403
|
}
|
|
4376
4404
|
if ((experiment.ac_sweep_type === "decade" || experiment.ac_sweep_type === "octave") && experiment.ac_samples_per_interval === void 0) {
|
|
4377
4405
|
context.addIssue({
|
|
4378
|
-
code:
|
|
4406
|
+
code: z193.ZodIssueCode.custom,
|
|
4379
4407
|
path: ["ac_samples_per_interval"],
|
|
4380
4408
|
message: "ac_samples_per_interval is required for decade and octave AC analyses"
|
|
4381
4409
|
});
|
|
@@ -4385,87 +4413,87 @@ var simulation_experiment = z192.object({
|
|
|
4385
4413
|
expectTypesMatch(true);
|
|
4386
4414
|
|
|
4387
4415
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4388
|
-
import { z as
|
|
4416
|
+
import { z as z195 } from "zod";
|
|
4389
4417
|
|
|
4390
4418
|
// src/simulation/simulation_parameter_sweep_coordinate.ts
|
|
4391
|
-
import { z as
|
|
4392
|
-
var simulation_parameter_sweep_coordinate =
|
|
4393
|
-
simulation_parameter_sweep_id:
|
|
4394
|
-
sweep_index:
|
|
4395
|
-
parameter_value:
|
|
4419
|
+
import { z as z194 } from "zod";
|
|
4420
|
+
var simulation_parameter_sweep_coordinate = z194.object({
|
|
4421
|
+
simulation_parameter_sweep_id: z194.string(),
|
|
4422
|
+
sweep_index: z194.number().int().nonnegative(),
|
|
4423
|
+
parameter_value: z194.number(),
|
|
4396
4424
|
parameter_unit: simulation_parameter_unit
|
|
4397
4425
|
});
|
|
4398
4426
|
expectTypesMatch(true);
|
|
4399
4427
|
|
|
4400
4428
|
// src/simulation/simulation_transient_voltage_graph.ts
|
|
4401
|
-
var simulation_transient_voltage_graph =
|
|
4402
|
-
type:
|
|
4429
|
+
var simulation_transient_voltage_graph = z195.object({
|
|
4430
|
+
type: z195.literal("simulation_transient_voltage_graph"),
|
|
4403
4431
|
simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4404
4432
|
"simulation_transient_voltage_graph"
|
|
4405
4433
|
),
|
|
4406
|
-
simulation_experiment_id:
|
|
4434
|
+
simulation_experiment_id: z195.string(),
|
|
4407
4435
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4408
|
-
timestamps_ms:
|
|
4409
|
-
voltage_levels:
|
|
4410
|
-
source_component_id:
|
|
4411
|
-
subcircuit_connectivity_map_key:
|
|
4436
|
+
timestamps_ms: z195.array(z195.number()).optional(),
|
|
4437
|
+
voltage_levels: z195.array(z195.number()),
|
|
4438
|
+
source_component_id: z195.string().optional(),
|
|
4439
|
+
subcircuit_connectivity_map_key: z195.string().optional(),
|
|
4412
4440
|
time_per_step: duration_ms,
|
|
4413
4441
|
start_time_ms: ms,
|
|
4414
4442
|
end_time_ms: ms,
|
|
4415
|
-
name:
|
|
4416
|
-
color:
|
|
4443
|
+
name: z195.string().optional(),
|
|
4444
|
+
color: z195.string().optional()
|
|
4417
4445
|
}).describe("Stores voltage measurements over time for a simulation");
|
|
4418
4446
|
expectTypesMatch(true);
|
|
4419
4447
|
|
|
4420
4448
|
// src/simulation/simulation_transient_current_graph.ts
|
|
4421
|
-
import { z as
|
|
4422
|
-
var simulation_transient_current_graph =
|
|
4423
|
-
type:
|
|
4449
|
+
import { z as z196 } from "zod";
|
|
4450
|
+
var simulation_transient_current_graph = z196.object({
|
|
4451
|
+
type: z196.literal("simulation_transient_current_graph"),
|
|
4424
4452
|
simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4425
4453
|
"simulation_transient_current_graph"
|
|
4426
4454
|
),
|
|
4427
|
-
simulation_experiment_id:
|
|
4455
|
+
simulation_experiment_id: z196.string(),
|
|
4428
4456
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4429
|
-
timestamps_ms:
|
|
4430
|
-
current_levels:
|
|
4431
|
-
source_component_id:
|
|
4432
|
-
subcircuit_connectivity_map_key:
|
|
4457
|
+
timestamps_ms: z196.array(z196.number()).optional(),
|
|
4458
|
+
current_levels: z196.array(z196.number()),
|
|
4459
|
+
source_component_id: z196.string().optional(),
|
|
4460
|
+
subcircuit_connectivity_map_key: z196.string().optional(),
|
|
4433
4461
|
time_per_step: duration_ms,
|
|
4434
4462
|
start_time_ms: ms,
|
|
4435
4463
|
end_time_ms: ms,
|
|
4436
|
-
name:
|
|
4437
|
-
color:
|
|
4464
|
+
name: z196.string().optional(),
|
|
4465
|
+
color: z196.string().optional()
|
|
4438
4466
|
}).describe("Stores current measurements over time for a simulation");
|
|
4439
4467
|
expectTypesMatch(true);
|
|
4440
4468
|
|
|
4441
4469
|
// src/simulation/simulation_switch.ts
|
|
4442
|
-
import { z as
|
|
4443
|
-
var simulation_switch =
|
|
4444
|
-
type:
|
|
4470
|
+
import { z as z197 } from "zod";
|
|
4471
|
+
var simulation_switch = z197.object({
|
|
4472
|
+
type: z197.literal("simulation_switch"),
|
|
4445
4473
|
simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
|
|
4446
|
-
source_component_id:
|
|
4474
|
+
source_component_id: z197.string().optional(),
|
|
4447
4475
|
closes_at: ms.optional(),
|
|
4448
4476
|
opens_at: ms.optional(),
|
|
4449
|
-
starts_closed:
|
|
4477
|
+
starts_closed: z197.boolean().optional(),
|
|
4450
4478
|
switching_frequency: frequency.optional()
|
|
4451
4479
|
}).describe("Defines a switch for simulation timing control");
|
|
4452
4480
|
expectTypesMatch(true);
|
|
4453
4481
|
|
|
4454
4482
|
// src/simulation/simulation_voltage_probe.ts
|
|
4455
|
-
import { z as
|
|
4456
|
-
var simulation_voltage_probe =
|
|
4457
|
-
type:
|
|
4483
|
+
import { z as z198 } from "zod";
|
|
4484
|
+
var simulation_voltage_probe = z198.object({
|
|
4485
|
+
type: z198.literal("simulation_voltage_probe"),
|
|
4458
4486
|
simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
|
|
4459
4487
|
"simulation_voltage_probe"
|
|
4460
4488
|
),
|
|
4461
|
-
source_component_id:
|
|
4462
|
-
name:
|
|
4463
|
-
signal_input_source_port_id:
|
|
4464
|
-
signal_input_source_net_id:
|
|
4465
|
-
reference_input_source_port_id:
|
|
4466
|
-
reference_input_source_net_id:
|
|
4467
|
-
subcircuit_id:
|
|
4468
|
-
color:
|
|
4489
|
+
source_component_id: z198.string().optional(),
|
|
4490
|
+
name: z198.string().optional(),
|
|
4491
|
+
signal_input_source_port_id: z198.string().optional(),
|
|
4492
|
+
signal_input_source_net_id: z198.string().optional(),
|
|
4493
|
+
reference_input_source_port_id: z198.string().optional(),
|
|
4494
|
+
reference_input_source_net_id: z198.string().optional(),
|
|
4495
|
+
subcircuit_id: z198.string().optional(),
|
|
4496
|
+
color: z198.string().optional()
|
|
4469
4497
|
}).describe(
|
|
4470
4498
|
"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."
|
|
4471
4499
|
).superRefine((data, ctx) => {
|
|
@@ -4475,20 +4503,20 @@ var simulation_voltage_probe = z197.object({
|
|
|
4475
4503
|
const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
|
|
4476
4504
|
if (has_ports && has_nets) {
|
|
4477
4505
|
ctx.addIssue({
|
|
4478
|
-
code:
|
|
4506
|
+
code: z198.ZodIssueCode.custom,
|
|
4479
4507
|
message: "Cannot mix port and net connections in a differential probe."
|
|
4480
4508
|
});
|
|
4481
4509
|
} else if (has_ports) {
|
|
4482
4510
|
if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
|
|
4483
4511
|
ctx.addIssue({
|
|
4484
|
-
code:
|
|
4512
|
+
code: z198.ZodIssueCode.custom,
|
|
4485
4513
|
message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
|
|
4486
4514
|
});
|
|
4487
4515
|
}
|
|
4488
4516
|
} else if (has_nets) {
|
|
4489
4517
|
if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
|
|
4490
4518
|
ctx.addIssue({
|
|
4491
|
-
code:
|
|
4519
|
+
code: z198.ZodIssueCode.custom,
|
|
4492
4520
|
message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
|
|
4493
4521
|
});
|
|
4494
4522
|
}
|
|
@@ -4496,7 +4524,7 @@ var simulation_voltage_probe = z197.object({
|
|
|
4496
4524
|
} else {
|
|
4497
4525
|
if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
|
|
4498
4526
|
ctx.addIssue({
|
|
4499
|
-
code:
|
|
4527
|
+
code: z198.ZodIssueCode.custom,
|
|
4500
4528
|
message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
|
|
4501
4529
|
});
|
|
4502
4530
|
}
|
|
@@ -4505,20 +4533,20 @@ var simulation_voltage_probe = z197.object({
|
|
|
4505
4533
|
expectTypesMatch(true);
|
|
4506
4534
|
|
|
4507
4535
|
// src/simulation/simulation_current_probe.ts
|
|
4508
|
-
import { z as
|
|
4509
|
-
var simulation_current_probe =
|
|
4510
|
-
type:
|
|
4536
|
+
import { z as z199 } from "zod";
|
|
4537
|
+
var simulation_current_probe = z199.object({
|
|
4538
|
+
type: z199.literal("simulation_current_probe"),
|
|
4511
4539
|
simulation_current_probe_id: getZodPrefixedIdWithDefault(
|
|
4512
4540
|
"simulation_current_probe"
|
|
4513
4541
|
),
|
|
4514
|
-
source_component_id:
|
|
4515
|
-
name:
|
|
4516
|
-
positive_source_port_id:
|
|
4517
|
-
negative_source_port_id:
|
|
4518
|
-
positive_source_net_id:
|
|
4519
|
-
negative_source_net_id:
|
|
4520
|
-
subcircuit_id:
|
|
4521
|
-
color:
|
|
4542
|
+
source_component_id: z199.string().optional(),
|
|
4543
|
+
name: z199.string().optional(),
|
|
4544
|
+
positive_source_port_id: z199.string().optional(),
|
|
4545
|
+
negative_source_port_id: z199.string().optional(),
|
|
4546
|
+
positive_source_net_id: z199.string().optional(),
|
|
4547
|
+
negative_source_net_id: z199.string().optional(),
|
|
4548
|
+
subcircuit_id: z199.string().optional(),
|
|
4549
|
+
color: z199.string().optional()
|
|
4522
4550
|
}).describe(
|
|
4523
4551
|
"Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
|
|
4524
4552
|
).superRefine((data, ctx) => {
|
|
@@ -4530,7 +4558,7 @@ var simulation_current_probe = z198.object({
|
|
|
4530
4558
|
const hasNets = hasPositiveNet || hasNegativeNet;
|
|
4531
4559
|
if (hasPorts && hasNets) {
|
|
4532
4560
|
ctx.addIssue({
|
|
4533
|
-
code:
|
|
4561
|
+
code: z199.ZodIssueCode.custom,
|
|
4534
4562
|
message: "Cannot mix port and net connections in a current probe."
|
|
4535
4563
|
});
|
|
4536
4564
|
return;
|
|
@@ -4538,7 +4566,7 @@ var simulation_current_probe = z198.object({
|
|
|
4538
4566
|
if (hasPorts) {
|
|
4539
4567
|
if (!hasPositivePort || !hasNegativePort) {
|
|
4540
4568
|
ctx.addIssue({
|
|
4541
|
-
code:
|
|
4569
|
+
code: z199.ZodIssueCode.custom,
|
|
4542
4570
|
message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
|
|
4543
4571
|
});
|
|
4544
4572
|
}
|
|
@@ -4547,71 +4575,71 @@ var simulation_current_probe = z198.object({
|
|
|
4547
4575
|
if (hasNets) {
|
|
4548
4576
|
if (!hasPositiveNet || !hasNegativeNet) {
|
|
4549
4577
|
ctx.addIssue({
|
|
4550
|
-
code:
|
|
4578
|
+
code: z199.ZodIssueCode.custom,
|
|
4551
4579
|
message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
|
|
4552
4580
|
});
|
|
4553
4581
|
}
|
|
4554
4582
|
return;
|
|
4555
4583
|
}
|
|
4556
4584
|
ctx.addIssue({
|
|
4557
|
-
code:
|
|
4585
|
+
code: z199.ZodIssueCode.custom,
|
|
4558
4586
|
message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
|
|
4559
4587
|
});
|
|
4560
4588
|
});
|
|
4561
4589
|
expectTypesMatch(true);
|
|
4562
4590
|
|
|
4563
4591
|
// src/simulation/simulation_unknown_experiment_error.ts
|
|
4564
|
-
import { z as
|
|
4592
|
+
import { z as z200 } from "zod";
|
|
4565
4593
|
var simulation_unknown_experiment_error = base_circuit_json_error.extend({
|
|
4566
|
-
type:
|
|
4594
|
+
type: z200.literal("simulation_unknown_experiment_error"),
|
|
4567
4595
|
simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
|
|
4568
4596
|
"simulation_unknown_experiment_error"
|
|
4569
4597
|
),
|
|
4570
|
-
error_type:
|
|
4571
|
-
simulation_experiment_id:
|
|
4572
|
-
subcircuit_id:
|
|
4598
|
+
error_type: z200.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
|
|
4599
|
+
simulation_experiment_id: z200.string().optional(),
|
|
4600
|
+
subcircuit_id: z200.string().optional()
|
|
4573
4601
|
}).describe("An unknown error occurred during the simulation experiment.");
|
|
4574
4602
|
expectTypesMatch(true);
|
|
4575
4603
|
|
|
4576
4604
|
// src/simulation/simulation_parameter_sweep.ts
|
|
4577
|
-
import { z as
|
|
4578
|
-
var simulation_parameter_type =
|
|
4605
|
+
import { z as z201 } from "zod";
|
|
4606
|
+
var simulation_parameter_type = z201.enum([
|
|
4579
4607
|
"resistance",
|
|
4580
4608
|
"capacitance",
|
|
4581
4609
|
"inductance",
|
|
4582
4610
|
"voltage",
|
|
4583
4611
|
"current"
|
|
4584
4612
|
]);
|
|
4585
|
-
var simulation_parameter_sweep_base =
|
|
4586
|
-
type:
|
|
4613
|
+
var simulation_parameter_sweep_base = z201.object({
|
|
4614
|
+
type: z201.literal("simulation_parameter_sweep"),
|
|
4587
4615
|
simulation_parameter_sweep_id: getZodPrefixedIdWithDefault(
|
|
4588
4616
|
"simulation_parameter_sweep"
|
|
4589
4617
|
),
|
|
4590
|
-
simulation_experiment_id:
|
|
4591
|
-
name:
|
|
4592
|
-
parameter_values:
|
|
4618
|
+
simulation_experiment_id: z201.string(),
|
|
4619
|
+
name: z201.string().optional(),
|
|
4620
|
+
parameter_values: z201.array(z201.number()).min(1),
|
|
4593
4621
|
parameter_unit: simulation_parameter_unit
|
|
4594
4622
|
});
|
|
4595
|
-
var simulation_parameter_sweep =
|
|
4623
|
+
var simulation_parameter_sweep = z201.discriminatedUnion("parameter_type", [
|
|
4596
4624
|
simulation_parameter_sweep_base.extend({
|
|
4597
|
-
parameter_type:
|
|
4598
|
-
resistor_source_component_id:
|
|
4625
|
+
parameter_type: z201.literal("resistance"),
|
|
4626
|
+
resistor_source_component_id: z201.string()
|
|
4599
4627
|
}),
|
|
4600
4628
|
simulation_parameter_sweep_base.extend({
|
|
4601
|
-
parameter_type:
|
|
4602
|
-
capacitor_source_component_id:
|
|
4629
|
+
parameter_type: z201.literal("capacitance"),
|
|
4630
|
+
capacitor_source_component_id: z201.string()
|
|
4603
4631
|
}),
|
|
4604
4632
|
simulation_parameter_sweep_base.extend({
|
|
4605
|
-
parameter_type:
|
|
4606
|
-
inductor_source_component_id:
|
|
4633
|
+
parameter_type: z201.literal("inductance"),
|
|
4634
|
+
inductor_source_component_id: z201.string()
|
|
4607
4635
|
}),
|
|
4608
4636
|
simulation_parameter_sweep_base.extend({
|
|
4609
|
-
parameter_type:
|
|
4610
|
-
source_net_id:
|
|
4637
|
+
parameter_type: z201.literal("voltage"),
|
|
4638
|
+
source_net_id: z201.string()
|
|
4611
4639
|
}),
|
|
4612
4640
|
simulation_parameter_sweep_base.extend({
|
|
4613
|
-
parameter_type:
|
|
4614
|
-
current_source_component_id:
|
|
4641
|
+
parameter_type: z201.literal("current"),
|
|
4642
|
+
current_source_component_id: z201.string()
|
|
4615
4643
|
})
|
|
4616
4644
|
]).describe("Repeats a simulation experiment over component parameter values");
|
|
4617
4645
|
expectTypesMatch(
|
|
@@ -4619,52 +4647,52 @@ expectTypesMatch(
|
|
|
4619
4647
|
);
|
|
4620
4648
|
|
|
4621
4649
|
// src/simulation/simulation_dc_operating_point_voltage.ts
|
|
4622
|
-
import { z as
|
|
4623
|
-
var simulation_dc_operating_point_voltage =
|
|
4624
|
-
type:
|
|
4650
|
+
import { z as z202 } from "zod";
|
|
4651
|
+
var simulation_dc_operating_point_voltage = z202.object({
|
|
4652
|
+
type: z202.literal("simulation_dc_operating_point_voltage"),
|
|
4625
4653
|
simulation_dc_operating_point_voltage_id: getZodPrefixedIdWithDefault(
|
|
4626
4654
|
"simulation_dc_operating_point_voltage"
|
|
4627
4655
|
),
|
|
4628
|
-
simulation_experiment_id:
|
|
4656
|
+
simulation_experiment_id: z202.string(),
|
|
4629
4657
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4630
|
-
simulation_voltage_probe_id:
|
|
4631
|
-
voltage:
|
|
4632
|
-
name:
|
|
4633
|
-
color:
|
|
4658
|
+
simulation_voltage_probe_id: z202.string(),
|
|
4659
|
+
voltage: z202.number(),
|
|
4660
|
+
name: z202.string().optional(),
|
|
4661
|
+
color: z202.string().optional()
|
|
4634
4662
|
});
|
|
4635
4663
|
expectTypesMatch(true);
|
|
4636
4664
|
|
|
4637
4665
|
// src/simulation/simulation_dc_operating_point_current.ts
|
|
4638
|
-
import { z as
|
|
4639
|
-
var simulation_dc_operating_point_current =
|
|
4640
|
-
type:
|
|
4666
|
+
import { z as z203 } from "zod";
|
|
4667
|
+
var simulation_dc_operating_point_current = z203.object({
|
|
4668
|
+
type: z203.literal("simulation_dc_operating_point_current"),
|
|
4641
4669
|
simulation_dc_operating_point_current_id: getZodPrefixedIdWithDefault(
|
|
4642
4670
|
"simulation_dc_operating_point_current"
|
|
4643
4671
|
),
|
|
4644
|
-
simulation_experiment_id:
|
|
4672
|
+
simulation_experiment_id: z203.string(),
|
|
4645
4673
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4646
|
-
simulation_current_probe_id:
|
|
4647
|
-
current:
|
|
4648
|
-
name:
|
|
4649
|
-
color:
|
|
4674
|
+
simulation_current_probe_id: z203.string(),
|
|
4675
|
+
current: z203.number(),
|
|
4676
|
+
name: z203.string().optional(),
|
|
4677
|
+
color: z203.string().optional()
|
|
4650
4678
|
});
|
|
4651
4679
|
expectTypesMatch(true);
|
|
4652
4680
|
|
|
4653
4681
|
// src/simulation/simulation_dc_sweep_voltage_graph.ts
|
|
4654
|
-
import { z as
|
|
4655
|
-
var simulation_dc_sweep_voltage_graph =
|
|
4656
|
-
type:
|
|
4682
|
+
import { z as z204 } from "zod";
|
|
4683
|
+
var simulation_dc_sweep_voltage_graph = z204.object({
|
|
4684
|
+
type: z204.literal("simulation_dc_sweep_voltage_graph"),
|
|
4657
4685
|
simulation_dc_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4658
4686
|
"simulation_dc_sweep_voltage_graph"
|
|
4659
4687
|
),
|
|
4660
|
-
simulation_experiment_id:
|
|
4688
|
+
simulation_experiment_id: z204.string(),
|
|
4661
4689
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4662
|
-
simulation_voltage_probe_id:
|
|
4663
|
-
sweep_values:
|
|
4690
|
+
simulation_voltage_probe_id: z204.string(),
|
|
4691
|
+
sweep_values: z204.array(z204.number()),
|
|
4664
4692
|
sweep_unit: simulation_dc_sweep_unit,
|
|
4665
|
-
voltage_levels:
|
|
4666
|
-
name:
|
|
4667
|
-
color:
|
|
4693
|
+
voltage_levels: z204.array(z204.number()),
|
|
4694
|
+
name: z204.string().optional(),
|
|
4695
|
+
color: z204.string().optional()
|
|
4668
4696
|
}).refine(
|
|
4669
4697
|
(graph) => graph.sweep_values.length === graph.voltage_levels.length,
|
|
4670
4698
|
{
|
|
@@ -4674,20 +4702,20 @@ var simulation_dc_sweep_voltage_graph = z203.object({
|
|
|
4674
4702
|
expectTypesMatch(true);
|
|
4675
4703
|
|
|
4676
4704
|
// src/simulation/simulation_dc_sweep_current_graph.ts
|
|
4677
|
-
import { z as
|
|
4678
|
-
var simulation_dc_sweep_current_graph =
|
|
4679
|
-
type:
|
|
4705
|
+
import { z as z205 } from "zod";
|
|
4706
|
+
var simulation_dc_sweep_current_graph = z205.object({
|
|
4707
|
+
type: z205.literal("simulation_dc_sweep_current_graph"),
|
|
4680
4708
|
simulation_dc_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4681
4709
|
"simulation_dc_sweep_current_graph"
|
|
4682
4710
|
),
|
|
4683
|
-
simulation_experiment_id:
|
|
4711
|
+
simulation_experiment_id: z205.string(),
|
|
4684
4712
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4685
|
-
simulation_current_probe_id:
|
|
4686
|
-
sweep_values:
|
|
4713
|
+
simulation_current_probe_id: z205.string(),
|
|
4714
|
+
sweep_values: z205.array(z205.number()),
|
|
4687
4715
|
sweep_unit: simulation_dc_sweep_unit,
|
|
4688
|
-
current_levels:
|
|
4689
|
-
name:
|
|
4690
|
-
color:
|
|
4716
|
+
current_levels: z205.array(z205.number()),
|
|
4717
|
+
name: z205.string().optional(),
|
|
4718
|
+
color: z205.string().optional()
|
|
4691
4719
|
}).refine(
|
|
4692
4720
|
(graph) => graph.sweep_values.length === graph.current_levels.length,
|
|
4693
4721
|
{
|
|
@@ -4697,29 +4725,29 @@ var simulation_dc_sweep_current_graph = z204.object({
|
|
|
4697
4725
|
expectTypesMatch(true);
|
|
4698
4726
|
|
|
4699
4727
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
4700
|
-
import { z as
|
|
4728
|
+
import { z as z207 } from "zod";
|
|
4701
4729
|
|
|
4702
4730
|
// src/simulation/simulation_complex_sample.ts
|
|
4703
|
-
import { z as
|
|
4704
|
-
var simulation_complex_sample =
|
|
4705
|
-
re:
|
|
4706
|
-
im:
|
|
4731
|
+
import { z as z206 } from "zod";
|
|
4732
|
+
var simulation_complex_sample = z206.object({
|
|
4733
|
+
re: z206.number(),
|
|
4734
|
+
im: z206.number()
|
|
4707
4735
|
});
|
|
4708
4736
|
expectTypesMatch(true);
|
|
4709
4737
|
|
|
4710
4738
|
// src/simulation/simulation_ac_sweep_voltage_graph.ts
|
|
4711
|
-
var simulation_ac_sweep_voltage_graph =
|
|
4712
|
-
type:
|
|
4739
|
+
var simulation_ac_sweep_voltage_graph = z207.object({
|
|
4740
|
+
type: z207.literal("simulation_ac_sweep_voltage_graph"),
|
|
4713
4741
|
simulation_ac_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
|
|
4714
4742
|
"simulation_ac_sweep_voltage_graph"
|
|
4715
4743
|
),
|
|
4716
|
-
simulation_experiment_id:
|
|
4744
|
+
simulation_experiment_id: z207.string(),
|
|
4717
4745
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4718
|
-
simulation_voltage_probe_id:
|
|
4719
|
-
frequencies_hz:
|
|
4720
|
-
complex_voltages:
|
|
4721
|
-
name:
|
|
4722
|
-
color:
|
|
4746
|
+
simulation_voltage_probe_id: z207.string(),
|
|
4747
|
+
frequencies_hz: z207.array(z207.number()),
|
|
4748
|
+
complex_voltages: z207.array(simulation_complex_sample),
|
|
4749
|
+
name: z207.string().optional(),
|
|
4750
|
+
color: z207.string().optional()
|
|
4723
4751
|
}).refine(
|
|
4724
4752
|
(graph) => graph.frequencies_hz.length === graph.complex_voltages.length,
|
|
4725
4753
|
{
|
|
@@ -4729,19 +4757,19 @@ var simulation_ac_sweep_voltage_graph = z206.object({
|
|
|
4729
4757
|
expectTypesMatch(true);
|
|
4730
4758
|
|
|
4731
4759
|
// src/simulation/simulation_ac_sweep_current_graph.ts
|
|
4732
|
-
import { z as
|
|
4733
|
-
var simulation_ac_sweep_current_graph =
|
|
4734
|
-
type:
|
|
4760
|
+
import { z as z208 } from "zod";
|
|
4761
|
+
var simulation_ac_sweep_current_graph = z208.object({
|
|
4762
|
+
type: z208.literal("simulation_ac_sweep_current_graph"),
|
|
4735
4763
|
simulation_ac_sweep_current_graph_id: getZodPrefixedIdWithDefault(
|
|
4736
4764
|
"simulation_ac_sweep_current_graph"
|
|
4737
4765
|
),
|
|
4738
|
-
simulation_experiment_id:
|
|
4766
|
+
simulation_experiment_id: z208.string(),
|
|
4739
4767
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4740
|
-
simulation_current_probe_id:
|
|
4741
|
-
frequencies_hz:
|
|
4742
|
-
complex_currents:
|
|
4743
|
-
name:
|
|
4744
|
-
color:
|
|
4768
|
+
simulation_current_probe_id: z208.string(),
|
|
4769
|
+
frequencies_hz: z208.array(z208.number()),
|
|
4770
|
+
complex_currents: z208.array(simulation_complex_sample),
|
|
4771
|
+
name: z208.string().optional(),
|
|
4772
|
+
color: z208.string().optional()
|
|
4745
4773
|
}).refine(
|
|
4746
4774
|
(graph) => graph.frequencies_hz.length === graph.complex_currents.length,
|
|
4747
4775
|
{
|
|
@@ -4751,52 +4779,52 @@ var simulation_ac_sweep_current_graph = z207.object({
|
|
|
4751
4779
|
expectTypesMatch(true);
|
|
4752
4780
|
|
|
4753
4781
|
// src/simulation/simulation_op_amp.ts
|
|
4754
|
-
import { z as
|
|
4755
|
-
var simulation_op_amp =
|
|
4756
|
-
type:
|
|
4782
|
+
import { z as z209 } from "zod";
|
|
4783
|
+
var simulation_op_amp = z209.object({
|
|
4784
|
+
type: z209.literal("simulation_op_amp"),
|
|
4757
4785
|
simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
|
|
4758
|
-
source_component_id:
|
|
4759
|
-
inverting_input_source_port_id:
|
|
4760
|
-
non_inverting_input_source_port_id:
|
|
4761
|
-
output_source_port_id:
|
|
4762
|
-
positive_supply_source_port_id:
|
|
4763
|
-
negative_supply_source_port_id:
|
|
4786
|
+
source_component_id: z209.string().optional(),
|
|
4787
|
+
inverting_input_source_port_id: z209.string(),
|
|
4788
|
+
non_inverting_input_source_port_id: z209.string(),
|
|
4789
|
+
output_source_port_id: z209.string(),
|
|
4790
|
+
positive_supply_source_port_id: z209.string(),
|
|
4791
|
+
negative_supply_source_port_id: z209.string()
|
|
4764
4792
|
}).describe("Defines a simple ideal operational amplifier for simulation");
|
|
4765
4793
|
expectTypesMatch(true);
|
|
4766
4794
|
|
|
4767
4795
|
// src/simulation/simulation_spice_subcircuit.ts
|
|
4768
|
-
import { z as
|
|
4769
|
-
var simulation_spice_subcircuit =
|
|
4770
|
-
type:
|
|
4796
|
+
import { z as z210 } from "zod";
|
|
4797
|
+
var simulation_spice_subcircuit = z210.object({
|
|
4798
|
+
type: z210.literal("simulation_spice_subcircuit"),
|
|
4771
4799
|
simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
|
|
4772
4800
|
"simulation_spice_subcircuit"
|
|
4773
4801
|
),
|
|
4774
|
-
source_component_id:
|
|
4775
|
-
spice_pin_to_source_port_map:
|
|
4776
|
-
subcircuit_source:
|
|
4802
|
+
source_component_id: z210.string(),
|
|
4803
|
+
spice_pin_to_source_port_map: z210.record(z210.string(), z210.string()),
|
|
4804
|
+
subcircuit_source: z210.string()
|
|
4777
4805
|
}).describe("Defines a custom SPICE subcircuit model for simulation");
|
|
4778
4806
|
expectTypesMatch(
|
|
4779
4807
|
true
|
|
4780
4808
|
);
|
|
4781
4809
|
|
|
4782
4810
|
// src/simulation/simulation_oscilloscope_trace.ts
|
|
4783
|
-
import { z as
|
|
4811
|
+
import { z as z211 } from "zod";
|
|
4784
4812
|
var hasValue = (value) => value !== void 0;
|
|
4785
|
-
var simulation_oscilloscope_trace =
|
|
4786
|
-
type:
|
|
4813
|
+
var simulation_oscilloscope_trace = z211.object({
|
|
4814
|
+
type: z211.literal("simulation_oscilloscope_trace"),
|
|
4787
4815
|
simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
|
|
4788
4816
|
"simulation_oscilloscope_trace"
|
|
4789
4817
|
),
|
|
4790
|
-
simulation_transient_voltage_graph_id:
|
|
4791
|
-
simulation_transient_current_graph_id:
|
|
4792
|
-
simulation_voltage_probe_id:
|
|
4793
|
-
simulation_current_probe_id:
|
|
4794
|
-
display_name:
|
|
4795
|
-
color:
|
|
4796
|
-
display_center_value:
|
|
4797
|
-
display_center_offset_divs:
|
|
4798
|
-
volts_per_div:
|
|
4799
|
-
amps_per_div:
|
|
4818
|
+
simulation_transient_voltage_graph_id: z211.string().optional(),
|
|
4819
|
+
simulation_transient_current_graph_id: z211.string().optional(),
|
|
4820
|
+
simulation_voltage_probe_id: z211.string().optional(),
|
|
4821
|
+
simulation_current_probe_id: z211.string().optional(),
|
|
4822
|
+
display_name: z211.string().optional(),
|
|
4823
|
+
color: z211.string().optional(),
|
|
4824
|
+
display_center_value: z211.number().optional(),
|
|
4825
|
+
display_center_offset_divs: z211.number().optional(),
|
|
4826
|
+
volts_per_div: z211.number().positive().optional(),
|
|
4827
|
+
amps_per_div: z211.number().positive().optional()
|
|
4800
4828
|
}).describe(
|
|
4801
4829
|
"Defines how a simulation measurement is rendered as an oscilloscope-style trace."
|
|
4802
4830
|
).superRefine((data, ctx) => {
|
|
@@ -4810,19 +4838,19 @@ var simulation_oscilloscope_trace = z210.object({
|
|
|
4810
4838
|
].filter(hasValue).length;
|
|
4811
4839
|
if (voltageReferences + currentReferences !== 1) {
|
|
4812
4840
|
ctx.addIssue({
|
|
4813
|
-
code:
|
|
4841
|
+
code: z211.ZodIssueCode.custom,
|
|
4814
4842
|
message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
|
|
4815
4843
|
});
|
|
4816
4844
|
}
|
|
4817
4845
|
if (voltageReferences > 0 && data.amps_per_div !== void 0) {
|
|
4818
4846
|
ctx.addIssue({
|
|
4819
|
-
code:
|
|
4847
|
+
code: z211.ZodIssueCode.custom,
|
|
4820
4848
|
message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
|
|
4821
4849
|
});
|
|
4822
4850
|
}
|
|
4823
4851
|
if (currentReferences > 0 && data.volts_per_div !== void 0) {
|
|
4824
4852
|
ctx.addIssue({
|
|
4825
|
-
code:
|
|
4853
|
+
code: z211.ZodIssueCode.custom,
|
|
4826
4854
|
message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
|
|
4827
4855
|
});
|
|
4828
4856
|
}
|
|
@@ -4830,8 +4858,8 @@ var simulation_oscilloscope_trace = z210.object({
|
|
|
4830
4858
|
expectTypesMatch(true);
|
|
4831
4859
|
|
|
4832
4860
|
// src/any_circuit_element.ts
|
|
4833
|
-
import { z as
|
|
4834
|
-
var any_circuit_element =
|
|
4861
|
+
import { z as z212 } from "zod";
|
|
4862
|
+
var any_circuit_element = z212.union([
|
|
4835
4863
|
source_runtime_error,
|
|
4836
4864
|
source_trace,
|
|
4837
4865
|
source_bus,
|
|
@@ -4984,6 +5012,7 @@ var any_circuit_element = z211.union([
|
|
|
4984
5012
|
schematic_table,
|
|
4985
5013
|
schematic_table_cell,
|
|
4986
5014
|
cad_component,
|
|
5015
|
+
cad_collision_error,
|
|
4987
5016
|
simulation_voltage_source,
|
|
4988
5017
|
simulation_current_source,
|
|
4989
5018
|
simulation_experiment,
|
|
@@ -5017,6 +5046,7 @@ export {
|
|
|
5017
5046
|
battery_capacity,
|
|
5018
5047
|
brep_shape,
|
|
5019
5048
|
cadModelDefaultDirectionMap,
|
|
5049
|
+
cad_collision_error,
|
|
5020
5050
|
cad_component,
|
|
5021
5051
|
cad_model_axis_directions,
|
|
5022
5052
|
cad_model_formats,
|