예제 #1
0
        public bool doubleconnect(ref AxipermtinterfaceLib.AxIIpeDisplay display1, ref AxipermtinterfaceLib.AxIIpeDisplay display2, string ipAddr)
        {
            visionDisplay = display1;
            hSherlock     = new ipermtinterfaceLib.IIpeRmtInterface();

            //Connect
            if (!hSherlock.connectServer_1(ipAddr))
            {
                Status = "Error While Connect " + ipAddr;
                return(false);
            }

            //Initialize
            if (!hSherlock.initialize())
            {
                Status = "Error While Initialize " + ipAddr;
                return(false);
            }

            //Connect Display
            //hSherlock.connectDisplay("image_windowA", BoaProDisplay1.displayHandle());
            hSherlock.connectDisplay("image_windowA", display1.displayHandle());
            hSherlock.connectDisplay("image_windowA", display2.displayHandle());
            Status = "Connection " + ipAddr;

            hSherlock.programLoopCompleted +=
                new ipermtinterfaceLib.IIIpeRmtInterfaceEvents_programLoopCompletedEventHandler(Device_ProgramLoopCompleted);

            return(true);
        }
예제 #2
0
        public bool disconnect()
        {
            try {
                //Disconnect Display
                hSherlock.disconnectDisplay(visionDisplay.displayHandle());

                //Disconnect
                if (!hSherlock.disconnectServer())
                {
                    Status = "Error While Disconnect ";
                    return(false);
                }
                else
                {
                    Status = "No connection";
                    return(true);
                }
            }
            catch (Exception) {
                Status = "Error While Disconnect ";
                return(false);
            }
        }
예제 #3
0
        public bool connect(ref AxipermtinterfaceLib.AxIIpeDisplay display, string ipAddr, bool withdisp)
        {
            visionDisplay = display;
            hSherlock     = new ipermtinterfaceLib.IIpeRmtInterface();

            //Connect
            if (!hSherlock.connectServer_1(ipAddr))
            {
                Status = "Error While Connect " + ipAddr;
                return(false);
            }

            //Initialize
            if (!hSherlock.initialize())
            {
                Status = "Error While Initialize " + ipAddr;
                return(false);
            }

            //Connect Display
            //hSherlock.connectDisplay("image_windowA", BoaProDisplay1.displayHandle());
            if (withdisp)
            {
                try
                {
                    hSherlock.connectDisplay("image_windowA", display.displayHandle());
                }
                catch (Exception ex)
                {
                    throw ex.InnerException;
                }
                ;
            }

            Status = "Connection " + ipAddr;

            hSherlock.programLoopCompleted +=
                new ipermtinterfaceLib.IIIpeRmtInterfaceEvents_programLoopCompletedEventHandler(Device_ProgramLoopCompleted);

            return(true);
        }