From eb424d24e39bab4a245725f35deab3f234ea0f13 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 13 十二月 2019 10:48:50 +0800
Subject: [PATCH] 2019.12.13
---
ZigbeeApp/Shared/Common/House.cs | 64 +++++++++++++++++++++++--------
1 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs
old mode 100755
new mode 100644
index 7d0728e..138ad8e
--- a/ZigbeeApp/Shared/Common/House.cs
+++ b/ZigbeeApp/Shared/Common/House.cs
@@ -46,7 +46,15 @@
/// <summary>
/// 浠呭瓙璐﹀彿鐧婚檰鐨勬椂鍊欎娇鐢�,褰撱�怚sOthreShare銆戜负"true"锛屽苟涓斻�怉ccountType銆戜负"1"鏃讹紝璇ヨ处鍙锋嫢鏈夌鐞嗗憳鏉冮檺
/// </summary>
- public int AccountType;
+ public int AccountType;
+ /// <summary>
+ /// 缁忓害
+ /// </summary>
+ public double Longitude = 0;
+ /// <summary>
+ /// 绾害
+ /// </summary>
+ public double Latitude = 0;
/// <summary>
/// 鎴块棿璺緞鍒楄〃
@@ -227,8 +235,6 @@
/// </summary>
public static async System.Threading.Tasks.Task<List<string>> GetHomeLists()
{
- //娓呯┖褰撳墠浣忓畢鍒楄〃
- Config.Instance.HomeFilePathList.Clear();
var pageSetting = new SendDataToServer.ResidenceListPageSettingObj()
{
PageSize = CommonPage.PageSize
@@ -258,7 +264,7 @@
if (responseDataObj.TotalCount == 0)
{
//褰撲綇瀹呬负绌烘椂鍏堟彁绀虹敤鎴锋柊寤轰綇瀹�
- var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst), Language.StringByID(R.MyInternationalizationString.Close), Language.StringByID(R.MyInternationalizationString.OK));
+ var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst), Language.StringByID(R.MyInternationalizationString.Close), Language.StringByID(R.MyInternationalizationString.Confrim));
alert.Show();
alert.ResultEventHandler += (sender, e) =>
{
@@ -270,6 +276,8 @@
}
else
{
+ //娓呯┖褰撳墠浣忓畢鍒楄〃
+ Config.Instance.HomeFilePathList.Clear();
if (Config.Instance.HomeId == string.Empty && responseDataObj.PageData.Count > 0)
{
//璧嬩竴涓垵濮嬪��
@@ -287,7 +295,9 @@
Name = residence.Name,
IsOthreShare = residence.IsOthreShare,
AccountType = residence.AccountType,
- MainUserDistributedMark = residence.MainUserDistributedMark
+ MainUserDistributedMark = residence.MainUserDistributedMark,
+ Longitude = residence.Longitude,
+ Latitude = residence.Latitude
};
}
else
@@ -296,10 +306,12 @@
house.Name = residence.Name;
house.IsOthreShare = residence.IsOthreShare;
house.AccountType = residence.AccountType;
- house.MainUserDistributedMark = residence.MainUserDistributedMark;
+ house.MainUserDistributedMark = residence.MainUserDistributedMark;
+ house.Longitude = residence.Longitude;
+ house.Latitude = residence.Latitude;
}
Global.CreateHomeDirectory(residence.Id);
- house.Save();
+ house.Save(false);
}
//鍖归厤褰撳墠浣忓畢
if (Config.Instance.HomeFilePathList.Find((obj) => obj == $"House_{Config.Instance.HomeId}.json") == null)
@@ -406,28 +418,46 @@
{
get
{
- return GetFloorName(CurrentFloorId);
+ return GetFloorNameById(CurrentFloorId);
}
}
/// <summary>
- /// GetFloorName
+ /// 鑾峰彇妤煎眰鍚嶇О
/// </summary>
/// <param name="floorId"></param>
/// <returns></returns>
- public string GetFloorName(string floorId)
+ public string GetFloorNameById(string floorId)
{
- if (string.IsNullOrEmpty(floorId))
+ if (Config.Instance.Home.FloorDics.Count == 0)
{
return null;
}
- if (Config.Instance.Home.FloorDics.Count == 0 || Config.Instance.Home.FloorDics.ContainsKey(floorId) == false)
- {
- return null;
- }
- return Config.Instance.Home.FloorDics[floorId];
- }
+ foreach (var floor in Config.Instance.Home.FloorDics)
+ {
+ if (floorId == floor.Key)
+ {
+ return floor.Value;
+ }
+ }
+ return null;
+ }
+ /// <summary>
+ /// InitFloor
+ /// </summary>
+ public void InitFloor()
+ {
+ if (Config.Instance.Home.FloorDics.Count > 0 && string.IsNullOrEmpty(CurrentFloorId))
+ {
+ foreach (var floor in Config.Instance.Home.FloorDics)
+ {
+ CurrentFloorId = floor.Key;
+ Save(false);
+ return;
+ }
+ }
+ }
#endregion
--
Gitblit v1.8.0