Пример #1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                //语言

                //数据源
                txtTxpower.DataContext        = JsonInterFace.WhiteListSelfLearningParameter;
                txtDuration.DataContext       = JsonInterFace.WhiteListSelfLearningParameter;
                txtClearWhiteList.DataContext = JsonInterFace.WhiteListSelfLearningParameter;
                txtCommand.DataContext        = JsonInterFace.WhiteListSelfLearningParameter;
                //白名单状态
                txtWhitelListSellLearningStatus.DataContext = JsonInterFace.LTEDeviceDetail;

                //获取白名单自学习状态
                if (NetWorkClient.ControllerServer.Connected)
                {
                    string   DomainFullPathName  = string.Empty;
                    string[] _DomainFullPathName = RemoteAPInfoParameter.DomainFullPathName.Split(new char[] { '.' });
                    for (int i = 0; i < _DomainFullPathName.Length - 1; i++)
                    {
                        if (DomainFullPathName == "" || DomainFullPathName == null)
                        {
                            DomainFullPathName = _DomainFullPathName[i];
                        }
                        else
                        {
                            DomainFullPathName += "." + _DomainFullPathName[i];
                        }
                    }
                    NetWorkClient.ControllerServer.Send(
                        JsonInterFace.GetDeviceDetailRequest(
                            DomainFullPathName,
                            RemoteAPInfoParameter.DeviceName
                            )
                        );
                }
                else
                {
                    MessageBox.Show("网络与服务器断开!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                }

                //自学习状态参数查询
                if (NetWorkClient.ControllerServer.Connected)
                {
                    NetWorkClient.ControllerServer.Send(
                        JsonInterFace.APWhiteListSelfLearningParameterQuery(
                            RemoteAPInfoParameter.DomainFullPathName,
                            RemoteAPInfoParameter.DeviceName,
                            RemoteAPInfoParameter.IP,
                            RemoteAPInfoParameter.Port,
                            RemoteAPInfoParameter.InnerType,
                            RemoteAPInfoParameter.SN
                            )
                        );
                }
                else
                {
                    MessageBox.Show("网络与服务器断开!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            catch (Exception ex)
            {
                Parameters.PrintfLogsExtended(ex.Message, ex.StackTrace);
            }
        }