From 51cd95b143cd928ea86a11e3618256a7d779c745 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 24 十二月 2019 13:22:53 +0800
Subject: [PATCH] 2019-12-24-1
---
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs | 39 +++++++++++++++++++++++++++++++--------
1 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
index a110acf..a628933 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -783,7 +783,7 @@
#endregion
#region ------鍦ㄥ 绂诲
- #region ------鍦ㄥ
+ #region ------鍦ㄥ
var athomeFrameLayout = new FrameLayout
{
@@ -879,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;
@@ -903,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;
}
}
@@ -925,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"))
@@ -943,14 +964,16 @@
}
LocationConditionsInfo.Add("AtHome", "1");
}
- double a1 = Config.Instance.Home.Latitude, a2 = Config.Instance.Home.Longitude;
+
//璋冪敤鏂规硶锛岃烦杞〉闈�
GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
{
+ //鎴彇瀛楃涓插悗绗�6浣嶏紱
+ //var len = name.Substring(name.Length - 6, 6);
//鐐瑰嚮淇濆瓨鎸夐挳锛屽洖璋冨綋鍓嶉�夋嫨鐨勭含搴︼紝缁忓害锛屽崐寰勮寖鍥�
- 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"))
{
@@ -974,8 +997,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);
@@ -983,7 +1006,7 @@
UserView.HomePage.Instance.AddChidren(logicCommunalPage);
UserView.HomePage.Instance.PageIndex += 1;
logicCommunalPage.Show(() => { });
- }, strname, true, a1, a2, 500);
+ }, strname, true, latitude, longitude, r);
};
}
--
Gitblit v1.8.0