HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-12-30 3dcbd186c42c598c0c08d1cd37034cf2baa09e54
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -222,7 +222,7 @@
            rowInfo.MenuRow = rowMenu;
            //向右图标
            var btnRight = rowMenu.frameTable.AddMostRightEmptyIcon(58, 58);
            btnRight.UnSelectedImagePath = "Item/Next.png";
            btnRight.UnSelectedImagePath = "Item/RightNext.png";
            btnRight.SelectedImagePath = "Item/Down.png";
            rowMenu.frameTable.ChangedChidrenBindMode(btnRight, ChidrenBindMode.NotBind);
@@ -626,51 +626,44 @@
        /// <param name="device"></param>
        private void ReceiveDeviceStatu(CommonDevice device)
        {
            lock (dicRowInfo)
            DeviceObjRowInfo rowInfo = null;
            if (this.dicRowInfo.ContainsKey(device.DeviceAddr) == true)
            {
                if (this.Parent == null)
                rowInfo = this.dicRowInfo[device.DeviceAddr];
            }
            if (rowInfo == null || rowInfo.MenuRow == null)
            {
                return;
            }
            //刷新设备的在线状态
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
            var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
            if (localDevice != null)
            {
                //在线状态一样的话,不需要刷新
                if (localDevice.IsOnline == device.IsOnline)
                {
                    return;
                }
                DeviceObjRowInfo rowInfo = null;
                if (this.dicRowInfo.ContainsKey(device.DeviceAddr) == true)
                {
                    rowInfo = this.dicRowInfo[device.DeviceAddr];
                }
                if (rowInfo == null || rowInfo.MenuRow == null)
                {
                    return;
                }
                //刷新设备的在线状态
                string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
                if (localDevice != null)
                {
                    //在线状态一样的话,不需要刷新
                    if (localDevice.IsOnline == device.IsOnline)
                    {
                        return;
                    }
                    //保存状态
                    localDevice.IsOnline = device.IsOnline;
                    localDevice.ReSave();
                }
                //保存状态
                localDevice.IsOnline = device.IsOnline;
                localDevice.ReSave();
            }
                HdlThreadLogic.Current.RunMain(() =>
            HdlThreadLogic.Current.RunMain(() =>
            {
                if (rowInfo != null)
                {
                    if (rowInfo != null)
                    rowInfo.MenuRow.isOnline = device.IsOnline == 1;
                    if (rowInfo.dicDetailRow != null)
                    {
                        rowInfo.MenuRow.isOnline = device.IsOnline == 1;
                        if (rowInfo.dicDetailRow != null)
                        foreach (var detailRow in rowInfo.dicDetailRow.Values)
                        {
                            foreach (var detailRow in rowInfo.dicDetailRow.Values)
                            {
                                detailRow.isOnline = rowInfo.MenuRow.isOnline;
                            }
                            detailRow.isOnline = rowInfo.MenuRow.isOnline;
                        }
                    }
                });
            }
                }
            });
        }
        /// <summary>
@@ -704,7 +697,7 @@
        {
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceListFormSensor", ReceiveComandDiv.A传感器上报, (device) =>
             {
                 Application.RunOnMainThread(() =>
                 HdlThreadLogic.Current.RunMain(() =>
                 {
                     if (this.dicRowInfo.ContainsKey(device.DeviceAddr) == false)
                     {