Exemplo n.º 1
0
    public void EventDevice(TypeStateDevice newState)
    {
        switch (newState)
        {
        case TypeStateDevice.Open: EnterState(TypeStateDevice.Open);  break;

        case TypeStateDevice.Close: EnterState(TypeStateDevice.Close); break;

        default: break;
        }
    }
Exemplo n.º 2
0
 public void EventOpenGate(int otherIdItem, TypeStateDevice newState)
 {
     if (isNeedItem)
     {
         if (otherIdItem == idItem)
         {
             EventDevice(newState);
         }
     }
     else
     {
         EventDevice(newState);
     }
 }
Exemplo n.º 3
0
    protected void EnterState(TypeStateDevice newState)
    {
        LeaveState();
        prevState = state;
        state     = newState;

        switch (state)
        {
        case TypeStateDevice.Idle: EnterIdleState(); break;

        case TypeStateDevice.Open: EnterOpenState(); break;

        case TypeStateDevice.Close: EnterCloseState(); break;

        default: break;
        }
    }