kamenges
Member
I agree with Okie PC. Personally I would do this as a state machine.
However, if you don't want to go as far as a state machine I would strongly encourage you to separate the logic deciding which pump needs to run from the actual pump outputs. You have at least one case where a pump needs to run outside of the normal sequence of swapping which pump runs when the pressure is low. It can me very difficult to keep your swapping logic working as intended when the extra pump run case is added if you use the pump outputs as part of your logic.
Keith
However, if you don't want to go as far as a state machine I would strongly encourage you to separate the logic deciding which pump needs to run from the actual pump outputs. You have at least one case where a pump needs to run outside of the normal sequence of swapping which pump runs when the pressure is low. It can me very difficult to keep your swapping logic working as intended when the extra pump run case is added if you use the pump outputs as part of your logic.
Keith