HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -141,7 +141,7 @@
                //停止接收
                this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    this.CloseForm();
                });
@@ -163,7 +163,7 @@
                return;
            }
            //根据设备Type创建对应的设备对象
            var device = Common.LocalDevice.Current.NewDeviceObjectByDeviceId((DeviceType)jobject.Value<int>("Device_ID"));
            var device = Common.LocalDevice.Current.NewDeviceObjectByDeviceId((DeviceType)jobject.Value<int>("Device_ID"), jobject.Value<int>("Epoint"));
            if (device == null)
            {
                return;
@@ -182,9 +182,6 @@
            //刷新超时时间
            this.waitDeviceTimeOut = 20;
            //获取设备的固定属性
            HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device);
            //不需要200端点的那个设备  2020.01.13 变更:ota也加进来
            this.listNewDevice.Add(device);
@@ -221,26 +218,36 @@
                this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
                System.Threading.Thread.Sleep(200);
                //目前就弄一个
                Application.RunOnMainThread(() =>
                var listDevice = new List<CommonDevice>();
                for (int i = 0; i < this.listNewDevice.Count; i++)
                {
                    var listDevice = new List<CommonDevice>();
                    for (int i = 0; i < this.listNewDevice.Count; i++)
                    var device = this.listNewDevice[i];
                    if (device.DeviceAddr != this.listNewDevice[0].DeviceAddr)
                    {
                        var device = this.listNewDevice[i];
                        if (device.DeviceAddr != this.listNewDevice[0].DeviceAddr)
                        {
                            continue;
                        }
                        listDevice.Add(device);
                        //重新变更UI
                        if (device is OTADevice)
                        {
                            continue;
                        }
                        device.IconPath = string.Empty;
                        device.ReSave();
                        continue;
                    }
                    listDevice.Add(device);
                    //重新变更UI
                    if (device is OTADevice)
                    {
                        continue;
                    }
                    device.IconPath = string.Empty;
                    device.ReSave();
                    //设置设备功能类型 (不能在接收回路的地方写入,不然网关可能会超负荷)
                    Common.LocalDevice.Current.RefreshDeviceFunctionType(device, device, true);
                    System.Threading.Thread.Sleep(200);
                    //获取设备的固定属性
                    if (HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device) == true)
                    {
                        System.Threading.Thread.Sleep(200);
                    }
                }
                //目前就弄一个
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //显示设备信息画面
                    this.ShowDeviceAddSuccessForm(listDevice);
                });
@@ -315,7 +322,7 @@
                            timeCount = 0;
                        }
                    }
                    Application.RunOnMainThread(() =>
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        if (btnRound != null)
                        {
@@ -439,6 +446,15 @@
            else if (topic == gatewayId + "/DeviceInComingRespon")
            {
                this.topTimeOut = topMaxTime;
                //设备入网时,有时候网关会上报虚拟设备
                var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
                CommonDevice.DeviceInfoData info = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceInfoData>(jobject["Data"].ToString());
                if (info.DriveCode != 0)
                {
                    //不需要虚拟设备
                    return 0;
                }
                //网关最终上报节点设备信息
                this.btnProgressBar.SetValue(6, 6);
                return 1;
@@ -468,7 +484,7 @@
                {
                    //响应超时,请重新入网
                    this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uResponseTimeoutsAndReAccessNetwork));
                    Application.RunOnMainThread(() =>
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        //关闭界面
                        this.CloseForm();