const baseTerminal = flux.getNodeById("8ef7a0f1-11ac-570d-001a-aa728039a85e");
const emitterTerminal = flux.getNodeById("96eb012e-f1d7-963c-7fa7-12854e2ee0f7");
const collectorTerminal = flux.getNodeById("ee3859a5-35ae-e0e9-803c-8ea0ad7442e4");
const baseVoltage = flux.createOutputNode("base-voltage");
const emitterVoltage = flux.createOutputNode("emitter-voltage");
const collectorVoltage = flux.createOutputNode("collector-voltage");
const baseCurrent = flux.createOutputNode("base-current");
const emitterCurrent = flux.createOutputNode("emitter-current");
const collectorCurrent = flux.createOutputNode("collector-current");
// Setup Event
flux.on("setup", (event) => {
const beta = flux.properties.find((prop) => prop.name === "Beta / hFe")?.value || 255;
const leakage = flux.properties.find((prop) => prop.name === "Leakage Current")?.value || 1e-13;
flux.simulationModel = {
type: "transistor",
pnp: true,
map_base_to_terminal_uid: baseTerminal?.uid,
map_emitter_to_terminal_uid: emitterTerminal?.uid,
map_collector_to_terminal_uid: collectorTerminal?.uid,