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/GatewayInfoEditorForm.cs | 119 ++++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 73 insertions(+), 46 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 7989f1a..ff1fb33 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勭綉鍏�
/// </summary>
@@ -51,15 +51,19 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1368);
//鍥剧墖
var btnPic = new DeviceInfoIconControl();
btnPic.Y = Application.GetRealHeight(92);
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
btnPic.InitControl(this.zbGateway);
//璁惧澶囨敞
@@ -84,15 +88,69 @@
}
};
- //璁惧绫诲瀷
+ //璁惧绫诲瀷 (鍥哄畾鏅鸿兘缃戝叧)
caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
- var btnType = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2);
+ var btnType = new FrameCaptionViewControl(caption, Language.StringByID(60004), listview.rowSpace / 2);
btnType.UseClickStatu = false;
listview.AddChidren(btnType);
btnType.InitControl();
- HdlGatewayLogic.Current.SetGatewayImageText(btnType.txtView, this.zbGateway);
//鍒掔嚎
btnType.AddBottomLine();
+
+ //瀹夎浣嶇疆
+ var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
+ listview.AddChidren(rowBeloneArea);
+ rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uInstallationLocation), this.zbGateway);
+ //搴曠嚎
+ rowBeloneArea.AddBottomLine();
+ rowBeloneArea.SelectRoomEvent += (roomKeys) =>
+ {
+ //鍙樻洿缃戝叧鎴块棿
+ HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway, roomKeys);
+ };
+
+ //鎵�灞炰綇瀹�
+ caption = Language.StringByID(R.MyInternationalizationString.uBelongResidence);
+ var btnBeloneArea = new FrameCaptionViewControl(caption, Common.Config.Instance.Home.Name, listview.rowSpace / 2);
+ btnBeloneArea.UseClickStatu = false;
+ listview.AddChidren(btnBeloneArea);
+ btnBeloneArea.InitControl();
+ //鍒掔嚎
+ btnBeloneArea.AddBottomLine();
+
+ //mini缃戝叧鏈変釜鍔熻兘璁剧疆
+ var linuxImageType = this.zbGateway.LinuxImageType;
+ if (linuxImageType == 11)
+ {
+ var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
+ CommonDevice miniDevice = null;
+ foreach (var device in listDevice)
+ {
+ //鑾峰彇杩欎釜缃戝叧涓嬬殑灏忓鐏澶�
+ if (Common.LocalDevice.Current.IsMiniLight(device) == true)
+ {
+ miniDevice = device;
+ break;
+ }
+ }
+ //濡傛灉鎵惧緱鍒扮殑璇�
+ if (miniDevice != null)
+ {
+ //鍔熻兘璁剧疆
+ var rowFunction = new RowLayoutControl(listview.rowSpace / 2);
+ listview.AddChidren(rowFunction);
+ rowFunction.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFunctionSettingUp), 700);
+ //鍙冲浘鏍�
+ rowFunction.frameTable.AddRightArrow();
+ //搴曠嚎
+ rowFunction.frameTable.AddBottomLine();
+ rowFunction.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new DeviceLight.MiniNightLightFunctionSettionForm();
+ form.AddForm(miniDevice);
+ };
+ }
+ }
//鏁版嵁涓婁紶涓庝笅杞�
var rowData = new RowLayoutControl(listview.rowSpace / 2);
@@ -105,7 +163,7 @@
rowData.frameTable.ButtonClickEvent += (sender, e) =>
{
var form = new GatewayUploadAndDownLoadForm();
- form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ form.AddForm(this.zbGateway.GwId);
};
//閫氱敤淇℃伅
@@ -136,7 +194,7 @@
btnNewVersion.Visible = false;
btnNewVersion.X = Application.GetRealWidth(242);
btnNewVersion.Y = Application.GetRealHeight(23);
- rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
+ rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
rowUpDate.ButtonClickEvent += (sender, e) =>
{
btnNewVersion.Visible = false;
@@ -145,7 +203,7 @@
};
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
@@ -162,7 +220,7 @@
if (oldName != btnNote.Text)
{
//淇敼鍚嶅瓧
- this.SetGatewayName(btnNote.Text, false);
+ this.SetGatewayName(btnNote.Text, true);
}
else
{
@@ -174,7 +232,7 @@
HdlThreadLogic.Current.RunThread(() =>
{
//妫�娴嬫柊鐗堟湰
- this.CheckNewVersion(btnNewVersion, btnType);
+ this.CheckNewVersion(btnNewVersion);
});
}
@@ -220,7 +278,7 @@
//鍒囨崲
MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1);
- string strWayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string strWayId = this.zbGateway.GwId;
if (strWayId == GatewayResourse.AppOldSelectGatewayId)
{
MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh);
@@ -268,8 +326,7 @@
/// 妫�娴嬫柊鐗堟湰
/// </summary>
/// <param name="btnNewVersion">鎻愮ず鏈夋柊鐗堟湰鐨勬帶浠�</param>
- /// <param name="btnType">缃戝叧绫诲瀷鎺т欢</param>
- private async void CheckNewVersion(PicViewControl btnNewVersion, FrameCaptionViewControl btnType)
+ private async void CheckNewVersion(PicViewControl btnNewVersion)
{
//鑾峰彇缃戝叧鐗堟湰淇℃伅
var result = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
@@ -281,7 +338,6 @@
{
if (this.Parent != null)
{
- HdlGatewayLogic.Current.SetGatewayImageText(btnType.txtView, this.zbGateway);
if (result[0] != null || result[1] != null || result[2] != null)
{
//鎻愮ず鏈夋柊鐗堟湰
@@ -289,34 +345,6 @@
}
}
});
- }
-
- #endregion
-
- #region 鈻� 瀹屾垚鎸夐挳鎸変笅_______________________
-
- /// <summary>
- /// 瀹屾垚鎸夐挳鎸変笅
- /// </summary>
- /// <param name="gatewayName">缃戝叧鍚�</param>
- private void FinishButtonClick(string gatewayName)
- {
- if (string.IsNullOrEmpty(gatewayName) == true)
- {
- //璇疯緭鍏ョ綉鍏冲悕绉�
- string msg = Language.StringByID(R.MyInternationalizationString.uGatewayNameMastInput);
- this.ShowMassage(ShowMsgType.Error, msg);
- return;
- }
- string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
- if (nameValue == gatewayName)
- {
- //鍚屽悕涓嶉渶瑕佸鐞�
- this.CloseForm();
- return;
- }
- //淇敼鍚嶅瓧
- this.SetGatewayName(gatewayName, true);
}
#endregion
@@ -353,8 +381,7 @@
/// <param name="online"></param>
private async void DoSwitchGateway()
{
- string gatewayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
- var result = await HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
+ var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
if (result == false)
{
return;
@@ -381,7 +408,7 @@
else
{
//鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
- this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
+ this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame");
}
});
}
--
Gitblit v1.8.0