Пример #1
0
            public new Acceptor this[int Index]
            {
                get
                {
                    Acceptor acceptor = this.Find((acc) => acc.number == Index);

                    if (acceptor != null)
                    {
                        AESImhei.ReadAcceptorDetails(acceptor.number, acceptor);
                    }

                    return(acceptor);
                }
                set
                {
                    Acceptor acceptor = this.Find((acc) => acc.number == Index);

                    if (acceptor != null)
                    {
                        this.Remove(acceptor);
                    }
                    if (value != null)
                    {
                        this.Add(value);
                    }
                }
            }
Пример #2
0
        /// <summary>
        /// Opens the MHE interface.
        /// </summary>
        /// <returns></returns>
        public int Open()
        {
            int retValue = AESImhei.OpenMHE();

            if (retValue != 0)
            {
                return(retValue);
            }

            meter = new CounterMeter();

            acceptors = new AcceptorList();
            // find out what Acceptors are connected by
            // attempting to get info on them
            for (int i = 0; i < 16; ++i)
            {
                // look for it and add it if it's there
                Acceptor acceptor = new Acceptor(i);
                if (AESImhei.ReadAcceptorDetails(i, acceptor))
                {
                    acceptors[i] = acceptor;
                }
            }

            dispensers = new DispenserList();
            // get info on all dispensers
            for (int i = 0; i < 16; ++i)
            {
                Dispenser dispenser = new Dispenser(i);
                if (AESImhei.ReadDispenserDetails(i, dispenser))
                {
                    dispensers[i] = dispenser;
                }
            }

            return(retValue);
        }
Пример #3
0
 public bool ReadDetails()
 {
     return(AESImhei.ReadAcceptorDetails(this.number, this));
 }