const terminalAid = "1d05b6b4-dd93-fc4b-719a-9ee164b9f6d0"; //A
const terminalBid = "44654286-4a28-ee48-fe11-5b858a5f61c4"; //B
const terminalCommonid = "e252cd8c-0591-e3d4-c438-84662006ed5c"; //Common
const mySwitch = flux.controls.find(control => control.name === "Switch Position");
// Set initial switch position
if (mySwitch !== undefined) {
if (mySwitch.value) {
flux.currentSymbol = "A";
flux.simulationModel = {
type: "SPDTSwitch",
position: 1,
map_input_one_to_terminal_uid: terminalBid,
map_input_two_to_terminal_uid: terminalAid,
map_output_to_terminal_uid: terminalCommonid,
};
} else {
flux.currentSymbol = "B";
flux.simulationModel = {
type: "SPDTSwitch",
position: 2,
map_input_one_to_terminal_uid: terminalBid,
map_input_two_to_terminal_uid: terminalAid,
map_output_to_terminal_uid: terminalCommonid,
};
}
};
// Set switch position based on control updates