Exemple #1
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);
        }
Exemple #2
0
            public new Dispenser this[int Index]
            {
                get
                {
                    Dispenser dispenser = this.Find((disp) => disp.number == Index);

                    if (dispenser != null)
                    {
                        AESImhei.ReadDispenserDetails(dispenser.number, dispenser);
                    }

                    return(dispenser);
                }
                set
                {
                    Dispenser dispenser = this.Find((disp) => disp.number == Index);
                    if (dispenser != null)
                    {
                        this.Remove(dispenser);
                    }
                    dispenser = value;
                    this.Add(dispenser);
                }
            }
Exemple #3
0
 public bool ReadDetails()
 {
     return(AESImhei.ReadDispenserDetails(this.number, this));
 }