Esempio n. 1
0
 public void OnSpeedChange(int speed)
 {
     if ((_oldSpeed < 20) && (speed >= 20))
     {
         _alarm.RaiseAlarm();
     }
     _oldSpeed = speed;
 }
Esempio n. 2
0
 public void OnSpeedChange(int speed)
 {
     if ((_oldSpeed < 20) && (speed >= 20))
     {
         if (_isLocked == false)
         {
             _alarm?.RaiseAlarm();
         }
     }
     _oldSpeed = speed;
 }
        public void RaiseAlarm()
        {
            if (_mode == "testing" || _mode == "verification")
            {
                Log();
            }

            if (_mode != "testing")
            {
                _alarm.RaiseAlarm();
            }
        }
Esempio n. 4
0
 public void DoorOpen()
 {
     if (IsDoorOpen == true)
     {
         _door.Close();
     }
     else
     {
         _alarm.RaiseAlarm();
         IsDoorBreached = true;
     }
 }
 public void DoorOpened()
 {
     if (_door.DoorIsOpen == false)
     {
         _state = States.DoorClosing;
         _door.Close();
         if (_door.DoorIsOpen == true)
         {
             _state = States.DoorBreached;
             _alarm.RaiseAlarm();
         }
     }
 }
Esempio n. 6
0
 public void DoorOpened()
 {
     if (CurrentDoorState == false)
     {
         _door.Closed();
         _alarm.RaiseAlarm();
     }
     else if (CurrentDoorState == true)
     {
         _door.Closed();
         CurrentDoorState = false;
     }
 }
Esempio n. 7
0
        public void DoorOpen()
        {
            switch (_controlState)
            {
            case DoorControlState.Validated:
                _controlState = DoorControlState.DoorOpened;
                break;

            default:
                _controlState = DoorControlState.DoorBreached;
                _alarm.RaiseAlarm();
                break;
            }
        }
 public void DoorOpened()
 {
     if (_currentState != DoorState.Closed)
     {
         _door.Close();
         _currentState = DoorState.Closing;
     }
     else
     {
         _door.Close();
         _alarm.RaiseAlarm();
         _currentState = DoorState.Breached;
     }
 }
        public void DoorOpen()
        {
            if (_state == State.DoorOpening)
            {
                _door.Close();
                _state = State.DoorClosing;
            }

            else if (_state == State.DoorClosed)
            {
                _door.Close();
                _alarm.RaiseAlarm();
                _state = State.DoorBreached;
            }
        }
Esempio n. 10
0
        public void DoorOpened()
        {
            switch (_state.State)
            {
            case DoorControlState.DoorClosed:
                _door.Close();
                _Alarm.RaiseAlarm();
                _state.State = DoorControlState.DoorBreached;
                break;

            case DoorControlState.DoorOpening:

                _door.Close();
                _state.State = DoorControlState.DoorClosing;
                break;

            default:

                throw new ArgumentException("Invalid state");
            }
        }
 public void Breach()
 {
     _alarm.RaiseAlarm();
 }
Esempio n. 12
0
 public void RaiseAlarm()
 {
     _alarm.RaiseAlarm();
 }