Example #1
0
        public Elevator()
        {
            _currentFloor = 0;

            for (int IDX = (Defaults.Floors - 1); IDX >= 0; IDX--)
            {
                _downwardRequired.Add(false);
                _upwardRequired.Add(false);
                _internRequired.Add(false);
            }

            _state = FIXED_CLOSED;
        }
Example #2
0
 /// <summary>
 /// Löst Zustandsübergang des ElevatorObjektes aus
 /// </summary>
 /// <param name="newState">Zielzustand aus Defaults.State</param>
 public void SetState( Defaults.State newState)
 {
     switch ( newState )
     {
         case Defaults.State.Moving      : State = Moving;       break;
         case Defaults.State.FixedOpen   : State = FixedOpen;    break;
         case Defaults.State.FixedClosed : State = FixedClosed;  break;
         case Defaults.State.Overload    : State = Overload;     break;
     }
 }
Example #3
0
        /// <summary>
        /// Löst Zustandsübergang des ElevatorObjektes aus
        /// </summary>
        /// <param name="newState">Zielzustand aus Defaults.State</param>
        public void SetState( Defaults.State newState)
        {
            switch ( newState )
            {
                case Defaults.State.Moving      : _state = MOVING;       break;
                case Defaults.State.FixedOpen   : _state = FIXED_OPEN;    break;
                case Defaults.State.FixedClosed : _state = FIXED_CLOSED;  break;
                case Defaults.State.Overload    : _state = OVERLOAD;     break;
            }

            Log.AddEntry("Neuer Zustand: " + newState.ToString());
            this._state.Loop(this);
        }
Example #4
0
        /// <summary>
        /// Setzt fahrstuhl in Ausgangszustand
        /// </summary>
        public void InitOrReset()
        {
            State = FixedClosed;
            _currentFloor = 0;

            // ANGEBLICH ARRAY-OUT-OF-BOUND   BITTE PRÜFEN, ICH HAB KEINE AHNUNG
            for (int IDX = (Defaults.Floors - 1); IDX >= 0; IDX--)
            {
                _downwardRequired.Add(false);
                _upwardRequired.Add(false);
            }

            State.Move( this );
        }