Exemplo n.º 1
0
 /// <summary>
 /// 加载扫码器信息
 /// </summary>
 private void AddCode()
 {
     if (CommonSQL.GetWcsParam("WCS_SCAN_CODE", out List <WCS_PARAM> info))
     {
         foreach (WCS_PARAM item in info)
         {
             Codes.Add(new CodeBase()
             {
                 _ip      = item.VALUE1,
                 _name    = item.VALUE2,
                 _forType = item.VALUE4,
                 _forDev  = item.VALUE5
             });
         }
     }
 }
Exemplo n.º 2
0
        private void RefreshData()
        {
            try
            {
                DList = ADS.GetDevInfo();
                EList = ADS.GetDevError();

                if (CommonSQL.GetWcsParam("WCS_SCAN_CODE", out List <WCS_PARAM> info))
                {
                    foreach (WCS_PARAM item in info)
                    {
                        bool isOnline = ADS.mSocket.IsConnected(string.Format("{0}-{1}-{2}", "Scan", item.VALUE4, item.VALUE5));
                        switch (item.VALUE3)
                        {
                        case 1:
                            CBscan1.IsChecked = isOnline;
                            break;

                        case 2:
                            CBscan2.IsChecked = isOnline;
                            break;

                        case 3:
                            CBscan3.IsChecked = isOnline;
                            break;

                        default:
                            break;
                        }
                    }
                }

                ShowData();
            }
            catch (Exception ex)
            {
                Notice.Show(ex.Message, "异常", 3, MessageBoxIcon.Error);
            }
        }