Beispiel #1
0
        private async void OnScanDevice(object obj)
        {
            ScanBtnEnable = false;
            var result = await _hcdzClient.ScanDevice(0);

            Thread.Sleep(200);
            var result2 = await _hcdzClient.ScanDevice(1);

            if (string.IsNullOrEmpty(result) && string.IsNullOrEmpty(result2))
            {
                MessageBox.Show("设备所有通道自检正常!");
                ScanBtnEnable = true;
            }
            else if (result.Contains("device") || result.Contains("orther") || result2.Contains("device") || result.Contains("orther"))
            {
                MessageBox.Show("设备自检发生异常!");
                ScanBtnEnable = true;
            }
            else
            {
                string showMsg = string.Format("设备通道{0},{1}有异常! \n", result, result2);
                MessageBox.Show(showMsg);
                LogInfo += showMsg;
            }
            ScanBtnEnable = true;
            var network = await _hcdzClient.GetNetWork();

            if (network)
            {
                LogInfo += "网络连接正常!\n";
            }
            else
            {
                LogInfo += "网络连接异常,请检查服务端网口!\n";
            }
        }