public void Down(long pulseTime) { if (_waitTimer != null) { _waitTimer.Dispose(); _waitTimer = null; } if (_upRelayClosedSig != null && _upRelayClosedSig.BoolValue) { _upRelayClosedSig.BoolValue = false; _waitTimer = new CTimer(RelaySet, _downRelayClosedSig, 500); } else if (_downRelayClosedSig != null) { RelaySet(_downRelayClosedSig); } else if (_upRelay.State) { _upRelay.Open(); _waitTimer = new CTimer(RelaySet, _downRelay, 500); } else { RelaySet(_downRelay); } State = UpDownRelayState.Down; }
public UpDownRelays(Relay upRelay, Relay downRelay, UpDownRelayModeType modeType) { _upRelay = upRelay; _downRelay = downRelay; ModeType = modeType; State = UpDownRelayState.Unknown; }
public void Stop() { _upRelay.Open(); _downRelay.Open(); State = UpDownRelayState.Unknown; }
public void Stop() { if (_downRelayClosedSig != null) { _downRelayClosedSig.BoolValue = false; _upRelayClosedSig.BoolValue = false; State = UpDownRelayState.Unknown; return; } _upRelay.Open(); _downRelay.Open(); State = UpDownRelayState.Unknown; }
public void Down() { if (_waitTimer != null) { _waitTimer.Stop(); } if (_upRelay.State) { _upRelay.Open(); _waitTimer = new CTimer(RelaySet, _downRelay, 500); } else { RelaySet(_downRelay); } State = UpDownRelayState.Down; }