From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs | 339 ++++++++++++++++++++++++++------------------------------
1 files changed, 158 insertions(+), 181 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs
index e6c53d3..e2302b6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelSimpleEnvironmentButtonSettionForm.cs
@@ -7,20 +7,20 @@
namespace Shared.Phone.UserCenter.DevicePanel
{
- /// <summary>
- /// 鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃晫闈�
+ /// <summary>
+ /// 闈㈡澘鐨勬寜閿厤缃晫闈€�愯绫绘殏鏃惰垗寮冦��
/// </summary>
public class PanelSimpleEnvironmentButtonSettionForm : EditorCommonForm
{
- #region 鈻� 鍙橀噺澹版槑___________________________
+ #region 鈻� 鍙橀噺澹版槑___________________________
- /// <summary>
- /// 鍒楄〃鎺т欢
- /// </summary>
- private FrameListControl listview = null;
- /// <summary>
- /// 璁惧鐨勬煇涓�鍥炶矾
- /// </summary>
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private FrameListControl listview = null;
+ /// <summary>
+ /// 璁惧鐨勬煇涓�鍥炶矾
+ /// </summary>
private CommonDevice deviceObj = null;
/// <summary>
/// 鏂伴鐩爣鍚嶅瓧
@@ -61,77 +61,77 @@
#endregion
- #region 鈻� 鍒濆鍖朹____________________________
+ #region 鈻� 鍒濆鍖朹____________________________
- /// <summary>
- /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
- /// </summary>
- /// <param name="i_device">璁惧鐨勬煇涓�鍥炶矾</param>
- public void ShowForm(CommonDevice i_device)
- {
- this.deviceObj = i_device;
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_device">璁惧鐨勬煇涓�鍥炶矾</param>
+ public void ShowForm(CommonDevice i_device)
+ {
+ this.deviceObj = i_device;
//鑾峰彇鏁版嵁
InitInfo(deviceObj);
-
- //璁剧疆澶撮儴淇℃伅
- base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPanelSettion));
-
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame();
-
- //鍒濆鍖栧彸涓婅鑿滃崟
- this.InitTopRightMenu();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
- /// </summary>
- private void InitMiddleFrame()
- {
- //娓呯┖bodyFrame
- this.ClearBodyFrame();
-
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPanelSettion));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+
+ //鍒濆鍖栧彸涓婅鑿滃崟
+ this.InitTopRightMenu();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
var listBackControl = new VerticalFrameControl();
listBackControl.Height = bodyFrameLayout.Height;
bodyFrameLayout.AddChidren(listBackControl);
- //鍥剧墖
- var btnPic = new PicViewControl(426, 426);
- btnPic.Y = Application.GetRealHeight(150);
- btnPic.UnSelectedImagePath = "RealDevice/ButtonPanelSimpleEnvironment.png";
- btnPic.Gravity = Gravity.CenterHorizontal;
- listBackControl.frameTable.AddChidren(btnPic);
-
- //鍒濆鍖栨甯�
- var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
-
- //鍒濆鍖栬彍鍗曡
- this.InitMenuRow();
-
- //鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl();
- tableContr = null;
-
- //淇濆瓨
- var btnFinish = new BottomClickButton();
- btnFinish.TextID = R.MyInternationalizationString.uSave;
- bodyFrameLayout.AddChidren(btnFinish);
- btnFinish.ButtonClickEvent += (sender, e) =>
- {
- //鍏抽棴鑷韩
- this.CloseForm();
- };
- }
-
- /// <summary>
- /// 鍒濆鍖栬彍鍗曡
- /// </summary>
- private void InitMenuRow()
- {
+ //鍥剧墖
+ var btnPic = new PicViewControl(426, 426);
+ btnPic.Y = Application.GetRealHeight(150);
+ btnPic.UnSelectedImagePath = "RealDevice/ButtonPanelSimpleEnvironment.png";
+ btnPic.Gravity = Gravity.CenterHorizontal;
+ listBackControl.frameTable.AddChidren(btnPic);
+
+ //鍒濆鍖栨甯�
+ var tableContr = new InformationEditorControl();
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
+
+ //鍒濆鍖栬彍鍗曡
+ this.InitMenuRow();
+
+ //鍒濆鍖栨甯冨畬鎴�
+ tableContr.FinishInitControl();
+ tableContr = null;
+
+ //淇濆瓨
+ var btnFinish = new BottomClickButton();
+ btnFinish.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnFinish);
+ btnFinish.ButtonClickEvent += (sender, e) =>
+ {
+ //鍏抽棴鑷韩
+ this.CloseForm();
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栬彍鍗曡
+ /// </summary>
+ private void InitMenuRow()
+ {
this.listview.RemoveAll();
//Ac鏉ユ簮
- this.AddAcRow();
+ this.AddAcRow();
//娣诲姞鏂伴鐩爣
this.AddFreshAirRow();
//娣诲姞娓╁害鏉ユ簮
@@ -164,7 +164,7 @@
Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5007" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
});
}
}
@@ -208,7 +208,10 @@
foreach (var bDev in bindList)
{
var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
-
+ if (device == null)
+ {
+ continue;
+ }
if (device.Type == DeviceType.FreshAir)
{
//鑾峰彇璁惧绫诲瀷鐨�
@@ -218,15 +221,7 @@
{
continue;
}
- if (string.IsNullOrEmpty(bDev.ESName))
- {
- bindFreshAirName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- }
- else
- {
- bindFreshAirName = bDev.ESName;
- }
-
+ bindFreshAirName = Common.LocalDevice.Current.GetDeviceEpointName(device);
bindFreshAirDev = device;
}
else if (device.Type == DeviceType.TemperatureSensor)
@@ -234,55 +229,37 @@
var bD = device as TemperatureSensor;
if (bD.SensorDiv == 1)
{
- if (string.IsNullOrEmpty(bDev.ESName))
- {
- bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- }
- else
- {
- bindTemperatureName = bDev.ESName;
- }
+ bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device);
bindTemperatureDev = device;
}
if (bD.SensorDiv == 2)
{
- if (string.IsNullOrEmpty(bDev.ESName))
- {
- bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- }
- else
- {
- bindHumidityName = bDev.ESName;
- }
-
+ bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device);
bindHumidityDev = device;
}
}
else if (device.Type == DeviceType.FreshAirHumiditySensor)
{
- if (string.IsNullOrEmpty(bDev.ESName))
- {
- bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- }
- else
- {
- bindHumidityName = bDev.ESName;
- }
-
+ bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device);
bindHumidityDev = device;
}
else if (device.Type == DeviceType.Thermostat)
{
- if (string.IsNullOrEmpty(bDev.ESName))
- {
- bindAcName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- }
- else
- {
- bindAcName = bDev.ESName;
- }
-
+ bindAcName = Common.LocalDevice.Current.GetDeviceEpointName(device);
bindAcDev = device;
+ }
+ else if (device.Type == DeviceType.PMSensor)
+ {
+ if (bDev.BindCluster == 1026)
+ {
+ bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+ bindTemperatureDev = device;
+ }
+ if (bDev.BindCluster == 1029)
+ {
+ bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+ bindHumidityDev = device;
+ }
}
}
count++;
@@ -342,30 +319,30 @@
};
}
#endregion
-
+
#region 鈻� 鏂伴鐩爣_________________________
/// <summary>
/// 鏂伴鐩爣琛�
/// </summary>
private void AddFreshAirRow()
{
- //鏂伴鐩爣
- var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
- listview.AddChidren(rowNewWind);
- rowNewWind.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewWindTarget), 600);
- //搴曠嚎
- rowNewWind.AddBottomLine();
- //鍙崇澶�
- rowNewWind.AddRightArrow();
+ //鏂伴鐩爣
+ var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowNewWind);
+ rowNewWind.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewWindTarget), 600);
+ //搴曠嚎
+ rowNewWind.AddBottomLine();
+ //鍙崇澶�
+ rowNewWind.AddRightArrow();
var msg = Language.StringByID(R.MyInternationalizationString.nothing);
if (!string.IsNullOrEmpty(bindFreshAirName))
{
msg = bindFreshAirName;
}
- var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
+ var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
- rowNewWind.ButtonClickEvent += (sender, e) =>
+ rowNewWind.ButtonClickEvent += (sender, e) =>
{
this.deviceObj.DeviceEpoint = 2;
var paneTargetsBaseFormp = new PaneTargetsBaseForm(this.deviceObj, bindAcDev, DeviceBind.BindInfo.BindType.FreshAir);
@@ -395,8 +372,8 @@
/// <summary>
/// 娓╁害鏉ユ簮琛�
/// </summary>
- private void AddTemperatureSensorRow()
- {
+ private void AddTemperatureSensorRow()
+ {
//娓╁害鏉ユ簮
var rowTemPerature = new FrameRowControl(listview.rowSpace / 2);
listview.AddChidren(rowTemPerature);
@@ -458,7 +435,7 @@
var btnHumidityStatu = rowHumidity.AddMostRightView(msg, 700);
rowHumidity.ButtonClickEvent += (sender, e) =>
{
- this.deviceObj.DeviceEpoint = 2;
+ this.deviceObj.DeviceEpoint = 1;
var paneTargetsBaseFormp = new PaneTargetsBaseForm(this.deviceObj, bindAcDev, DeviceBind.BindInfo.BindType.Humidity);
Shared.Phone.UserView.HomePage.Instance.AddChidren(paneTargetsBaseFormp);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
@@ -488,58 +465,58 @@
private void AddLevelRow()
{
//浜害璋冭妭
- var rowLight = new FrameRowControl(listview.rowSpace / 2);
- listview.AddChidren(rowLight);
- rowLight.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uLightRegulation), 600);
- //搴曠嚎
- rowLight.AddBottomLine();
- //鍙崇澶�
- rowLight.AddRightArrow();
- rowLight.ButtonClickEvent += (sender, e) =>
+ var rowLight = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowLight);
+ rowLight.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uLightRegulation), 600);
+ //搴曠嚎
+ rowLight.AddBottomLine();
+ //鍙崇澶�
+ rowLight.AddRightArrow();
+ rowLight.ButtonClickEvent += (sender, e) =>
{
- var form = new PanelBrightnessAdjustForm();
- form.AddForm(this.deviceObj);
+ var form = new PanelBrightnessAdjustForm();
+ form.AddForm(this.deviceObj);
};
}
- #endregion
+ #endregion
#region 鈻� 鍙充笂瑙掕彍鍗昣________________________
- /// <summary>
- /// 鍒濆鍖栧彸涓婅鑿滃崟
- /// </summary>
- private void InitTopRightMenu()
- {
- //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘
- if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(deviceObj) == false)
- {
- return;
- }
- var btnIcon = new MostRightIconControl(69, 69);
- btnIcon.UnSelectedImagePath = "Item/More.png";
- topFrameLayout.AddChidren(btnIcon);
- btnIcon.InitControl();
- btnIcon.ButtonClickEvent += ((sender, e) =>
- {
- //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
- this.ShowTopRightMenu();
- });
- }
-
- /// <summary>
- /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
- /// </summary>
- private void ShowTopRightMenu()
- {
- var frame = new TopRightMenuControl(1, 1);
- //瀹氫綅
- string deviceMenu = Language.StringByID(R.MyInternationalizationString.uFixedPosition);
- frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
- {
- //鍙戦�佸畾浣嶅姛鑳�
- Common.LocalDevice.Current.SetFixedPositionCommand(deviceObj);
- });
- }
-
- #endregion
- }
+ /// <summary>
+ /// 鍒濆鍖栧彸涓婅鑿滃崟
+ /// </summary>
+ private void InitTopRightMenu()
+ {
+ //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘
+ if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(deviceObj) == false)
+ {
+ return;
+ }
+ var btnIcon = new MostRightIconControl(69, 69);
+ btnIcon.UnSelectedImagePath = "Item/More.png";
+ topFrameLayout.AddChidren(btnIcon);
+ btnIcon.InitControl();
+ btnIcon.ButtonClickEvent += ((sender, e) =>
+ {
+ //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ this.ShowTopRightMenu();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ /// </summary>
+ private void ShowTopRightMenu()
+ {
+ var frame = new TopRightMenuControl(1, 1);
+ //瀹氫綅
+ string deviceMenu = Language.StringByID(R.MyInternationalizationString.uFixedPosition);
+ frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
+ {
+ //鍙戦�佸畾浣嶅姛鑳�
+ Common.LocalDevice.Current.SetFixedPositionCommand(deviceObj);
+ });
+ }
+
+ #endregion
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0