WJC
2019-12-19 7a23bcdf0fe5f7442aa95ec2203cd5b6670a910d
2019-12-19-1

修复地理围栏,场景显示等问题,请合并代码
8个文件已修改
166 ■■■■ 已修改文件
ZigbeeApp/GateWay.Droid/Assets/Language.ini 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Home.Ios/Resources/Language.ini 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Category/Category.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/R.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -607,6 +607,7 @@
5370=请选择用户,否则无法执行下一步.
5371=请选择场景,否则无法执行下一步.
5372=请选择安防模式,否则无法执行下一步.
5373=自动化已执行.
ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -607,6 +607,7 @@
5370=请选择用户,否则无法执行下一步.
5371=请选择场景,否则无法执行下一步.
5372=请选择安防模式,否则无法执行下一步.
5373=自动化已执行.
ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -722,6 +722,7 @@
            //new一个新逻辑对象;
            Common.Logic.CurrentLogic = new Common.Logic();
            Common.Logic.CurrentLogic.IsEnable = 1;//默认为开
            Common.Logic.CurrentLogic.LogicCustomPushText = Language.StringByID(MyInternationalizationString.defaulttext);
            Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
            var addLogicPage = new Shared.Phone.Device.Logic.AddLogicPage();
            UserView.HomePage.Instance.AddChidren(addLogicPage);
@@ -1747,7 +1748,8 @@
        private  void ShowAutotion()
        {
            functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            var bjFrameLayout = new FrameLayout
            {
                Width = Application.GetRealWidth(1080 - 58),
@@ -1807,7 +1809,7 @@
            var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
            {
                Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                X = Application.GetRealWidth(58),
                //Radius = (uint)Application.GetRealHeight(50),
                Y = scenehorizontalScrol.Bottom,
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -925,8 +925,13 @@
                {
                    LocationConditionsInfo.Remove("IsValid");
                }
                if (LocationConditionsInfo.ContainsKey("WhoSiteUId"))
                {
                    LocationConditionsInfo.Remove("WhoSiteUId");
                }
                LocationConditionsInfo.Add("Type", "7");
                LocationConditionsInfo.Add("IsValid", "1");
                LocationConditionsInfo.Add("WhoSiteUId", Config.Instance.Guid);
                if (leavehomeSelected.Visible)
                {
                    if (LocationConditionsInfo.ContainsKey("AtHome"))
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -18,7 +18,7 @@
            Tag = "LockLogic";
        }
        EditText logicTextBox;
        public void Show(Action action)
        public async void Show(Action action)
        {
            #region  最上面的布局代码
@@ -283,7 +283,8 @@
                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
                                if (deviceinof == null)
                                {
                                    continue;
                                    deviceinof = new ZigBee.Device.CommonDevice();
                                    //continue;
                                }
                                ///显示设备名称
                                var btndevice = new Button
@@ -554,7 +555,8 @@
                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
                                if (deviceinof == null)
                                {
                                    continue;
                                    deviceinof = new ZigBee.Device.CommonDevice();
                                    //continue;
                                }
                                ///设备名称Button
@@ -864,12 +866,30 @@
                        case 2:
                            {
                                //在本地查找该场景;
                                var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); });
                                //本地没有存在;
                                if (sceneinof == null)
                                {
                                    continue;
                                    //在网关查找该场景;
                                    sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
                                    //网关没有存在;
                                    if (sceneinof == null)
                                    {
                                        //注解:本地和网关都不存在该场景,界面将不会显示该场景;
                                        //sceneinof = new SceneUI();
                                        //移除该场景数据;
                                        Common.Logic.CurrentLogic.Actions.Remove(actions);
                                        //移除该场景视图;
                                        devicesFrameLayout.RemoveFromParent();
                                        continue;
                                    }
                                }
                                actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
                                ///设备名称Button
                                var btndevicename = new Button
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -18,7 +18,7 @@
            Tag = "Logic";
        }
        EditText logicTextBox;
        public void Show(Action action)
        public async void Show(Action action)
        {
            
            #region  最上面的布局代码
@@ -497,7 +497,8 @@
                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
                                if (deviceinof == null)
                                {
                                    continue;
                                    deviceinof = new ZigBee.Device.CommonDevice();
                                    //continue;
                                }
                                ///显示设备名称
                                var btndevice = new Button
@@ -1195,9 +1196,11 @@
                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
                                if (deviceinof == null)
                                {
                                    continue;
                                    deviceinof = new ZigBee.Device.CommonDevice();
                                    // continue;
                                }
                                ///设备名称Button
                                var btndevicename = new Button
                                {
@@ -1503,11 +1506,25 @@
                            break;
                        case 2:
                            {
                                //在本地查找该场景;
                                var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); });
                                //本地没有存在;
                                if (sceneinof == null)
                                {
                                    continue;
                                    //在网关查找该场景;
                                    sceneinof =await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
                                    //网关没有存在;
                                    if (sceneinof == null)
                                    {
                                        //注解:本地和网关都不存在该场景,界面将不会显示该场景;
                                        //sceneinof = new SceneUI();
                                        //移除该场景数据;
                                        Common.Logic.CurrentLogic.Actions.Remove(actions);
                                        //移除该场景视图;
                                        devicesFrameLayout.RemoveFromParent();
                                        continue;
                                    }
                                }
                                actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
@@ -1539,7 +1556,6 @@
                                Common.Room room = new Common.Room();
                                btnregionname.Text = room.GetRoomNameBySceneId(sceneinof.Id);
                                //Send.RoomNmae(btnregionname, deviceinof);
                            }
@@ -1752,6 +1768,7 @@
                            if (e1)
                            {
                                Common.Logic.CurrentLogic.Actions.Remove(actions);
                                // devicesFrameLayout.RemoveFromParent();
                                var logicCommunalPage = new LogicCommunalPage();
                                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                                UserView.HomePage.Instance.PageIndex += 1;
@@ -1888,23 +1905,11 @@
                Gravity = Gravity.CenterVertical,
            };
            pushswitchRowlayout.AddChidren(btnswitch);
            btnswitch.MouseUpEventHandler += (sender1, e1) =>
            {
                btnswitch.IsSelected = !btnswitch.IsSelected;
                if (btnswitch.IsSelected)
                {
                }
                else
                {
                }
            };
            var custompushFrameLayout = new FrameLayout
            {
                Height = Application.GetRealHeight(160),
                Height = Application.GetRealHeight(0),
                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
            };
            middle.AddChidren(custompushFrameLayout);
@@ -1952,7 +1957,18 @@
            btncustompush.MouseUpEventHandler += customclick;
            custompushback.MouseUpEventHandler += customclick;
            custompushRowLayout.MouseUpEventHandler += customclick;
            btnswitch.MouseUpEventHandler += (sender1, e1) =>
            {
                btnswitch.IsSelected = !btnswitch.IsSelected;
                if (btnswitch.IsSelected)
                {
                    custompushFrameLayout.Height = Application.GetRealHeight(160);
                }
                else
                {
                    custompushFrameLayout.Height = Application.GetRealHeight(0);
                }
            };
            #endregion
@@ -2523,7 +2539,7 @@
        }
        /// <summary>
        /// 闪现提示框的方法
        /// 闪现式提示框的方法
        /// </summary>
        /// <param name="tipText">提示内容</param>
        /// <param name="second">停留时间单位为s</param>
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -380,6 +380,16 @@
                                };
                                conditions.Add(sInfo);
                                break;
                            case 7:
                                var diliInfo = new JObject
                                {
                                    ["Type"] = int.Parse(dictionary["Type"]),
                                    ["IsValid"] = int.Parse(dictionary["IsValid"]),
                                    ["AtHome"] = int.Parse(dictionary["AtHome"]),
                                    ["WhoSiteUId"] =dictionary["WhoSiteUId"],
                                };
                                conditions.Add(diliInfo);
                                break;
                        }
                    }
                    var actions = new JArray();
@@ -735,7 +745,59 @@
            //return list1;
        }
        /// <summary>
        /// 获取场景信息的方法
        /// </summary>
        /// <param name="SceneId"></param>
        /// <returns></returns>
        public static async System.Threading.Tasks.Task<SceneUI> GetScene(int SceneId)
        {
            SceneUI sceneui = null;
            return await System.Threading.Tasks.Task.Run(async () =>
            {
                Action<string, string> action = (topic, data) =>
                {
                    var gatewayID = topic.Split('/')[0];
                    var jObjectdata = JObject.Parse(data);
                    if (jObjectdata == null)
                    {
                        return;
                    }
                    if (topic == $"{gatewayID}/Scene/GetDeviceList_Respon")
                    {
                        sceneui = new SceneUI();
                        sceneui.Name = jObjectdata["Data"]["ScenesName"].ToString();
                        sceneui.Id = int.Parse(jObjectdata["Data"]["ScenesId"].ToString());
                    }
                };
                var mainGateWay = ZbGateway.MainGateWay;
                if (mainGateWay == null)
                {
                    Console.WriteLine("没有主网关");
                    return sceneui;
                }
                mainGateWay.GwResDataAction += action;
                var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 806 } };
                var jObjectdata1 = new JObject { { "ScenesId", SceneId } };
                jObject.Add("Data", jObjectdata1);
                mainGateWay?.Send("Scene/GetDeviceList", jObject.ToString());
                var dateTime = DateTime.Now;
                while ((DateTime.Now - dateTime).TotalMilliseconds < 3 * 1000)
                {
                    await System.Threading.Tasks.Task.Delay(100);
                    if (sceneui!=null)
                    {
                        break;
                    }
                }
                ZbGateway.MainGateWay.GwResDataAction -= action;
                return sceneui;
            });
        }
        #endregion
        #region  ----获取门锁
ZigbeeApp/Shared/R.cs
@@ -577,6 +577,7 @@
        public readonly static int usertip = 5370;
        public readonly static int scenetip = 5371;
        public readonly static int securitytip = 5372;
        public readonly static int defaulttext = 5373;
        #region 登录注册
        /// <summary>