示例#1
0
 public virtual void AddComponent(AComponent component)
 {
     if (Components == null)
     {
         Components = new List<AComponent>();
     }
     component.ParentDevice = this;
     Components.Add(component);
 }
示例#2
0
        public virtual void OnComponentStateChanged(AComponent component)
        {
            switch (component.TypeCode)
            {

                case Component.Type.BaseDevice:
                {
                    var cashout = GetComponent(Component.Type.CashDispenser);
                    if (cashout != null)
                        RenewComponent(Component.Type.CashoutAvailable);

                    var cashin = GetComponent(Component.Type.CashAcceptor);
                    if (cashin != null)
                        RenewComponent(Component.Type.CashinAvailable);

                    var recycler = GetComponent(Component.Type.CashRecycler);
                    if (recycler != null)
                        RenewComponent(Component.Type.CashRecyclerAvailable);
                }
                break;
                case Component.Type.CardReader:
                case Component.Type.JournalPrinter:
                case Component.Type.LinkToProcessing:
                case Component.Type.LinkToMonitoring:
                case Component.Type.OpenedByHost:
                case Component.Type.PinEncryptor:
                case Component.Type.SupervisorMode:
                    RenewComponent(Component.Type.BaseDevice);
                    break;

                case Component.Type.CashoutHopper:
                    RenewComponent(Component.Type.CashoutNotEmpty);
                    break;

                case Component.Type.CashoutNotEmpty:
                    RenewComponent(Component.Type.CashoutAvailable);
                    break;

                case Component.Type.CashinHopper:
                    RenewComponent(Component.Type.CashinNotFull);
                    break;

                case Component.Type.CashinNotFull:
                    RenewComponent(Component.Type.CashinAvailable);
                    break;

                case Component.Type.CashDispenser:
                    RenewComponent(Component.Type.CashoutAvailable);
                    break;

                case Component.Type.CashAcceptor:
                    RenewComponent(Component.Type.CashinAvailable);
                    break;

                /* Recycling */
                case Component.Type.CashRecycler:
                    RenewComponent(Component.Type.CashRecyclerAvailable);
                    break;
                case Component.Type.CashRecyclerHopper:
                    RenewComponent(Component.Type.CashRecyclerNotEmpty);
                    break;
                case Component.Type.CashRecyclerNotEmpty:
                case Component.Type.CashRecyclerNotFull:
                    RenewComponent(Component.Type.CashRecyclerAvailable);
                break;
            }
        }