예제 #1
0
파일: MHE.cs 프로젝트: ilandembinsky8/pt1
        /// <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);
        }
예제 #2
0
파일: MHE.cs 프로젝트: ilandembinsky8/pt1
            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);
                }
            }
예제 #3
0
파일: MHE.cs 프로젝트: ilandembinsky8/pt1
 public bool ReadDetails()
 {
     return(AESImhei.ReadDispenserDetails(this.number, this));
 }