const anodeTerminalId = "d727c28d-8dc3-54a3-dbd6-c7b78c0f1164";
const cathodeTerminalId = "189822c2-307d-3ef1-984d-6a157f530d3a";
const anodeTerminal = flux.getNodeById(anodeTerminalId, "elementTerminal");
const cathodeTerminal = flux.getNodeById(cathodeTerminalId, "elementTerminal");
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const voltageDrop = flux.createOutputNode("vDrop");
const current = flux.createOutputNode("I");
// Setup Event
flux.on("setup", () => {
const voltageHigh = flux.properties.find((prop) => prop.name === "Voltage")?.value || 5.00;
const toggle = flux.controls.find((prop) => prop.name === "State");
const voltage = toggle?.value ? Number(voltageHigh) : 0.0;
flux.simulationModel = simModel(voltage);
});
// Property was changed event
flux.on("propertyChange", (event: PropertyChangeEvent) => {