Пример #1
0
        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;
        }
Пример #2
0
 public UpDownRelays(Relay upRelay, Relay downRelay, UpDownRelayModeType modeType)
 {
     _upRelay   = upRelay;
     _downRelay = downRelay;
     ModeType   = modeType;
     State      = UpDownRelayState.Unknown;
 }
Пример #3
0
        public void Stop()
        {
            _upRelay.Open();
            _downRelay.Open();

            State = UpDownRelayState.Unknown;
        }
Пример #4
0
        public void Stop()
        {
            if (_downRelayClosedSig != null)
            {
                _downRelayClosedSig.BoolValue = false;
                _upRelayClosedSig.BoolValue   = false;
                State = UpDownRelayState.Unknown;
                return;
            }

            _upRelay.Open();
            _downRelay.Open();

            State = UpDownRelayState.Unknown;
        }
Пример #5
0
        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;
        }