Example #1
0
        public void TestMethod1()
        {
            //Clean Ch./Light IWDV-100S-24
            var are = new AutoResetEvent(false);

            using (var light = new MvLeimacLightLdd())
            {
                light.TcpClient.EhDataReceive += (ss, ee) =>
                {
                    System.Diagnostics.Debug.WriteLine("Message:" + ee.Message);
                    System.Diagnostics.Debug.WriteLine("Data:" + ee.TrxMessage.GetString());
                    are.Set();
                };


                //LP
                //light.Model = MvEnumLeimacModel.IDGB_50M4PG_24_TP;
                //light.ConnectIfNo("192.168.0.119", 1000);

                //CL
                //light.Model = MvEnumLeimacModel.IWDV_100S_24;
                //light.ConnectIfNo("192.168.0.129", 1000);

                //OS
                //light.Model = MvEnumLeimacModel.IDGB_50M4PG_24_TP;
                //light.ConnectIfNo("192.168.0.139", 1000);

                //RB
                //light.Model = MvEnumLeimacModel.IDGB_50M4PG_24_TP;
                //light.ConnectIfNo("192.168.0.155", 1000);

                //IC1: ch1: Top Defense 環形光 ; ch2: Side Inspection 條形光 ; ch3: Side Defense 條形光 ; ch4: No install
                light.Model = MvEnumLeimacModel.IDGB_50M4PG_24_TP;
                light.ConnectIfNo("192.168.0.160", 1000);

                //IC2: ch1: Top Inspcetion 環形光 ; ch2: No install
                //light.Model = MvEnumLeimacModel.IDGB_50M2PG_12_TP;
                //light.ConnectIfNo("192.168.0.161", 1000);

                //IC3: ch1: Left Spot Light ; ch2: Right Spot Light
                //light.Model = MvEnumLeimacModel.IWDV_600M2_24;
                //light.ConnectIfNo("192.168.0.162", 1000);



                light.SetValue(1, 0);

                Thread.Sleep(1000);
                are.WaitOne();
            }
        }
Example #2
0
        public override int HalConnect()
        {
            this.ip      = this.GetDevConnStr(DevConnStr_Ip);
            this.port    = this.GetDevConnStrInt(DevConnStr_Port);
            this.model   = this.GetDevConnStrEnum <MvEnumLeimacModel>(DevConnStr_Model);
            this.channel = this.GetDevConnStrInt(DevConnStr_Channel);

            this.ldd = this.HalContext.ResourceGetOrRegister(this.resourceKey, () => new MvLeimacLightLdd()
            {
                RemoteIp   = this.ip,
                RemotePort = this.port,
                Model      = this.model,
            });

            return(0);
        }