Exemplo n.º 1
0
        /// <summary>產生 Drawer</summary>
        /// <param name="cabinetNo">Cabinet 編號</param>
        /// <param name="drawerNo">Drawer 編號</param>
        /// <param name="deviceIP">裝置 IP</param>
        /// <param name="udpServerPort">Drawer 內建 UDP Server Port</param>
        /// <returns></returns>
        public MvaKjMachineDrawerLdd CreateDrawer(int cabinetNo, string drawerNo, IPEndPoint deviceEndpoint, string localIP)
        {
            try
            {
                MvaKjMachineDrawerLdd drawer = new MvaKjMachineDrawerLdd(cabinetNo, drawerNo, deviceEndpoint, localIP, this.PortStatusDictionary);

                Drawers.Add(drawer);
                return(drawer);
            }
            catch (Exception ex)
            {
                MvaLog.WarnNs(this, ex);
                return(null);
            }
        }
 public MvaKjMachineDrawerLdd CreateLdd(string drawerIndex, IPEndPoint deviceEndpoint, string localIP)
 {
     try
     {
         // 檢查一下, ldd 是否存在, 如果存在, 就將 Ldd 找出來,回傳 Note: 2020/11/13 King
         MvaKjMachineDrawerLdd ldd = new MvaKjMachineDrawerLdd(drawerIndex, deviceEndpoint, localIP, this.PortStatusDictionary);
         _ldds.Add(ldd);
         return(ldd);
     }
     catch (Exception ex)
     {
         MvaLog.WarnNs(this, ex);
         return(null);
     }
 }