const baseTerminal = flux.getNodeById("50a8f160-a9de-116f-ae5d-83a4176cf1de");
const emitterTerminal = flux.getNodeById("2c782be2-400d-4397-7268-c7021df206c4");
const collectorTerminal = flux.getNodeById("0899767f-00f2-de9b-6dc4-de23d7b60f06");
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 || 78;
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,