Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let firstPhaseTrigger = false;
- let isFirstPhaseTriggered = false;
- outputsArray.forEach(out => {
- out.setHighVoltage(311.127);
- out.setLowVoltage(-311.127);
- out.setState(false);
- });
- if (in2.getVoltage() == 0) {
- isFirstPhaseTriggered = false;
- }
- if (in2.getVoltage() == -311.127) {
- if (firstPhaseTrigger == true) {
- firstPhaseTrigger = false;
- isFirstPhaseTriggered = true;
- } else if (firstPhaseTrigger == false) {
- firstPhaseTrigger = true;
- isFirstPhaseTriggered = true;
- }
- }
- if (firstPhaseTrigger == true) {
- if (in2.getVoltage() <= in3.getVoltage()) {
- out0.setState(false);
- out3.setState(false);
- } else if (in2.getVoltage() > in3.getVoltage()) {
- out0.setState(true);
- out3.setState(true);
- }
- } else if (firstPhaseTrigger == false) {
- if (in2.getVoltage() <= in3.getVoltage()) {
- out1.setState(false);
- out2.setState(false);
- } else if (in2.getVoltage() > in3.getVoltage()) {
- out1.setState(true);
- out2.setState(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement