From 627093aca723d4bfb971b97c828e8b3a22dbda78 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 17 七月 2020 17:26:19 +0800
Subject: [PATCH] 2020-07-17-1
---
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs | 113 ++++++++++++++++++++++++++++++--------------------------
1 files changed, 61 insertions(+), 52 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index 8a6a8e7..74055ac 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -88,34 +88,19 @@
if (listway.Count == 0)
{
//杩樻病鏈夌粦瀹氱綉鍏冲摝
- var btnPic = new PicViewControl(683, 392);
- btnPic.UnSelectedImagePath = "Item/NoFunction.png";
- btnPic.Y = (int)(bodyFrameLayout.Height * 0.382) - Application.GetRealHeight(392 / 2);
- btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
-
- var btnView = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
- btnView.Y = btnPic.Bottom + Application.GetRealHeight(32);
- btnView.TextID = R.MyInternationalizationString.uHadNotBindGatewayMsg;
- btnView.TextAlignment = TextAlignment.Center;
- btnView.TextSize = 12;
- btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
- bodyFrameLayout.AddChidren(btnView);
+ this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uHadNotBindGatewayMsg));
return;
}
for (int i = 0; i < listway.Count; i++)
{
//娣诲姞琛�
- var gwId = HdlGatewayLogic.Current.GetGatewayId(listway[i]);
- this.AddRowLayout(gwId, i != listway.Count - 1);
+ this.AddRowLayout(listway[i].GwId, i != listway.Count - 1);
}
//璋冩暣鍒楄〃鎺т欢鐨勯珮搴�
this.listview.AdjustRealHeight(Application.GetRealHeight(23));
- //璁剧疆鎺ュ彈鍦ㄧ嚎鐘舵�佹帹閫�
- this.AddGatewayOnlinePush();
//寮�鍚綉鍏冲湪绾跨洃娴嬬殑绾跨▼
this.StartGatewayOnlieCheckThread(listway);
}
@@ -145,11 +130,18 @@
//鎻愮ず鏂扮増鏈�
var btnNew = new InformationTipView(gatewayRow.btnIcon);
btnNew.Visible = false;
- gatewayRow.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
+ gatewayRow.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
gatewayRow.AddTag("btnNew", btnNew);
//鍗曞嚮浜嬩欢
gatewayRow.frameTable.ButtonClickEvent += (sender, e) =>
{
+ if (UserCenterResourse.HideOption.GotoGatewayProductInfoForm == 1)
+ {
+ //寮哄埗璺宠浆
+ var form2 = new GatewayProductInfoForm();
+ form2.AddForm(gateway);
+ return;
+ }
var form = new GatewayInfoEditorForm();
form.AddForm(gateway);
};
@@ -177,19 +169,17 @@
}
this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
- //鎵ц鍒囨崲缃戝叧鎿嶄綔
- this.DoSwitchGateway(strWayId);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鎵ц鍒囨崲缃戝叧鎿嶄綔
+ this.DoSwitchGateway(strWayId);
+ });
});
};
//瀹氫綅
- var btnPosition = new NormalViewControl(Application.GetRealWidth(184), gatewayRow.Height, false);
- btnPosition.BackgroundColor = 0xff4a4a4a;
- btnPosition.TextAlignment = TextAlignment.Center;
- btnPosition.TextColor = UserCenterColor.Current.White;
- btnPosition.TextSize = 12;
+ var btnPosition = gatewayRow.AddEditorControl(false);
btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
- gatewayRow.AddRightView(btnPosition);
btnPosition.ButtonClickEvent += (sender, e) =>
{
//鍙戦�佸畾浣嶅懡浠�
@@ -214,7 +204,10 @@
}
this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
- this.DeleteGateway(strWayId, gatewayRow);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ this.DeleteGateway(strWayId, gatewayRow);
+ });
});
};
@@ -223,6 +216,16 @@
if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == true)
{
HdlGatewayLogic.Current.SaveGatewayIdToLocation(strWayId);
+ }
+
+ //褰撳墠缃戝叧鐨勮鏍�
+ if (strWayId == GatewayResourse.AppOldSelectGatewayId)
+ {
+ var btnNow = new IconViewControl(52);
+ btnNow.Y = Application.GetMinReal(23) + gatewayRow.frameTable.chidrenYaxis;
+ btnNow.UnSelectedImagePath = "Item/NowAcctionTip.png";
+ btnNow.X = gatewayRow.btnName.X + gatewayRow.btnName.GetRealWidthByText();
+ gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEvent);
}
}
@@ -237,8 +240,12 @@
/// <param name="row"></param>
private async void DeleteGateway(string strWayId, GatewayRowControl row)
{
+ //鎵撳紑杩涘害鏉�
+ this.ShowProgressBar();
//鍒犻櫎浜戠缃戝叧
bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
if (result == false)
{
return;
@@ -250,13 +257,11 @@
this.closeDeviceManagForm = true;
HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
}
-
- //绉婚櫎
- if (this.dicRowContr.ContainsKey(strWayId) == true)
+ HdlThreadLogic.Current.RunMain(() =>
{
- this.dicRowContr.Remove(strWayId);
- }
- row?.RemoveFromParent();
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ });
}
#endregion
@@ -278,19 +283,22 @@
//濡傛灉閫夋嫨浜嗗埛鏂扮殑缃戝叧锛屽垯涓嶅叧闂鐞嗙晫闈�
this.closeDeviceManagForm = false;
- if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
+ HdlThreadLogic.Current.RunMain(() =>
{
- //鍒锋柊涓荤敾闈�
- var form = new Device.DeviceListMainForm();
- this.AddFromAndRemoveNowForm(form);
- }
- else
- {
- //鍏抽棴鐣岄潰
- this.CloseForm();
- //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
- this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
- }
+ if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
+ {
+ //鍒锋柊涓荤敾闈�
+ var form = new Device.DeviceListMainForm();
+ this.AddFromAndRemoveNowForm(form);
+ }
+ else
+ {
+ //鍏抽棴鐣岄潰
+ this.CloseForm();
+ //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
+ this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame");
+ }
+ });
}
#endregion
@@ -331,7 +339,7 @@
return;
}
bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(way);
- this.GatewayOnlinePush(way, online);
+ this.GatewayOnlinePush(way, online, true);
}
//缃戝叧鏂扮増鏈娴�
this.CheckGatewayNewVersion(listway);
@@ -343,7 +351,8 @@
/// </summary>
/// <param name="gateWay">缃戝叧瀵硅薄</param>
/// <param name="online">鍦ㄧ嚎鐘舵�佸彉鏇村悗鐨勭姸鎬�</param>
- public override void GatewayOnlinePush(ZbGateway gateWay, bool online)
+ /// <param name="hadGwOnline">2020.05.25杩藉姞:姝や綇瀹呮槸鍚︽嫢鏈夌綉鍏冲湪绾�</param>
+ public override void GatewayOnlinePush(ZbGateway gateWay, bool online, bool hadGwOnline)
{
Application.RunOnMainThread(() =>
{
@@ -351,10 +360,10 @@
{
return;
}
- string gwid = HdlGatewayLogic.Current.GetGatewayId(gateWay);
+ string gwid = gateWay.GwId;
if (this.dicRowContr.ContainsKey(gwid) == true && this.dicRowContr[gwid] != null)
{
- this.dicRowContr[gwid].RefreshControl(gateWay);
+ this.dicRowContr[gwid].IsOnline = online;
}
});
}
@@ -389,7 +398,7 @@
if (result[0] != null || result[1] != null || result[2] != null)
{
//鏈夋柊鐗堟湰
- string gwid = HdlGatewayLogic.Current.GetGatewayId(way);
+ string gwid = way.GwId;
Application.RunOnMainThread(() =>
{
if (this.dicRowContr.ContainsKey(gwid) == true && this.dicRowContr[gwid] != null)
@@ -412,9 +421,9 @@
/// <summary>
/// 鐢婚潰鍏抽棴
/// </summary>
- public override void CloseForm()
+ public override void CloseFormBefore()
{
- base.CloseForm();
+ base.CloseFormBefore();
if (this.closeDeviceManagForm == true)
{
--
Gitblit v1.8.0