// Howdy 👋.
// If you are new to writing code in Flux make sure to check out our get started docs: https://docs.flux.ai/reference/introduction
// We also have a Flux Slack Community in case you need help: https://join.slack.com/t/fluxcommunity/shared_invite/zt-p48n941f-wzQ06kGmuFJ2HXnGYT1JkA
// To infinity and beyond 🚀
const p1TerminalId = "d98a89ea-c6f2-cdca-5944-96dcb17d1a58"; //P1
const p2TerminalId = "59bca7b5-2b6b-b8af-65ed-6e5660b0878f"; //P2
const p3TerminalId = "bffec325-8cf4-aa69-a738-336af38f5b2c"; //P3
const p1Terminal = flux.getNodeById(p1TerminalId, "elementTerminal");
const p2Terminal = flux.getNodeById(p2TerminalId, "elementTerminal");
const p3Terminal = flux.getNodeById(p2TerminalId, "elementTerminal");
const voltageInputNode = flux.createOutputNode("v1");
const voltageOutputNode = flux.createOutputNode("v2");
const voltageDrop = flux.createOutputNode("vdrop");
const powerOutputNode = flux.createOutputNode("power");
const amperageOutputNode = flux.createOutputNode("current");
//setup event
flux.on("setup", () => {
const position = Number(flux.properties.find((prop) => prop.name === "Resistance")?.value)/100;