예제 #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);
        }