HDL Home App 第二版本 旧平台金堂用 正在使用
WJC
2019-12-20 e1bfa1d3bf3819bbae18228eb10eacc2f6912d14
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -36,6 +36,7 @@
                Height = Application.GetRealHeight(69),
                Y = Application.GetRealHeight(92),
                TextID = MyInternationalizationString.selection,
                IsBold = true,
            };
            topRowLayout.AddChidren(titleName);
@@ -383,23 +384,17 @@
                flMain.RemoveFromParent();
            };
            var securityfra1 = new FrameLayout
            {
                Width = Application.GetRealWidth(1080),
                Height = Application.GetRealHeight(100),
                Y = Application.GetRealHeight(1920 - 100),
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
            };
            flMain.AddChidren(securityfra1);
            var securityfra = new FrameLayout
            {
                Width = Application.GetRealWidth(1080),
                Height = Application.GetRealHeight(690),
                Y = Application.GetRealHeight(1920 - 690),
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                Radius = (uint)Application.GetRealHeight(60),
                //Radius = (uint)Application.GetRealHeight(60),
            };
            flMain.AddChidren(securityfra);
            securityfra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            #region  -------取消   完成
            var timetype = new RowLayout
            {
@@ -726,24 +721,17 @@
                flMain.RemoveFromParent();
            };
            var Locationfra1 = new FrameLayout
            {
                Width = Application.GetRealWidth(1080),
                Height = Application.GetRealHeight(100),
                Y = Application.GetRealHeight(1920 - 100),
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
            };
            flMain.AddChidren(Locationfra1);
            var Locationfra = new FrameLayout
            {
                Width = Application.GetRealWidth(1080),
                Height = Application.GetRealHeight(530),
                Y = Application.GetRealHeight(1920 - 530),
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                Radius = (uint)Application.GetRealHeight(60),
                //Radius = (uint)Application.GetRealHeight(60),
            };
            flMain.AddChidren(Locationfra);
            Locationfra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            #region  -------取消   完成
            var typeRow = new RowLayout
@@ -795,7 +783,7 @@
            #endregion
            #region  ------在家   离家  
            #region ------在家
             #region ------在家
            var athomeFrameLayout = new FrameLayout
            {
@@ -891,14 +879,18 @@
            leavehomeSelected.MouseUpEventHandler += leavehomeclick;
            leavehomeRowLayout.MouseUpEventHandler += leavehomeclick;
            leavehomeFrameLayout.MouseUpEventHandler += leavehomeclick;
            double latitude = Config.Instance.Home.Latitude;//纬度
            double longitude = Config.Instance.Home.Longitude;//经度
            int r = 500;//半径
            if (edit)
            {
                string guid = "";
                foreach (var Locationifon in Common.Logic.CurrentLogic.Conditions)
                {
                    if (Locationifon["Type"] == "7")
                    {
                        guid = Locationifon["WhoSiteUId"];
                        if (Locationifon["AtHome"] == "0")
                        {
                            strname = btnleavehome.Text;
@@ -915,6 +907,18 @@
                            btnleavehome.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
                            btnathome.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
                        }
                        break;
                    }
                }
                foreach (var accounts in Common.Logic.CurrentLogic.Accounts)
                {
                    if (accounts["Type"] == "7" && accounts["Account"] == guid)
                    {
                        latitude = Convert.ToDouble(accounts["Latitude"])/1000000.0;
                        longitude = Convert.ToDouble(accounts["Longitude"]) / 1000000.0;
                        r = int.Parse(accounts["Radius"]);
                        break;
                    }
                }
@@ -937,8 +941,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"))
@@ -955,14 +964,14 @@
                    }
                    LocationConditionsInfo.Add("AtHome", "1");
                }
                double a1 = Config.Instance.Home.Latitude, a2 = Config.Instance.Home.Longitude;
                //调用方法,跳转页面
                GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
                {
                    //点击保存按钮,回调当前选择的纬度,经度,半径范围
                    var latitud = (int)Math.Truncate(mLatitude * 1000000);
                    var longitude = (int)Math.Truncate(mLongitude * 1000000);
                    var latitudW = (int)Math.Truncate(mLatitude * 1000000);
                    var longitudeH = (int)Math.Truncate(mLongitude * 1000000);
                    Dictionary<string, string> accounts = new Dictionary<string, string>();
                    if (accounts.ContainsKey("Account"))
                    {
@@ -986,8 +995,8 @@
                    }
                    accounts.Add("Account", Config.Instance.Guid);
                    accounts.Add("Type", "7");
                    accounts.Add("Latitude", latitud.ToString());
                    accounts.Add("Longitude", longitude.ToString());
                    accounts.Add("Latitude", latitudW.ToString());
                    accounts.Add("Longitude", longitudeH.ToString());
                    accounts.Add("Radius", mRadius.ToString());
                    LogicIfon.Addaccounts(accounts);
                    LogicIfon.AddLocationconditions(LocationConditionsInfo);
@@ -995,7 +1004,7 @@
                    UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                    UserView.HomePage.Instance.PageIndex += 1;
                    logicCommunalPage.Show(() => { });
                }, strname, true, a1, a2, 500);
                }, strname, true, latitude, longitude, r);
            };
        }
@@ -1013,14 +1022,7 @@
                flMain.RemoveFromParent();
            };
            var timetypeframelayout1 = new FrameLayout
            {
                Width = Application.GetRealWidth(1080),
                Height = Application.GetRealHeight(100),
                Y = Application.GetRealHeight(1920 - 100),
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
            };
            flMain.AddChidren(timetypeframelayout1);
            var timetypeframelayout = new FrameLayout
            {
@@ -1028,9 +1030,10 @@
                Height = Application.GetRealHeight(530),
                Y = Application.GetRealHeight(1920 - 530),
                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                Radius = (uint)Application.GetRealHeight(60),
               // Radius = (uint)Application.GetRealHeight(60),
            };
            flMain.AddChidren(timetypeframelayout);
            timetypeframelayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
            #region  -------取消   完成
            var timetype = new RowLayout