From c7df85937f73fb347ee0b19e9c052d2d00a6df6c Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 18 九月 2020 13:58:19 +0800
Subject: [PATCH] 新版本
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 114 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 74 insertions(+), 40 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index 33a1934..d8943b3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -533,21 +533,25 @@
/// </summary>
public static void RefreshHomeObject()
{
- //澶囦唤鐨勬暟鎹紝鏈夊彲鑳芥槸涓讳汉鑷繁涓婁紶鐨勶紝濡傛灉绠$悊鍛樼櫥闄嗘椂锛屼粬鑾峰彇鐨勫浠芥暟鎹湁鐐圭壒娈�
- //姣斿涓嬮潰杩欎笁涓笢瑗垮湪涓昏处鍙烽偅閲屾槸涓嶉渶瑕佺殑
- bool isOthreShare = Config.Instance.Home.IsOthreShare;
- int accountType = Config.Instance.Home.AccountType;
- string mainMark = Config.Instance.Home.MainUserDistributedMark;
- double Longitude = Config.Instance.Home.Longitude;
- double Latitude = Config.Instance.Home.Latitude;
- //杩樺師浣忓畢瀵硅薄
- Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(Config.Instance.Home.Id);
- Config.Instance.Home.IsOthreShare = isOthreShare;
- Config.Instance.Home.AccountType = accountType;
- Config.Instance.Home.MainUserDistributedMark = mainMark;
- Config.Instance.Home.Longitude = Longitude;
- Config.Instance.Home.Latitude = Latitude;
+ var home = HdlResidenceLogic.Current.GetHouseByHouseId(Config.Instance.Home.Id);
+
+ //鍒锋柊妤煎眰
+ Config.Instance.Home.FloorDics = home.FloorDics;
+ Config.Instance.Home.CurrentFloorId = string.Empty;
+ if (Config.Instance.Home.TemplateMode == -1)
+ {
+ Config.Instance.Home.TemplateMode = home.TemplateMode;
+ if (Config.Instance.Home.TemplateMode == -1)
+ {
+ //榛樿鍒濆鍊�
+ Config.Instance.Home.TemplateMode = 1;
+ }
+ }
+
Config.Instance.Home.Save(false);
+
+ //涓婚〉闇�瑕侀噸鏂板埛鏂�
+ UserView.UserPage.Instance.RefreshAllForm = true;
}
#endregion
@@ -576,7 +580,7 @@
//鍏抽棴鍏ㄩ儴寮圭獥
ShowMsgControl.CloseAllMsgDialog();
//鍏抽棴鎵�鏈夋墦寮�浜嗙殑鐣岄潰
- CloseAllOpenForm();
+ CloseAllOpenForm(null, false);
//鏄剧ず鐧婚檰鐢婚潰
var formLogin = new Login.AccountLoginForm();
@@ -617,7 +621,7 @@
//鏀惰捣宸﹁彍鍗�
CommonPage.Instance.CloseLeftMenu();
//鍏抽棴鎵�鏈夋墦寮�浜嗙殑鐣岄潰
- CloseAllOpenForm();
+ CloseAllOpenForm(null, false);
//鏄剧ず鐧婚檰鐢婚潰
var formLogin = new Login.AccountLoginForm();
@@ -637,7 +641,8 @@
/// 鍏抽棴鎵�鏈夋墦寮�浜嗙殑鐣岄潰
/// </summary>
/// <param name="tagetFrom">鐩爣鐣岄潰,濡傛灉鎸囧畾浜嗙殑璇�,鍒欏叧闂洰鏍囩晫闈笂灞傜殑鍏ㄩ儴鐣岄潰(瀹冭嚜韬笉鍏抽棴)</param>
- public static void CloseAllOpenForm(string tagetFrom = null)
+ /// <param name="refreshMainPage">褰撳叧闂殑鐣岄潰杈惧埌涓婚〉鏃�,鏄惁鍒锋柊涓婚〉</param>
+ public static void CloseAllOpenForm(string tagetFrom = null, bool refreshMainPage = true)
{
while (UserView.HomePage.Instance.ChildrenCount > 0)
{
@@ -661,7 +666,10 @@
else if (view is UserView.UserPage)
{
//鍒锋柊涓婚〉
- UserView.UserPage.Instance.ReFreshControl();
+ if (refreshMainPage == true)
+ {
+ UserView.UserPage.Instance.ReFreshControl();
+ }
return;
}
else
@@ -810,6 +818,17 @@
HdlGatewayLogic.Current.ResetComandToBindBackupGateway();
//璇诲彇闅愬尶閰嶇疆
HdlBackupLogic.Current.LoadHideOption();
+ //璋冭瘯锛氬己鍒跺紑鍚悗鍙拌皟璇旳pp鍔熻兘
+ if (UserCenterResourse.HideOption.StartDebugApp == 1)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ var form = new HideOption.HideOptionMainForm();
+ form.AddForm();
+ });
+ ProgressBar.Close(true);
+ return false;
+ }
}
//鍏抽棴鎵�鏈夋帴鏀�
@@ -871,33 +890,19 @@
System.Threading.Thread.Sleep(30);
if (hadNet == 1)
{
- try
- {
- bool canReceiveGw = false;
- foreach (var gateway in UserCenterResourse.DicReceiveGatewayTest.Values)
- {
- if (gateway.HomeId == Config.Instance.Home.Id)
- {
- //鑳藉鎼滅储寰楀埌缃戝叧
- canReceiveGw = true;
- break;
- }
- }
- UserCenterResourse.DicReceiveGatewayTest = null;
- //璁剧疆杩滅▼杩炴帴鐨勫垵濮嬪��
- ZigBee.Device.ZbGateway.IsRemote = canReceiveGw == false;
- if (canReceiveGw == false)
- {
- //濡傛灉鏄繙绋嬬殑璇�,杩藉姞绛夊緟鏃堕棿
- System.Threading.Thread.Sleep(1500);
- }
- }
- catch { }
+ //浣忓畢鍒囨崲鏃�,妫�娴嬬綉鍏宠繛鎺ユ儏鍐�
+ CheckGatewayConnection();
+
}
UserCenterResourse.DicReceiveGatewayTest = null;
}
//APP缂撳瓨鍔犺浇瀹屾垚
UserCenterResourse.AccountOption.AppCanSignout = true;
+ if (Shared.Phone.Device.Logic.Send.If_Exist == "1")
+ {
+ //浠ユ湰鍦扮姸鎬佷负涓绘墦寮�GPS鏈嶅姟
+ Application.StartGPSLocationService();
+ }
return true;
}
@@ -949,6 +954,35 @@
Common.Logic.SoneLogicList.Clear();
}
+ /// <summary>
+ /// 浣忓畢鍒囨崲鏃�,妫�娴嬬綉鍏宠繛鎺ユ儏鍐�
+ /// </summary>
+ private static void CheckGatewayConnection()
+ {
+ try
+ {
+ bool canReceiveGw = false;
+ foreach (var gateway in UserCenterResourse.DicReceiveGatewayTest.Values)
+ {
+ if (gateway.HomeId == Config.Instance.Home.Id)
+ {
+ //鑳藉鎼滅储寰楀埌缃戝叧
+ canReceiveGw = true;
+ break;
+ }
+ }
+ UserCenterResourse.DicReceiveGatewayTest = null;
+ //璁剧疆杩滅▼杩炴帴鐨勫垵濮嬪��
+ ZigBee.Device.ZbGateway.IsRemote = canReceiveGw == false;
+ if (canReceiveGw == false)
+ {
+ //濡傛灉鏄繙绋嬬殑璇�,杩藉姞绛夊緟鏃堕棿
+ System.Threading.Thread.Sleep(1500);
+ }
+ }
+ catch { }
+ }
+
#endregion
#region 鈻� 鍒濆鍖栫櫥闄嗚处鍙风殑淇℃伅_______________
--
Gitblit v1.8.0