From 0d9f64668fd7350d6a21fd157e32009a96d98134 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 16 十二月 2020 13:09:08 +0800 Subject: [PATCH] 新云端代码Ver1.2 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBrightnessAdjustForm.cs | 140 +++++++++++++++++++++++----------------------- 1 files changed, 70 insertions(+), 70 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBrightnessAdjustForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBrightnessAdjustForm.cs index 1803c0b..f1036ef 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBrightnessAdjustForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBrightnessAdjustForm.cs @@ -1,10 +1,10 @@ 锘縰sing System; using System.Collections.Generic; using System.Threading.Tasks; -using ZigBee.Device; -namespace Shared.Phone.UserCenter.DevicePanel -{ - public class PanelBrightnessAdjustForm : EditorCommonForm +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DevicePanel +{ + public class PanelBrightnessAdjustForm : EditorCommonForm { #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> @@ -14,7 +14,7 @@ /// <summary> /// 闈㈡澘鐨勫洖璺� /// </summary> - private Panel panelDevice; + private Panel panelDevice; /// <summary> /// 璁惧鐨勬煇涓�鍥炶矾 /// </summary> @@ -34,7 +34,7 @@ /// <summary> /// 鎸夐敭鐨勯鑹叉暟鎹� /// </summary> - private Panel.KeyColorData keyColorData = null; + private Panel.KeyColorData keyColorData = null; /// <summary> /// 閫夋嫨鐫$湢鏃堕棿鐨勪簨浠� value:绱㈠紩(浠�0寮�濮�) 鏂囨湰淇℃伅璇风敤Text鑾峰彇 /// </summary> @@ -56,11 +56,11 @@ /// <summary> ///鐫$湢鏃堕棿 /// </summary> - public NormalViewControl btnSleepTime = null; + public NormalViewControl btnSleepTime = null; #endregion - + #region 鈻� 鍒濆鍖朹____________________________ - + /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> @@ -68,14 +68,14 @@ public void ShowForm(CommonDevice device) { //宸︽粦浣胯兘涓嶅彲 - this.ScrollEnabled = false; - this.deviceObj = device; - this.panelDevice = new Panel(); - this.panelDevice.DeviceAddr = this.deviceObj.DeviceAddr; - this.panelDevice.DeviceEpoint = 200; - this.panelDevice.CurrentGateWayId = this.deviceObj.CurrentGateWayId; - - //璁剧疆澶撮儴淇℃伅 + this.ScrollEnabled = false; + this.deviceObj = device; + this.panelDevice = new Panel(); + this.panelDevice.DeviceAddr = this.deviceObj.DeviceAddr; + this.panelDevice.DeviceEpoint = 200; + this.panelDevice.CurrentGateWayId = this.deviceObj.CurrentGateWayId; + + //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uLightRegulation)); //鍒濆鍖栦腑閮ㄤ俊鎭� @@ -99,24 +99,24 @@ listview = new VerticalScrolViewLayout(); listview.Height = Application.GetRealHeight(1981 - 184); - bodyFrameLayout.AddChidren(listview); - + bodyFrameLayout.AddChidren(listview); + HdlThreadLogic.Current.RunMain(() => { //娣诲姞鑺傝兘妯″紡鎺т欢 this.AddEnergyConservationRow(); //娣诲姞灞忓箷浜害绾у埆鎺т欢 - this.AddScreenBrightnesLevelControl(); - - //鑾峰彇璁惧绫诲瀷鐨� - var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); - if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_SimpleEnvironment) - { - //娣诲姞闈㈡澘鐨勯鑹� - this.AddColorControl(); - } - + this.AddScreenBrightnesLevelControl(); + + //鑾峰彇璁惧绫诲瀷鐨� + var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); + if (deviceEnumInfo.ConcreteType != DeviceConcreteType.ButtonPanel_SimpleEnvironment) + { + //娣诲姞闈㈡澘鐨勯鑹� + this.AddColorControl(); + } + this.FinishInitControl(listview, energyModeInfo.enable); //淇濆瓨 @@ -140,7 +140,7 @@ private void AddScreenBrightnesLevelControl() { var btnEspace = new NormalViewControl(600, 58, true); - btnEspace.X = ControlCommonResourse.XXLeft; + btnEspace.X = HdlControlResourse.XXLeft; listview.AddChidren(btnEspace); var frameBack = new FrameLayout(); @@ -151,7 +151,7 @@ //灞忓箷浜害绾у埆 var btnLevelView = new NormalViewControl(400, 60, true); - btnLevelView.X = ControlCommonResourse.XXLeft; + btnLevelView.X = HdlControlResourse.XXLeft; btnLevelView.Y = Application.GetRealHeight(54); btnLevelView.TextID = R.MyInternationalizationString.uScreenBrightnesLevel; frameBack.AddChidren(btnLevelView); @@ -167,7 +167,7 @@ //褰撳墠浜害 var btnProgressView1 = new NormalViewControl(200, 50, true); - btnProgressView1.X = ControlCommonResourse.XXLeft; + btnProgressView1.X = HdlControlResourse.XXLeft; btnProgressView1.Y = Application.GetRealHeight(157); btnProgressView1.TextSize = 12; btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1; @@ -279,7 +279,7 @@ } var btnTemp1 = new NormalViewControl(200, 50, true); - btnTemp1.X = ControlCommonResourse.XXLeft; + btnTemp1.X = HdlControlResourse.XXLeft; btnTemp1.Y = Application.GetRealHeight(322); btnTemp1.TextSize = 12; btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3; @@ -287,7 +287,7 @@ frameBack.AddChidren(btnTemp1); var btnTemp2 = new NormalViewControl(100, 50, true); - btnTemp2.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(100); + btnTemp2.X = frameBack.Width - HdlControlResourse.XXLeft - Application.GetRealWidth(100); btnTemp2.Y = Application.GetRealHeight(322); btnTemp2.TextAlignment = TextAlignment.CenterRight; btnTemp2.TextSize = 12; @@ -305,7 +305,7 @@ private void AddColorControl() { var btnEspace = new NormalViewControl(600, 58, true); - btnEspace.X = ControlCommonResourse.XXLeft; + btnEspace.X = HdlControlResourse.XXLeft; listview.AddChidren(btnEspace); //鑳屾櫙 @@ -317,7 +317,7 @@ //鑳屽厜鐏鑹� var btnLevelView = new NormalViewControl(400, 60, true); - btnLevelView.X = ControlCommonResourse.XXLeft; + btnLevelView.X = HdlControlResourse.XXLeft; btnLevelView.Y = Application.GetRealHeight(54); btnLevelView.Gravity = Gravity.CenterVertical; btnLevelView.TextID = R.MyInternationalizationString.BackgroundLightColor; @@ -328,7 +328,7 @@ frameColor.Width = Application.GetRealHeight(262); frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); - frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); + frameColor.X = listview.Width - HdlControlResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 @@ -434,7 +434,7 @@ //褰撳墠浜害 var btnProgressView1 = new NormalViewControl(200, 49, true); - btnProgressView1.X = ControlCommonResourse.XXLeft; + btnProgressView1.X = HdlControlResourse.XXLeft; btnProgressView1.Y = Application.GetRealHeight(164); btnProgressView1.TextSize = 12; btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1; @@ -468,7 +468,7 @@ seekBar1.Progress = energyModeInfo.level; var btnTemp1 = new NormalViewControl(200, 49, true); - btnTemp1.X = ControlCommonResourse.XXLeft; + btnTemp1.X = HdlControlResourse.XXLeft; btnTemp1.Y = Application.GetRealHeight(325); btnTemp1.TextSize = 12; btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3; @@ -519,9 +519,9 @@ frameBack.UseClickStatu = false; frameBack.Y = Application.GetRealHeight(443); frameBack.Height = Application.GetRealHeight(170); - frameRowControl.AddChidren(frameBack); - - //鎺ヨ繎鎰熷簲 + frameRowControl.AddChidren(frameBack); + + //鎺ヨ繎鎰熷簲 frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400); //寮�鍏虫帶浠� var btnSwitch = frameBack.AddMostRightSwitchIcon(); @@ -550,13 +550,13 @@ frameBack.BackgroundColor = UserCenterColor.Current.White; frameBack.UseClickStatu = false; frameBack.Y = Application.GetRealHeight(784 - 170); - frameBack.Height = Application.GetRealHeight(170); + frameBack.Height = Application.GetRealHeight(170); frameRowControl.AddChidren(frameBack); //鐫$湢鏃堕棿 frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SleepTime), 400); //鍙崇澶� - frameBack.AddRightArrow(); + frameBack.AddRightArrow(); btnSleepTime = new NormalViewControl(700, true); switch (energyModeInfo.time) { @@ -572,28 +572,28 @@ btnSleepTime.Text = "5min"; nowSelectNo = 2; break; - } + } frameBack.AddMostRightView(this.sleepTimeText, 700); timeAction = null; - timeAction += (nowSelectNo) => - { - switch (nowSelectNo) - { - case 0: - energyModeInfo.time = 15; - break; - case 1: - energyModeInfo.time = 60; - break; - case 2: - energyModeInfo.time = 300; - break; - } + timeAction += (nowSelectNo) => + { + switch (nowSelectNo) + { + case 0: + energyModeInfo.time = 15; + break; + case 1: + energyModeInfo.time = 60; + break; + case 2: + energyModeInfo.time = 300; + break; + } AddSleepTimeRow(frameRowControl); }; frameBack.ButtonClickEvent += (sender, e) => - { + { this.ShowSelectDeviceSleepTimeListForm(); }; } @@ -624,8 +624,8 @@ } //-1:閫夋嫨鍙栨秷 this.sleepTimeText = selectNo == -1 ? string.Empty : listText[selectNo]; - nowSelectNo = selectNo; - //璋冪敤鍥炶皟鍑芥暟 + nowSelectNo = selectNo; + //璋冪敤鍥炶皟鍑芥暟 this.timeAction?.Invoke(nowSelectNo); }; } @@ -688,10 +688,10 @@ /// </summary> private async void SavePanelData() { - this.ShowProgressBar(); - - //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) - + this.ShowProgressBar(); + + //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) + var result = HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); if (result == false) { @@ -763,8 +763,8 @@ private uint GetColorByRGB(byte R, byte G, byte B) { return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B); - } - + } + #endregion - } -} + } +} -- Gitblit v1.8.0