// These are the unique ids of the terminal P1 and P2
const anodeTerminalElementId = "9b43137e-5678-604b-097b-07055b46b0c6"; //P1
const cathodeTerminalElementId = "8d0d6e5c-9570-643c-7237-cd6c714368b5"; //P2
const anodeTerminalElement = flux.getNodeById(anodeTerminalElementId, "elementTerminal");
const cathodeTerminalElement = flux.getNodeById(cathodeTerminalElementId, "elementTerminal");
const pi = Math.PI;
var peakVoltage: any;
var dcOffset: any;
var dutyCycle: any;
var typeActive: any = "B"; // Set default waveform type to Sinusoid
var phaseShift: any;
var frequency: any;
flux.on("inputChange", (e: InputControlChangeEvent) => {
//listen for any input change on the control with name Waveform Type
if (e.control_name === "Waveform Type") {
switch (e.value) {
case 'Sinusoid':
typeActive = "A"; flux.currentSymbol = "sine";
// flux.notify("Type changed to " + e.value, {variant: "success",});
// flux.notify( typeActive, {variant: "success",});
break;
case 'Square':
typeActive = "B"; flux.currentSymbol = "square";
// flux.notify("Type changed to " + e.value, {variant: "success",});
// flux.notify( typeActive, {variant: "success",});
break;
case 'Triangle':