const p1Terminal = flux.getNodeById("604a8937-8f99-1e92-7983-82618585f70e"); //P1
const p2Terminal = flux.getNodeById("27ab3356-c083-6d96-a117-482b1b78cd26"); //P2
const p1Voltage = flux.createOutputNode("v1");
const p2Voltage = flux.createOutputNode("v2");
const amperageOutputNode = flux.createOutputNode("current");
const powerOutputNode = flux.createOutputNode("power");
const voltageDrop = flux.createOutputNode("vdrop");
// Setup Event
flux.on("setup", (event) => {
const resistance = flux.properties.find((prop) => prop.name === "Resistance")?.value || 43200;
flux.simulationModel = {
type: "resistor",
resistance: resistance,
map_input_to_terminal_uid: p1Terminal?.uid,
map_output_to_terminal_uid: p2Terminal?.uid
};
});
// Before Event
flux.on("beforeStep", (event) => {