const p1TerminalUid = "3d606e31-1193-adf0-af2d-9a6f5fc959a3";
const p2TerminalUid = "58992c51-2d5c-0b07-af59-4b5b1df793b8";
flux.on("setup", () => {
const pushSwitch = flux.controls.find(control => control.name === "Momentary Switch");
if (!pushSwitch) {
throw new Error("Oops! Could not find switch control")
}
if (pushSwitch.value) {
flux.currentSymbol = "push-closed";
flux.simulationModel = {
type: "switch",
state: true,
map_input_to_terminal_uid: p1TerminalUid,
map_output_to_terminal_uid: p2TerminalUid,
};
} else {
flux.currentSymbol = "push-open";
flux.simulationModel = {
type: "switch",
state: false,
map_input_to_terminal_uid: p1TerminalUid,
map_output_to_terminal_uid: p2TerminalUid,
};
}
})
flux.on("inputChange", (e) => {
vivek12
copilot
vivek12
copilot