コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (MyTCPServer == null)
            {
                MyTCPServer                 = new TcpServer();
                this.MyTCPServer.Port       = 2000;
                this.MyTCPServer.DataType   = TcpServer.StreamType.Text;
                this.MyTCPServer.OnConnect += Connection2_OnConnect;
                this.MyTCPServer.OnLeaving += Connection2_OnLeaving;

                MyTCPServer.Open();
            }
            else
            {
            }

            SmartRayImageSource.ImageSource srIs = new ImageSource();

            if (srIs.Configure(Application.StartupPath + "/ScanSmartRay_2/SmartRayImageSource.xml"))
            {
                SmartRayImageSource = srIs;

                SmartRayImageSource.OnImage += ImageSource_OnImage;
            }

            if (srIs != null)
            {
                srIs.OnPackageImage += SrIs_OnPackageImage;
            }
            // this.MainDisplay.ColorMapLoad(Application.StartupPath + "/ColorMap.map");


            NotifierHelper.Notify("App.Init.Sucess", "完成初始化。");

            //}


            {
                visionProAlg      = (CogSerializer.LoadObjectFromFile(Application.StartupPath + "/XXX.vpp") as CogToolBlock);
                visionProAlg.Ran += VisionAlgorithm_OnRan;
            }
            MessageBox.Show("完成初始化");
        }