HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-03-06 a5b3c4bae726ef6770d4bfcbf2f4b50a37ed4a15
ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedContentForm.cs
@@ -155,12 +155,15 @@
            this.frameSceneTable.RemoveAll();
            var listScene = new List<Common.SceneUI>();
            for (int i = 0; i < lookRoom.SceneUIList.Count; i++)
            for (int i = 0; i < lookRoom.ListSceneId.Count; i++)
            {
                if (HdlShardLogic.Current.IsFileExists(lookRoom.SceneUIList[i].FileName) == true)
                var byteData = HdlShardLogic.Current.GetShardFileContent($"Scene_{lookRoom.ListSceneId[i]}.json");
                if (byteData == null)
                {
                    listScene.Add(lookRoom.SceneUIList[i]);
                    continue;
                }
                var sceneUi = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.SceneUI>(System.Text.Encoding.UTF8.GetString(byteData));
                listScene.Add(sceneUi);
            }
            if (listScene.Count == 0)
            {
@@ -171,26 +174,22 @@
            HdlThreadLogic.Current.RunMainInThread(() =>
            {
                var listView = new VerticalFrameControl(29);
                var listView = new VerticalFrameControl(3);
                listView.Y = Application.GetRealHeight(53);
                listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(187);
                frameSceneTable.AddChidren(listView);
                foreach (var data in listScene)
                {
                    //场景图片
                    var frameContr = new FrameLayoutControl();
                    frameContr.UseClickStatu = false;
                    frameContr.Width = Application.GetRealWidth(878);
                    frameContr.Height = Application.GetRealHeight(440);
                    frameContr.Gravity = Gravity.CenterHorizontal;
                    frameContr.BackgroundImagePath = data.IconPath;
                    //场景控件
                    var frameContr = new ScenePictrueControl();
                    listView.AddChidrenFrame(frameContr);
                    frameContr.InitControl(data);
                    var btnSelect = new IconViewControl(58);
                    btnSelect.UnSelectedImagePath = "Item/ItemUnSelected.png";
                    btnSelect.SelectedImagePath = "Item/ItemSelected.png";
                    btnSelect.X = Application.GetRealWidth(786);
                    btnSelect.X = Application.GetRealWidth(887);
                    btnSelect.Y = Application.GetRealHeight(35);
                    frameContr.AddChidren(btnSelect, ChidrenBindMode.BindEventOnly);
                    if (dicSelectScene.ContainsKey(data.Id) == true)
@@ -219,6 +218,8 @@
                        }
                    };
                }
                //调整一下高度
                listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(185));
            });
        }
@@ -245,13 +246,13 @@
                }
                else
                {
                    var frameBack = new FrameLayoutControl(false);
                    var frameBack = new FrameLayout();
                    frameBack.X = ControlCommonResourse.XXLeft;
                    frameBack.Y = Application.GetRealHeight(178);
                    frameBack.BackgroundColor = UserCenterColor.Current.White;
                    frameBack.Width = bodyFrameLayout.Width;
                    frameBack.Height = Application.GetRealHeight(1650);
                    frameBack.RadiusEx = 20;
                    frameBack.Radius = (uint)Application.GetRealHeight(58);
                    frameDeviceTable.AddChidren(frameBack);
                    var listView = new VerticalListControl(23);
@@ -300,6 +301,8 @@
        private void AddDeviceRow(List<CommonDevice> listDevice, VerticalListControl listView)
        {
            listView.RemoveAll();
            //还原高度
            listView.RecoverHeight();
            foreach (var device in listDevice)
            {
@@ -348,6 +351,8 @@
                    }
                };
            }
            //列表自己有个23的Y轴坐标
            listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23), Application.GetRealHeight(300 - 23));
        }
        #endregion
@@ -365,44 +370,10 @@
            var dic = new Dictionary<int, List<CommonDevice>>();
            foreach (var device in listDevice)
            {
                var typeInfo = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
                if (device.Type == DeviceType.IASZone)
                var typeInfo = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
                if (dic.ContainsKey(typeInfo.BeloneTextId) == false)
                {
                    //这个强制为传感器
                    typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId1200;
                    typeInfo.ConcreteType = Common.DeviceConcreteType.Sensor;
                }
                if (device.Type == DeviceType.OnOffOutput)
                {
                    //继电器的时候,需要特殊处理
                    if (device.DfunctionType == DeviceFunctionType.A开关)
                    {
                        typeInfo.BeloneTextId = R.MyInternationalizationString.uSwitch;
                    }
                    else if (device.DfunctionType == DeviceFunctionType.A插座)
                    {
                        typeInfo.BeloneTextId = R.MyInternationalizationString.uSocket1;
                    }
                    else if (device.DfunctionType == DeviceFunctionType.A灯光)
                    {
                        typeInfo.BeloneTextId = R.MyInternationalizationString.uLight;
                    }
                    else
                    {
                        //继电器
                        typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId2300;
                    }
                    if (dic.ContainsKey(typeInfo.BeloneTextId) == false)
                    {
                        dic[typeInfo.BeloneTextId] = new List<CommonDevice>();
                    }
                }
                else
                {
                    if (dic.ContainsKey(typeInfo.BeloneTextId) == false)
                    {
                        dic[typeInfo.BeloneTextId] = new List<CommonDevice>();
                    }
                    dic[typeInfo.BeloneTextId] = new List<CommonDevice>();
                }
                dic[typeInfo.BeloneTextId].Add(device);
            }
@@ -462,8 +433,9 @@
        {
            //获取这个房间里面的分享设备
            var listDevice = new List<CommonDevice>();
            foreach (var deviceFile in this.lookRoom.DeviceUIFilePathList)
            foreach (var deviceKeys in this.lookRoom.ListDevice)
            {
                string deviceFile = HdlShardLogic.Current.GetShardDeviceFileName(deviceKeys);
                if (memberShardInfo.dicAllShardKeys.ContainsKey(deviceFile) == true)
                {
                    var strArry = deviceFile.Split('_');