Beispiel #1
0
        public override int HalConnect()
        {  // LddPool
            var connected = false;

            try
            {
                LddPool = MvaKjMachineDrawerLddPool.GetInstance(HostListenDrawerPortRangeStart, HostListenDrawerPortRangeEnd, HostListenDrawerSysEventPort);
                if (LddPool == null)
                {
                    connected = false;
                }
                else
                {
                    Ldd = LddPool.CreateLdd(DeviceId, DeviceEndPoint, HostIP);
                }
                if (Ldd == null || LddPool == null)
                {
                    connected = false;
                }
                else
                {
                    BindLddEvent();

                    connected = true;
                }
            }
            catch (Exception ex)
            {
                connected = false;
                MvaLog.WarnNs(this, ex);
            }
            return(connected ? 1 : 0);
        }
Beispiel #2
0
        public override int HalConnect()
        {  // LddPool
           /** real
            * var connected = false;
            * try
            * {
            *
            *  LddPool = MvKjMachineDrawerLddPool.GetInstance(HostListenDrawerPortRangeStart,HostListenDrawerPortRangeEnd, HostListenDrawerSysEventPort);
            *  if (LddPool == null)
            *  {
            *      connected = false;
            *
            *  }
            *  else
            *  {
            *      Ldd = LddPool.CreateLdd(DeviceIndex, DeviceEndPoint, HostIP);
            *  }
            *  if (Ldd == null || LddPool==null)
            *  {
            *      connected = false;
            *  }
            *  else
            *  {
            *      BindLddEvent();
            *
            *      connected = true;
            *  }
            *
            * }
            * catch (Exception ex)
            * {
            *  connected = false;
            * }
            * return connected ? 1:0;
            */
            #region  Fake
            LddPool = MvaKjMachineDrawerLddPool.GetFakeInstance(HostListenDrawerPortRangeStart, HostListenDrawerPortRangeEnd, HostListenDrawerSysEventPort);
            Ldd     = LddPool.CreateFakeLdd(DeviceId, DeviceEndPoint, HostIP);
            Debug.WriteLine("[Fake] Drawer HalConnect(); DeviceIndex=" + DeviceId + ", HostIP=" + HostIP + ", DeviceEndPoint=" + DeviceEndPoint.Address + ":" + DeviceEndPoint.Port);

            return(1);

            #endregion
        }